[Mesa-dev] [PATCH 02/12] R600/structurizer: improve PHI value finding
Christian König
deathsimple at vodafone.de
Thu Feb 14 09:34:15 PST 2013
From: Christian König <christian.koenig at amd.com>
Using the new NearestCommonDominator class.
Signed-off-by: Christian König <christian.koenig at amd.com>
---
lib/Target/R600/AMDGPUStructurizeCFG.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/Target/R600/AMDGPUStructurizeCFG.cpp b/lib/Target/R600/AMDGPUStructurizeCFG.cpp
index 86cb04a..3801347 100644
--- a/lib/Target/R600/AMDGPUStructurizeCFG.cpp
+++ b/lib/Target/R600/AMDGPUStructurizeCFG.cpp
@@ -533,12 +533,18 @@ void AMDGPUStructurizeCFG::setPhiValues() {
Updater.AddAvailableValue(&Func->getEntryBlock(), Undef);
Updater.AddAvailableValue(To, Undef);
+ NearestCommonDominator Dominator(DT);
+ Dominator.addBlock(To, false);
for (BBValueVector::iterator VI = PI->second.begin(),
VE = PI->second.end(); VI != VE; ++VI) {
Updater.AddAvailableValue(VI->first, VI->second);
+ Dominator.addBlock(VI->first);
}
+ if (!Dominator.wasResultExplicitMentioned())
+ Updater.AddAvailableValue(Dominator.getResult(), Undef);
+
for (BBVector::iterator FI = From.begin(), FE = From.end();
FI != FE; ++FI) {
--
1.7.10.4
More information about the mesa-dev
mailing list