]> granicus.if.org Git - llvm/commit
[Hexagon] Account for negative offset when limiting max deviation
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 25 Oct 2017 18:46:40 +0000 (18:46 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 25 Oct 2017 18:46:40 +0000 (18:46 +0000)
commitc936ad38895bb014817ee9210c3c1eee2bd4fae6
tree654f2d7fb91233301900201b6de31f42cfad242b
parent74a12b374012835b2c76b37b5f0b0deb633880e5
[Hexagon] Account for negative offset when limiting max deviation

In getOffsetRange, Max can be set to 0 to force the extender replacement
to be at or below the original value. This would cause the new offset to
be non-negative, which is preferred for memory instructions (to reduce
the likelihood of it getting constant-extended due to predication). The
problem happens when the range is shifted by an offset (present in the
instruction being examined) and the offset is negative. The entire range
for the allowable deviation will then be strictly negative. This creates
a problem, since 0 is assumed to be a valid deviation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316601 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Hexagon/HexagonConstExtenders.cpp
test/CodeGen/Hexagon/cext-opt-range-offset.mir [new file with mode: 0644]