Fixes: https://github.com/llvm/llvm-project/issues/61120
Signed-off-by: Jun Zhang <jun@junz.org>
Differential D146512
[TLI] SimplifySetCC - Fold ~X >/< ~Y --> Y >/< X junaire on Mar 21 2023, 4:20 AM. Authored by
Details
Fixes: https://github.com/llvm/llvm-project/issues/61120 Signed-off-by: Jun Zhang <jun@junz.org>
Diff Detail
Event TimelineComment Actions Looks like the patch doesn't work for vectors, do you have any insights about it? @RKSimon Comment Actions
Comment Actions What regressions are you seeing for ULE vector cases with this fold? Manual optimization looks OK - https://llvm.godbolt.org/z/n9ezae5En
Comment Actions I may misunderstand something. I was expected it could folded like https://llvm.godbolt.org/z/ebfj4MoKr Comment Actions Revert 'Make N0.getValueType().isInteger() an assert.' since it causes a lot of crashes in the tests.
|
Take a look at https://github.com/llvm/llvm-project/blob/3a8f161a3401edeb58e018e2d389dd2413a6417f/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp#L6501
This shows its safe to handle all icmp predicates - and handles cases where one operand is a constant which can be constant folded