diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2016-01-14 15:05:27 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2016-01-14 15:05:27 +0000 |
commit | b28ae10a163e4be5ef4553987d6e0104b7f806bf (patch) | |
tree | 036e2775529464bee3974f711ae3312b66ab1b55 /llvm/lib/Target/Hexagon | |
parent | 31f3ddd589367a4dff747983758b4b81cdc44634 (diff) | |
download | bcm5719-llvm-b28ae10a163e4be5ef4553987d6e0104b7f806bf.tar.gz bcm5719-llvm-b28ae10a163e4be5ef4553987d6e0104b7f806bf.zip |
[Hexagon] Handle branches with non-mbb operands
llvm-svn: 257768
Diffstat (limited to 'llvm/lib/Target/Hexagon')
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp index eb3590cb107..c3cf05541aa 100644 --- a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp +++ b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp @@ -377,6 +377,9 @@ bool HexagonInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB, bool LastOpcodeHasJMP_c = PredOpcodeHasJMP_c(LastOpcode); bool LastOpcodeHasNVJump = isNewValueJump(LastInst); + if (LastOpcodeHasJMP_c && !LastInst->getOperand(1).isMBB()) + return true; + // If there is only one terminator instruction, process it. if (LastInst && !SecondLastInst) { if (LastOpcode == Hexagon::J2_jump) { @@ -412,6 +415,8 @@ bool HexagonInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB, bool SecLastOpcodeHasJMP_c = PredOpcodeHasJMP_c(SecLastOpcode); bool SecLastOpcodeHasNVJump = isNewValueJump(SecondLastInst); if (SecLastOpcodeHasJMP_c && (LastOpcode == Hexagon::J2_jump)) { + if (!SecondLastInst->getOperand(1).isMBB()) + return true; TBB = SecondLastInst->getOperand(1).getMBB(); Cond.push_back(MachineOperand::CreateImm(SecondLastInst->getOpcode())); Cond.push_back(SecondLastInst->getOperand(0)); diff --git a/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp b/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp index 20c4ab112b5..69dd554cf36 100644 --- a/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp +++ b/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp @@ -485,6 +485,8 @@ bool HexagonNewValueJump::runOnMachineFunction(MachineFunction &MF) { if (predLive) break; + if (!MI->getOperand(1).isMBB()) + continue; jmpTarget = MI->getOperand(1).getMBB(); foundJump = true; if (MI->getOpcode() == Hexagon::J2_jumpf || |