[LICM] Only forget loop/block dispositions
authorNikita Popov <npopov@redhat.com>
Tue, 25 Apr 2023 07:57:39 +0000 (09:57 +0200)
committerNikita Popov <npopov@redhat.com>
Tue, 25 Apr 2023 07:58:31 +0000 (09:58 +0200)
As we are moving the instruction without changing its value, it
is sufficient to only invalidate the loop/block dispositions.
This is the same we do in LoopSink.

llvm/lib/Transforms/Scalar/LICM.cpp

index 5a19451..a498a7c 100644 (file)
@@ -1518,7 +1518,7 @@ static void moveInstructionBefore(Instruction &I, Instruction &Dest,
           MSSAU.getMemorySSA()->getMemoryAccess(&I)))
     MSSAU.moveToPlace(OldMemAcc, Dest.getParent(), MemorySSA::BeforeTerminator);
   if (SE)
-    SE->forgetValue(&I);
+    SE->forgetBlockAndLoopDispositions(&I);
 }
 
 static Instruction *sinkThroughTriviallyReplaceablePHI(