LICM pass now understands invariant load metadata. Nothing generates this yet so it will currently never get used in real tests
llvm-svn: 144107
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index b79bb13..8098b36 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -369,6 +369,8 @@
// 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;