From 2b0d2f9f993397f8425fc790a3cbd6c17fc744a8 Mon Sep 17 00:00:00 2001 From: Jakub Staszak Date: Thu, 7 Mar 2013 20:01:19 +0000 Subject: [PATCH] ArrayRef ca accept one element. Simplify code a little bit, also it matches now coding in the other places of the file. llvm-svn: 176641 --- lib/Analysis/IPA/InlineCost.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Analysis/IPA/InlineCost.cpp b/lib/Analysis/IPA/InlineCost.cpp index 3292e003f57..35c45e61808 100644 --- a/lib/Analysis/IPA/InlineCost.cpp +++ b/lib/Analysis/IPA/InlineCost.cpp @@ -474,10 +474,12 @@ bool CallAnalyzer::visitCastInst(CastInst &I) { bool CallAnalyzer::visitUnaryInstruction(UnaryInstruction &I) { Value *Operand = I.getOperand(0); - Constant *Ops[1] = { dyn_cast(Operand) }; - if (Ops[0] || (Ops[0] = SimplifiedValues.lookup(Operand))) + Constant *COp = dyn_cast(Operand); + if (!COp) + COp = SimplifiedValues.lookup(Operand); + if (COp) if (Constant *C = ConstantFoldInstOperands(I.getOpcode(), I.getType(), - Ops, TD)) { + COp, TD)) { SimplifiedValues[&I] = C; return true; }