diff options
| author | Andrew Trick <atrick@apple.com> | 2011-09-12 17:20:57 +0000 |
|---|---|---|
| committer | Andrew Trick <atrick@apple.com> | 2011-09-12 17:20:57 +0000 |
| commit | 8c6fb3af6e8d161d8d31bc6121fe2d04ef70e7fc (patch) | |
| tree | ae71670d769f989c64a7f8d0d6b4cadc0f04067d /llvm/test/Transforms/IndVarSimplify | |
| parent | b5a07abe94ded2dfc568b860b2e6cc4ddef1a283 (diff) | |
| download | bcm5719-llvm-8c6fb3af6e8d161d8d31bc6121fe2d04ef70e7fc.tar.gz bcm5719-llvm-8c6fb3af6e8d161d8d31bc6121fe2d04ef70e7fc.zip | |
Test case for r139453, WidenIV::GetExtendedOperandRecurrence.
llvm-svn: 139504
Diffstat (limited to 'llvm/test/Transforms/IndVarSimplify')
| -rw-r--r-- | llvm/test/Transforms/IndVarSimplify/2011-09-10-widen-nsw.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/Transforms/IndVarSimplify/2011-09-10-widen-nsw.ll b/llvm/test/Transforms/IndVarSimplify/2011-09-10-widen-nsw.ll new file mode 100644 index 00000000000..4dc3c1ea48c --- /dev/null +++ b/llvm/test/Transforms/IndVarSimplify/2011-09-10-widen-nsw.ll @@ -0,0 +1,30 @@ +; RUN: opt < %s -indvars -disable-iv-rewrite -S | FileCheck %s +; Test WidenIV::GetExtendedOperandRecurrence. +; add219 should be extended to i64 because it is nsw, even though its +; sext cannot be hoisted outside the loop. + +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" + +define void @test() nounwind { +entry: + br i1 undef, label %for.body11, label %for.end285 + +for.body11: ; preds = %entry + %shl = shl i32 1, 1 + %shl132 = shl i32 %shl, 1 + br label %for.body153 + +for.body153: ; preds = %for.body153, %for.body11 + br i1 undef, label %for.body170, label %for.body153 + +; CHECK: add nsw i64 %indvars.iv, 1 +for.body170: ; preds = %for.body170, %for.body153 + %i2.19 = phi i32 [ %add249, %for.body170 ], [ undef, %for.body153 ] + %add219 = add nsw i32 %i2.19, 1 + %idxprom220 = sext i32 %add219 to i64 + %add249 = add nsw i32 %i2.19, %shl132 + br label %for.body170 + +for.end285: ; preds = %entry + ret void +} |

