diff options
author | Jessica Paquette <jpaquette@apple.com> | 2022-02-23 10:35:52 -0800 |
---|---|---|
committer | Jessica Paquette <jpaquette@apple.com> | 2022-02-23 10:35:52 -0800 |
commit | 68c718c8f4b77dac87bdf7dfd9f2b14f3bac0592 (patch) | |
tree | fe8d8d93e97588cb08b26bedc246808ebcf42d87 /llvm/lib/CodeGen/MachineOutliner.cpp | |
parent | beff16f7bd6353054ee7dbf43c6f35082ad61577 (diff) | |
download | llvm-68c718c8f4b77dac87bdf7dfd9f2b14f3bac0592.zip llvm-68c718c8f4b77dac87bdf7dfd9f2b14f3bac0592.tar.gz llvm-68c718c8f4b77dac87bdf7dfd9f2b14f3bac0592.tar.bz2 |
Revert "[MachineOutliner][AArch64] NFC: Split MBBs into "outlinable ranges""
This reverts commit d97f997eb79d91b2872ac13619f49cb3a7120781.
This commit was not NFC.
(See: https://reviews.llvm.org/rGd97f997eb79d91b2872ac13619f49cb3a7120781)
Diffstat (limited to 'llvm/lib/CodeGen/MachineOutliner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineOutliner.cpp | 67 |
1 files changed, 25 insertions, 42 deletions
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp index e742642..7ce655d 100644 --- a/llvm/lib/CodeGen/MachineOutliner.cpp +++ b/llvm/lib/CodeGen/MachineOutliner.cpp @@ -258,10 +258,6 @@ struct InstructionMapper { if (!TII.isMBBSafeToOutlineFrom(MBB, Flags)) return; - auto Ranges = TII.getOutlinableRanges(MBB, Flags); - if (Ranges.empty()) - return; - // Store info for the MBB for later outlining. MBBFlagsMap[&MBB] = Flags; @@ -284,47 +280,34 @@ struct InstructionMapper { std::vector<unsigned> UnsignedVecForMBB; std::vector<MachineBasicBlock::iterator> InstrListForMBB; - for (auto &Range : Ranges) { - auto RangeStart = Range.first; - auto RangeEnd = Range.second; - // Everything outside of an outlinable range is illegal. - for (; It != RangeStart; ++It) + for (MachineBasicBlock::iterator Et = MBB.end(); It != Et; ++It) { + // Keep track of where this instruction is in the module. + switch (TII.getOutliningType(It, Flags)) { + case InstrType::Illegal: mapToIllegalUnsigned(It, CanOutlineWithPrevInstr, UnsignedVecForMBB, InstrListForMBB); - assert(It != MBB.end() && "Should still have instructions?"); - // `It` is now positioned at the beginning of a range of instructions - // which may be outlinable. Check if each instruction is known to be safe. - for (; It != RangeEnd; ++It) { - // Keep track of where this instruction is in the module. - switch (TII.getOutliningType(It, Flags)) { - case InstrType::Illegal: - mapToIllegalUnsigned(It, CanOutlineWithPrevInstr, UnsignedVecForMBB, - InstrListForMBB); - break; - - case InstrType::Legal: - mapToLegalUnsigned(It, CanOutlineWithPrevInstr, HaveLegalRange, - NumLegalInBlock, UnsignedVecForMBB, - InstrListForMBB); - break; - - case InstrType::LegalTerminator: - mapToLegalUnsigned(It, CanOutlineWithPrevInstr, HaveLegalRange, - NumLegalInBlock, UnsignedVecForMBB, + break; + + case InstrType::Legal: + mapToLegalUnsigned(It, CanOutlineWithPrevInstr, HaveLegalRange, + NumLegalInBlock, UnsignedVecForMBB, InstrListForMBB); + break; + + case InstrType::LegalTerminator: + mapToLegalUnsigned(It, CanOutlineWithPrevInstr, HaveLegalRange, + NumLegalInBlock, UnsignedVecForMBB, InstrListForMBB); + // The instruction also acts as a terminator, so we have to record that + // in the string. + mapToIllegalUnsigned(It, CanOutlineWithPrevInstr, UnsignedVecForMBB, InstrListForMBB); - // The instruction also acts as a terminator, so we have to record - // that in the string. - mapToIllegalUnsigned(It, CanOutlineWithPrevInstr, UnsignedVecForMBB, - InstrListForMBB); - break; - - case InstrType::Invisible: - // Normally this is set by mapTo(Blah)Unsigned, but we just want to - // skip this instruction. So, unset the flag here. - ++NumInvisible; - AddedIllegalLastTime = false; - break; - } + break; + + case InstrType::Invisible: + // Normally this is set by mapTo(Blah)Unsigned, but we just want to + // skip this instruction. So, unset the flag here. + ++NumInvisible; + AddedIllegalLastTime = false; + break; } } |