[llvm] a1ddfb6 - [LICM] Only forget loop/block dispositions

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 00:58:41 PDT 2023


Author: Nikita Popov
Date: 2023-04-25T09:58:31+02:00
New Revision: a1ddfb60da108acd3adb18f8e50901739edea3c7

URL: https://github.com/llvm/llvm-project/commit/a1ddfb60da108acd3adb18f8e50901739edea3c7
DIFF: https://github.com/llvm/llvm-project/commit/a1ddfb60da108acd3adb18f8e50901739edea3c7.diff

LOG: [LICM] Only forget loop/block dispositions

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.

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/LICM.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 5a1945196a729..a498a7c91639b 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -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(


        


More information about the llvm-commits mailing list