[llvm] [SLSR] Adding a cost model considering register pressure (PR #213808)

Justin Fargnoli via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 15:48:21 PDT 2026


================
@@ -1362,6 +1376,118 @@ bool StraightLineStrengthReduceLegacyPass::runOnFunction(Function &F) {
   return StraightLineStrengthReduce(DL, DT, SE, TTI).runOnFunction(F);
 }
 
+// Go through all operands of instruction, and check if any operand is used in
+// another block different from the instruction's block and the another use is
+// not rewritable. return true if such operand is found, otherwise return false.
+bool StraightLineStrengthReduce::
+    hasOperandsUsedInNonRewritableUsersInAnotherBlock(
+        llvm::Instruction *Inst) const {
+  llvm::BasicBlock *InstBB = Inst->getParent();
+  if (!InstBB)
+    return false;
----------------
justinfargnoli wrote:

Can this ever occur? 

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


More information about the llvm-commits mailing list