[llvm] [IVDescriptors] Bail out on FindFirst/FindLast reductions on i1. (PR #174225)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 5 06:22:37 PST 2026
nikic wrote:
> Hm, strange: is ConstantRange::getEmpty() or APInt::getSignedMinValue() broken?
The code uses ConstantRange::getNonEmpty(), so for the case where Lower==Upper, a full range will be used. So for the i1 case where the range should be empty it is full instead.
Though I wonder whether there isn't an off by one in the range calculation? The ranges are half-open, so the range `[SignedMin, SignedMax - 1)` excludes both SignedMax *and* SignedMax-1. Probably only excluding SignedMax was intended? In that case the range should be `[SignedMin, SignedMax)`, which would also avoid the i1 problem.
https://github.com/llvm/llvm-project/pull/174225
More information about the llvm-commits
mailing list