aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2011-03-22 00:04:35 +0000
committerDan Gohman <gohman@apple.com>2011-03-22 00:04:35 +0000
commitb55d6b6a7ea64f1cd168181f619aaa2f7080855a (patch)
tree347db12338a5cab9f20c549345769f877f0c2877 /test/CodeGen
parentce3a1bac4bb3168b4862e4b674800dd6922267ac (diff)
downloadexternal_llvm-b55d6b6a7ea64f1cd168181f619aaa2f7080855a.zip
external_llvm-b55d6b6a7ea64f1cd168181f619aaa2f7080855a.tar.gz
external_llvm-b55d6b6a7ea64f1cd168181f619aaa2f7080855a.tar.bz2
Fix fast-isel address mode folding to avoid folding instructions
outside of the current basic block. This fixes PR9500, rdar://9156159. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128041 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/fast-isel-gep.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGen/X86/fast-isel-gep.ll b/test/CodeGen/X86/fast-isel-gep.ll
index fbe0243..48abfd0 100644
--- a/test/CodeGen/X86/fast-isel-gep.ll
+++ b/test/CodeGen/X86/fast-isel-gep.ll
@@ -87,4 +87,23 @@ define i64 @test5(i8* %A, i32 %I, i64 %B) nounwind {
; X64-NEXT: ret
}
+; PR9500, rdar://9156159 - Don't do non-local address mode folding,
+; because it may require values which wouldn't otherwise be live out
+; of their blocks.
+define void @test6() {
+if.end: ; preds = %if.then, %invoke.cont
+ %tmp15 = load i64* undef
+ %dec = add i64 %tmp15, 13
+ store i64 %dec, i64* undef
+ %call17 = invoke i8* @_ZNK18G__FastAllocString4dataEv()
+ to label %invoke.cont16 unwind label %lpad
+invoke.cont16: ; preds = %if.then14
+ %arrayidx18 = getelementptr inbounds i8* %call17, i64 %dec
+ store i8 0, i8* %arrayidx18
+ unreachable
+
+lpad: ; preds = %if.end19, %if.then14, %if.end, %entry
+ unreachable
+}
+declare i8* @_ZNK18G__FastAllocString4dataEv() nounwind