Skip to content

Commit dcdbcdd

Browse files
committed
Address review comments
1 parent 2790df9 commit dcdbcdd

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2739,10 +2739,9 @@ void AArch64AsmPrinter::emitInstruction(const MachineInstr *MI) {
27392739
/// (TPIDR_EL0 offset now in x0)
27402740
const MachineOperand &MO_Sym = MI->getOperand(0);
27412741
MachineOperand MO_TLSDESC_LO12(MO_Sym), MO_TLSDESC(MO_Sym);
2742-
MCOperand Sym, SymTLSDescLo12, SymTLSDesc;
2742+
MCOperand SymTLSDescLo12, SymTLSDesc;
27432743
MO_TLSDESC_LO12.setTargetFlags(AArch64II::MO_TLS | AArch64II::MO_PAGEOFF);
27442744
MO_TLSDESC.setTargetFlags(AArch64II::MO_TLS | AArch64II::MO_PAGE);
2745-
MCInstLowering.lowerOperand(MO_Sym, Sym);
27462745
MCInstLowering.lowerOperand(MO_TLSDESC_LO12, SymTLSDescLo12);
27472746
MCInstLowering.lowerOperand(MO_TLSDESC, SymTLSDesc);
27482747

@@ -2768,7 +2767,7 @@ void AArch64AsmPrinter::emitInstruction(const MachineInstr *MI) {
27682767
Add.addOperand(MCOperand::createImm(AArch64_AM::getShiftValue(0)));
27692768
EmitToStreamer(*OutStreamer, Add);
27702769

2771-
// Authenticated TLSDESC accesses are not relatex.
2770+
// Authenticated TLSDESC accesses are not relaxed.
27722771
// Thus, do not emit .tlsdesccall for AUTH TLSDESC.
27732772

27742773
MCInst Blraa;

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10143,11 +10143,9 @@ AArch64TargetLowering::LowerELFGlobalTLSAddress(SDValue Op,
1014310143
AArch64FunctionInfo *MFI =
1014410144
DAG.getMachineFunction().getInfo<AArch64FunctionInfo>();
1014510145

10146-
TLSModel::Model Model;
10147-
if (MFI->hasELFSignedGOT())
10148-
Model = TLSModel::GeneralDynamic;
10149-
else
10150-
Model = getTargetMachine().getTLSModel(GA->getGlobal());
10146+
TLSModel::Model Model = MFI->hasELFSignedGOT()
10147+
? TLSModel::GeneralDynamic
10148+
: getTargetMachine().getTLSModel(GA->getGlobal());
1015110149

1015210150
if (!EnableAArch64ELFLocalDynamicTLSGeneration) {
1015310151
if (Model == TLSModel::LocalDynamic)

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,6 @@ def SDT_AArch64stnp : SDTypeProfile<0, 3, [SDTCisVT<0, v4i32>, SDTCisSameAs<0, 1
498498
// number of operands (the variable)
499499
def SDT_AArch64TLSDescCallSeq : SDTypeProfile<0,1,
500500
[SDTCisPtrTy<0>]>;
501-
def SDT_AArch64TLSDescAuthCallSeq : SDTypeProfile<0,1,
502-
[SDTCisPtrTy<0>]>;
503501

504502
def SDT_AArch64WrapperLarge : SDTypeProfile<1, 4,
505503
[SDTCisVT<0, i64>, SDTCisVT<1, i32>,
@@ -886,9 +884,8 @@ def AArch64tlsdesc_callseq : SDNode<"AArch64ISD::TLSDESC_CALLSEQ",
886884
[SDNPOutGlue, SDNPHasChain, SDNPVariadic]>;
887885

888886
def AArch64tlsdesc_auth_callseq : SDNode<"AArch64ISD::TLSDESC_AUTH_CALLSEQ",
889-
SDT_AArch64TLSDescAuthCallSeq,
890-
[SDNPInGlue, SDNPOutGlue, SDNPHasChain,
891-
SDNPVariadic]>;
887+
SDT_AArch64TLSDescCallSeq,
888+
[SDNPOutGlue, SDNPHasChain, SDNPVariadic]>;
892889

893890
def AArch64WrapperLarge : SDNode<"AArch64ISD::WrapperLarge",
894891
SDT_AArch64WrapperLarge>;

llvm/test/CodeGen/AArch64/ptrauth-arm64-tls-dynamics.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ define ptr @test_generaldynamic_addr() {
4646
; CHECK-OBJ-NOT: R_AARCH64_TLSDESC_CALL
4747
}
4848

49+
;; Note: with signed TLSDESC, general dynamic model is always used,
50+
;; even when local dynamic is requested.
51+
4952
@local_dynamic_var = external thread_local(localdynamic) global i32
5053

5154
define i32 @test_localdynamic() {

0 commit comments

Comments
 (0)