aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstCombineCasts.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-01-05 20:07:06 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-01-05 20:07:06 +0000
commit11acaa374cdcebb161bf0de5f244265d78a749c1 (patch)
tree6150e8c34a88c68bfaa4041f914b3d1628015946 /lib/Transforms/InstCombine/InstCombineCasts.cpp
parent13be48701d09891e7945f9522d622053e1b61d1a (diff)
Convert a ton of simple integer type equality tests to the new predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92760 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineCasts.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineCasts.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCasts.cpp b/lib/Transforms/InstCombine/InstCombineCasts.cpp
index 36d5d46eaa..103630e061 100644
--- a/lib/Transforms/InstCombine/InstCombineCasts.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCasts.cpp
@@ -23,8 +23,7 @@ using namespace PatternMatch;
///
static Value *DecomposeSimpleLinearExpr(Value *Val, unsigned &Scale,
int &Offset) {
- assert(Val->getType() == Type::getInt32Ty(Val->getContext()) &&
- "Unexpected allocation size type!");
+ assert(Val->getType()->isInteger(32) && "Unexpected allocation size type!");
if (ConstantInt *CI = dyn_cast<ConstantInt>(Val)) {
Offset = CI->getZExtValue();
Scale = 0;
@@ -935,7 +934,7 @@ Instruction *InstCombiner::visitSExt(SExtInst &CI) {
Value *Src = CI.getOperand(0);
// Canonicalize sign-extend from i1 to a select.
- if (Src->getType() == Type::getInt1Ty(CI.getContext()))
+ if (Src->getType()->isInteger(1))
return SelectInst::Create(Src,
Constant::getAllOnesValue(CI.getType()),
Constant::getNullValue(CI.getType()));