summaryrefslogtreecommitdiff
path: root/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-10-11 21:20:43 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2017-10-11 21:20:43 +0000
commitbdeacd17d754e86a0168b89e43a5f8eb03ef8514 (patch)
treec87ef8eab8b152d6e31c9a51f4a18b7acedde1f9 /lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
parent9c28c0a064bf015b761d5fbbae2c0c8e3ef6f4be (diff)
[Hexagon] Make sure that new-value jump is packetized with producer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Hexagon/HexagonVLIWPacketizer.cpp')
-rw-r--r--lib/Target/Hexagon/HexagonVLIWPacketizer.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp b/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
index 2555b50f91c..1bc8d45c3dc 100644
--- a/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
+++ b/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
@@ -1338,11 +1338,9 @@ bool HexagonPacketizerList::isLegalToPacketizeTogether(SUnit *SUI, SUnit *SUJ) {
if (NOp1.isReg() && I.getOperand(0).getReg() == NOp1.getReg())
secondRegMatch = true;
- for (auto T : CurrentPacketMIs) {
- SUnit *PacketSU = MIToSUnit.find(T)->second;
- MachineInstr &PI = *PacketSU->getInstr();
+ for (MachineInstr *PI : CurrentPacketMIs) {
// NVJ can not be part of the dual jump - Arch Spec: section 7.8.
- if (PI.isCall()) {
+ if (PI->isCall()) {
Dependence = true;
break;
}
@@ -1354,22 +1352,22 @@ bool HexagonPacketizerList::isLegalToPacketizeTogether(SUnit *SUI, SUnit *SUJ) {
// 3. If the second operand of the nvj is newified, (which means
// first operand is also a reg), first reg is not defined in
// the same packet.
- if (PI.getOpcode() == Hexagon::S2_allocframe || PI.mayStore() ||
- HII->isLoopN(PI)) {
+ if (PI->getOpcode() == Hexagon::S2_allocframe || PI->mayStore() ||
+ HII->isLoopN(*PI)) {
Dependence = true;
break;
}
// Check #2/#3.
const MachineOperand &OpR = secondRegMatch ? NOp0 : NOp1;
- if (OpR.isReg() && PI.modifiesRegister(OpR.getReg(), HRI)) {
+ if (OpR.isReg() && PI->modifiesRegister(OpR.getReg(), HRI)) {
Dependence = true;
break;
}
}
+ GlueToNewValueJump = true;
if (Dependence)
return false;
- GlueToNewValueJump = true;
}
// There no dependency between a prolog instruction and its successor.
@@ -1613,7 +1611,15 @@ bool HexagonPacketizerList::isLegalToPruneDependencies(SUnit *SUI, SUnit *SUJ) {
if (ChangedOffset != INT64_MAX)
undoChangedOffset(I);
- else if (updateOffset(SUI, SUJ)) {
+
+ if (GlueToNewValueJump) {
+ // Putting I and J together would prevent the new-value jump from being
+ // packetized with the producer. In that case I and J must be separated.
+ GlueToNewValueJump = false;
+ return false;
+ }
+
+ if (ChangedOffset == INT64_MAX && updateOffset(SUI, SUJ)) {
FoundSequentialDependence = false;
Dependence = false;
return true;