File: pr33549.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 (91 lines) | stat: -rw-r--r-- 4,681 bytes parent folder | download | duplicates (7)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -gvn -S < %s | FileCheck %s

@Data = common local_unnamed_addr global [32 x i32] zeroinitializer, align 4

; Function Attrs: norecurse nounwind
define void @testshl() local_unnamed_addr #0 {
; CHECK-LABEL: @testshl(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    br label [[FOR_BODY:%.*]]
; CHECK:       for.body:
; CHECK-NEXT:    [[K_031:%.*]] = phi i32 [ 1, [[ENTRY:%.*]] ], [ [[INC9:%.*]], [[FOR_INC8:%.*]] ]
; CHECK-NEXT:    [[SHL:%.*]] = shl i32 1, [[K_031]]
; CHECK-NEXT:    [[SHR:%.*]] = ashr exact i32 [[SHL]], 1
; CHECK-NEXT:    [[CMP229:%.*]] = icmp slt i32 [[SHL]], 64
; CHECK-NEXT:    br i1 [[CMP229]], label [[FOR_BODY3_PREHEADER:%.*]], label [[FOR_INC8]]
; CHECK:       for.body3.preheader:
; CHECK-NEXT:    [[DIV:%.*]] = sdiv i32 [[SHR]], 2
; CHECK-NEXT:    br label [[FOR_BODY3:%.*]]
; CHECK:       for.body3:
; CHECK-NEXT:    [[I_030:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_BODY3]] ], [ [[DIV]], [[FOR_BODY3_PREHEADER]] ]
; CHECK-NEXT:    [[ADD:%.*]] = add nsw i32 [[I_030]], [[SHR]]
; CHECK-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [32 x i32], [32 x i32]* @Data, i32 0, i32 [[ADD]]
; CHECK-NEXT:    [[ARRAYIDX4:%.*]] = getelementptr inbounds [32 x i32], [32 x i32]* @Data, i32 0, i32 [[I_030]]
; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* [[ARRAYIDX]], align 4, [[TBAA3:!tbaa !.*]]
; CHECK-NEXT:    [[TMP1:%.*]] = load i32, i32* [[ARRAYIDX4]], align 4, [[TBAA3]]
; CHECK-NEXT:    [[SUB:%.*]] = sub nsw i32 [[TMP1]], [[TMP0]]
; CHECK-NEXT:    store i32 [[SUB]], i32* [[ARRAYIDX]], align 4, [[TBAA3]]
; CHECK-NEXT:    [[ADD7:%.*]] = add nsw i32 [[TMP1]], [[TMP0]]
; CHECK-NEXT:    store i32 [[ADD7]], i32* [[ARRAYIDX4]], align 4, [[TBAA3]]
; CHECK-NEXT:    [[INC]] = add nsw i32 [[I_030]], 1
; CHECK-NEXT:    [[CMP2:%.*]] = icmp slt i32 [[I_030]], 15
; CHECK-NEXT:    br i1 [[CMP2]], label [[FOR_BODY3]], label [[FOR_INC8]]
; CHECK:       for.inc8:
; CHECK-NEXT:    [[INC9]] = add nuw nsw i32 [[K_031]], 1
; CHECK-NEXT:    [[EXITCOND:%.*]] = icmp eq i32 [[INC9]], 8
; CHECK-NEXT:    br i1 [[EXITCOND]], label [[FOR_END10:%.*]], label [[FOR_BODY]]
; CHECK:       for.end10:
; CHECK-NEXT:    ret void
;
entry:
  br label %for.body

for.body:                                         ; preds = %for.inc8, %entry
  %k.031 = phi i32 [ 1, %entry ], [ %inc9, %for.inc8 ]
  %shl = shl i32 1, %k.031
  %shr = ashr exact i32 %shl, 1
  %cmp229 = icmp slt i32 %shl, 64
  br i1 %cmp229, label %for.body3.preheader, label %for.inc8

for.body3.preheader:                              ; preds = %for.body
  %div = sdiv i32 %shr, 2
  br label %for.body3

for.body3:                                        ; preds = %for.body3.preheader, %for.body3
  %i.030 = phi i32 [ %inc, %for.body3 ], [ %div, %for.body3.preheader ]
  %add = add nsw i32 %i.030, %shr
  %arrayidx = getelementptr inbounds [32 x i32], [32 x i32]* @Data, i32 0, i32 %add
  %arrayidx4 = getelementptr inbounds [32 x i32], [32 x i32]* @Data, i32 0, i32 %i.030
  %0 = load i32, i32* %arrayidx, align 4, !tbaa !3
  %1 = load i32, i32* %arrayidx4, align 4, !tbaa !3
  %sub = sub nsw i32 %1, %0
  store i32 %sub, i32* %arrayidx, align 4, !tbaa !3
  %2 = load i32, i32* %arrayidx4, align 4, !tbaa !3
  %add7 = add nsw i32 %2, %0
  store i32 %add7, i32* %arrayidx4, align 4, !tbaa !3
  %inc = add nsw i32 %i.030, 1
  %cmp2 = icmp slt i32 %i.030, 15
  br i1 %cmp2, label %for.body3, label %for.inc8

for.inc8:                                         ; preds = %for.body3, %for.body
  %inc9 = add nuw nsw i32 %k.031, 1
  %exitcond = icmp eq i32 %inc9, 8
  br i1 %exitcond, label %for.end10, label %for.body

for.end10:                                        ; preds = %for.inc8
  ret void
}

attributes #0 = { norecurse nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="cortex-m7" "target-features"="+d16,+dsp,+fp-armv8,+hwdiv,+strict-align,+thumb-mode" "unsafe-fp-math"="false" "use-soft-float"="false" }

!llvm.module.flags = !{!0, !1}
!llvm.ident = !{!2}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 1, !"min_enum_size", i32 4}
!2 = !{!"clang version 5.0.0 (http://llvm.org/git/clang.git 100ecde90ef26ee81763214d5fb335415ffc2b53) (http://llvm.org/git/llvm.git f2fe26d60eb81a699f2d565e8baabcaf32f9c5ea)"}
!3 = !{!4, !4, i64 0}
!4 = !{!"int", !5, i64 0}
!5 = !{!"omnipotent char", !6, i64 0}
!6 = !{!"Simple C/C++ TBAA"}