diff options
author | Zhigang Gong <zhigang.gong@intel.com> | 2015-09-18 09:00:52 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2015-09-18 09:00:52 +0800 |
commit | 40ecd62cf3934341bac416927d598b8a651e44cf (patch) | |
tree | df4a2e9d271f30d6e00e3beb0f7abdf6abc48220 | |
parent | dd44931d60633ac924ecb1d5b4ce824bb89222f1 (diff) |
quick fix.optimize
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
-rw-r--r-- | backend/src/backend/gen_program.cpp | 2 | ||||
-rw-r--r-- | backend/src/ir/value.cpp | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/backend/src/backend/gen_program.cpp b/backend/src/backend/gen_program.cpp index 3ea2ed16..c1f88bc3 100644 --- a/backend/src/backend/gen_program.cpp +++ b/backend/src/backend/gen_program.cpp @@ -180,11 +180,13 @@ namespace gbe { // Use largest live regs as hint to ignore this strategy if too much register pressure // with zero reserved spill regs. // If this is the last stratey, we will give a try any way. +#if 0 if (ctx->getLargestLiveRegs() > (128 - reservedSpillRegs) / (simdWidth / 8) && reservedSpillRegs == 0 && codeGen < codeGenNum - 1) { continue; } +#endif ctx->startNewCG(simdWidth, reservedSpillRegs, limitRegisterPressure); kernel = ctx->compileKernel(); if (kernel != NULL) { diff --git a/backend/src/ir/value.cpp b/backend/src/ir/value.cpp index 027c8de2..744394e1 100644 --- a/backend/src/ir/value.cpp +++ b/backend/src/ir/value.cpp @@ -190,7 +190,7 @@ namespace ir { // Do not transfer dead values if (info.inLiveOut(reg) == false) continue; // If we overwrite it, do not transfer the initial value - if (info.inVarKill(reg) == true) continue; + if (info.inVarKill(reg) == true && info.inUpwardUsed(reg) == false ) continue; ValueDef *def = const_cast<ValueDef*>(this->dag.getDefAddress(&arg)); auto it = blockDefMap->find(reg); GBE_ASSERT(it != blockDefMap->end()); @@ -205,7 +205,7 @@ namespace ir { // Do not transfer dead values if (info.inLiveOut(reg) == false) continue; // If we overwrite it, do not transfer the initial value - if (info.inVarKill(reg) == true) continue; + if (info.inVarKill(reg) == true && info.inUpwardUsed(reg) == false ) continue; ValueDef *def = const_cast<ValueDef*>(this->dag.getDefAddress(reg)); auto it = blockDefMap->find(reg); GBE_ASSERT(it != blockDefMap->end()); @@ -219,7 +219,7 @@ namespace ir { // Do not transfer dead values if (info.inLiveOut(reg) == false) continue; // If we overwrite it, do not transfer the initial value - if (info.inVarKill(reg) == true) continue; + if (info.inVarKill(reg) == true && info.inUpwardUsed(reg) == false ) continue; ValueDef *def = const_cast<ValueDef*>(this->dag.getDefAddress(&pushed.second)); auto it = blockDefMap->find(reg); GBE_ASSERT(it != blockDefMap->end()); |