diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-02-19 20:55:17 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-02-19 20:55:17 +0000 |
commit | 8af9f2019d565de6161a3ce884a16942fe2dde29 (patch) | |
tree | 16dc2c22ced0ee00053811c657e52dead9db406d /lib/Transforms/Scalar/MergedLoadStoreMotion.cpp | |
parent | 608e665946afc2b89050fcf0b99070db2c006bee (diff) | |
download | src-8af9f2019d565de6161a3ce884a16942fe2dde29.tar.gz src-8af9f2019d565de6161a3ce884a16942fe2dde29.zip |
Vendor import of llvm RELEASE_360/rc4 tag r229772 (effectively, 3.6.0 RC4):vendor/llvm/llvm-release_360-r229772
Notes
Notes:
svn path=/vendor/llvm/dist/; revision=279019
svn path=/vendor/llvm/llvm-release_360-r229772/; revision=279020; tag=vendor/llvm/llvm-release_360-r229772
Diffstat (limited to 'lib/Transforms/Scalar/MergedLoadStoreMotion.cpp')
-rw-r--r-- | lib/Transforms/Scalar/MergedLoadStoreMotion.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp b/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp index 8509713b3367..1f73cbc4ac30 100644 --- a/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp +++ b/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp @@ -403,7 +403,7 @@ bool MergedLoadStoreMotion::isStoreSinkBarrierInRange(const Instruction& Start, const Instruction& End, AliasAnalysis::Location Loc) { - return AA->canInstructionRangeModRef(Start, End, Loc, AliasAnalysis::Ref); + return AA->canInstructionRangeModRef(Start, End, Loc, AliasAnalysis::ModRef); } /// @@ -414,6 +414,7 @@ bool MergedLoadStoreMotion::isStoreSinkBarrierInRange(const Instruction& Start, StoreInst *MergedLoadStoreMotion::canSinkFromBlock(BasicBlock *BB1, StoreInst *Store0) { DEBUG(dbgs() << "can Sink? : "; Store0->dump(); dbgs() << "\n"); + BasicBlock *BB0 = Store0->getParent(); for (BasicBlock::reverse_iterator RBI = BB1->rbegin(), RBE = BB1->rend(); RBI != RBE; ++RBI) { Instruction *Inst = &*RBI; @@ -422,13 +423,14 @@ StoreInst *MergedLoadStoreMotion::canSinkFromBlock(BasicBlock *BB1, continue; StoreInst *Store1 = cast<StoreInst>(Inst); - BasicBlock *BB0 = Store0->getParent(); AliasAnalysis::Location Loc0 = AA->getLocation(Store0); AliasAnalysis::Location Loc1 = AA->getLocation(Store1); if (AA->isMustAlias(Loc0, Loc1) && Store0->isSameOperationAs(Store1) && - !isStoreSinkBarrierInRange(*Store1, BB1->back(), Loc1) && - !isStoreSinkBarrierInRange(*Store0, BB0->back(), Loc0)) { + !isStoreSinkBarrierInRange(*(std::next(BasicBlock::iterator(Store1))), + BB1->back(), Loc1) && + !isStoreSinkBarrierInRange(*(std::next(BasicBlock::iterator(Store0))), + BB0->back(), Loc0)) { return Store1; } } |