From: Chris Lattner Date: Tue, 21 Aug 2007 17:03:38 +0000 (+0000) Subject: simplify code slightly X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32e32e77823bbfe81e4737267e0d1f46ab23a3c5;p=clang simplify code slightly git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41233 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/CodeGen/CGExpr.cpp b/CodeGen/CGExpr.cpp index d0c241398b..b36bff0af5 100644 --- a/CodeGen/CGExpr.cpp +++ b/CodeGen/CGExpr.cpp @@ -1251,10 +1251,11 @@ RValue CodeGenFunction::EmitBinaryCompare(const BinaryOperator *E, ResultI = Builder.CreateFCmp((llvm::FCmpInst::Predicate)FCmpOpc, LHS.second, RHS.second, "cmp.i"); } else { - unsigned Opc = CETy->isUnsignedIntegerType() ? UICmpOpc : SICmpOpc; - ResultR = Builder.CreateICmp((llvm::ICmpInst::Predicate)Opc, + // Complex comparisons can only be equality comparisons. As such, signed + // and unsigned opcodes are the same. + ResultR = Builder.CreateICmp((llvm::ICmpInst::Predicate)UICmpOpc, LHS.first, RHS.first, "cmp.r"); - ResultI = Builder.CreateICmp((llvm::ICmpInst::Predicate)Opc, + ResultI = Builder.CreateICmp((llvm::ICmpInst::Predicate)UICmpOpc, LHS.second, RHS.second, "cmp.i"); }