[PATCH] D17176: [CodeGen] Add getBuildVector and getSplatBuildVector helpers.

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 4 18:00:42 PDT 2016


ab marked an inline comment as done.

================
Comment at: include/llvm/CodeGen/SelectionDAG.h:641
@@ +640,3 @@
+    return getNode(ISD::BUILD_VECTOR, DL, VT, Ops);
+  }
+
----------------
What do you think of moving the VerifySDNode checks here?

================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:3294-3299
@@ -3301,7 +3293,8 @@
           return Folded;
         SmallVector<SDValue, 4> Outputs;
+        llvm_unreachable("can't have vectors ops with scalar operands");
         // We may have a vector type but a scalar result. Create a splat.
         Outputs.resize(VT.getVectorNumElements(), Outputs.back());
         // Build a big vector out of the scalar elements we generated.
         return getNode(ISD::BUILD_VECTOR, SDLoc(), VT, Outputs);
       } else {
----------------
I think this block is unreachable: if two operands are constants, there's no way for this op to be vector.

If I didn't miss anything, I'll remove this separately.


http://reviews.llvm.org/D17176





More information about the llvm-commits mailing list