[llvm] r327503 - [AArch64] Don't produce R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC
Martin Storsjo via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 14 06:09:10 PDT 2018
Author: mstorsjo
Date: Wed Mar 14 06:09:10 2018
New Revision: 327503
URL: http://llvm.org/viewvc/llvm-project?rev=327503&view=rev
Log:
[AArch64] Don't produce R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC
Support for this relocation is missing in both LLD and GNU binutils
at the moment.
This reverts the ELF parts of SVN r327316.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/trunk/test/CodeGen/AArch64/arm64-tls-execs.ll
Modified: llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp?rev=327503&r1=327502&r2=327503&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp Wed Mar 14 06:09:10 2018
@@ -3918,7 +3918,10 @@ AArch64TargetLowering::LowerELFGlobalTLS
DAG.getTargetConstant(0, DL, MVT::i32)),
0);
SDValue TPWithOff =
- DAG.getNode(AArch64ISD::ADDlow, DL, PtrVT, TPWithOff_lo, LoVar);
+ SDValue(DAG.getMachineNode(AArch64::ADDXri, DL, PtrVT, TPWithOff_lo,
+ LoVar,
+ DAG.getTargetConstant(0, DL, MVT::i32)),
+ 0);
return TPWithOff;
} else if (Model == TLSModel::InitialExec) {
TPOff = DAG.getTargetGlobalAddress(GV, DL, PtrVT, 0, AArch64II::MO_TLS);
@@ -3955,7 +3958,9 @@ AArch64TargetLowering::LowerELFGlobalTLS
TPOff = SDValue(DAG.getMachineNode(AArch64::ADDXri, DL, PtrVT, TPOff, HiVar,
DAG.getTargetConstant(0, DL, MVT::i32)),
0);
- TPOff = DAG.getNode(AArch64ISD::ADDlow, DL, PtrVT, TPOff, LoVar);
+ TPOff = SDValue(DAG.getMachineNode(AArch64::ADDXri, DL, PtrVT, TPOff, LoVar,
+ DAG.getTargetConstant(0, DL, MVT::i32)),
+ 0);
} else if (Model == TLSModel::GeneralDynamic) {
// The call needs a relocation too for linker relaxation. It doesn't make
// sense to call it MO_PAGE or MO_PAGEOFF though so we need another copy of
Modified: llvm/trunk/test/CodeGen/AArch64/arm64-tls-execs.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/arm64-tls-execs.ll?rev=327503&r1=327502&r2=327503&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/arm64-tls-execs.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/arm64-tls-execs.ll Wed Mar 14 06:09:10 2018
@@ -40,10 +40,11 @@ define i32 @test_local_exec() {
; CHECK: mrs x[[R1:[0-9]+]], TPIDR_EL0
; CHECK: add x[[R2:[0-9]+]], x[[R1]], :tprel_hi12:local_exec_var
-; CHECK: ldr w0, [x[[R2]], :tprel_lo12_nc:local_exec_var]
+; CHECK: add x[[R3:[0-9]+]], x[[R2]], :tprel_lo12_nc:local_exec_var
+; CHECK: ldr w0, [x[[R3]]]
; CHECK-RELOC: R_AARCH64_TLSLE_ADD_TPREL_HI12
-; CHECK-RELOC: R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC
+; CHECK-RELOC: R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
ret i32 %val
}
More information about the llvm-commits
mailing list