[llvm] [SPIRV] Sign-extend operands of sign-sensitive ops on sub-pow2 widths (PR #203661)
Faijul Amin via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 11 11:06:18 PDT 2026
mdfaijul wrote:
> I feel like I missed something. Are `G_ICMP, G_ASHR, G_SDIV, G_SREM` the only sign sensitive instructions? Why only the four are need correct widening for signed arguments? The widening mechanism of signed operators sounds generic for me, not specific to 4 instructions
This PR does not address all sign sensitive instructions. I have plan to extend it in later PRs. Added TODO for additional ones. Would the instructions that use `TargetOpcode::G_SEXT` for `widenScalarSrc(...)` be a sufficient list for sign sensitive instructions? https://github.com/llvm/llvm-project/blob/main/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp#L2771-L3644
https://github.com/llvm/llvm-project/pull/203661
More information about the llvm-commits
mailing list