[PATCH] D25524: [DAGCombine] Preserve shuffles when one of the vector operands is constant
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 23 01:40:52 PDT 2016
RKSimon added inline comments.
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7754
return SDValue(Op.getOperand(0));
- if (ISD::isBuildVectorOfConstantSDNodes(Op.getNode()) ||
- ISD::isBuildVectorOfConstantFPSDNodes(Op.getNode()))
+ if (isAnyConstantBuildVector(Op.getNode()))
return DAG.getBitcast(VT, Op);
----------------
If possible, do this change (along with the addition of isAnyConstantBuildVector) as a separate NFC pre-commit?
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:13936
// BUILD_VECTOR or SCALAR_TO_VECTOR into a single BUILD_VECTOR.
if (Level < AfterLegalizeVectorOps && TLI.isTypeLegal(VT)) {
+ if (SDValue Res = combineShuffleOfScalars(SVN, DAG, TLI))
----------------
Remove the outer braces to match style guide.
Repository:
rL LLVM
https://reviews.llvm.org/D25524
More information about the llvm-commits
mailing list