This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add back handling of X > -1 to ISD::SETCC lowering.
ClosedPublic

Authored by craig.topper on Aug 7 2023, 11:12 AM.

Details

Summary

There are cases where the -1 doesn't become visible until lowering
so the folding doesn't have a chance to run.

I think in these cases there is a missed DAGCombine for truncate (undef),
which I may fix separately, but RISC-V backend should protect itself.

Fixes #64503.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 7 2023, 11:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2023, 11:12 AM
craig.topper requested review of this revision.Aug 7 2023, 11:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2023, 11:12 AM
Herald added subscribers: eopXD, MaskRay. · View Herald Transcript
craig.topper edited the summary of this revision. (Show Details)Aug 7 2023, 11:16 AM
asb accepted this revision.Aug 7 2023, 12:12 PM

LGTM. Worth considering for backporting to the 17.x branch too I think.

This revision is now accepted and ready to land.Aug 7 2023, 12:12 PM
This revision was landed with ongoing or failed builds.Aug 7 2023, 1:01 PM
This revision was automatically updated to reflect the committed changes.