Skip to content

Commit 144be7e

Browse files
pratikashargfxbot
authored andcommitted
Fix missing pseudo_kill for last instruction in BB
Change-Id: Ic9f45acecf2c4416f92cd24ab901c6d5a4e54823
1 parent bfa51ff commit 144be7e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

visa/RegAlloc.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2701,16 +2701,20 @@ void LivenessAnalysis::computeGenKillandPseudoKill(G4_BB* bb,
27012701
//
27022702
for (auto&& pseudoKill : pseudoKills)
27032703
{
2704-
if (pseudoKill.second != bb->rbegin())
2704+
INST_LIST_ITER iterToInsert = pseudoKill.second.base();
2705+
if (iterToInsert == bb->end())
2706+
{
2707+
std::advance(iterToInsert, -1);
2708+
}
2709+
else
27052710
{
2706-
INST_LIST_ITER iterToInsert = pseudoKill.second.base();
27072711
do
27082712
{
27092713
iterToInsert--;
27102714
} while ((*iterToInsert)->isPseudoKill());
2711-
G4_INST* killInst = fg.builder->createPseudoKill(pseudoKill.first);
2712-
bb->insert(iterToInsert, killInst);
27132715
}
2716+
G4_INST* killInst = fg.builder->createPseudoKill(pseudoKill.first);
2717+
bb->insert(iterToInsert, killInst);
27142718
}
27152719

27162720
//

0 commit comments

Comments
 (0)