[llvm] [AMDGPU] Shrink to SOPK with 32-bit signed literals (PR #70263)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 00:25:37 PDT 2023


================
@@ -159,7 +159,7 @@ bool SIShrinkInstructions::shouldShrinkTrue16(MachineInstr &MI) const {
 }
 
 bool SIShrinkInstructions::isKImmOperand(const MachineOperand &Src) const {
-  return isInt<16>(Src.getImm()) &&
+  return isInt<16>(SignExtend64(Src.getImm(), 32)) &&
----------------
rampitec wrote:

> Could write this as `isInt<16>((int32_t)Src.getImm())` but it's a matter of taste I guess.

Same thing in principle.

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


More information about the llvm-commits mailing list