[clang] [llvm] [HLSL][DXIL][SPIRV] Create llvm dot intrinsic and use for HLSL (PR #102872)

Vyacheslav Levytskyy via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 13 06:18:31 PDT 2024


================
@@ -380,6 +383,20 @@ bool SPIRVInstructionSelector::spvSelect(Register ResVReg,
       MIB.addImm(V);
     return MIB.constrainAllUses(TII, TRI, RBI);
   }
+
+  case TargetOpcode::G_FDOTPROD: {
+    MachineBasicBlock &BB = *I.getParent();
+    return BuildMI(BB, I, I.getDebugLoc(), TII.get(SPIRV::OpDot))
+        .addDef(ResVReg)
+        .addUse(GR.getSPIRVTypeID(ResType))
+        .addUse(I.getOperand(1).getReg())
+        .addUse(I.getOperand(2).getReg())
+        .constrainAllUses(TII, TRI, RBI);
+  }
----------------
VyacheslavLevytskyy wrote:

I think trying to merge those two `SPIRV::OpDot`'s would not simplify or improve anything, let's keep as is.

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


More information about the cfe-commits mailing list