• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; REQUIRES: asserts
2; RUN: opt -mtriple=x86_64-unknown-linux-gnu -loop-reduce -S < %s
3; PR33077. Check the LSR Use formula to be inserted is already canonicalized and
4; will not trigger assertion.
5
6target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7
8; Function Attrs: uwtable
9define void @foo() {
10cHeapLvb.exit:
11  br label %not_zero48.us
12
13not_zero48.us:                                    ; preds = %not_zero48.us, %cHeapLvb.exit
14  %indvars.iv.us = phi i64 [ %indvars.iv.next.us.7, %not_zero48.us ], [ undef, %cHeapLvb.exit ]
15  %0 = phi i32 [ %13, %not_zero48.us ], [ undef, %cHeapLvb.exit ]
16  %indvars.iv.next.us = add nuw nsw i64 %indvars.iv.us, 1
17  %1 = add i32 %0, 2
18  %2 = getelementptr inbounds i32, i32 addrspace(1)* undef, i64 %indvars.iv.next.us
19  %3 = load i32, i32 addrspace(1)* %2, align 4
20  %4 = add i32 %0, 3
21  %5 = load i32, i32 addrspace(1)* undef, align 4
22  %6 = sub i32 undef, %5
23  %factor.us.2 = shl i32 %6, 1
24  %7 = add i32 %factor.us.2, %1
25  %8 = load i32, i32 addrspace(1)* undef, align 4
26  %9 = sub i32 %7, %8
27  %factor.us.3 = shl i32 %9, 1
28  %10 = add i32 %factor.us.3, %4
29  %11 = load i32, i32 addrspace(1)* undef, align 4
30  %12 = sub i32 %10, %11
31  %factor.us.4 = shl i32 %12, 1
32  %13 = add i32 %0, 8
33  %indvars.iv.next.us.7 = add nsw i64 %indvars.iv.us, 8
34  br label %not_zero48.us
35}
36
37