OSDN Git Service

[ARM] GlobalISel: Select globals in PIC mode
authorDiana Picus <diana.picus@linaro.org>
Tue, 29 Aug 2017 09:47:55 +0000 (09:47 +0000)
committerDiana Picus <diana.picus@linaro.org>
Tue, 29 Aug 2017 09:47:55 +0000 (09:47 +0000)
commitd29af7c957776f9800ebc2e8bddf966ea00b215d
treecd07dd2c9c19e55d874f0c5631019af1390cf700
parent86e510258a9c1605741f6170bbd3626672cc7d7a
[ARM] GlobalISel: Select globals in PIC mode

Support the selection of G_GLOBAL_VALUE in the PIC relocation model. For
simplicity we use the same pseudoinstructions for both Darwin and ELF:
(MOV|LDRLIT)_ga_pcrel(_ldr).

This is new for ELF, so it requires a small update to the ARM pseudo
expansion pass to make sure it adds the correct constant pool modifier
and add-current-address in the case of ELF.

Differential Revision: https://reviews.llvm.org/D36507

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311992 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMExpandPseudoInsts.cpp
lib/Target/ARM/ARMInstructionSelector.cpp
lib/Target/ARM/ARMSubtarget.cpp
lib/Target/ARM/ARMSubtarget.h
test/CodeGen/ARM/GlobalISel/arm-isel-globals-pic.ll [new file with mode: 0644]
test/CodeGen/ARM/GlobalISel/arm-select-globals-pic.mir [new file with mode: 0644]
test/CodeGen/ARM/GlobalISel/arm-unsupported.ll