diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-02-27 19:09:00 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-02-27 19:09:00 +0000 |
| commit | 570228780990568f27288961f8ffe17de8f31e3d (patch) | |
| tree | e42969d563156b8e2472f5c0b4e9711851660b13 /llvm/include | |
| parent | f9ab416d7066d75ae1e42c706687926840454726 (diff) | |
| download | bcm5719-llvm-570228780990568f27288961f8ffe17de8f31e3d.tar.gz bcm5719-llvm-570228780990568f27288961f8ffe17de8f31e3d.zip | |
CodeGen: Update DFAPacketizer API to take MachineInstr&, NFC
In all but one case, change the DFAPacketizer API to take MachineInstr&
instead of MachineInstr*. In DFAPacketizer::endPacket(), take
MachineBasicBlock::iterator. Besides cleaning up the API, this is in
search of PR26753.
llvm-svn: 262142
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/CodeGen/DFAPacketizer.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/llvm/include/llvm/CodeGen/DFAPacketizer.h b/llvm/include/llvm/CodeGen/DFAPacketizer.h index 2a0ff239248..2145884658e 100644 --- a/llvm/include/llvm/CodeGen/DFAPacketizer.h +++ b/llvm/include/llvm/CodeGen/DFAPacketizer.h @@ -108,11 +108,11 @@ public: // Check if the resources occupied by a machine instruction are available // in the current state. - bool canReserveResources(llvm::MachineInstr *MI); + bool canReserveResources(llvm::MachineInstr &MI); // Reserve the resources occupied by a machine instruction and change the // current state to reflect that change. - void reserveResources(llvm::MachineInstr *MI); + void reserveResources(llvm::MachineInstr &MI); const InstrItineraryData *getInstrItins() const { return InstrItins; } }; @@ -156,33 +156,31 @@ public: DFAPacketizer *getResourceTracker() {return ResourceTracker;} // addToPacket - Add MI to the current packet. - virtual MachineBasicBlock::iterator addToPacket(MachineInstr *MI) { - MachineBasicBlock::iterator MII = MI; - CurrentPacketMIs.push_back(MI); + virtual MachineBasicBlock::iterator addToPacket(MachineInstr &MI) { + CurrentPacketMIs.push_back(&MI); ResourceTracker->reserveResources(MI); - return MII; + return MI; } // End the current packet and reset the state of the packetizer. // Overriding this function allows the target-specific packetizer // to perform custom finalization. - virtual void endPacket(MachineBasicBlock *MBB, MachineInstr *MI); + virtual void endPacket(MachineBasicBlock *MBB, + MachineBasicBlock::iterator MI); // Perform initialization before packetizing an instruction. This // function is supposed to be overrided by the target dependent packetizer. virtual void initPacketizerState() {} // Check if the given instruction I should be ignored by the packetizer. - virtual bool ignorePseudoInstruction(const MachineInstr *I, + virtual bool ignorePseudoInstruction(const MachineInstr &I, const MachineBasicBlock *MBB) { return false; } // Return true if instruction MI can not be packetized with any other // instruction, which means that MI itself is a packet. - virtual bool isSoloInstruction(const MachineInstr *MI) { - return true; - } + virtual bool isSoloInstruction(const MachineInstr &MI) { return true; } // Check if the packetizer should try to add the given instruction to // the current packet. One reasons for which it may not be desirable @@ -190,9 +188,7 @@ public: // would cause a stall. // If this function returns "false", the current packet will be ended, // and the instruction will be added to the next packet. - virtual bool shouldAddToPacket(const MachineInstr *MI) { - return true; - } + virtual bool shouldAddToPacket(const MachineInstr &MI) { return true; } // Check if it is legal to packetize SUI and SUJ together. virtual bool isLegalToPacketizeTogether(SUnit *SUI, SUnit *SUJ) { |

