[llvm-branch-commits] [llvm] AMDGPU: Fix src2_modifiers for v_dot2_f32_f16/bf16 on gfx11+ (PR #179224)

Mirko BrkuĊĦanin via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 11 10:02:04 PST 2026


================
@@ -5164,6 +5164,26 @@ AMDGPUInstructionSelector::selectVOP3PModsDOT(MachineOperand &Root) const {
   return selectVOP3PRetHelper(Root, true);
 }
 
+InstructionSelector::ComplexRendererFns
+AMDGPUInstructionSelector::selectVOP3PModsF32(MachineOperand &Root) const {
+  Register Src = Root.getReg();
+  unsigned Mods = SISrcMods::OP_SEL_1;
+  if (Subtarget->isGFX11Plus()) {
+    unsigned ModsImpl;
+    std::tie(Src, ModsImpl) = selectVOP3ModsImpl(Root.getReg());
+    Mods |= ModsImpl;
+    if (Mods & SISrcMods::ABS) {
+      Mods ^= SISrcMods::ABS;
+      Mods |= SISrcMods::NEG_HI;
+    }
----------------
mbrkusanin wrote:

According to SIDefines.h these are equal.
NEG_HI = ABS
Is there a reason for replacing ABS with NEG_HI?

(Same for SDAG version)

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


More information about the llvm-branch-commits mailing list