From 11acaa374cdcebb161bf0de5f244265d78a749c1 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 5 Jan 2010 20:07:06 +0000 Subject: 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 --- lib/Transforms/InstCombine/InstCombineCasts.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/Transforms/InstCombine/InstCombineCasts.cpp') 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(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())); -- cgit v1.2.3