[PATCH] D25374: [DAGCombiner] Update most ADD combines to support general vector combines
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 7 15:36:27 PDT 2016
RKSimon added inline comments.
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:829
+ return !Const->isOpaque();
+ return ISD::isBuildVectorOfConstantSDNodes(N.getNode());
+}
----------------
mkuper wrote:
> What if we have a BUILD_VECTOR of constants where one of the constants going into it is opaque?
I see what you're saying. For the current cases it won't have much effect - some of the combines would switch ops around but the expected constant folding will just fail. I'll change isNonOpaqueConstantOrConstantVector to check for opaques in the build vector, and make a separate isConstantOrConstantVector helper as well which we can use in a couple of places. Thorough tests of opaque vector elements might be tricky though.
Repository:
rL LLVM
https://reviews.llvm.org/D25374
More information about the llvm-commits
mailing list