diff options
| author | Artur Pilipenko <apilipenko@azulsystems.com> | 2017-05-25 15:14:48 +0000 |
|---|---|---|
| committer | Artur Pilipenko <apilipenko@azulsystems.com> | 2017-05-25 15:14:48 +0000 |
| commit | 315eafc33980be8a90b16e48bdf551f517b55c48 (patch) | |
| tree | f093a24708dc7c912f6b885026d909679fa4fdc2 /llvm/test/Transforms | |
| parent | 3ea9499e7578616c2d48aec3b5ffaf9fef5a7e90 (diff) | |
| download | bcm5719-llvm-315eafc33980be8a90b16e48bdf551f517b55c48.tar.gz bcm5719-llvm-315eafc33980be8a90b16e48bdf551f517b55c48.zip | |
[InstCombine] Teach isAllocSiteRemovable to look through addrspacecasts
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D28565
llvm-svn: 303870
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/alloca.ll | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/alloca.ll b/llvm/test/Transforms/InstCombine/alloca.ll index f81f700e6cf..490830af2d8 100644 --- a/llvm/test/Transforms/InstCombine/alloca.ll +++ b/llvm/test/Transforms/InstCombine/alloca.ll @@ -51,8 +51,8 @@ define i32* @test4(i32 %n) { ret i32* %A } -; Allocas which are only used by GEPs, bitcasts, and stores (transitively) -; should be deleted. +; Allocas which are only used by GEPs, bitcasts, addrspacecasts, and stores +; (transitively) should be deleted. define void @test5() { ; CHECK-LABEL: @test5( ; CHECK-NOT: alloca @@ -62,6 +62,7 @@ define void @test5() { entry: %a = alloca { i32 } %b = alloca i32* + %c = alloca i32 %a.1 = getelementptr { i32 }, { i32 }* %a, i32 0, i32 0 store i32 123, i32* %a.1 store i32* %a.1, i32** %b @@ -73,6 +74,8 @@ entry: store atomic i32 3, i32* %a.3 release, align 4 %a.4 = getelementptr { i32 }, { i32 }* %a, i32 0, i32 0 store atomic i32 4, i32* %a.4 seq_cst, align 4 + %c.1 = addrspacecast i32* %c to i32 addrspace(1)* + store i32 123, i32 addrspace(1)* %c.1 ret void } |

