mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-18 07:52:35 +00:00
don't delete the last store to an alloca if the store is volatile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50390 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3fb2968f2f
commit
cea1fdd174
@ -10311,7 +10311,7 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) {
|
||||
|
||||
// If the RHS is an alloca with a single use, zapify the store, making the
|
||||
// alloca dead.
|
||||
if (Ptr->hasOneUse()) {
|
||||
if (Ptr->hasOneUse() && !SI.isVolatile()) {
|
||||
if (isa<AllocaInst>(Ptr)) {
|
||||
EraseInstFromFunction(SI);
|
||||
++NumCombined;
|
||||
|
8
test/Transforms/InstCombine/2008-04-28-VolatileStore.ll
Normal file
8
test/Transforms/InstCombine/2008-04-28-VolatileStore.ll
Normal file
@ -0,0 +1,8 @@
|
||||
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {volatile store}
|
||||
|
||||
define void @test() {
|
||||
%votf = alloca <4 x float> ; <<4 x float>*> [#uses=1]
|
||||
volatile store <4 x float> zeroinitializer, <4 x float>* %votf, align 16
|
||||
ret void
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user