Skip to content

Commit 9b26c48

Browse files
committed
Remove unecessary pseudo probe handling
1 parent bbd7c26 commit 9b26c48

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

llvm/lib/CodeGen/BranchFolding.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,31 +2109,28 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
21092109
MachineBasicBlock::iterator FI = FBB->begin();
21102110
for (MachineBasicBlock::iterator TI :
21112111
make_early_inc_range(make_range(TBB->begin(), TIB))) {
2112-
2113-
// Hoist and kill debug instructions from FBB. Skip over pseudo
2114-
// instructions. After this loop FI points to the next non-debug
2115-
// instruction to hoist (checked in assert after the TBB debug
2116-
// instruction handling code).
2117-
while (FI->isDebugOrPseudoInstr()) {
2112+
// Hoist and kill debug instructions from FBB. After this loop FI points
2113+
// to the next non-debug instruction to hoist (checked in assert after the
2114+
// TBB debug instruction handling code).
2115+
while (FI->isDebugInstr()) {
21182116
assert(FI != FE && "Unexpected end of FBB range");
21192117
MachineBasicBlock::iterator FINext = std::next(FI);
21202118
HoistAndKillDbgInstr(FI);
21212119
FI = FINext;
21222120
}
21232121

2124-
// Move pseudo probes without modifying them.
2125-
if (TI->isPseudoProbe()) {
2126-
TI->moveBefore(&*Loc);
2127-
continue;
2128-
}
21292122
// Kill debug instructions before moving.
21302123
if (TI->isDebugInstr()) {
21312124
HoistAndKillDbgInstr(TI);
21322125
continue;
21332126
}
21342127

2135-
// Get the next non-meta instruction in FBB.
2128+
// If FI is a debug instruction, skip forward to the next non-debug
2129+
// instruction.
21362130
FI = skipDebugInstructionsForward(FI, FE, false);
2131+
// Pseudo probes are excluded from the range when identifying foldable
2132+
// instructions, so we don't expect to see one now.
2133+
assert(!TI->isPseudoProbe() && "Unexpected psuedo probe in range");
21372134
// NOTE: The loop above checks CheckKillDead but we can't do that here as
21382135
// it modifies some kill markers after the check.
21392136
assert(TI->isIdenticalTo(*FI, MachineInstr::CheckDefs) &&

0 commit comments

Comments
 (0)