[PATCH] D59096: [SelectionDAG][RISCV] Add a SELECT_PARTS SelectionDAG node
Alex Bradbury via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 7 12:30:55 PST 2019
asb added a comment.
In D59096#1421940 <https://reviews.llvm.org/D59096#1421940>, @efriedma wrote:
> I'm not sure generating SELECT_PARTS in type legalization is the best approach. Instead of specifically considering the case of a SELECT whose result is split by legalization exactly once, you could more generally consider DAGs which, after type legalization, contain multiple SELECTs with the same condition.
>
> The x86 backend actually has some code to try improve the lowering for this sort of construct after isel, in cases where there is no native cmov instruction; see X86TargetLowering::EmitLoweredSelect. As written, it's not completely reliable; it depends on the DAG scheduler to schedule the relevant nodes next to each other. Not suggesting that's the best approach, but maybe a useful reference point.
Thanks Eli. One reason we were drawn to this approach is it seemed a reasonable analogue of the situation with SHL_PARTS. That code has of course been in LLVM for a very very long time, and perhaps would be done another way now, and of course there are other differences.
I hadn't realised X86 made a similar optimisation. Handling it in EmitInstrWithCustomInserter seems a promising approach (or as you suggest, at least something along those lines).
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59096/new/
https://reviews.llvm.org/D59096
More information about the llvm-commits
mailing list