[PATCH] Sink store based on alias analysis
Gerolf Hoflehner
ghoflehner at apple.com
Mon Dec 1 11:44:25 PST 2014
================
Comment at: include/llvm/Analysis/AliasAnalysis.h:520
@@ -519,1 +519,3 @@
+ const Instruction &I2, const Location &Loc,
+ const ModRefResult mode);
----------------
mode -> Mode
================
Comment at: lib/Transforms/Scalar/MergedLoadStoreMotion.cpp:148
@@ -147,1 +147,3 @@
+ const Instruction& End,
+ StoreInst* LI);
bool sinkStore(BasicBlock *BB, StoreInst *SinkCand, StoreInst *ElseInst);
----------------
Rename to SI
================
Comment at: lib/Transforms/Scalar/MergedLoadStoreMotion.cpp:429
@@ +428,3 @@
+ if (AA->isMustAlias(Loc0, Loc1) && Store0->isSameOperationAs(Store1) &&
+ !isStoreSinkBarrierInRange(*Store1, BB1->back(), Store1) &&
+ !isStoreSinkBarrierInRange(*Store0, BB0->back(), Store0)) {
----------------
You could pass Loc as the third parameter and save one call to getLocation.
================
Comment at: test/Transforms/InstMerge/st_sink_no_barrier_call.ll:45
@@ +44,2 @@
+
+attributes #0 = { readnone }
----------------
Please remove
http://reviews.llvm.org/D6420
More information about the llvm-commits
mailing list