[llvm] AMDGPU: Use generic legality checks instead of checking subtarget feature (PR #177656)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 23 11:14:25 PST 2026


================
@@ -4558,7 +4558,7 @@ SDValue AMDGPUTargetLowering::performMulCombine(SDNode *N,
   }
 
   // There are i16 integer mul/mad.
-  if (Subtarget->has16BitInsts() && VT.getScalarType().bitsLE(MVT::i16))
+  if (isTypeLegal(MVT::i16) && VT.getScalarType().bitsLE(MVT::i16))
----------------
shiltian wrote:

Is `isTypeLegal` sufficient? IIUC it just checks whether there is a RC for that and it doesn't seem like we guard RC with predicate?

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


More information about the llvm-commits mailing list