OSDN Git Service

[ARM] Fix so immediates and pc relative checks
authorSimon Wallis <simon.wallis2@arm.com>
Mon, 14 Sep 2020 07:52:59 +0000 (08:52 +0100)
committerSimon Wallis <simon.wallis2@arm.com>
Mon, 14 Sep 2020 07:52:59 +0000 (08:52 +0100)
commit4946802c5f406b050cbb1524d0fd03cf3fd7b0dc
tree08a490584217eb3b5273118fa91cb785fc6f93cf
parent15bff4dec4360985a6a058a7e42a4ffd590dc665
[ARM] Fix so immediates and pc relative checks

Treating an SoImm offset as a multiple of 4 between -1020 and 1020
mis-handles the second of a pair of 16-bit constants where the offset is a multiple of 2 but not a multiple of 4,
leading to an LLVM ERROR: out of range pc-relative fixup value

For 32-bit and larger (64-bit) constants, continue to treat an SoImm offset as a multiple of 4 between -1020 and 1020.
For smaller (16-bit) constants, treat an SoImm offset as a multiple of 1 between -255 and 255.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D86949
llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
llvm/test/CodeGen/ARM/constant-island-SOImm-limit16.mir [new file with mode: 0644]