[llvm] [ValueTracking] Handle intrinsics in `computeConstantRange` (PR #100870)

Andreas Jonson via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 27 10:37:29 PDT 2024


andjo403 wrote:

for the https://github.com/llvm/llvm-project/issues/95255#issuecomment-2166944909 is it not enough to do a non Zero check something like this in the foldCtpop
```
    unsigned KnownMinPop = Known.countMinPopulation();
    unsigned Lower =
        KnownMinPop ? KnownMinPop
                    : isKnownNonZero(
                          Op0, IC.getSimplifyQuery().getWithInstruction(&II));
    ConstantRange Range(APInt(BitWidth, Lower),
                        APInt(BitWidth, Known.countMaxPopulation() + 1));
```

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


More information about the llvm-commits mailing list