Skip to content

Commit 9b06294

Browse files
author
git apple-llvm automerger
committed
Merge commit '88736f5944a0' from llvm.org/main into next
2 parents ad0380c + 88736f5 commit 9b06294

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

llvm/lib/Target/BPF/BTFDebug.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,17 +1542,12 @@ bool BTFDebug::InstLower(const MachineInstr *MI, MCInst &OutMI) {
15421542
const GlobalValue *GVal = MO.getGlobal();
15431543
auto *GVar = dyn_cast<GlobalVariable>(GVal);
15441544
if (GVar) {
1545-
// Emit "mov ri, <imm>"
1546-
int64_t Imm;
1547-
uint32_t Reloc;
1548-
if (GVar->hasAttribute(BPFCoreSharedInfo::AmaAttr) ||
1549-
GVar->hasAttribute(BPFCoreSharedInfo::TypeIdAttr)) {
1550-
Imm = PatchImms[GVar].first;
1551-
Reloc = PatchImms[GVar].second;
1552-
} else {
1545+
if (!GVar->hasAttribute(BPFCoreSharedInfo::AmaAttr) &&
1546+
!GVar->hasAttribute(BPFCoreSharedInfo::TypeIdAttr))
15531547
return false;
1554-
}
15551548

1549+
// Emit "mov ri, <imm>"
1550+
auto [Imm, Reloc] = PatchImms[GVar];
15561551
if (Reloc == BTF::ENUM_VALUE_EXISTENCE || Reloc == BTF::ENUM_VALUE ||
15571552
Reloc == BTF::BTF_TYPE_ID_LOCAL || Reloc == BTF::BTF_TYPE_ID_REMOTE)
15581553
OutMI.setOpcode(BPF::LD_imm64);

0 commit comments

Comments
 (0)