[llvm] [SPIRV] Use `Op[S|U]Dot` when possible for integer dot product (PR #115095)

Greg Roth via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 16:08:45 PST 2024


================
@@ -1013,21 +1013,26 @@ static void AddDotProductRequirements(const MachineInstr &MI,
   Reqs.addCapability(SPIRV::Capability::DotProduct);
 
   const MachineRegisterInfo &MRI = MI.getMF()->getRegInfo();
-  const MachineInstr *InstrPtr = &MI;
-  assert(MI.getOperand(1).isReg() && "Unexpected operand in dot");
+  assert(MI.getOperand(2).isReg() && "Unexpected operand in dot");
+  const MachineInstr *InputInstr = MRI.getVRegDef(MI.getOperand(2).getReg());
+  assert(InputInstr->getOperand(1).isReg() &&
+         "Unexpected operand in dot input");
----------------
pow2clk wrote:

This represents a complete change of which instruction we are vetting here. Can you explain why the change was needed and maybe why it worked before, but we don't need to verify that it does?

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


More information about the llvm-commits mailing list