[PATCH] D11854: DeadStoreElimination: remove a redundant store even if the load is in a different block.
Erik Eckstein via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 7 17:02:53 PDT 2015
eeckstein created this revision.
eeckstein added a subscriber: llvm-commits.
DeadStoreElimination does eliminate a store if it stores a value which was loaded from the same memory location.
So far this worked only if the store is in the same block as the load. This patch allows that the load is in another block than the store.
Example:
define i32 @test26(i1, i32*) {
entry:
%l2 = load i32, i32* %1, align 4
br i1 %0, label %bb1, label %bb2
bb1:
br label %bb3
bb2:
; This store is redundant
store i32 %l2, i32* %1, align 4
br label %bb3
bb3:
ret i32 0
}
http://reviews.llvm.org/D11854
Files:
lib/Transforms/Scalar/DeadStoreElimination.cpp
test/Transforms/DeadStoreElimination/simple.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11854.31560.patch
Type: text/x-patch
Size: 5074 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150808/6c622cc4/attachment.bin>
More information about the llvm-commits
mailing list