diff options
| author | Fiona Glaser <escha@apple.com> | 2018-01-11 21:28:57 +0000 |
|---|---|---|
| committer | Fiona Glaser <escha@apple.com> | 2018-01-11 21:28:57 +0000 |
| commit | efe6a84e5b5015326ee0825e275bc929f8afee5f (patch) | |
| tree | 6a78bacd9790393a184143389691a45c7193cf8e /llvm/lib/Transforms | |
| parent | 1ee1f49393afac0ff1b0723c3d35129debe571c6 (diff) | |
| download | bcm5719-llvm-efe6a84e5b5015326ee0825e275bc929f8afee5f.tar.gz bcm5719-llvm-efe6a84e5b5015326ee0825e275bc929f8afee5f.zip | |
[Sink] Really really fix predicate in legality check
LoadInst isn't enough; we need to include intrinsics that perform loads too.
All side-effecting intrinsics and such are already covered by the isSafe
check, so we just need to care about things that read from memory.
D41960, originally from D33179.
llvm-svn: 322311
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/Sink.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/Sink.cpp b/llvm/lib/Transforms/Scalar/Sink.cpp index cfb8a062299..81176288049 100644 --- a/llvm/lib/Transforms/Scalar/Sink.cpp +++ b/llvm/lib/Transforms/Scalar/Sink.cpp @@ -114,7 +114,7 @@ static bool IsAcceptableTarget(Instruction *Inst, BasicBlock *SuccToSinkTo, if (SuccToSinkTo->getUniquePredecessor() != Inst->getParent()) { // We cannot sink a load across a critical edge - there may be stores in // other code paths. - if (isa<LoadInst>(Inst)) + if (Inst->mayReadFromMemory()) return false; // We don't want to sink across a critical edge if we don't dominate the |

