From bd51c164d98ab7ed4c6d1a0e1acdabc4c3832835 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Fri, 2 Sep 2016 15:43:25 +0000 Subject: [PATCH] fix documentation comments; NFC llvm-svn: 280489 --- llvm/include/llvm/IR/Instructions.h | 19 +++++++++++-------- llvm/lib/IR/Instructions.cpp | 5 ----- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h index 49b7d47..da694f6 100644 --- a/llvm/include/llvm/IR/Instructions.h +++ b/llvm/include/llvm/IR/Instructions.h @@ -2160,19 +2160,22 @@ public: return cast(getOperand(2)); } - /// Return the index from the shuffle mask for the specified - /// output result. This is either -1 if the element is undef or a number less - /// than 2*numelements. - static int getMaskValue(Constant *Mask, unsigned i); + /// Return the shuffle mask value for the specified element of the mask. + /// Return -1 if the element is undef. + static int getMaskValue(Constant *Mask, unsigned Elt); - int getMaskValue(unsigned i) const { - return getMaskValue(getMask(), i); + /// Return the shuffle mask value of this instruction for the given element + /// index. Return -1 if the element is undef. + int getMaskValue(unsigned Elt) const { + return getMaskValue(getMask(), Elt); } - /// Return the full mask for this instruction, where each - /// element is the element number and undef's are returned as -1. + /// Convert the input shuffle mask operand to a vector of integers. Undefined + /// elements of the mask are returned as -1. static void getShuffleMask(Constant *Mask, SmallVectorImpl &Result); + /// Return the mask for this instruction as a vector of integers. Undefined + /// elements of the mask are returned as -1. void getShuffleMask(SmallVectorImpl &Result) const { return getShuffleMask(getMask(), Result); } diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index 5355f1a..89c2caf 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -1908,9 +1908,6 @@ bool ShuffleVectorInst::isValidOperands(const Value *V1, const Value *V2, return false; } -/// getMaskValue - Return the index from the shuffle mask for the specified -/// output result. This is either -1 if the element is undef or a number less -/// than 2*numelements. int ShuffleVectorInst::getMaskValue(Constant *Mask, unsigned i) { assert(i < Mask->getType()->getVectorNumElements() && "Index out of range"); if (ConstantDataSequential *CDS =dyn_cast(Mask)) @@ -1921,8 +1918,6 @@ int ShuffleVectorInst::getMaskValue(Constant *Mask, unsigned i) { return cast(C)->getZExtValue(); } -/// getShuffleMask - Return the full mask for this instruction, where each -/// element is the element number and undef's are returned as -1. void ShuffleVectorInst::getShuffleMask(Constant *Mask, SmallVectorImpl &Result) { unsigned NumElts = Mask->getType()->getVectorNumElements(); -- 2.7.4