From bf1bd0dcc7da214411b76c0c87485ee66a612274 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 21 Aug 2007 17:03:38 +0000 Subject: [PATCH] simplify code slightly llvm-svn: 41233 --- clang/CodeGen/CGExpr.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clang/CodeGen/CGExpr.cpp b/clang/CodeGen/CGExpr.cpp index d0c241398b69..b36bff0af51c 100644 --- a/clang/CodeGen/CGExpr.cpp +++ b/clang/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"); }