mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-26 07:29:55 +00:00
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@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175346 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f0e469bcaf
commit
4c79c71d99
@ -533,12 +533,18 @@ void AMDGPUStructurizeCFG::setPhiValues() {
|
|||||||
Updater.AddAvailableValue(&Func->getEntryBlock(), Undef);
|
Updater.AddAvailableValue(&Func->getEntryBlock(), Undef);
|
||||||
Updater.AddAvailableValue(To, Undef);
|
Updater.AddAvailableValue(To, Undef);
|
||||||
|
|
||||||
|
NearestCommonDominator Dominator(DT);
|
||||||
|
Dominator.addBlock(To, false);
|
||||||
for (BBValueVector::iterator VI = PI->second.begin(),
|
for (BBValueVector::iterator VI = PI->second.begin(),
|
||||||
VE = PI->second.end(); VI != VE; ++VI) {
|
VE = PI->second.end(); VI != VE; ++VI) {
|
||||||
|
|
||||||
Updater.AddAvailableValue(VI->first, VI->second);
|
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();
|
for (BBVector::iterator FI = From.begin(), FE = From.end();
|
||||||
FI != FE; ++FI) {
|
FI != FE; ++FI) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user