[llvm] [AMDGPU] Select v_bfe_u32 for i8/i16 (and (srl x, c), mask) (PR #182446)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 00:11:59 PST 2026


================
@@ -4157,17 +4157,32 @@ def IMMZeroBasedBitfieldMask : ImmLeaf <i32, [{
   return isMask_32(Imm);
 }]>;
 
+def IMMZeroBasedBitfieldMask16 : ImmLeaf <i16, [{
+  return isUInt<16>(Imm) && isMask_32(Imm);
+}]>;
+
 def IMMPopCount : SDNodeXForm<imm, [{
   return CurDAG->getTargetConstant(llvm::popcount(N->getZExtValue()), SDLoc(N),
                                    MVT::i32);
 }]>;
 
+def IMMAsI32 : SDNodeXForm<imm, [{
----------------
arsenm wrote:

You should be able to use the existing as_i32timm

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


More information about the llvm-commits mailing list