diff options
author | Filipe Cabecinhas <me@filcab.net> | 2014-05-27 16:54:33 +0000 |
---|---|---|
committer | Filipe Cabecinhas <me@filcab.net> | 2014-05-27 16:54:33 +0000 |
commit | 078862e67f226103d4368eeda8c0d8c9ac6766e7 (patch) | |
tree | 06f1115b6a88ad8c5222a106ce579ea3d0cf2a62 /lib/Transforms | |
parent | fb26356bed7ca3ada126eae946e34b1b281642de (diff) | |
download | llvm-078862e67f226103d4368eeda8c0d8c9ac6766e7.tar.gz llvm-078862e67f226103d4368eeda8c0d8c9ac6766e7.tar.bz2 llvm-078862e67f226103d4368eeda8c0d8c9ac6766e7.tar.xz |
Post-commit fixes for r209643
Detected by Daniel Jasper, Ilia Filippov, and Andrea Di Biagio
Fixed the argument order to select (the mask semantics to blendv* are the
inverse of select) and fixed the tests
Added parenthesis to the assert condition
Ran clang-format
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209667 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineCalls.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index dda585294f..d4b583b3a7 100644 --- a/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -734,10 +734,13 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { auto SelectorType = cast<VectorType>(Mask->getType()); auto EltTy = SelectorType->getElementType(); unsigned Size = SelectorType->getNumElements(); - unsigned BitWidth = EltTy->isFloatTy() ? 32 : (EltTy->isDoubleTy() ? 64 : EltTy->getIntegerBitWidth()); + unsigned BitWidth = + EltTy->isFloatTy() + ? 32 + : (EltTy->isDoubleTy() ? 64 : EltTy->getIntegerBitWidth()); assert((BitWidth == 64 || BitWidth == 32 || BitWidth == 8) && "Wrong arguments for variable blend intrinsic"); - SmallVector<Constant*, 32> Selectors; + SmallVector<Constant *, 32> Selectors; for (unsigned I = 0; I < Size; ++I) { // The intrinsics only read the top bit uint64_t Selector; @@ -748,7 +751,8 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { Selectors.push_back(ConstantInt::get(Tyi1, Selector >> (BitWidth - 1))); } auto NewSelector = ConstantVector::get(Selectors); - return SelectInst::Create(NewSelector, II->getArgOperand(0), II->getArgOperand(1), "blendv"); + return SelectInst::Create(NewSelector, II->getArgOperand(1), + II->getArgOperand(0), "blendv"); } else { break; } |