[llvm] [Sink] Allow sinking of loads to distant blocks (PR #135986)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 17 10:14:54 PDT 2025


================
@@ -27,43 +27,71 @@ using namespace llvm;
 STATISTIC(NumSunk, "Number of instructions sunk");
 STATISTIC(NumSinkIter, "Number of sinking iterations");
 
-static bool isSafeToMove(Instruction *Inst, AliasAnalysis &AA,
-                         SmallPtrSetImpl<Instruction *> &Stores) {
-
-  if (Inst->mayWriteToMemory()) {
-    Stores.insert(Inst);
-    return false;
-  }
-
+static bool hasStoreConflict(Instruction *Inst, AliasAnalysis &AA,
+                             SmallPtrSetImpl<Instruction *> &Stores) {
----------------
arsenm wrote:

Can you decouple the changes to call handling from the more predecessor search for a later change 

https://github.com/llvm/llvm-project/pull/135986


More information about the llvm-commits mailing list