Add a comment.
authorDevang Patel <dpatel@apple.com>
Thu, 20 Oct 2011 17:31:18 +0000 (17:31 +0000)
committerDevang Patel <dpatel@apple.com>
Thu, 20 Oct 2011 17:31:18 +0000 (17:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142592 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineLICM.cpp

index 969a9b084d5927f9b2e90e8be4664112aa085553..c693386f9bb81ae85d15d462eb4be45e22dffd48 100644 (file)
@@ -788,7 +788,9 @@ bool MachineLICM::IsLICMCandidate(MachineInstr &I) {
 
   // If it is load then check if it is guaranteed to execute by making sure that
   // it dominates all exiting blocks. If it doesn't, then there is a path out of
-  // the loop which does not execute this load, so we can't hoist it.
+  // the loop which does not execute this load, so we can't hoist it. Loads
+  // from constant memory are not safe to speculate all the time, for example
+  // indexed load from a jump table.
   // Stores and side effects are already checked by isSafeToMove.
   if (I.getDesc().mayLoad() && !isLoadFromGOT(I) && 
       !IsGuaranteedToExecute(I.getParent()))