Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 08a8edb

Browse files
committed
ARM: constrain Thumb LDRLIT pseudo-instructions to r0-r7.
Previously we only used GPR for the destination placeholder in "ldr rD, [pc, incorrect codegen under the integrated assembler. This should fix both issues (which probably only affect MachO targets at the moment). rdar://problem/15800156 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199108 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent f712548 commit 08a8edb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/Target/ARM/ARMInstrThumb.td

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,14 +1312,15 @@ def : T1Pat<(subc tGPR:$lhs, tGPR:$rhs),
13121312
def : T1Pat<(ARMWrapper tconstpool :$dst), (tLEApcrel tconstpool :$dst)>;
13131313

13141314
// GlobalAddress
1315-
def tLDRLIT_ga_pcrel : PseudoInst<(outs GPR:$dst), (ins i32imm:$addr),
1315+
def tLDRLIT_ga_pcrel : PseudoInst<(outs tGPR:$dst), (ins i32imm:$addr),
13161316
IIC_iLoadiALU,
1317-
[(set GPR:$dst,
1317+
[(set tGPR:$dst,
13181318
(ARMWrapperPIC tglobaladdr:$addr))]>,
13191319
Requires<[IsThumb, DontUseMovt]>;
13201320

1321-
def tLDRLIT_ga_abs : PseudoInst<(outs GPR:$dst), (ins i32imm:$src), IIC_iLoad_i,
1322-
[(set GPR:$dst,
1321+
def tLDRLIT_ga_abs : PseudoInst<(outs tGPR:$dst), (ins i32imm:$src),
1322+
IIC_iLoad_i,
1323+
[(set tGPR:$dst,
13231324
(ARMWrapper tglobaladdr:$src))]>,
13241325
Requires<[IsThumb, DontUseMovt]>;
13251326

0 commit comments

Comments
 (0)