]> granicus.if.org Git - llvm/commit
[ARM GlobalISel] Support global variables for Thumb2
authorDiana Picus <diana.picus@linaro.org>
Thu, 28 Feb 2019 10:42:47 +0000 (10:42 +0000)
committerDiana Picus <diana.picus@linaro.org>
Thu, 28 Feb 2019 10:42:47 +0000 (10:42 +0000)
commitc8a454ac138775167f3bee1b9ef4e7cc32684b2b
tree7191cd6bbba45ee9a03fe7fb365b0c0a4007baa8
parent32f6332ef1a600a98c971614639e49aac239e18f
[ARM GlobalISel] Support global variables for Thumb2

Add the same level of support as for ARM mode (i.e. still no TLS
support).

In most cases, it is sufficient to replace the opcodes with the
t2-equivalent, but there are some idiosyncrasies that I decided to
preserve because I don't understand the full implications:
* For ARM we use LDRi12 to load from constant pools, but for Thumb we
  use t2LDRpci (I'm not sure if the ideal would be to use t2LDRi12 for
  Thumb as well, or to use LDRcp for ARM).
* For Thumb we don't have an equivalent for MOV|LDRLIT_ga_pcrel_ldr, so
  we have to generate MOV|LDRLIT_ga_pcrel plus a load from GOT.

The tests are in separate files because they're hard enough to read even
without doubling the number of checks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355077 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMInstructionSelector.cpp
lib/Target/ARM/ARMLegalizerInfo.cpp
test/CodeGen/ARM/GlobalISel/arm-legalize-globals.mir [new file with mode: 0644]
test/CodeGen/ARM/GlobalISel/arm-legalizer.mir
test/CodeGen/ARM/GlobalISel/thumb-isel-globals-pic.ll [new file with mode: 0644]
test/CodeGen/ARM/GlobalISel/thumb-isel-globals-ropi-rwpi.ll [new file with mode: 0644]
test/CodeGen/ARM/GlobalISel/thumb-isel-globals-static.ll [new file with mode: 0644]
test/CodeGen/ARM/GlobalISel/thumb-select-globals-pic.mir [new file with mode: 0644]
test/CodeGen/ARM/GlobalISel/thumb-select-globals-ropi-rwpi.mir [new file with mode: 0644]
test/CodeGen/ARM/GlobalISel/thumb-select-globals-static.mir [new file with mode: 0644]