diff options
| author | Guozhi Wei <carrot@google.com> | 2018-01-16 19:28:50 +0000 |
|---|---|---|
| committer | Guozhi Wei <carrot@google.com> | 2018-01-16 19:28:50 +0000 |
| commit | e6fb4e1f8ab3c76cbded23fbebdaec969205031f (patch) | |
| tree | 4705f366087fb5c15e2c6e5aea66e1c48bb53608 /llvm/lib/Target | |
| parent | 62003fbb024862a67837f963c2ac157850848af7 (diff) | |
| download | bcm5719-llvm-e6fb4e1f8ab3c76cbded23fbebdaec969205031f.tar.gz bcm5719-llvm-e6fb4e1f8ab3c76cbded23fbebdaec969205031f.zip | |
[PPC] Add a new register XER aliased to CARRY
When "xer" is specified as clobbered register in inline assembler, clang can accept it, but llvm simply ignore it when lowered to machine instructions. It may cause problems later in scheduler.
This patch adds a new register XER aliased to CARRY, and adds it to register class CARRYRC. Now PPCTargetLowering::getRegForInlineAsmConstraint can return correct register number for inline asm constraint "{xer}", and scheduler behave correctly.
Differential Revision: https://reviews.llvm.org/D41967
llvm-svn: 322591
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCRegisterInfo.td | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCRegisterInfo.td b/llvm/lib/Target/PowerPC/PPCRegisterInfo.td index f7807907bd6..cd82faf3f58 100644 --- a/llvm/lib/Target/PowerPC/PPCRegisterInfo.td +++ b/llvm/lib/Target/PowerPC/PPCRegisterInfo.td @@ -208,10 +208,14 @@ def CTR8 : SPR<9, "ctr">, DwarfRegNum<[66, -2]>; // VRsave register def VRSAVE: SPR<256, "vrsave">, DwarfRegNum<[109]>; +def XER: SPR<1, "xer">, DwarfRegNum<[76]>; + // Carry bit. In the architecture this is really bit 0 of the XER register // (which really is SPR register 1); this is the only bit interesting to a // compiler. -def CARRY: SPR<1, "ca">, DwarfRegNum<[76]>; +def CARRY: SPR<1, "xer">, DwarfRegNum<[76]> { + let Aliases = [XER]; +} // FP rounding mode: bits 30 and 31 of the FP status and control register // This is not allocated as a normal register; it appears only in @@ -351,7 +355,7 @@ def CTRRC8 : RegisterClass<"PPC", [i64], 64, (add CTR8)> { } def VRSAVERC : RegisterClass<"PPC", [i32], 32, (add VRSAVE)>; -def CARRYRC : RegisterClass<"PPC", [i32], 32, (add CARRY)> { +def CARRYRC : RegisterClass<"PPC", [i32], 32, (add CARRY, XER)> { let CopyCost = -1; } |

