From: Craig Topper Date: Fri, 1 Sep 2017 21:27:31 +0000 (+0000) Subject: [InstCombine] Don't require the compare types to be the same in getMaskedTypeForICmpPair. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea5d9cce86737d7d7dd0b54256baefc51d316b5d;p=llvm [InstCombine] Don't require the compare types to be the same in getMaskedTypeForICmpPair. A future patch will make the code look through truncates feeding the compare. So the compares might be different types but the pretruncated types might be the same. This should be safe because we still require the same Value* to be used truncated or not in both compares. So that serves to ensure the types are the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312381 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp index 4a6c46ddaab..36bb4d012ca 100644 --- a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp +++ b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp @@ -312,10 +312,9 @@ static unsigned getMaskedTypeForICmpPair(Value *&A, Value *&B, Value *&C, ICmpInst *RHS, ICmpInst::Predicate &PredL, ICmpInst::Predicate &PredR) { - if (LHS->getOperand(0)->getType() != RHS->getOperand(0)->getType()) - return 0; // vectors are not (yet?) supported. Don't support pointers either. - if (!LHS->getOperand(0)->getType()->isIntegerTy()) + if (!LHS->getOperand(0)->getType()->isIntegerTy() || + !RHS->getOperand(0)->getType()->isIntegerTy()) return 0; // Here comes the tricky part: