[PATCH] D34077: DAGCombine: Combine BUILD_VECTOR to TRUNCATE
Zvi Rackover via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 26 05:50:40 PDT 2017
zvi added inline comments.
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:14192
+ // TODO: Allow undef elements in some cases?
+ if (any_of(make_range(N->op_begin(), N->op_end()), [VT](SDValue Op) {
+ return Op.getOpcode() != ISD::EXTRACT_VECTOR_ELT ||
----------------
delena wrote:
> Code simplification:
> any_of(N->operands() ..
There is no SDNode::operands(). I was thinking of adding one as a follow-up commit if it makes sense.
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:14289
+ if (SDValue V = reduceBuildVecToTrunc(N))
+ return V;
----------------
delena wrote:
> I'd put isDesirable..() here, before call to reduceBuildVecToTrunc(), with N node as parameter.
But we don't know in advance what will be the truncate's operand type and result type. Need to some analysis first.
https://reviews.llvm.org/D34077
More information about the llvm-commits
mailing list