[lld] r272915 - Early return. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 16 09:40:36 PDT 2016
Author: ruiu
Date: Thu Jun 16 11:40:36 2016
New Revision: 272915
URL: http://llvm.org/viewvc/llvm-project?rev=272915&view=rev
Log:
Early return. NFC.
Modified:
lld/trunk/ELF/Target.cpp
Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=272915&r1=272914&r2=272915&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Thu Jun 16 11:40:36 2016
@@ -1414,20 +1414,19 @@ void AArch64TargetInfo::relaxTlsIeToLe(u
uint64_t Val) const {
checkUInt<32>(Val, Type);
- uint32_t Inst = read32le(Loc);
- uint32_t NewInst;
if (Type == R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21) {
- // Generate movz.
- unsigned RegNo = (Inst & 0x1f);
- NewInst = (0xd2a00000 | RegNo) | (((Val >> 16) & 0xffff) << 5);
- } else if (Type == R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC) {
- // Generate movk
- unsigned RegNo = (Inst & 0x1f);
- NewInst = (0xf2800000 | RegNo) | ((Val & 0xffff) << 5);
- } else {
- llvm_unreachable("invalid Relocation for TLS IE to LE Relax");
+ // Generate MOVZ.
+ uint32_t RegNo = read32le(Loc) & 0x1f;
+ write32le(Loc, (0xd2a00000 | RegNo) | (((Val >> 16) & 0xffff) << 5));
+ return;
}
- write32le(Loc, NewInst);
+ if (Type == R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC) {
+ // Generate MOVK.
+ uint32_t RegNo = read32le(Loc) & 0x1f;
+ write32le(Loc, (0xf2800000 | RegNo) | ((Val & 0xffff) << 5));
+ return;
+ }
+ llvm_unreachable("invalid relocation for TLS IE to LE relaxation");
}
// Implementing relocations for AMDGPU is low priority since most
More information about the llvm-commits
mailing list