summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2018-03-30 19:28:37 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2018-03-30 19:28:37 +0000
commit0f983d69a43b71d62c407c51d154698bd41633b6 (patch)
tree9bb3c435413dbf8563997479e423c9965acac14c /llvm/lib
parent95f9a68b1f8fa4d9a93b8eb5abc5c5c9bc58ee5b (diff)
downloadbcm5719-llvm-0f983d69a43b71d62c407c51d154698bd41633b6.tar.gz
bcm5719-llvm-0f983d69a43b71d62c407c51d154698bd41633b6.zip
[Hexagon] Avoid creating invalid offsets in packetizer
Two memory instructions with a dependency only on the address register between the two (the first one of them being post-incrememnt) can be packetized together after the offset on the second was updated to the incremement value. Make sure that the new offset is valid for the instruction. llvm-svn: 328897
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp b/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
index 16d3733b92e..135e90be9d9 100644
--- a/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
@@ -530,6 +530,9 @@ bool HexagonPacketizerList::updateOffset(SUnit *SUI, SUnit *SUJ) {
return false;
int64_t Offset = MI.getOperand(OPI).getImm();
+ if (!HII->isValidOffset(MI.getOpcode(), Offset+Incr, HRI))
+ return false;
+
MI.getOperand(OPI).setImm(Offset + Incr);
ChangedOffset = Offset;
return true;
OpenPOWER on IntegriCloud