diff options
| author | Alexandros Lamprineas <alexandros.lamprineas@arm.com> | 2018-07-23 09:42:35 +0000 |
|---|---|---|
| committer | Alexandros Lamprineas <alexandros.lamprineas@arm.com> | 2018-07-23 09:42:35 +0000 |
| commit | 592cc78dd8b1bef45b9b0495b815cb260a5dcd0e (patch) | |
| tree | e8e69fbbc380cd2a8a0103b2e8b16726d6ad117e /llvm/lib/Transforms | |
| parent | 1d926fb9f4a967c7d1ef7312e147933987c8cd7b (diff) | |
| download | bcm5719-llvm-592cc78dd8b1bef45b9b0495b815cb260a5dcd0e.tar.gz bcm5719-llvm-592cc78dd8b1bef45b9b0495b815cb260a5dcd0e.zip | |
[GVNHoist] safeToHoistLdSt allows illegal hoisting
Bug fix for PR36787. When reasoning if it's safe to hoist a load we
want to make sure that the defining memory access dominates the new
insertion point of the hoisted instruction. safeToHoistLdSt calls
firstInBB(InsertionPoint,DefiningAccess) which returns false if
InsertionPoint == DefiningAccess, and therefore it falsely thinks
it's safe to hoist.
Differential Revision: https://reviews.llvm.org/D49555
llvm-svn: 337674
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/GVNHoist.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp index bec0a565124..6d2b25cf601 100644 --- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp +++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp @@ -534,7 +534,7 @@ private: if (NewBB == DBB && !MSSA->isLiveOnEntryDef(D)) if (auto *UD = dyn_cast<MemoryUseOrDef>(D)) - if (firstInBB(NewPt, UD->getMemoryInst())) + if (!firstInBB(UD->getMemoryInst(), NewPt)) // Cannot move the load or store to NewPt above its definition in D. return false; |

