llvm.org GIT mirror llvm / 8f7ca5d
Test case for r139453, WidenIV::GetExtendedOperandRecurrence. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139504 91177308-0d34-0410-b5e6-96231b3b80d8 Andrew Trick 8 years ago
1 changed file(s) with 30 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt < %s -indvars -disable-iv-rewrite -S | FileCheck %s
1 ; Test WidenIV::GetExtendedOperandRecurrence.
2 ; add219 should be extended to i64 because it is nsw, even though its
3 ; sext cannot be hoisted outside the loop.
4
5 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"
6
7 define void @test() nounwind {
8 entry:
9 br i1 undef, label %for.body11, label %for.end285
10
11 for.body11: ; preds = %entry
12 %shl = shl i32 1, 1
13 %shl132 = shl i32 %shl, 1
14 br label %for.body153
15
16 for.body153: ; preds = %for.body153, %for.body11
17 br i1 undef, label %for.body170, label %for.body153
18
19 ; CHECK: add nsw i64 %indvars.iv, 1
20 for.body170: ; preds = %for.body170, %for.body153
21 %i2.19 = phi i32 [ %add249, %for.body170 ], [ undef, %for.body153 ]
22 %add219 = add nsw i32 %i2.19, 1
23 %idxprom220 = sext i32 %add219 to i64
24 %add249 = add nsw i32 %i2.19, %shl132
25 br label %for.body170
26
27 for.end285: ; preds = %entry
28 ret void
29 }