summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2016-05-06 21:43:51 +0000
committerPhilip Reames <listmail@philipreames.com>2016-05-06 21:43:51 +0000
commit4a3c3b66d7466ff7d04d92c976a9416876feb422 (patch)
treec31d2362f5b12015b0bc5b08df26d478ed63901c /llvm/lib/Transforms/Scalar
parent2def0a878af939c78f15cb5fa9e106816eafb7c3 (diff)
downloadbcm5719-llvm-4a3c3b66d7466ff7d04d92c976a9416876feb422.tar.gz
bcm5719-llvm-4a3c3b66d7466ff7d04d92c976a9416876feb422.zip
[GVN] PRE of unordered loads
Again, fairly simple. Only change is ensuring that we actually copy the property of the load correctly. The aliasing legality constraints were already handled by the FRE patches. There's nothing special about unorder atomics from the perspective of the PRE algorithm itself. llvm-svn: 268804
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index 7e937bf954a..97ec1eab654 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -1552,9 +1552,10 @@ bool GVN::PerformLoadPRE(LoadInst *LI, AvailValInBlkVect &ValuesPerBlock,
BasicBlock *UnavailablePred = PredLoad.first;
Value *LoadPtr = PredLoad.second;
- Instruction *NewLoad = new LoadInst(LoadPtr, LI->getName()+".pre", false,
- LI->getAlignment(),
- UnavailablePred->getTerminator());
+ auto *NewLoad = new LoadInst(LoadPtr, LI->getName()+".pre",
+ LI->isVolatile(), LI->getAlignment(),
+ LI->getOrdering(), LI->getSynchScope(),
+ UnavailablePred->getTerminator());
// Transfer the old load's AA tags to the new load.
AAMDNodes Tags;
@@ -1664,11 +1665,6 @@ bool GVN::processNonLocalLoad(LoadInst *LI) {
return true;
}
- // This code hasn't been audited for atomic, ordered, or volatile memory
- // access.
- if (!LI->isSimple())
- return false;
-
// Step 4: Eliminate partial redundancy.
if (!EnablePRE || !EnableLoadPRE)
return false;
OpenPOWER on IntegriCloud