[llvm] [EarlyIfConversion] Extend data dependent analysis across multiple blocks (PR #180623)

Jonathan Cohen via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 12:55:22 PDT 2026


================
@@ -923,15 +932,62 @@ static bool isConstantPoolLoad(const MachineInstr *MI) {
          });
 }
 
-/// Check if there are any calls in the range (From, To].
-static bool callInRange(const MachineInstr *From, const MachineInstr *To) {
-  constexpr int MaxInstructionsToCheck = 64;
-  int Count = 0;
-  auto InstrRange =
-      make_range(std::next(From->getIterator()), To->getIterator());
-  return any_of(InstrRange, [&](const MachineInstr &MI) {
-    return ++Count > MaxInstructionsToCheck || MI.isCall();
-  });
+/// Check if there are any calls in the path from From to To, potentially
----------------
jcohen-apple wrote:

Changed the name, also expanded the analysis to consider all the relevant predecessor blocks (not just those which contain instructions on the use-def chain). Added quite a few tests to reflect that as well.

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


More information about the llvm-commits mailing list