aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/IndVarSimplify/casted-argument.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-04-23 15:16:49 +0000
committerDan Gohman <gohman@apple.com>2009-04-23 15:16:49 +0000
commit752ec7da506f5d41c08bd37e195750b57550ce68 (patch)
tree29c9aa4f22339fc36ee937332eb664934ada172a /test/Transforms/IndVarSimplify/casted-argument.ll
parentb1f321b5539a7f14864c0dc7ed44176785c62d14 (diff)
downloadexternal_llvm-752ec7da506f5d41c08bd37e195750b57550ce68.zip
external_llvm-752ec7da506f5d41c08bd37e195750b57550ce68.tar.gz
external_llvm-752ec7da506f5d41c08bd37e195750b57550ce68.tar.bz2
Change SCEVExpander's expandCodeFor to provide more flexibility
with the persistent insertion point, and change IndVars to make use of it. This fixes a bug where IndVars was holding on to a stale insertion point and forcing the SCEVExpander to continue to use it. This fixes PR4038. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/IndVarSimplify/casted-argument.ll')
-rw-r--r--test/Transforms/IndVarSimplify/casted-argument.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Transforms/IndVarSimplify/casted-argument.ll b/test/Transforms/IndVarSimplify/casted-argument.ll
index ae41e3a..0a14c3e 100644
--- a/test/Transforms/IndVarSimplify/casted-argument.ll
+++ b/test/Transforms/IndVarSimplify/casted-argument.ll
@@ -1,5 +1,6 @@
; RUN: llvm-as < %s | opt -indvars -disable-output
; PR4009
+; PR4038
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"
@@ -21,4 +22,27 @@ loop: ; preds = %loop, %if.else
br label %loop
}
+define void @safe_bcopy_4038(i8* %from, i8* %to, i32 %size) nounwind {
+entry:
+ br i1 false, label %if.else, label %if.then12
+
+if.then12: ; preds = %entry
+ ret void
+
+if.else: ; preds = %entry
+ %sub.ptr.rhs.cast40 = ptrtoint i8* %from to i32 ; <i32> [#uses=1]
+ br label %if.end54
+
+if.end54: ; preds = %if.end54, %if.else
+ %sub.ptr4912.pn = phi i8* [ %sub.ptr4912, %if.end54 ], [ null, %if.else ] ; <i8*> [#uses=1]
+ %sub.ptr7 = phi i8* [ %sub.ptr, %if.end54 ], [ null, %if.else ] ; <i8*> [#uses=2]
+ %sub.ptr.rhs.cast46.pn = ptrtoint i8* %from to i32 ; <i32> [#uses=1]
+ %sub.ptr.lhs.cast45.pn = ptrtoint i8* %to to i32 ; <i32> [#uses=1]
+ %sub.ptr.sub47.pn = sub i32 %sub.ptr.rhs.cast46.pn, %sub.ptr.lhs.cast45.pn ; <i32> [#uses=1]
+ %sub.ptr4912 = getelementptr i8* %sub.ptr4912.pn, i32 %sub.ptr.sub47.pn ; <i8*> [#uses=2]
+ tail call void @bcopy(i8* %sub.ptr4912, i8* %sub.ptr7, i32 0) nounwind
+ %sub.ptr = getelementptr i8* %sub.ptr7, i32 %sub.ptr.rhs.cast40 ; <i8*> [#uses=1]
+ br label %if.end54
+}
+
declare void @bcopy(i8* nocapture) nounwind