mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 00:17:01 +00:00
[PowerPC] Fix reverted patch r227976 to avoid register assignment issues
See full discussion in http://reviews.llvm.org/D7491. We now hide the add-immediate and call instructions together in a separate pseudo-op, which is tagged to define GPR3 and clobber the call-killed registers. The PPCTLSDynamicCall pass prior to RA now expands this op into the two separate addi and call ops, with explicit definitions of GPR3 on both instructions, and explicit clobbers on the call instruction. The pass is now marked as requiring and preserving the LiveIntervals and SlotIndexes analyses, and fixes these up after the replacement sequences are introduced. Self-hosting has been verified on LE P8 and BE P7 with various optimization levels, etc. It has also been verified with the --no-tls-optimize flag workaround removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228725 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -101,10 +101,6 @@ namespace llvm {
|
||||
/// SVR4 calls.
|
||||
CALL, CALL_NOP,
|
||||
|
||||
/// CALL_TLS and CALL_NOP_TLS - Versions of CALL and CALL_NOP used
|
||||
/// to access TLS variables.
|
||||
CALL_TLS, CALL_NOP_TLS,
|
||||
|
||||
/// CHAIN,FLAG = MTCTR(VAL, CHAIN[, INFLAG]) - Directly corresponds to a
|
||||
/// MTCTR instruction.
|
||||
MTCTR,
|
||||
@@ -223,26 +219,46 @@ namespace llvm {
|
||||
/// register to sym\@got\@tlsgd\@ha.
|
||||
ADDIS_TLSGD_HA,
|
||||
|
||||
/// G8RC = ADDI_TLSGD_L G8RReg, Symbol - For the general-dynamic TLS
|
||||
/// %X3 = ADDI_TLSGD_L G8RReg, Symbol - For the general-dynamic TLS
|
||||
/// model, produces an ADDI8 instruction that adds G8RReg to
|
||||
/// sym\@got\@tlsgd\@l.
|
||||
/// sym\@got\@tlsgd\@l and stores the result in X3. Hidden by
|
||||
/// ADDIS_TLSGD_L_ADDR until after register assignment.
|
||||
ADDI_TLSGD_L,
|
||||
|
||||
/// %X3 = GET_TLS_ADDR %X3, Symbol - For the general-dynamic TLS
|
||||
/// model, produces a call to __tls_get_addr(sym\@tlsgd). Hidden by
|
||||
/// ADDIS_TLSGD_L_ADDR until after register assignment.
|
||||
GET_TLS_ADDR,
|
||||
|
||||
/// G8RC = ADDI_TLSGD_L_ADDR G8RReg, Symbol, Symbol - Op that
|
||||
/// combines ADDI_TLSGD_L and GET_TLS_ADDR until expansion following
|
||||
/// register assignment.
|
||||
ADDI_TLSGD_L_ADDR,
|
||||
|
||||
/// G8RC = ADDIS_TLSLD_HA %X2, Symbol - For the local-dynamic TLS
|
||||
/// model, produces an ADDIS8 instruction that adds the GOT base
|
||||
/// register to sym\@got\@tlsld\@ha.
|
||||
ADDIS_TLSLD_HA,
|
||||
|
||||
/// G8RC = ADDI_TLSLD_L G8RReg, Symbol - For the local-dynamic TLS
|
||||
/// %X3 = ADDI_TLSLD_L G8RReg, Symbol - For the local-dynamic TLS
|
||||
/// model, produces an ADDI8 instruction that adds G8RReg to
|
||||
/// sym\@got\@tlsld\@l.
|
||||
/// sym\@got\@tlsld\@l and stores the result in X3. Hidden by
|
||||
/// ADDIS_TLSLD_L_ADDR until after register assignment.
|
||||
ADDI_TLSLD_L,
|
||||
|
||||
/// G8RC = ADDIS_DTPREL_HA %X3, Symbol, Chain - For the
|
||||
/// local-dynamic TLS model, produces an ADDIS8 instruction
|
||||
/// that adds X3 to sym\@dtprel\@ha. The Chain operand is needed
|
||||
/// to tie this in place following a copy to %X3 from the result
|
||||
/// of a GET_TLSLD_ADDR.
|
||||
/// %X3 = GET_TLSLD_ADDR %X3, Symbol - For the local-dynamic TLS
|
||||
/// model, produces a call to __tls_get_addr(sym\@tlsld). Hidden by
|
||||
/// ADDIS_TLSLD_L_ADDR until after register assignment.
|
||||
GET_TLSLD_ADDR,
|
||||
|
||||
/// G8RC = ADDI_TLSLD_L_ADDR G8RReg, Symbol, Symbol - Op that
|
||||
/// combines ADDI_TLSLD_L and GET_TLSLD_ADDR until expansion
|
||||
/// following register assignment.
|
||||
ADDI_TLSLD_L_ADDR,
|
||||
|
||||
/// G8RC = ADDIS_DTPREL_HA %X3, Symbol - For the local-dynamic TLS
|
||||
/// model, produces an ADDIS8 instruction that adds X3 to
|
||||
/// sym\@dtprel\@ha.
|
||||
ADDIS_DTPREL_HA,
|
||||
|
||||
/// G8RC = ADDI_DTPREL_L G8RReg, Symbol - For the local-dynamic TLS
|
||||
@@ -635,8 +651,6 @@ namespace llvm {
|
||||
SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const;
|
||||
SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG) const;
|
||||
SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const;
|
||||
std::pair<SDValue,SDValue> lowerTLSCall(SDValue Op, SDLoc dl,
|
||||
SelectionDAG &DAG) const;
|
||||
SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
|
||||
SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
|
||||
SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG) const;
|
||||
|
||||
Reference in New Issue
Block a user