summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2017-07-09 07:04:03 +0000
committerCraig Topper <craig.topper@intel.com>2017-07-09 07:04:03 +0000
commitfde4723ebead58f0342ae88abd1cc5ad795a5e5b (patch)
tree373399d8986978b02ec9e21161eb4a569f77ecac /llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
parent95d2347ae16335aa30139c0aa6c050ac3dce2ad7 (diff)
downloadbcm5719-llvm-fde4723ebead58f0342ae88abd1cc5ad795a5e5b.tar.gz
bcm5719-llvm-fde4723ebead58f0342ae88abd1cc5ad795a5e5b.zip
[IR] Add Type::isIntOrIntVectorTy(unsigned) similar to the existing isIntegerTy(unsigned), but also works for vectors.
llvm-svn: 307492
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index 952e126abaf..e3a50220f94 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -326,7 +326,7 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) {
}
/// i1 mul -> i1 and.
- if (I.getType()->getScalarType()->isIntegerTy(1))
+ if (I.getType()->isIntOrIntVectorTy(1))
return BinaryOperator::CreateAnd(Op0, Op1);
// X*(1 << Y) --> X << Y
@@ -938,8 +938,7 @@ Instruction *InstCombiner::commonIDivTransforms(BinaryOperator &I) {
}
if (match(Op0, m_One())) {
- assert(!I.getType()->getScalarType()->isIntegerTy(1) &&
- "i1 divide not removed?");
+ assert(!I.getType()->isIntOrIntVectorTy(1) && "i1 divide not removed?");
if (I.getOpcode() == Instruction::SDiv) {
// If Op1 is 0 then it's undefined behaviour, if Op1 is 1 then the
// result is one, if Op1 is -1 then the result is minus one, otherwise
OpenPOWER on IntegriCloud