aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2011-11-15 02:07:21 +0100
committerChristoph Bumiller <[email protected]>2012-04-14 21:54:01 +0200
commit898b0981b6c90d2f1e446a532b6ac3cbbb49747d (patch)
treedbca0364db46397bb785d170be02fbe460eb3131 /src/gallium
parent3e9150cd961b2399e402e940400deae11ec7852f (diff)
nv50/ir: Add convenience method for calculating the live sets of a function.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir.h1
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp10
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir_ssa.cpp8
3 files changed, 12 insertions, 7 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir.h b/src/gallium/drivers/nv50/codegen/nv50_ir.h
index d4e7c945226..74692d8251a 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir.h
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir.h
@@ -938,6 +938,7 @@ public:
inline LValue *getLValue(int id);
+ void buildLiveSets();
void buildDefSets();
bool convertToSSA();
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp
index 7c8f2e97fb5..54d8ef82bb3 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp
@@ -416,6 +416,16 @@ Function::orderInstructions(ArrayList &result)
}
void
+Function::buildLiveSets()
+{
+ for (unsigned i = 0; i <= loopNestingBound; ++i)
+ buildLiveSetsPreSSA(BasicBlock::get(cfg.getRoot()), cfg.nextSequence());
+
+ for (ArrayList::Iterator bi = allBBlocks.iterator(); !bi.end(); bi.next())
+ BasicBlock::get(bi)->liveSet.marker = false;
+}
+
+void
Function::buildDefSets()
{
for (unsigned i = 0; i <= loopNestingBound; ++i)
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_ssa.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_ssa.cpp
index 21b6cba251c..f8ee4d53f53 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_ssa.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_ssa.cpp
@@ -315,13 +315,7 @@ bool
Function::convertToSSA()
{
// 0. calculate live in variables (for pruned SSA)
- int seq = cfg.nextSequence();
- for (unsigned i = 0; i <= loopNestingBound; seq = cfg.nextSequence(), ++i)
- buildLiveSetsPreSSA(BasicBlock::get(cfg.getRoot()), seq);
-
- // reset liveSet marker for use in regalloc
- for (ArrayList::Iterator bi = allBBlocks.iterator(); !bi.end(); bi.next())
- reinterpret_cast<BasicBlock *>(bi.get())->liveSet.marker = false;
+ buildLiveSets();
// 1. create the dominator tree
domTree = new DominatorTree(&cfg);