[llvm] [AMDGPU][True16][CodeGen] optimize codegen for mad-mix in true16 (PR #124995)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 21 05:47:14 PDT 2025


================
@@ -3665,6 +3665,11 @@ bool AMDGPUDAGToDAGISel::SelectVOP3PMadMixModsImpl(SDValue In, SDValue &Src,
       // TODO: Should we try to look for neg/abs here?
     }
 
+    // Prevent unnecessary subreg COPY to VGPR_16
+    if (Src.getOpcode() == ISD::TRUNCATE &&
+        Src.getOperand(0).getValueType().getSizeInBits() == 32) {
----------------
arsenm wrote:

```suggestion
        Src.getOperand(0).getValueType() == MVT::i32) {
```

We also don't want to do this if it somehow ended up with a v2i16 

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


More information about the llvm-commits mailing list