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.
Details
Details
- Reviewers
craig.topper frasercrmck luismarques
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
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.
Comment Actions
Indeed; d27c147aaa8fea0d3b438ba9e51b497a621ecf1e (and the XLEN check isn't needed since ConstantSDNode is specifically for integers)