[llvm] r280489 - fix documentation comments; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 2 08:43:26 PDT 2016
Author: spatel
Date: Fri Sep 2 10:43:25 2016
New Revision: 280489
URL: http://llvm.org/viewvc/llvm-project?rev=280489&view=rev
Log:
fix documentation comments; NFC
Modified:
llvm/trunk/include/llvm/IR/Instructions.h
llvm/trunk/lib/IR/Instructions.cpp
Modified: llvm/trunk/include/llvm/IR/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Instructions.h?rev=280489&r1=280488&r2=280489&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Instructions.h (original)
+++ llvm/trunk/include/llvm/IR/Instructions.h Fri Sep 2 10:43:25 2016
@@ -2160,19 +2160,22 @@ public:
return cast<Constant>(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<int> &Result);
+ /// Return the mask for this instruction as a vector of integers. Undefined
+ /// elements of the mask are returned as -1.
void getShuffleMask(SmallVectorImpl<int> &Result) const {
return getShuffleMask(getMask(), Result);
}
Modified: llvm/trunk/lib/IR/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Instructions.cpp?rev=280489&r1=280488&r2=280489&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Instructions.cpp (original)
+++ llvm/trunk/lib/IR/Instructions.cpp Fri Sep 2 10:43:25 2016
@@ -1908,9 +1908,6 @@ bool ShuffleVectorInst::isValidOperands(
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<ConstantDataSequential>(Mask))
@@ -1921,8 +1918,6 @@ int ShuffleVectorInst::getMaskValue(Cons
return cast<ConstantInt>(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<int> &Result) {
unsigned NumElts = Mask->getType()->getVectorNumElements();
More information about the llvm-commits
mailing list