[llvm] [Hexagon] Fuse vminub intrinsic pair (PR #225153)

Santanu Das via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 00:29:24 PDT 2026


================
@@ -274,9 +295,82 @@ bool HexagonPeephole::runOnMachineFunction(MachineFunction &MF) {
 
     } // Instruction
   } // Basic Block
+
+  if (FuseIntrinsicVMinUB)
+    Changed |= fuseIntrinsicVMinUB(MF);
+
+  return Changed;
+}
+
+// Return true if both instructions have identical input operands in order.
+static bool hasCommonInputOps(const MachineInstr *I1, const MachineInstr *I2) {
+  if (I1->getNumOperands() != I2->getNumOperands())
+    return false;
+
+  for (unsigned i = 0, e = I1->getNumOperands(); i != e; ++i) {
+    const MachineOperand &Op1 = I1->getOperand(i);
----------------
quic-santdas wrote:

Nitpick: if one instruction has 2 inputs and 1 output, another has 2 output and 1 input, this will cause a exception. better to also add a check for presence of operand first.

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


More information about the llvm-commits mailing list