[cfe-commits] r53948 - /cfe/trunk/lib/CodeGen/CGBuiltin.cpp
Chris Lattner
sabre at nondot.org
Tue Jul 22 23:53:35 PDT 2008
Author: lattner
Date: Wed Jul 23 01:53:34 2008
New Revision: 53948
URL: http://llvm.org/viewvc/llvm-project?rev=53948&view=rev
Log:
don't depend on the result of CreateNeg to be a binop
Modified:
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=53948&r1=53947&r2=53948&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Wed Jul 23 01:53:34 2008
@@ -103,10 +103,10 @@
case Builtin::BI__builtin_abs: {
Value *ArgValue = EmitScalarExpr(E->getArg(0));
- llvm::BinaryOperator *NegOp =
- Builder.CreateNeg(ArgValue, (ArgValue->getName() + "neg").c_str());
+ Value *NegOp = Builder.CreateNeg(ArgValue, "neg");
Value *CmpResult =
- Builder.CreateICmpSGE(ArgValue, NegOp->getOperand(0), "abscond");
+ Builder.CreateICmpSGE(ArgValue, Constant::getNullValue(ArgValue->getType()),
+ "abscond");
Value *Result =
Builder.CreateSelect(CmpResult, ArgValue, NegOp, "abs");
More information about the cfe-commits
mailing list