@@ -2109,31 +2109,28 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
2109
2109
MachineBasicBlock::iterator FI = FBB->begin ();
2110
2110
for (MachineBasicBlock::iterator TI :
2111
2111
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 ()) {
2118
2116
assert (FI != FE && " Unexpected end of FBB range" );
2119
2117
MachineBasicBlock::iterator FINext = std::next (FI);
2120
2118
HoistAndKillDbgInstr (FI);
2121
2119
FI = FINext;
2122
2120
}
2123
2121
2124
- // Move pseudo probes without modifying them.
2125
- if (TI->isPseudoProbe ()) {
2126
- TI->moveBefore (&*Loc);
2127
- continue ;
2128
- }
2129
2122
// Kill debug instructions before moving.
2130
2123
if (TI->isDebugInstr ()) {
2131
2124
HoistAndKillDbgInstr (TI);
2132
2125
continue ;
2133
2126
}
2134
2127
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.
2136
2130
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" );
2137
2134
// NOTE: The loop above checks CheckKillDead but we can't do that here as
2138
2135
// it modifies some kill markers after the check.
2139
2136
assert (TI->isIdenticalTo (*FI, MachineInstr::CheckDefs) &&
0 commit comments