diff options
| author | Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> | 2019-12-04 10:06:12 +0000 |
|---|---|---|
| committer | Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> | 2019-12-04 11:30:00 +0000 |
| commit | b5f69e234ef0af43fa4b86d9977d46e0a4e442e7 (patch) | |
| tree | bdcff099d962ff913333aee9153cf9499bafea06 /llvm/lib/Target/Mips | |
| parent | b91f239485fb7bb8d29be3e0b60660a2de7570a9 (diff) | |
| download | bcm5719-llvm-b5f69e234ef0af43fa4b86d9977d46e0a4e442e7.tar.gz bcm5719-llvm-b5f69e234ef0af43fa4b86d9977d46e0a4e442e7.zip | |
Handle BUNDLE instructions in MipsAsmPrinter
Summary:
In our CHERI fork we use BUNDLE instructions to ensure that a
three-instruction sequence to generate a program-counter-relative value is
emitted without reordering or insertions (since that would break the 32-bit
offset computation).
Currently MipsAsmPrinter asserts when it encounters a pseudo instruction.
To handle BUNDLE we can simply skip the instruction which will then make
EmitInstruction() process the contents of the bundle in order.
Reviewers: atanasyan
Reviewed By: atanasyan
Subscribers: merge_guards_bot, sdardis, hiraditya, jrtc27, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70945
Diffstat (limited to 'llvm/lib/Target/Mips')
| -rw-r--r-- | llvm/lib/Target/Mips/MipsAsmPrinter.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsAsmPrinter.cpp b/llvm/lib/Target/Mips/MipsAsmPrinter.cpp index 353f10c8c64..be556cfba4d 100644 --- a/llvm/lib/Target/Mips/MipsAsmPrinter.cpp +++ b/llvm/lib/Target/Mips/MipsAsmPrinter.cpp @@ -257,6 +257,10 @@ void MipsAsmPrinter::EmitInstruction(const MachineInstr *MI) { if (emitPseudoExpansionLowering(*OutStreamer, &*I)) continue; + // Skip the BUNDLE pseudo instruction and lower the contents + if (I->isBundle()) + continue; + if (I->getOpcode() == Mips::PseudoReturn || I->getOpcode() == Mips::PseudoReturn64 || I->getOpcode() == Mips::PseudoIndirectBranch || |

