diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/LICM.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index b79bb1300f..8098b3608e 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -369,6 +369,8 @@ bool LICM::canSinkOrHoistInst(Instruction &I) { // in the same alias set as something that ends up being modified. if (AA->pointsToConstantMemory(LI->getOperand(0))) return true; + if (LI->getMetadata(LI->getContext().getMDKindID("invariant.load"))) + return true; // Don't hoist loads which have may-aliased stores in loop. uint64_t Size = 0; |