This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Teach normaliseSetCC to canonicalize X > -1 to X >= 0 and X < 1 to 0 >= X.
ClosedPublic

Authored by craig.topper on Mar 12 2021, 11:22 AM.

Details

Summary

This allows the use of BGE with X0 instead of puting -1/1 in a
register.

Diff Detail

Event Timeline

craig.topper created this revision.Mar 12 2021, 11:22 AM
craig.topper requested review of this revision.Mar 12 2021, 11:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2021, 11:22 AM
Herald added a subscriber: MaskRay. · View Herald Transcript

Hm, this seems like a bit of an abuse of what the function is intended to do, at least with its current name and comment, as it's now not just doing normalisation for mapping to the set of supported instructions but also optimising at the same time.

Improve comment and try to improve function name to encapsulate new behavior.

Improve comment and try to improve function name to encapsulate new behavior.

Thanks, looks better now to me (and I was struggling to come up with a good name myself otherwise I would have suggested one).

jrtc27 accepted this revision.Mar 12 2021, 11:43 AM
This revision is now accepted and ready to land.Mar 12 2021, 11:43 AM
This revision was landed with ongoing or failed builds.Mar 12 2021, 11:50 AM
This revision was automatically updated to reflect the committed changes.