diff options
| author | Dan Gohman <gohman@apple.com> | 2011-03-22 00:04:35 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2011-03-22 00:04:35 +0000 |
| commit | c1783b31a4b4ad233bc25091cae7b1e6eca6721e (patch) | |
| tree | 08ab88069514c1a2171807b9eab24fdb28e9753f /llvm/test | |
| parent | 9d46337511801abafb2c4f366c4849bbc2cd0938 (diff) | |
| download | bcm5719-llvm-c1783b31a4b4ad233bc25091cae7b1e6eca6721e.tar.gz bcm5719-llvm-c1783b31a4b4ad233bc25091cae7b1e6eca6721e.zip | |
Fix fast-isel address mode folding to avoid folding instructions
outside of the current basic block. This fixes PR9500, rdar://9156159.
llvm-svn: 128041
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/X86/fast-isel-gep.ll | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/fast-isel-gep.ll b/llvm/test/CodeGen/X86/fast-isel-gep.ll index fbe0243716b..48abfd0f26e 100644 --- a/llvm/test/CodeGen/X86/fast-isel-gep.ll +++ b/llvm/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 |

