[PATCH] D13655: DAGCombiner: Combine extract_vector_elt from build_vector

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 14:25:13 PDT 2015


RKSimon added a subscriber: RKSimon.
RKSimon added a reviewer: RKSimon.
RKSimon added a comment.

Very surprising that this was missing!


================
Comment at: include/llvm/Target/TargetLowering.h:1723
@@ -1722,1 +1722,3 @@
 
+  // Return true if it is profitable to use a scalar input to a BUILD_VECTOR
+  // even if the vector itself has multiple uses.
----------------
By 'use' do you just mean 'directly access' or do you foresee other possibilities?

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:11893
@@ +11892,3 @@
+       TLI.aggressivelyPreferBuildVectorSources(VT))) {
+    return InVec.getOperand(ConstEltNo->getZExtValue());
+  }
----------------
You may need to confirm that the operand value type is the same as the BUILD_VECTOR scalar value type - implicit truncation may be occurring.


http://reviews.llvm.org/D13655





More information about the llvm-commits mailing list