mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
First chunk of MachineInstr bundle support.
1. Added opcode BUNDLE 2. Taught MachineInstr class to deal with bundled MIs 3. Changed MachineBasicBlock iterator to skip over bundled MIs; added an iterator to walk all the MIs 4. Taught MachineBasicBlock methods about bundled MIs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145975 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -53,9 +53,11 @@ public:
|
||||
};
|
||||
|
||||
enum MIFlag {
|
||||
NoFlags = 0,
|
||||
FrameSetup = 1 << 0 // Instruction is used as a part of
|
||||
NoFlags = 0,
|
||||
FrameSetup = 1 << 0, // Instruction is used as a part of
|
||||
// function frame setup code.
|
||||
InsideBundle = 1 << 1 // Instruction is inside a bundle (not
|
||||
// the first MI in a bundle)
|
||||
};
|
||||
private:
|
||||
const MCInstrDesc *MCID; // Instruction descriptor.
|
||||
@@ -148,6 +150,12 @@ public:
|
||||
AsmPrinterFlags |= (uint8_t)Flag;
|
||||
}
|
||||
|
||||
/// clearAsmPrinterFlag - clear specific AsmPrinter flags
|
||||
///
|
||||
void clearAsmPrinterFlag(CommentFlag Flag) {
|
||||
AsmPrinterFlags &= ~Flag;
|
||||
}
|
||||
|
||||
/// getFlags - Return the MI flags bitvector.
|
||||
uint8_t getFlags() const {
|
||||
return Flags;
|
||||
@@ -167,10 +175,44 @@ public:
|
||||
Flags = flags;
|
||||
}
|
||||
|
||||
/// clearAsmPrinterFlag - clear specific AsmPrinter flags
|
||||
/// isInsideBundle - Return true if MI is in a bundle (but not the first MI
|
||||
/// in a bundle).
|
||||
///
|
||||
void clearAsmPrinterFlag(CommentFlag Flag) {
|
||||
AsmPrinterFlags &= ~Flag;
|
||||
/// A bundle looks like this before it's finalized:
|
||||
/// ----------------
|
||||
/// | MI |
|
||||
/// ----------------
|
||||
/// |
|
||||
/// ----------------
|
||||
/// | MI * |
|
||||
/// ----------------
|
||||
/// |
|
||||
/// ----------------
|
||||
/// | MI * |
|
||||
/// ----------------
|
||||
/// In this case, the first MI starts a bundle but is not inside a bundle, the
|
||||
/// next 2 MIs are considered "inside" the bundle.
|
||||
///
|
||||
/// After a bundle is finalized, it looks like this:
|
||||
/// ----------------
|
||||
/// | Bundle |
|
||||
/// ----------------
|
||||
/// |
|
||||
/// ----------------
|
||||
/// | MI * |
|
||||
/// ----------------
|
||||
/// |
|
||||
/// ----------------
|
||||
/// | MI * |
|
||||
/// ----------------
|
||||
/// |
|
||||
/// ----------------
|
||||
/// | MI * |
|
||||
/// ----------------
|
||||
/// The first instruction has the special opcode "BUNDLE". It's not "inside"
|
||||
/// a bundle, but the next three MIs are.
|
||||
bool isInsideBundle() const {
|
||||
return getFlag(InsideBundle);
|
||||
}
|
||||
|
||||
/// getDebugLoc - Returns the debug location id of this MachineInstr.
|
||||
@@ -232,6 +274,14 @@ public:
|
||||
return MemRefsEnd - MemRefs == 1;
|
||||
}
|
||||
|
||||
/// API for querying MachineInstr properties. These are bundle aware.
|
||||
///
|
||||
bool hasProperty(unsigned short Flag) const;
|
||||
|
||||
bool isTerminator() const {
|
||||
return hasProperty(MCID::Terminator);
|
||||
}
|
||||
|
||||
enum MICheckType {
|
||||
CheckDefs, // Check all operands for equality
|
||||
CheckKillDead, // Check all operands including kill / dead markers
|
||||
|
Reference in New Issue
Block a user