From: Zhigang Gong Date: Tue, 29 Apr 2014 03:26:14 +0000 (+0800) Subject: GBE: No need to compute liveout again in value.cpp. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89b490b5a17cfda2d9816dc1c246ce5bbff12648;p=contrib%2Fbeignet.git GBE: No need to compute liveout again in value.cpp. We already did a complete liveness analysis at the liveness.cpp. Don't need to do that again. Save about 10% of the compile time. Signed-off-by: Zhigang Gong Reviewed-by: Ruiling Song --- diff --git a/backend/src/ir/value.cpp b/backend/src/ir/value.cpp index 1dbd4f4..cdc1a4c 100644 --- a/backend/src/ir/value.cpp +++ b/backend/src/ir/value.cpp @@ -66,8 +66,6 @@ namespace ir { * registers */ void initializeOtherDef(void); - /*! Iterate to completely transfer the liveness and get the def sets */ - void iterateLiveOut(void); /*! Use custom allocators */ GBE_CLASS(LiveOutSet); }; @@ -80,7 +78,6 @@ namespace ir { { this->initializeInstructionDef(); this->initializeOtherDef(); - this->iterateLiveOut(); } LiveOutSet::RegDefSet &LiveOutSet::getDefSet(const BasicBlock *bb, Register reg) @@ -227,36 +224,6 @@ namespace ir { } } - void LiveOutSet::iterateLiveOut(void) { - bool changed = true; - - while (changed) { - changed = false; - - // Compute the union of the current liveout definitions with the previous - // ones. Do not take into account the killed values though - liveness.foreach([&](Liveness::BlockInfo &curr, - const Liveness::BlockInfo &pred) - { - const BasicBlock &bb = curr.bb; - const BasicBlock &pbb = pred.bb; - for (auto reg : curr.liveOut) { - if (pred.inLiveOut(reg) == false) continue; - if (curr.inVarKill(reg) == true) continue; - RegDefSet &currSet = this->getDefSet(&bb, reg); - RegDefSet &predSet = this->getDefSet(&pbb, reg); - - // Transfer the values - for (auto def : predSet) { - if (currSet.contains(def)) continue; - changed = true; - currSet.insert(def); - } - } - }); - } - } - LiveOutSet::~LiveOutSet(void) { for (const auto pair : defMap) { BlockDefMap *block = pair.second;