[llvm] [InstSimplify] Provide information about the range of possible values that `ucmp`/`scmp` can return (PR #96410)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 23 09:56:29 PDT 2024


nikic wrote:

The point of encoding this in the intrinsic attributes is that it's *not* for a specific use case, but a general mechanism. Target-independent intrinsics with fixed result ranges are pretty rare, but this comes up for target-specific intrinsics as well. For example arm_mve_pred_v2i currently adds a fixed range attribute via an InstCombine hook: https://github.com/llvm/llvm-project/blob/c19028f364cceb4b2111c7956dcacbc257a96fd4/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp#L195C19-L195C35 x86_sse42_crc32_64_64 instead adds a special case in ValueTracking: https://github.com/llvm/llvm-project/blob/c19028f364cceb4b2111c7956dcacbc257a96fd4/llvm/lib/Analysis/ValueTracking.cpp#L1732C23-L1732C44 We have some NVPTX intrinsics with fixed ranges as well.

Anyway, we should still land this patch in the meantime. I may look into the generic mechanism myself.

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


More information about the llvm-commits mailing list