commit | cea1fdd1748e06455940d3aa8a258ab65f232840 | [log] [tgz] |
---|---|---|
author | Chris Lattner <sabre@nondot.org> | Tue Apr 29 04:58:38 2008 +0000 |
committer | Chris Lattner <sabre@nondot.org> | Tue Apr 29 04:58:38 2008 +0000 |
tree | 68a0f1888b2e0fffa856906ef57254e4291645c0 | |
parent | 3fb2968f2febbcd8e05270270858b6f2afd4b342 [diff] |
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
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 655ab10..c707e6e 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -10311,7 +10311,7 @@ // 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;