[llvm] [AMDGPU] Shrink to SOPK with 32-bit signed literals (PR #70263)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 26 00:20:35 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)) &&
----------------
jayfoad wrote:
Could write this as `isInt<16>((int32_t)Src.getImm())` but it's a matter of taste I guess.
https://github.com/llvm/llvm-project/pull/70263
More information about the llvm-commits
mailing list