This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Let lowerSELECT merge SETCC into SELECT_CC for floats
AbandonedPublic

Authored by jrtc27 on Aug 17 2021, 10:32 AM.

Details

Summary

We already perform this optimisation later in PerformDAGCombine for both
integers and floats, but try to perform it early for integers during
lowering rather than deferring to optimising combines. Using the
optimised lowering works for floats too so we might as well make the two
have matching behaviours rather than adding an unnecessary condition. We
just need to be careful when checking for selects of two constant
integers.

Diff Detail

Event Timeline

jrtc27 created this revision.Aug 17 2021, 10:32 AM
jrtc27 requested review of this revision.Aug 17 2021, 10:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2021, 10:32 AM
jrtc27 retitled this revision from [RISC] Let lowerSELECT merge SETCC into SELECT_CC for floats to [RISCV] Let lowerSELECT merge SETCC into SELECT_CC for floats.Aug 17 2021, 10:33 AM
craig.topper added a comment.EditedAug 17 2021, 11:29 AM

Do we have test coverage for fp selects with integer conditions? The DAG combine was added in https://reviews.llvm.org/D98132 but I don't see any FP related test changes in there. I'm not sure I realized I was changing the behavior of FP selects at the time.

I think this patch is obsolete.

jrtc27 abandoned this revision.May 15 2023, 12:34 PM

I think this patch is obsolete.

Indeed; d27c147aaa8fea0d3b438ba9e51b497a621ecf1e (and the XLEN check isn't needed since ConstantSDNode is specifically for integers)