simplify code slightly

llvm-svn: 41233
This commit is contained in:
Chris Lattner 2007-08-21 17:03:38 +00:00
parent 755a5a9933
commit bf1bd0dcc7
1 changed files with 4 additions and 3 deletions

View File

@ -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");
}