From 102187efba7e084e7b2f59a435cb0b3583189d7b Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Fri, 30 May 2014 03:50:06 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209872 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/SelectionDAG.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index d9c38c072dd..bbcbf607f7e 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -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 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. -- 2.34.1