diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2016-08-19 21:07:35 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2016-08-19 21:07:35 +0000 |
commit | 48a33fd8e5d0156b296b1d675173a3622c5c15d7 (patch) | |
tree | e326b225b72e84244a7f0167530142d8b18115a4 /lib/Target/Hexagon/HexagonVLIWPacketizer.cpp | |
parent | 878c720c8aca716556b049060bd9542debb9e1e2 (diff) |
[Hexagon] Avoid register dependencies on indirect branches in packetizer
Do not packetize the instruction setting the branch address with the
indirect branch itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279324 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Hexagon/HexagonVLIWPacketizer.cpp')
-rw-r--r-- | lib/Target/Hexagon/HexagonVLIWPacketizer.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp b/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp index b2acace100d..47892848261 100644 --- a/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp +++ b/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp @@ -283,11 +283,18 @@ bool HexagonPacketizerList::isCallDependent(const MachineInstr &MI, // Assumes that the first operand of the CALLr is the function address. if (HII->isIndirectCall(MI) && (DepType == SDep::Data)) { - MachineOperand MO = MI.getOperand(0); + const MachineOperand MO = MI.getOperand(0); if (MO.isReg() && MO.isUse() && (MO.getReg() == DepReg)) return true; } + if (HII->isJumpR(MI)) { + const MachineOperand &MO = HII->isPredicated(MI) ? MI.getOperand(1) + : MI.getOperand(0); + assert(MO.isReg() && MO.isUse()); + if (MO.getReg() == DepReg) + return true; + } return false; } @@ -1293,12 +1300,6 @@ bool HexagonPacketizerList::isLegalToPacketizeTogether(SUnit *SUI, SUnit *SUJ) { // dealloc return unless we have dependencies on the explicit uses // of the registers used by jumpr (like r31) or dealloc return // (like r29 or r30). - // - // TODO: Currently, jumpr is handling only return of r31. So, the - // following logic (specificaly isCallDependent) is working fine. - // We need to enable jumpr for register other than r31 and then, - // we need to rework the last part, where it handles indirect call - // of that (isCallDependent) function. Bug 6216 is opened for this. unsigned DepReg = 0; const TargetRegisterClass *RC = nullptr; if (DepType == SDep::Data) { |