File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -2502,15 +2502,18 @@ bool SchedGroup::canAddSU(SUnit &SU) const {
25022502 return canAddMI (MI);
25032503
25042504 // Special case for bundled MIs.
2505+ // Return true if all of the bundled MIs can be added to this group.
2506+ // A meta instruction in a bundle is an exception.
25052507 const MachineBasicBlock *MBB = MI.getParent ();
2506- MachineBasicBlock::instr_iterator B = MI.getIterator (), E = ++B;
2507- while (E != MBB->end () && E->isBundledWithPred ())
2508- ++E;
2508+ // Initially, iterator is on a bundler header.
2509+ MachineBasicBlock::instr_iterator B = std::next (MI.getIterator ());
2510+ while (B != MBB->end () && B->isBundledWithPred ()) {
2511+ if (!B->isMetaInstruction () && !canAddMI (*B))
2512+ return false ;
2513+ ++B;
2514+ }
25092515
2510- // Return true if all of the bundled MIs can be added to this group.
2511- return std::all_of (B, E, [this ](MachineInstr &MI) {
2512- return (MI.isMetaInstruction ()) || canAddMI (MI);
2513- });
2516+ return true ;
25142517}
25152518
25162519void SchedGroup::initSchedGroup () {
You can’t perform that action at this time.
0 commit comments