aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/DFAPacketizer.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2015-12-16 16:38:16 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2015-12-16 16:38:16 +0000
commit2005d7dc0123d716ffad985f76e2355a80622699 (patch)
tree5ae0acdc008de65be10ecbf11f1ff7786b9b87ea /llvm/lib/CodeGen/DFAPacketizer.cpp
parentcb15b739ef253b415724c512218fb21ab05ac436 (diff)
downloadllvm-2005d7dc0123d716ffad985f76e2355a80622699.zip
llvm-2005d7dc0123d716ffad985f76e2355a80622699.tar.gz
llvm-2005d7dc0123d716ffad985f76e2355a80622699.tar.bz2
[Packetizer] Add a check whether an instruction should be packetized now
Add a function VLIWPacketizerList::shouldAddToPacket, which will allow specific implementations to decide if it is profitable to add given instruction to the current packet. llvm-svn: 255780
Diffstat (limited to 'llvm/lib/CodeGen/DFAPacketizer.cpp')
-rw-r--r--llvm/lib/CodeGen/DFAPacketizer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/DFAPacketizer.cpp b/llvm/lib/CodeGen/DFAPacketizer.cpp
index 80e03d9..af6b6a3 100644
--- a/llvm/lib/CodeGen/DFAPacketizer.cpp
+++ b/llvm/lib/CodeGen/DFAPacketizer.cpp
@@ -239,7 +239,7 @@ void VLIWPacketizerList::PacketizeMIs(MachineBasicBlock *MBB,
// Ask DFA if machine resource is available for MI.
bool ResourceAvail = ResourceTracker->canReserveResources(MI);
- if (ResourceAvail) {
+ if (ResourceAvail && shouldAddToPacket(MI)) {
// Dependency check for MI with instructions in CurrentPacketMIs.
for (std::vector<MachineInstr*>::iterator VI = CurrentPacketMIs.begin(),
VE = CurrentPacketMIs.end(); VI != VE; ++VI) {
@@ -258,7 +258,8 @@ void VLIWPacketizerList::PacketizeMIs(MachineBasicBlock *MBB,
} // !isLegalToPacketizeTogether.
} // For all instructions in CurrentPacketMIs.
} else {
- // End the packet if resource is not available.
+ // End the packet if resource is not available, or if the instruction
+ // shoud not be added to the current packet.
endPacket(MBB, MI);
}