summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/SystemZ
diff options
context:
space:
mode:
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>2018-03-07 08:45:09 +0000
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>2018-03-07 08:45:09 +0000
commite18dbeb24f4c5627d3afd6e8a2a99eaee8607017 (patch)
treee92ded19629ccd23ee871d27cba3bbe4a21ac659 /llvm/lib/Target/SystemZ
parent61fbcf582578d58072a18ddc3ed88b7c001b637c (diff)
downloadbcm5719-llvm-e18dbeb24f4c5627d3afd6e8a2a99eaee8607017.tar.gz
bcm5719-llvm-e18dbeb24f4c5627d3afd6e8a2a99eaee8607017.zip
[SystemZ] NFC refactoring in SystemZHazardRecognizer.
Handle the not-taken branch in emitInstruction() where the TakenBranch argument is available. This is cleaner than relying on EmitInstruction(). Review: Ulrich Weigand llvm-svn: 326879
Diffstat (limited to 'llvm/lib/Target/SystemZ')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZHazardRecognizer.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZHazardRecognizer.cpp b/llvm/lib/Target/SystemZ/SystemZHazardRecognizer.cpp
index d29711ef65e..d71d1fd1ccf 100644
--- a/llvm/lib/Target/SystemZ/SystemZHazardRecognizer.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZHazardRecognizer.cpp
@@ -283,9 +283,6 @@ EmitInstruction(SUnit *SU) {
<< LastFPdOpCycleIdx << "\n";);
}
- bool GroupEndingBranch =
- (CurrGroupSize >= 1 && isBranchRetTrap(SU->getInstr()));
-
// Insert SU into current group by increasing number of slots used
// in current group.
CurrGroupSize += getNumDecoderSlots(SU);
@@ -293,7 +290,7 @@ EmitInstruction(SUnit *SU) {
// Check if current group is now full/ended. If so, move on to next
// group to be ready to evaluate more candidates.
- if (CurrGroupSize == 3 || SC->EndGroup || GroupEndingBranch)
+ if (CurrGroupSize == 3 || SC->EndGroup)
nextGroup();
}
@@ -386,8 +383,15 @@ void SystemZHazardRecognizer::emitInstruction(MachineInstr *MI,
}
}
+ unsigned GroupSizeBeforeEmit = CurrGroupSize;
EmitInstruction(&SU);
+ if (!TakenBranch && isBranchRetTrap(MI)) {
+ // NT Branch on second slot ends group.
+ if (GroupSizeBeforeEmit == 1)
+ nextGroup();
+ }
+
if (TakenBranch && CurrGroupSize > 0)
nextGroup();
OpenPOWER on IntegriCloud