[PATCH] D54698: [SelectionDAG] Initial support for FSHL/FSHR funnel shift opcodes (PR39467)
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 19 07:24:53 PST 2018
nikic added inline comments.
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7001
+ unsigned RotOpc = IsFSHL ? ISD::ROTL : ISD::ROTR;
+ if (N0 == N1 && hasOperation(RotOpc, VT))
+ return DAG.getNode(RotOpc, SDLoc(N), VT, N0, N2);
----------------
Similar to what the DAG builder code does, would it make sense to also check for the reverse direction rotate here?
================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:5744
+ auto FunnelOpcode = IsFSHL ? ISD::FSHL : ISD::FSHR;
+ if (TLI.isOperationLegalOrCustom(FunnelOpcode, VT)) {
+ setValue(&I, DAG.getNode(FunnelOpcode, sdl, VT, X, Y, Z));
----------------
Would it be possible to unconditionally create FSHL/FSHR here, drop the expansion code below and rely on the expansion in DAG legalization only?
Repository:
rL LLVM
https://reviews.llvm.org/D54698
More information about the llvm-commits
mailing list