[InstSimplify][NFC] shortened the code
authorLiaoChunyu <chunyu@iscas.ac.cn>
Mon, 5 Sep 2022 15:57:53 +0000 (23:57 +0800)
committerLiaoChunyu <chunyu@iscas.ac.cn>
Mon, 5 Sep 2022 15:57:53 +0000 (23:57 +0800)
llvm/lib/Analysis/InstructionSimplify.cpp

index aad8acf..27ec7a0 100644 (file)
@@ -3131,9 +3131,9 @@ static Value *simplifyICmpWithBinOpOnLHS(CmpInst::Predicate Pred,
   if (match(LBO, m_Sub(m_APInt(C), m_Specific(RHS)))) {
     if ((*C & 1) == 1) {
       if (Pred == CmpInst::ICMP_EQ)
-        return ConstantInt::getFalse(getCompareTy(RHS));
+        return getFalse(ITy);
       if (Pred == CmpInst::ICMP_NE)
-        return ConstantInt::getTrue(getCompareTy(RHS));
+        return getTrue(ITy);
     }
   }