[llvm] r209872 - Add a trivial ArrayRef helper overload to the SelectionDAG interface.

Chandler Carruth chandlerc at gmail.com
Thu May 29 20:50:06 PDT 2014


Author: chandlerc
Date: Thu May 29 22:50:06 2014
New Revision: 209872

URL: http://llvm.org/viewvc/llvm-project?rev=209872&view=rev
Log:
Add a trivial ArrayRef helper overload to the SelectionDAG interface.
I'm using this pretty frequently in a patch I'm working on and it seems
generally useful.

Modified:
    llvm/trunk/include/llvm/CodeGen/SelectionDAG.h

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=209872&r1=209871&r2=209872&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Thu May 29 22:50:06 2014
@@ -540,6 +540,12 @@ public:
   /// undefined.
   SDValue getVectorShuffle(EVT VT, SDLoc dl, SDValue N1, SDValue N2,
                            const int *MaskElts);
+  SDValue getVectorShuffle(EVT VT, SDLoc dl, SDValue N1, SDValue N2,
+                           ArrayRef<int> MaskElts) {
+    assert(VT.getVectorNumElements() == MaskElts.size() &&
+           "Must have the same number of vector elements as mask elements!");
+    return getVectorShuffle(VT, dl, N1, N2, MaskElts.data());
+  }
 
   /// getAnyExtOrTrunc - Convert Op, which must be of integer type, to the
   /// integer type VT, by either any-extending or truncating it.





More information about the llvm-commits mailing list