From cc99c421308046e3e5d7f78d45c57e1994a7ddb1 Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Sat, 19 Jan 2013 00:42:16 +0000 Subject: Fix 80-col and early exit in cost model llvm-svn: 172877 --- llvm/lib/Analysis/TargetTransformInfo.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'llvm/lib/Analysis/TargetTransformInfo.cpp') diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp index 344be719cb5..4873a7f923f 100644 --- a/llvm/lib/Analysis/TargetTransformInfo.cpp +++ b/llvm/lib/Analysis/TargetTransformInfo.cpp @@ -289,7 +289,9 @@ ImmutablePass *llvm::createNoTargetTransformInfoPass() { //======================================= COST TABLES == -CostTable::CostTable(const CostTableEntry *table, const size_t size, unsigned numTypes) +CostTable::CostTable(const CostTableEntry *table, + const size_t size, + unsigned numTypes) : table(table), size(size), numTypes(numTypes) { assert(table && "missing cost table"); assert(size > 0 && "empty cost table"); @@ -297,22 +299,23 @@ CostTable::CostTable(const CostTableEntry *table, const size_t size, unsigned nu unsigned CostTable::_findCost(int ISD, MVT *Types) const { for (unsigned i = 0; i < size; ++i) { - if (table[i].ISD == ISD) { - bool found = true; - for (unsigned t=0; t