[PATCH] D35566: [DAG] Extend visitSCALAR_TO_VECTOR optimization to truncated vector.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 12:37:52 PDT 2017


efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:15766
+        // If not we can truncate the vector.
+        if (VT.getScalarType() == InVecT.getVectorElementType()) {
+          MVT IdxTy = TLI.getVectorIdxTy(DAG.getDataLayout());
----------------
I would probably rearrange this to move the element type check into the outer if statement, for the sake of clarity... but either way is fine, I guess.


https://reviews.llvm.org/D35566





More information about the llvm-commits mailing list