File: compare-scev-by-complexity.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (76 lines) | stat: -rw-r--r-- 3,450 bytes parent folder | download | duplicates (12)
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
; RUN: opt -passes=load-store-vectorizer %s -S | FileCheck %s
; RUN: opt -aa-pipeline=basic-aa -passes='function(load-store-vectorizer)' %s -S | FileCheck %s

; Check that setting wrapping flags after a SCEV node is created
; does not invalidate "sorted by complexity" invariant for
; operands of commutative and associative SCEV operators.

target triple = "x86_64--"

@global_value0 = external constant i32
@global_value1 = external constant i32
@other_value = external global float
@a = external global float
@b = external global float
@c = external global float
@d = external global float
@plus1 = external global i32
@cnd = external global i8

; Function Attrs: nounwind
define void @main() local_unnamed_addr #0 {
; CHECK-LABEL: @main()
; CHECK:  = load <2 x float>, ptr %preheader.load0.address
; CHECK-LABEL: for.body23:
entry:
  %tmp = load i32, ptr @global_value0, !range !0
  %tmp2 = load i32, ptr @global_value1
  %and.i.i = and i32 %tmp2, 2
  %add.nuw.nsw.i.i = add nuw nsw i32 %and.i.i, 0
  %mul.i.i = shl nuw nsw i32 %add.nuw.nsw.i.i, 1
  %and6.i.i = and i32 %tmp2, 3
  %and9.i.i = and i32 %tmp2, 4
  %add.nuw.nsw10.i.i = add nuw nsw i32 %and6.i.i, %and9.i.i
  %conv3.i42.i = add nuw nsw i32 %mul.i.i, 1
  %reass.add346.7 = add nuw nsw i32 %add.nuw.nsw10.i.i, 56
  %reass.mul347.7 = mul nuw nsw i32 %tmp, %reass.add346.7
  %add7.i.7 = add nuw nsw i32 %reass.mul347.7, 0
  %preheader.address0.idx = add nuw nsw i32 %add7.i.7, %mul.i.i
  %preheader.address0.idx.zext = zext i32 %preheader.address0.idx to i64
  %preheader.load0.address = getelementptr inbounds float, ptr @other_value, i64 %preheader.address0.idx.zext
  %preheader.load0. = load float, ptr %preheader.load0.address, align 4, !tbaa !1
  %common.address.idx = add nuw nsw i32 %add7.i.7, %conv3.i42.i
  %preheader.header.common.address.idx.zext = zext i32 %common.address.idx to i64
  %preheader.load1.address = getelementptr inbounds float, ptr @other_value, i64 %preheader.header.common.address.idx.zext
  %preheader.load1. = load float, ptr %preheader.load1.address, align 4, !tbaa !1
  br label %for.body23

for.body23:                                       ; preds = %for.body23, %entry
  %loop.header.load0.address = getelementptr inbounds float, ptr @other_value, i64 %preheader.header.common.address.idx.zext
  %loop.header.load0. = load float, ptr %loop.header.load0.address, align 4, !tbaa !1
  %reass.mul343.7 = mul nuw nsw i32 %reass.add346.7, 72
  %add7.i286.7.7 = add nuw nsw i32 %reass.mul343.7, 56
  %add9.i288.7.7 = add nuw nsw i32 %add7.i286.7.7, %mul.i.i
  %loop.header.address1.idx = add nuw nsw i32 %add9.i288.7.7, 1
  %loop.header.address1.idx.zext = zext i32 %loop.header.address1.idx to i64
  %loop.header.load1.address = getelementptr inbounds float, ptr @other_value, i64 %loop.header.address1.idx.zext
  %loop.header.load1. = load float, ptr %loop.header.load1.address, align 4, !tbaa !1
  store float %preheader.load0., ptr @a, align 4, !tbaa !1
  store float %preheader.load1., ptr @b, align 4, !tbaa !1
  store float %loop.header.load0., ptr @c, align 4, !tbaa !1
  store float %loop.header.load1., ptr @d, align 4, !tbaa !1
  %loaded.cnd = load i8, ptr @cnd
  %condition = trunc i8 %loaded.cnd to i1
  br i1 %condition, label %for.body23, label %exit

exit:
  ret void
}

attributes #0 = { nounwind }

!0 = !{i32 0, i32 65536}
!1 = !{!2, !2, i64 0}
!2 = !{!"float", !3, i64 0}
!3 = !{!"omnipotent char", !4, i64 0}
!4 = !{!"Simple C++ TBAA"}