This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeTypes][RISCV][VE] Add a special case to IntegerExpandSetCCOperands.
AbandonedPublic

Authored by craig.topper on May 10 2023, 10:46 AM.

Details

Summary

This code handles splitting setccs where the type is 2x the size of
a legal integer type. For example, i64 on RV32.

For a setcc like (x u< -256U), we used to try to emit
(hi(x) == -1U) ? (lo(x) u< -256U) : (hi(x) u< -1U)

The (hi(x) u< -1U) part simplies to (hi(x) != -1U) since -1U is the largest
unsigned value.

This leaves
(hi(x) == -1U) ? (lo(x) u< -256U) : (hi(x) != -1U)

Notice that the false value is the inverse of the condition. We can
simplify this to ((lo(x) u< -256U) | (hi(x) != -1U)). Add this as a special
case.

I could do this in DAGCombine, but it would probably require more code and
I don't know if this pattern occurs anywhere else.

Diff Detail

Event Timeline

craig.topper created this revision.May 10 2023, 10:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2023, 10:46 AM
craig.topper requested review of this revision.May 10 2023, 10:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2023, 10:46 AM
craig.topper abandoned this revision.May 10 2023, 11:58 AM

D150286 is an attempt to fix the same issue and seems to get cases this one doesn't.