Skip to content

Commit 1fdd2ac

Browse files
author
Tony Linthicum
committed
Use VNInfo api to check for PHI def rather than doing it manually
1 parent 81b0444 commit 1fdd2ac

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,10 +1231,8 @@ void RewriteScheduleStage::findReachingDefs(
12311231
LiveInterval &UseLI = LIS->getInterval(UseMO.getReg());
12321232
VNInfo *VNI = UseLI.getVNInfoAt(LIS->getInstructionIndex(*UseMI));
12331233

1234-
SlotIndex DefMBBStart = LIS->getMBBStartIdx(LIS->getMBBFromIndex(VNI->def));
1235-
1236-
// If the def is in the block, then it must be the only reaching def.
1237-
if (DefMBBStart != VNI->def) {
1234+
// If the def is not a PHI, then it must be the only reaching def.
1235+
if (!VNI->isPHIDef()) {
12381236
DefIdxs.push_back(VNI->def);
12391237
return;
12401238
}
@@ -1257,11 +1255,10 @@ void RewriteScheduleStage::findReachingDefs(
12571255
VNInfo *VNI = UseLI.getVNInfoAt(CurrMBBEnd.getPrevSlot());
12581256

12591257
MachineBasicBlock *DefMBB = LIS->getMBBFromIndex(VNI->def);
1260-
SlotIndex DefMBBStart = LIS->getMBBStartIdx(DefMBB);
12611258

12621259
// If there is a def in this block, then add it to the list. This is the
12631260
// reaching def of this path.
1264-
if (DefMBBStart != VNI->def) {
1261+
if (!VNI->isPHIDef()) {
12651262
DefIdxs.push_back(VNI->def);
12661263
continue;
12671264
}

0 commit comments

Comments
 (0)