diff options
author | John Brawn <john.brawn@arm.com> | 2017-05-15 11:57:54 +0000 |
---|---|---|
committer | John Brawn <john.brawn@arm.com> | 2017-05-15 11:57:54 +0000 |
commit | 9486becf09fd8ca849066bf70f9cbb0bb3716181 (patch) | |
tree | cd84c44d4d4f95e76611515b5a523a9b7d3ffec7 /llvm/lib/Target/ARM | |
parent | 43132c46a6ca95feb959377a50e74acd8b0125c9 (diff) | |
download | bcm5719-llvm-9486becf09fd8ca849066bf70f9cbb0bb3716181.tar.gz bcm5719-llvm-9486becf09fd8ca849066bf70f9cbb0bb3716181.zip |
[ARM] Mark LEApcrel instructions as isAsCheapAsAMove
Doing this means that if an LEApcrel is used in two places we will rematerialize
instead of generating two MOVs. This is particularly useful for printfs using
the same format string, where we want to generate an address into a register
that's going to get corrupted by the call.
Differential Revision: https://reviews.llvm.org/D32858
llvm-svn: 303054
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r-- | llvm/lib/Target/ARM/ARMInstrInfo.td | 2 | ||||
-rw-r--r-- | llvm/lib/Target/ARM/ARMInstrThumb.td | 2 | ||||
-rw-r--r-- | llvm/lib/Target/ARM/ARMInstrThumb2.td | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ARMInstrInfo.td b/llvm/lib/Target/ARM/ARMInstrInfo.td index 9e33f5ced87..5b7666af876 100644 --- a/llvm/lib/Target/ARM/ARMInstrInfo.td +++ b/llvm/lib/Target/ARM/ARMInstrInfo.td @@ -2222,7 +2222,7 @@ def ADR : AI1<{0,?,?,0}, (outs GPR:$Rd), (ins adrlabel:$label), let Inst{11-0} = label{11-0}; } -let hasSideEffects = 0, isReMaterializable = 1 in +let hasSideEffects = 0, isReMaterializable = 1, isAsCheapAsAMove = 1 in def LEApcrel : ARMPseudoInst<(outs GPR:$Rd), (ins i32imm:$label, pred:$p), 4, IIC_iALUi, []>, Sched<[WriteALU, ReadALU]>; diff --git a/llvm/lib/Target/ARM/ARMInstrThumb.td b/llvm/lib/Target/ARM/ARMInstrThumb.td index bee83dfb6f6..118627fd5d7 100644 --- a/llvm/lib/Target/ARM/ARMInstrThumb.td +++ b/llvm/lib/Target/ARM/ARMInstrThumb.td @@ -1402,7 +1402,7 @@ def tADR : T1I<(outs tGPR:$Rd), (ins t_adrlabel:$addr, pred:$p), let DecoderMethod = "DecodeThumbAddSpecialReg"; } -let hasSideEffects = 0, isReMaterializable = 1 in +let hasSideEffects = 0, isReMaterializable = 1, isAsCheapAsAMove = 1 in def tLEApcrel : tPseudoInst<(outs tGPR:$Rd), (ins i32imm:$label, pred:$p), 2, IIC_iALUi, []>, Sched<[WriteALU]>; diff --git a/llvm/lib/Target/ARM/ARMInstrThumb2.td b/llvm/lib/Target/ARM/ARMInstrThumb2.td index bf3d820e7b7..842c46cc2b6 100644 --- a/llvm/lib/Target/ARM/ARMInstrThumb2.td +++ b/llvm/lib/Target/ARM/ARMInstrThumb2.td @@ -1227,7 +1227,7 @@ def t2ADR : T2PCOneRegImm<(outs rGPR:$Rd), let DecoderMethod = "DecodeT2Adr"; } -let hasSideEffects = 0, isReMaterializable = 1 in +let hasSideEffects = 0, isReMaterializable = 1, isAsCheapAsAMove = 1 in def t2LEApcrel : t2PseudoInst<(outs rGPR:$Rd), (ins i32imm:$label, pred:$p), 4, IIC_iALUi, []>, Sched<[WriteALU, ReadALU]>; let hasSideEffects = 1 in |