[llvm] r213497 - Fix for regression: [Bug 20369] wrong code at -O3 on x86_64-linux-gnu in 64-bit mode
Gerolf Hoflehner
ghoflehner at apple.com
Sun Jul 20 20:02:46 PDT 2014
Author: ghoflehner
Date: Sun Jul 20 22:02:46 2014
New Revision: 213497
URL: http://llvm.org/viewvc/llvm-project?rev=213497&view=rev
Log:
Fix for regression: [Bug 20369] wrong code at -O3 on x86_64-linux-gnu in 64-bit mode
Prevents hoisting of loads above stores and sinking of stores below loads
in MergedLoadStoreMotion.cpp (rdar://15991737)
Modified:
llvm/trunk/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp?rev=213497&r1=213496&r2=213497&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp Sun Jul 20 22:02:46 2014
@@ -243,6 +243,10 @@ bool MergedLoadStoreMotion::isLoadHoistB
return true;
if (isa<TerminatorInst>(Inst))
return true;
+ // FIXME: Conservatively let a store instruction block the load.
+ // Use alias analysis instead.
+ if (isa<StoreInst>(Inst))
+ return true;
// Note: mayHaveSideEffects covers all instructions that could
// trigger a change to state. Eg. in-flight stores have to be executed
// before ordered loads or fences, calls could invoke functions that store
@@ -411,8 +415,12 @@ bool MergedLoadStoreMotion::mergeLoads(B
///
/// \brief True when instruction is sink barrier for a store
-///
+///
bool MergedLoadStoreMotion::isStoreSinkBarrier(Instruction *Inst) {
+ // FIXME: Conservatively let a load instruction block the store.
+ // Use alias analysis instead.
+ if (isa<LoadInst>(Inst))
+ return true;
if (isa<CallInst>(Inst))
return true;
if (isa<TerminatorInst>(Inst) && !isa<BranchInst>(Inst))
More information about the llvm-commits
mailing list