[llvm] [AMDGPU] Eliminate unnecessary packing in wider f16 vectors for sdwa/opsel-able instruction (PR #137137)

Vikash Gupta via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 10 23:52:48 PST 2025


================
@@ -73,6 +73,15 @@ class VOP_Pseudo <string opName, string suffix, VOPProfile P, dag outs, dag ins,
   bit IsTrue16 = P.IsTrue16;
   VOPProfile Pfl = P;
 
+  // True if destination is FP16 and all sources are 16-bit (FP16, BF16, or INT16).
+  // Used for V_PACK_B32_F16 optimization in SIPeepholeSDWA Pass.
+  bit IsSrcDestFP16 = !and(
----------------
vg0204 wrote:

> Second, as something to think about ... can this OR be done by querying existing properties in C++? (But also I think a table's fine).

I don't found anything specific that exists that can be helpful, but if others here could point to a better solution than the search table created here, I can look into that!

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


More information about the llvm-commits mailing list