From 065db2347f4df7a92f18221bd7288ebcd4c38c35 Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Sat, 19 Jan 2013 00:42:16 +0000 Subject: [PATCH] Fix 80-col and early exit in cost model git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172877 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/TargetTransformInfo.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/lib/Analysis/TargetTransformInfo.cpp b/lib/Analysis/TargetTransformInfo.cpp index 344be719cb5..4873a7f923f 100644 --- a/lib/Analysis/TargetTransformInfo.cpp +++ b/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