diff options
| author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2017-10-11 15:59:51 +0000 |
|---|---|---|
| committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2017-10-11 15:59:51 +0000 |
| commit | 12bdcab59c7ed91475b2f9cd25f45e72b5d1f9f1 (patch) | |
| tree | d050f64fca87108c93a6bd93eb27bf4893b42a6a /llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp | |
| parent | 3a03a7f6365ae85644ed61a6c6d45bdb8da77305 (diff) | |
| download | bcm5719-llvm-12bdcab59c7ed91475b2f9cd25f45e72b5d1f9f1.tar.gz bcm5719-llvm-12bdcab59c7ed91475b2f9cd25f45e72b5d1f9f1.zip | |
[Pipeliner] Fix offset value for instrs dependent on post-inc load/stores
The software pipeliner and the packetizer try to break dependence
between the post-increment instruction and the dependent memory
instructions by changing the base register and the offset value.
However, in some cases, the existing logic didn't work properly
and created incorrect offset value.
Patch by Jyotsna Verma.
llvm-svn: 315468
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp')
| -rw-r--r-- | llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp index c2125bec3a5..5e2cfbd531a 100644 --- a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp +++ b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp @@ -1651,13 +1651,14 @@ bool HexagonInstrInfo::areMemAccessesTriviallyDisjoint( bool HexagonInstrInfo::getIncrementValue(const MachineInstr &MI, int &Value) const { if (isPostIncrement(MI)) { - // For a post-increment, the offset is zero and the increment value is - // determined by the instruction's access size. - int Zero; - unsigned AccessSize; - bool RetVal = getBaseAndOffset(MI, Zero, AccessSize); - Value = (int) AccessSize; - return RetVal; + unsigned BasePos = 0, OffsetPos = 0; + if (!getBaseAndOffsetPosition(MI, BasePos, OffsetPos)) + return false; + const MachineOperand &OffsetOp = MI.getOperand(OffsetPos); + if (OffsetOp.isImm()) { + Value = OffsetOp.getImm(); + return true; + } } if (MI.getOpcode() == Hexagon::A2_addi) { Value = MI.getOperand(2).getImm(); |

