File: pr42294.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (46 lines) | stat: -rw-r--r-- 1,726 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
; REQUIRES: asserts
; RUN: opt -loop-rotate -licm %s -disable-output -debug-only=licm 2>&1 | FileCheck %s -check-prefix=LICM
; RUN: opt -loop-rotate -licm %s -S  | FileCheck %s

; LICM-NOT: LICM sinking instruction:   %.pre = load i8, i8* %arrayidx.phi.trans.insert

; CHECK-LABEL: @fn1
; CHECK-LABEL: entry:
; CHECK:    br i1 true, label %[[END:.*]], label %[[PH:.*]]
; CHECK: [[PH]]:
; CHECK:    br label %[[CRIT:.*]]
; CHECK: [[CRIT]]:
; CHECK:    load i8
; CHECK:    store i8
; CHECK:    br i1 true, label %[[ENDCRIT:.*]], label %[[CRIT]]
; CHECK: [[ENDCRIT]]:
; CHECK-NOT: load i8
; CHECK:    br label %[[END]]

target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64"
target triple = "s390x-unknown-linux-gnu"

define void @fn1() {
entry:
  %g = alloca [9 x i8], align 1
  br label %for.body

for.body:                                         ; preds = %for.body.for.body_crit_edge, %entry
  %0 = phi i64 [ 0, %entry ], [ %phitmp, %for.body.for.body_crit_edge ]
  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body.for.body_crit_edge ]
  %arrayidx = getelementptr inbounds [9 x i8], [9 x i8]* %g, i64 0, i64 %indvars.iv
  store i8 2, i8* %arrayidx, align 1
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 undef, label %for.end18, label %for.body.for.body_crit_edge

for.body.for.body_crit_edge:                      ; preds = %for.body
  %arrayidx.phi.trans.insert = getelementptr inbounds [9 x i8], [9 x i8]* %g, i64 0, i64 %indvars.iv.next
  %.pre = load i8, i8* %arrayidx.phi.trans.insert, align 1
  %phitmp = zext i8 %.pre to i64
  br label %for.body

for.end18:                                        ; preds = %for.body
  store i64 %0, i64* undef, align 8
  ret void
}