Add a DAG combine for the PowerPC code generator to generate the Power9 extswsli extend sign and shift immediate instruction.
Details
Diff Detail
Event Timeline
llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
---|---|---|
14118 | The use of isa followed by cast is discouraged. Please use dyn_cast. Then this can be turned into an early exit if any of the conditions are not met and the body of this block doesn't need to be nested in an if. |
Update to access constant shift amount by dynamic cast and to reverse if from block form to early exit.
LGTM aside from the minor nit.
llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
---|---|---|
14118 | Nit: please change CN1 == NULL to either !CN1 or CN1 == nullptr. Feel free to do this on the commit - no new review required. |
llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
---|---|---|
14118 | Sorry, I don't have commit access, so I have updated the diff. |
Do you have any reason to use isConstOrConstSplat instead of more common isa<ConstantSDNode>(N1)?