llvm.org GIT mirror llvm / 52164ea
Test case for r140670: indvars should hoist sext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140671 91177308-0d34-0410-b5e6-96231b3b80d8 Andrew Trick 8 years ago
1 changed file(s) with 28 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt < %s -indvars -S | FileCheck %s
1 ; Test indvars' ability to hoist new sext created by WidenIV.
2 ; From ffbench.
3
4 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
5 define internal double @fourn(double* %data, i32 %x, i32 %y, i32 %n) nounwind {
6 ; CHECK: entry:
7 ; CHECK: sext
8 ; CHECK: sext
9 entry:
10 br label %for.body
11
12 ; CHECK: for.body:
13 ; CHECK-NOT: sext
14 ; CHECK: br
15 for.body:
16 %i2.115 = phi i32 [ 0, %entry ], [ %add249, %for.body ]
17 %add174 = add nsw i32 %i2.115, %x
18 %idxprom177 = sext i32 %add174 to i64
19 %arrayidx179 = getelementptr inbounds double* %data, i64 %idxprom177
20 %tmp180 = load double* %arrayidx179, align 8
21 %add249 = add nsw i32 %i2.115, %y
22 %cmp168 = icmp sgt i32 %add249, %n
23 br i1 %cmp168, label %exit, label %for.body
24
25 exit:
26 ret double %tmp180
27 }