[llvm] r175346 - R600/structurizer: improve PHI value finding
Christian Konig
christian.koenig at amd.com
Sat Feb 16 03:27:35 PST 2013
Author: ckoenig
Date: Sat Feb 16 05:27:35 2013
New Revision: 175346
URL: http://llvm.org/viewvc/llvm-project?rev=175346&view=rev
Log:
R600/structurizer: improve PHI value finding
Using the new NearestCommonDominator class.
This is a candidate for the stable branch.
Signed-off-by: Christian König <christian.koenig at amd.com>
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
Modified:
llvm/trunk/lib/Target/R600/AMDGPUStructurizeCFG.cpp
Modified: llvm/trunk/lib/Target/R600/AMDGPUStructurizeCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUStructurizeCFG.cpp?rev=175346&r1=175345&r2=175346&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUStructurizeCFG.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUStructurizeCFG.cpp Sat Feb 16 05:27:35 2013
@@ -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) {
More information about the llvm-commits
mailing list