diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-04-20 19:06:46 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-04-20 19:06:46 +0000 |
commit | 642120122c18ef6479e0047759c9cbe370483216 (patch) | |
tree | 3a9459b8ac759e1fb4e87678bc6c2f965978ae1b /llvm/lib | |
parent | 76238aac8b139f3ac1d2346d05b1bd63316f592a (diff) | |
download | bcm5719-llvm-642120122c18ef6479e0047759c9cbe370483216.tar.gz bcm5719-llvm-642120122c18ef6479e0047759c9cbe370483216.zip |
[Hexagon] Skip fixed-stack indexes in HexagonConstExtenders
Fixed slots have negative values, and TRI::stackSlot2Index and
TRI::index2StackSlot do not handle negative numbers.
llvm-svn: 330468
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp b/llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp index 27b0906f229..a2adc43bc48 100644 --- a/llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp +++ b/llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp @@ -1140,6 +1140,13 @@ void HCE::recordExtender(MachineInstr &MI, unsigned OpNum) { bool IsLoad = MI.mayLoad(); bool IsStore = MI.mayStore(); + // Fixed stack slots have negative indexes, and they cannot be used + // with TRI::stackSlot2Index and TRI::index2StackSlot. This is somewhat + // unfortunate, but should not be a frequent thing. + for (MachineOperand &Op : MI.operands()) + if (Op.isFI() && Op.getIndex() < 0) + return; + if (IsLoad || IsStore) { unsigned AM = HII->getAddrMode(MI); switch (AM) { |