aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-02-18 17:22:41 +0000
committerDan Gohman <gohman@apple.com>2009-02-18 17:22:41 +0000
commitf5a309e989b8d2199cb542793e9edf48395d9fed (patch)
treec52543300d485f04baebd2bc1ee8f1fb7721a411 /test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll
parentcad24c9abc834db5cf8f92019f99370507d8d07a (diff)
downloadexternal_llvm-f5a309e989b8d2199cb542793e9edf48395d9fed.zip
external_llvm-f5a309e989b8d2199cb542793e9edf48395d9fed.tar.gz
external_llvm-f5a309e989b8d2199cb542793e9edf48395d9fed.tar.bz2
Use a sign-extend instead of a zero-extend when promoting a
trip count value when the original loop iteration condition is signed and the canonical induction variable won't undergo signed overflow. This isn't required for correctness; it just preserves more information about original loop iteration values. Add a getTruncateOrSignExtend method to ScalarEvolution, following getTruncateOrZeroExtend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64918 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll')
-rw-r--r--test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll b/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll
index 08b08f2..9588bd3 100644
--- a/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll
+++ b/test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll
@@ -1,6 +1,7 @@
-; RUN: llvm-as < %s | opt -indvars | llvm-dis | not grep sext
-
-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"
+; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t
+; RUN: grep sext %t | count 2
+; RUN: grep { = sext i16 %N to i64} %t
+; RUN: grep { = sext i32 %count to i64} %t
define i64 @test(i64* nocapture %first, i32 %count) nounwind readonly {
entry: