summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2014-05-27 16:54:33 +0000
committerFilipe Cabecinhas <me@filcab.net>2014-05-27 16:54:33 +0000
commite8d6a1e82fe6c93b9b261e690973be7437cb45f4 (patch)
tree01cb8f2149f46dc869b9d1de72f95f4583ad4742 /llvm/lib/Transforms
parent345c9cc5f41881f3f76fed49ce06986e4f6e226b (diff)
downloadbcm5719-llvm-e8d6a1e82fe6c93b9b261e690973be7437cb45f4.tar.gz
bcm5719-llvm-e8d6a1e82fe6c93b9b261e690973be7437cb45f4.zip
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 llvm-svn: 209667
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index dda585294fa..d4b583b3a7d 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud