From 32e32e77823bbfe81e4737267e0d1f46ab23a3c5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 21 Aug 2007 17:03:38 +0000 Subject: [PATCH] simplify code slightly git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41233 91177308-0d34-0410-b5e6-96231b3b80d8 --- CodeGen/CGExpr.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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"); }