Enhance DSE to handle the variable index case in PR8657.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120498 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2010-11-30 23:43:23 +00:00
parent d309b413a5
commit 3161ae1867
2 changed files with 48 additions and 2 deletions

View File

@@ -52,3 +52,20 @@ define void @test4(i8* %P) {
store double 0.0, double* %Q
ret void
}
; PR8657
declare void @test5a(i32*)
define void @test5(i32 %i) nounwind ssp {
%A = alloca i32
%B = bitcast i32* %A to i8*
%C = getelementptr i8* %B, i32 %i
store i8 10, i8* %C ;; Dead store to variable index.
store i32 20, i32* %A
call void @test5a(i32* %A)
ret void
; CHECK: @test5(
; CHECK-NEXT: alloca
; CHECK-NEXT: store i32 20
; CHECK-NEXT: call void @test5a
}