diff options
author | Philip Reames <listmail@philipreames.com> | 2016-04-22 20:53:32 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2016-04-22 20:53:32 +0000 |
commit | 5f0e36947bb634416f0425266f6066e8b83fc382 (patch) | |
tree | 9ffbe7fafaeb891e482aa514da35ad699d2cde3b /llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | |
parent | f97229d6ba32dc9a74a53eb75dab806d2ca44bff (diff) | |
download | bcm5719-llvm-5f0e36947bb634416f0425266f6066e8b83fc382.tar.gz bcm5719-llvm-5f0e36947bb634416f0425266f6066e8b83fc382.zip |
[unordered] sink unordered stores at end of blocks
The existing code turned out to be completely correct when auditted. Thus, only minor code changes and adding a couple of tests.
llvm-svn: 267215
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index aa72244463e..e8314006dd1 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -1193,10 +1193,6 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) { if (isa<UndefValue>(Val)) return eraseInstFromFunction(SI); - // The code below needs to be audited and adjusted for unordered atomics - if (!SI.isSimple()) - return nullptr; - // If this store is the last instruction in the basic block (possibly // excepting debug info instructions), and if the block ends with an // unconditional branch, try to move it to the successor block. @@ -1222,6 +1218,9 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) { /// into a phi node with a store in the successor. /// bool InstCombiner::SimplifyStoreAtEndOfBlock(StoreInst &SI) { + assert(SI.isUnordered() && + "this code has not been auditted for volatile or ordered store case"); + BasicBlock *StoreBB = SI.getParent(); // Check to see if the successor block has exactly two incoming edges. If |