[llvm] [InstCombine] Fold selection between less than zero and one (PR #69961)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 01:02:06 PST 2023


elhewaty wrote:

> @elhewaty I think the type of your `One` is wrong. It should be the same type as `SLTZero` (and i1 or i1 vector), not the same type as the original select.

I tried:
 `Constant *One = ConstantInt::get(SLTZero->getType(), 1);`
`auto *Sel = Builder.CreateSelect(CondVal, SLTZero, Builder.getTrue());`
`auto *One = Constant::getAllOnesValue(SLTZero->getType());`

They all crash

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


More information about the llvm-commits mailing list