Skip to content

Commit dcf4856

Browse files
authored
MC: Centralize X86 PC-relative fixup adjustment in MCAssembler
Move the X86 PC-relative fixup adjustment from X86MCCodeEmitter::emitImmediate to MCAssembler, leveraging a generalized evaluateFixup. This saves a MCBinaryExpr. For `call foo`, the fixup expression is now `foo` instead of `foo-4`. There is no change in generated relocations. In bolt/lib/Target/X86/X86MCPlusBuilder.cpp, createRelocation needs to decrease the addend. Both max-rss and instructions:u show a minor decrease. https://llvm-compile-time-tracker.com/compare.php?from=ea600576a6f94d6f28925c4b99962cc26b463c29&to=016e8fd4ddf851e5555f606c6394241d68f1a7bb&stat=max-rss&linkStats=on Next: Update targets that use FKF_IsAlignedDownTo32Bits to define `evaluateFixup` and remove FKF_IsAlignedDownTo32Bits from the generic code. Pull Request: #147113
1 parent 708c0fe commit dcf4856

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+874
-848
lines changed

bolt/lib/Target/X86/X86MCPlusBuilder.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,6 +2441,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
24412441

24422442
assert(FKI.TargetOffset == 0 && "0-bit relocation offset expected");
24432443
const uint64_t RelOffset = Fixup.getOffset();
2444+
auto [RelSymbol, RelAddend] = extractFixupExpr(Fixup);
24442445

24452446
uint32_t RelType;
24462447
if (Fixup.isPCRel()) {
@@ -2452,6 +2453,9 @@ class X86MCPlusBuilder : public MCPlusBuilder {
24522453
case 32: RelType = ELF::R_X86_64_PC32; break;
24532454
case 64: RelType = ELF::R_X86_64_PC64; break;
24542455
}
2456+
// Adjust PC-relative fixup offsets, which are calculated from the start
2457+
// of the next instruction.
2458+
RelAddend -= FKI.TargetSize / 8;
24552459
} else {
24562460
switch (FKI.TargetSize) {
24572461
default:
@@ -2463,8 +2467,6 @@ class X86MCPlusBuilder : public MCPlusBuilder {
24632467
}
24642468
}
24652469

2466-
auto [RelSymbol, RelAddend] = extractFixupExpr(Fixup);
2467-
24682470
return Relocation({RelOffset, RelSymbol, RelType, RelAddend, 0});
24692471
}
24702472

llvm/include/llvm/MC/MCValue.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class MCValue {
4242
friend class MCExpr;
4343
MCValue() = default;
4444
int64_t getConstant() const { return Cst; }
45+
void setConstant(int64_t C) { Cst = C; }
4546
uint32_t getSpecifier() const { return Specifier; }
4647
void setSpecifier(uint32_t S) { Specifier = S; }
4748

llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ class X86AsmBackend : public MCAsmBackend {
168168

169169
MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const override;
170170

171-
bool shouldForceRelocation(const MCFixup &, const MCValue &);
172-
171+
std::optional<bool> evaluateFixup(const MCFragment &, MCFixup &, MCValue &,
172+
uint64_t &) override;
173173
void applyFixup(const MCFragment &, const MCFixup &, const MCValue &Target,
174174
MutableArrayRef<char> Data, uint64_t Value,
175175
bool IsResolved) override;
@@ -678,6 +678,37 @@ static unsigned getFixupKindSize(unsigned Kind) {
678678
}
679679
}
680680

681+
constexpr char GotSymName[] = "_GLOBAL_OFFSET_TABLE_";
682+
683+
// Adjust PC-relative fixup offsets, which are calculated from the start of the
684+
// next instruction.
685+
std::optional<bool> X86AsmBackend::evaluateFixup(const MCFragment &,
686+
MCFixup &Fixup,
687+
MCValue &Target, uint64_t &) {
688+
if (Fixup.isPCRel()) {
689+
switch (Fixup.getTargetKind()) {
690+
case FK_Data_1:
691+
Target.setConstant(Target.getConstant() - 1);
692+
break;
693+
case FK_Data_2:
694+
Target.setConstant(Target.getConstant() - 2);
695+
break;
696+
default: {
697+
Target.setConstant(Target.getConstant() - 4);
698+
auto *Add = Target.getAddSym();
699+
// If this is a pc-relative load off _GLOBAL_OFFSET_TABLE_:
700+
// leaq _GLOBAL_OFFSET_TABLE_(%rip), %r15
701+
// this needs to be a GOTPC32 relocation.
702+
if (Add && Add->getName() == GotSymName)
703+
Fixup = MCFixup::create(Fixup.getOffset(), Fixup.getValue(),
704+
X86::reloc_global_offset_table);
705+
} break;
706+
}
707+
}
708+
// Use default handling for `Value` and `IsResolved`.
709+
return {};
710+
}
711+
681712
void X86AsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
682713
const MCValue &Target,
683714
MutableArrayRef<char> Data, uint64_t Value,

llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,9 @@ enum GlobalOffsetTableExprKind { GOT_None, GOT_Normal, GOT_SymDiff };
470470
/// ELF i386 as _GLOBAL_OFFSET_TABLE_ is magical. We check only simple case that
471471
/// are know to be used: _GLOBAL_OFFSET_TABLE_ by itself or at the start of a
472472
/// binary expression.
473+
///
474+
/// TODO: Move this to X86AsmBackend.cpp at relocation decision phase so that we
475+
/// don't have to mess with MCExpr.
473476
static GlobalOffsetTableExprKind
474477
startsWithGlobalOffsetTable(const MCExpr *Expr) {
475478
const MCExpr *RHS = nullptr;
@@ -587,22 +590,11 @@ void X86MCCodeEmitter::emitImmediate(const MCOperand &DispOp, SMLoc Loc,
587590
}
588591
}
589592

590-
// If the fixup is pc-relative, we need to bias the value to be relative to
591-
// the start of the field, not the end of the field.
592-
if (PCRel) {
593-
ImmOffset -= Size;
594-
// If this is a pc-relative load off _GLOBAL_OFFSET_TABLE_:
595-
// leaq _GLOBAL_OFFSET_TABLE_(%rip), %r15
596-
// this needs to be a GOTPC32 relocation.
597-
if (Size == 4 && startsWithGlobalOffsetTable(Expr) != GOT_None)
598-
FixupKind = X86::reloc_global_offset_table;
599-
}
600-
601593
if (ImmOffset)
602594
Expr = MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(ImmOffset, Ctx),
603595
Ctx, Expr->getLoc());
604596

605-
// Emit a symbolic constant as a fixup and 4 zeros.
597+
// Emit a symbolic constant as a fixup and a few zero bytes.
606598
Fixups.push_back(MCFixup::create(static_cast<uint32_t>(CB.size() - StartByte),
607599
Expr, FixupKind, PCRel));
608600
emitConstant(0, Size, CB);

llvm/test/CodeGen/X86/AMX/amx-lower-tile-copy.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ define dso_local void @test1(ptr%buf) nounwind {
8787
; EGPR-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
8888
; EGPR-NEXT: testb %al, %al # encoding: [0x84,0xc0]
8989
; EGPR-NEXT: jne .LBB0_3 # encoding: [0x75,A]
90-
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_3-1, kind: FK_PCRel_1
90+
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_3, kind: FK_PCRel_1
9191
; EGPR-NEXT: # %bb.1: # %loop.header.preheader
9292
; EGPR-NEXT: movq %rdi, %rbx # encoding: [0x48,0x89,0xfb]
9393
; EGPR-NEXT: xorl %r14d, %r14d # encoding: [0x45,0x31,0xf6]
@@ -100,7 +100,7 @@ define dso_local void @test1(ptr%buf) nounwind {
100100
; EGPR-NEXT: # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7a,0x4b,0x9c,0x04,0xd0,0x0b,0x00,0x00]
101101
; EGPR-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
102102
; EGPR-NEXT: callq foo # encoding: [0xe8,A,A,A,A]
103-
; EGPR-NEXT: # fixup A - offset: 1, value: foo-4, kind: reloc_branch_4byte_pcrel
103+
; EGPR-NEXT: # fixup A - offset: 1, value: foo, kind: reloc_branch_4byte_pcrel
104104
; EGPR-NEXT: ldtilecfg {{[0-9]+}}(%rsp) # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x78,0x49,0x84,0x24,0xc0,0x03,0x00,0x00]
105105
; EGPR-NEXT: movabsq $64, %rax # encoding: [0x48,0xb8,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
106106
; EGPR-NEXT: tileloadd 3024(%rsp,%rax), %tmm3 # 1024-byte Folded Reload
@@ -116,7 +116,7 @@ define dso_local void @test1(ptr%buf) nounwind {
116116
; EGPR-NEXT: incl %r14d # encoding: [0x41,0xff,0xc6]
117117
; EGPR-NEXT: cmpw $100, %r14w # encoding: [0x66,0x41,0x83,0xfe,0x64]
118118
; EGPR-NEXT: jl .LBB0_2 # encoding: [0x7c,A]
119-
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_2-1, kind: FK_PCRel_1
119+
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_2, kind: FK_PCRel_1
120120
; EGPR-NEXT: .LBB0_3: # %exit
121121
; EGPR-NEXT: addq $4056, %rsp # encoding: [0x48,0x81,0xc4,0xd8,0x0f,0x00,0x00]
122122
; EGPR-NEXT: # imm = 0xFD8
@@ -226,7 +226,7 @@ define dso_local void @test2(ptr%buf) nounwind {
226226
; EGPR-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
227227
; EGPR-NEXT: testb %al, %al # encoding: [0x84,0xc0]
228228
; EGPR-NEXT: jne .LBB1_3 # encoding: [0x75,A]
229-
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_3-1, kind: FK_PCRel_1
229+
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_3, kind: FK_PCRel_1
230230
; EGPR-NEXT: # %bb.1: # %loop.header.preheader
231231
; EGPR-NEXT: movq %rdi, %rbx # encoding: [0x48,0x89,0xfb]
232232
; EGPR-NEXT: xorl %r14d, %r14d # encoding: [0x45,0x31,0xf6]
@@ -237,7 +237,7 @@ define dso_local void @test2(ptr%buf) nounwind {
237237
; EGPR-NEXT: tilezero %tmm0 # encoding: [0xc4,0xe2,0x7b,0x49,0xc0]
238238
; EGPR-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
239239
; EGPR-NEXT: callq foo # encoding: [0xe8,A,A,A,A]
240-
; EGPR-NEXT: # fixup A - offset: 1, value: foo-4, kind: reloc_branch_4byte_pcrel
240+
; EGPR-NEXT: # fixup A - offset: 1, value: foo, kind: reloc_branch_4byte_pcrel
241241
; EGPR-NEXT: ldtilecfg {{[0-9]+}}(%rsp) # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x78,0x49,0x44,0x24,0x08]
242242
; EGPR-NEXT: tilezero %tmm2 # encoding: [0xc4,0xe2,0x7b,0x49,0xd0]
243243
; EGPR-NEXT: tileloadd (%rbx,%r15), %tmm0 # EVEX TO VEX Compression encoding: [0xc4,0xa2,0x7b,0x4b,0x04,0x3b]
@@ -247,7 +247,7 @@ define dso_local void @test2(ptr%buf) nounwind {
247247
; EGPR-NEXT: incl %r14d # encoding: [0x41,0xff,0xc6]
248248
; EGPR-NEXT: cmpw $100, %r14w # encoding: [0x66,0x41,0x83,0xfe,0x64]
249249
; EGPR-NEXT: jl .LBB1_2 # encoding: [0x7c,A]
250-
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_2-1, kind: FK_PCRel_1
250+
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_2, kind: FK_PCRel_1
251251
; EGPR-NEXT: .LBB1_3: # %exit
252252
; EGPR-NEXT: addq $72, %rsp # encoding: [0x48,0x83,0xc4,0x48]
253253
; EGPR-NEXT: popq %rbx # encoding: [0x5b]

llvm/test/CodeGen/X86/AMX/amx-spill-merge.ll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ define dso_local void @test_api(i16 signext %0, i16 signext %1) nounwind {
125125
; EGPR-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
126126
; EGPR-NEXT: testb %al, %al # encoding: [0x84,0xc0]
127127
; EGPR-NEXT: jne .LBB0_2 # encoding: [0x75,A]
128-
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_2-1, kind: FK_PCRel_1
128+
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_2, kind: FK_PCRel_1
129129
; EGPR-NEXT: # %bb.1: # %if.true
130130
; EGPR-NEXT: movl $buf, %eax # encoding: [0xb8,A,A,A,A]
131131
; EGPR-NEXT: # fixup A - offset: 1, value: buf, kind: FK_Data_4
@@ -143,13 +143,13 @@ define dso_local void @test_api(i16 signext %0, i16 signext %1) nounwind {
143143
; EGPR-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
144144
; EGPR-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
145145
; EGPR-NEXT: callq foo # encoding: [0xe8,A,A,A,A]
146-
; EGPR-NEXT: # fixup A - offset: 1, value: foo-4, kind: reloc_branch_4byte_pcrel
146+
; EGPR-NEXT: # fixup A - offset: 1, value: foo, kind: reloc_branch_4byte_pcrel
147147
; EGPR-NEXT: ldtilecfg (%rsp) # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x78,0x49,0x04,0x24]
148148
; EGPR-NEXT: movabsq $64, %rax # encoding: [0x48,0xb8,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
149149
; EGPR-NEXT: tileloadd 64(%rsp,%rax), %tmm6 # 1024-byte Folded Reload
150150
; EGPR-NEXT: # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7b,0x4b,0x74,0x04,0x40]
151151
; EGPR-NEXT: jmp .LBB0_3 # encoding: [0xeb,A]
152-
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_3-1, kind: FK_PCRel_1
152+
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB0_3, kind: FK_PCRel_1
153153
; EGPR-NEXT: .LBB0_2: # %if.false
154154
; EGPR-NEXT: movl $buf, %eax # encoding: [0xb8,A,A,A,A]
155155
; EGPR-NEXT: # fixup A - offset: 1, value: buf, kind: FK_Data_4
@@ -167,7 +167,7 @@ define dso_local void @test_api(i16 signext %0, i16 signext %1) nounwind {
167167
; EGPR-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
168168
; EGPR-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
169169
; EGPR-NEXT: callq foo # encoding: [0xe8,A,A,A,A]
170-
; EGPR-NEXT: # fixup A - offset: 1, value: foo-4, kind: reloc_branch_4byte_pcrel
170+
; EGPR-NEXT: # fixup A - offset: 1, value: foo, kind: reloc_branch_4byte_pcrel
171171
; EGPR-NEXT: ldtilecfg (%rsp) # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x78,0x49,0x04,0x24]
172172
; EGPR-NEXT: movabsq $64, %rax # encoding: [0x48,0xb8,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
173173
; EGPR-NEXT: tileloadd 64(%rsp,%rax), %tmm6 # 1024-byte Folded Reload
@@ -294,7 +294,7 @@ define dso_local void @test3(ptr%buf) nounwind {
294294
; EGPR-NEXT: xorl %eax, %eax # encoding: [0x31,0xc0]
295295
; EGPR-NEXT: testb %al, %al # encoding: [0x84,0xc0]
296296
; EGPR-NEXT: jne .LBB1_3 # encoding: [0x75,A]
297-
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_3-1, kind: FK_PCRel_1
297+
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_3, kind: FK_PCRel_1
298298
; EGPR-NEXT: # %bb.1: # %loop.header.preheader
299299
; EGPR-NEXT: movq %rdi, %rbx # encoding: [0x48,0x89,0xfb]
300300
; EGPR-NEXT: movl $32, %r14d # encoding: [0x41,0xbe,0x20,0x00,0x00,0x00]
@@ -307,7 +307,7 @@ define dso_local void @test3(ptr%buf) nounwind {
307307
; EGPR-NEXT: tilezero %tmm0 # encoding: [0xc4,0xe2,0x7b,0x49,0xc0]
308308
; EGPR-NEXT: vzeroupper # encoding: [0xc5,0xf8,0x77]
309309
; EGPR-NEXT: callq foo # encoding: [0xe8,A,A,A,A]
310-
; EGPR-NEXT: # fixup A - offset: 1, value: foo-4, kind: reloc_branch_4byte_pcrel
310+
; EGPR-NEXT: # fixup A - offset: 1, value: foo, kind: reloc_branch_4byte_pcrel
311311
; EGPR-NEXT: ldtilecfg {{[0-9]+}}(%rsp) # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x78,0x49,0x44,0x24,0x08]
312312
; EGPR-NEXT: tilezero %tmm0 # encoding: [0xc4,0xe2,0x7b,0x49,0xc0]
313313
; EGPR-NEXT: tileloadd (%rbx,%r14), %tmm1 # EVEX TO VEX Compression encoding: [0xc4,0xa2,0x7b,0x4b,0x0c,0x33]
@@ -318,7 +318,7 @@ define dso_local void @test3(ptr%buf) nounwind {
318318
; EGPR-NEXT: incl %r15d # encoding: [0x41,0xff,0xc7]
319319
; EGPR-NEXT: cmpw $100, %r15w # encoding: [0x66,0x41,0x83,0xff,0x64]
320320
; EGPR-NEXT: jl .LBB1_2 # encoding: [0x7c,A]
321-
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_2-1, kind: FK_PCRel_1
321+
; EGPR-NEXT: # fixup A - offset: 1, value: .LBB1_2, kind: FK_PCRel_1
322322
; EGPR-NEXT: .LBB1_3: # %exit
323323
; EGPR-NEXT: addq $72, %rsp # encoding: [0x48,0x83,0xc4,0x48]
324324
; EGPR-NEXT: popq %rbx # encoding: [0x5b]

llvm/test/CodeGen/X86/absolute-cmp.ll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ define void @foo8(i64 %val) {
1616
; NOPIC-NEXT: cmpq $cmp8@ABS8, %rdi # encoding: [0x48,0x83,0xff,A]
1717
; NOPIC-NEXT: # fixup A - offset: 3, value: cmp8@ABS8, kind: FK_Data_1
1818
; NOPIC-NEXT: ja .LBB0_2 # encoding: [0x77,A]
19-
; NOPIC-NEXT: # fixup A - offset: 1, value: .LBB0_2-1, kind: FK_PCRel_1
19+
; NOPIC-NEXT: # fixup A - offset: 1, value: .LBB0_2, kind: FK_PCRel_1
2020
; NOPIC-NEXT: # %bb.1: # %t
2121
; NOPIC-NEXT: pushq %rax # encoding: [0x50]
2222
; NOPIC-NEXT: .cfi_def_cfa_offset 16
2323
; NOPIC-NEXT: callq f@PLT # encoding: [0xe8,A,A,A,A]
24-
; NOPIC-NEXT: # fixup A - offset: 1, value: f@PLT-4, kind: FK_PCRel_4
24+
; NOPIC-NEXT: # fixup A - offset: 1, value: f@PLT, kind: FK_PCRel_4
2525
; NOPIC-NEXT: popq %rax # encoding: [0x58]
2626
; NOPIC-NEXT: .cfi_def_cfa_offset 8
2727
; NOPIC-NEXT: .LBB0_2: # %f
@@ -32,12 +32,12 @@ define void @foo8(i64 %val) {
3232
; PIC-NEXT: cmpq $cmp8@ABS8, %rdi # encoding: [0x48,0x83,0xff,A]
3333
; PIC-NEXT: # fixup A - offset: 3, value: cmp8@ABS8, kind: FK_Data_1
3434
; PIC-NEXT: ja .LBB0_2 # encoding: [0x77,A]
35-
; PIC-NEXT: # fixup A - offset: 1, value: .LBB0_2-1, kind: FK_PCRel_1
35+
; PIC-NEXT: # fixup A - offset: 1, value: .LBB0_2, kind: FK_PCRel_1
3636
; PIC-NEXT: # %bb.1: # %t
3737
; PIC-NEXT: pushq %rax # encoding: [0x50]
3838
; PIC-NEXT: .cfi_def_cfa_offset 16
3939
; PIC-NEXT: callq f@PLT # encoding: [0xe8,A,A,A,A]
40-
; PIC-NEXT: # fixup A - offset: 1, value: f@PLT-4, kind: FK_PCRel_4
40+
; PIC-NEXT: # fixup A - offset: 1, value: f@PLT, kind: FK_PCRel_4
4141
; PIC-NEXT: popq %rax # encoding: [0x58]
4242
; PIC-NEXT: .cfi_def_cfa_offset 8
4343
; PIC-NEXT: .LBB0_2: # %f
@@ -59,12 +59,12 @@ define void @foo32(i64 %val) {
5959
; NOPIC-NEXT: cmpq $cmp32, %rdi # encoding: [0x48,0x81,0xff,A,A,A,A]
6060
; NOPIC-NEXT: # fixup A - offset: 3, value: cmp32, kind: reloc_signed_4byte
6161
; NOPIC-NEXT: ja .LBB1_2 # encoding: [0x77,A]
62-
; NOPIC-NEXT: # fixup A - offset: 1, value: .LBB1_2-1, kind: FK_PCRel_1
62+
; NOPIC-NEXT: # fixup A - offset: 1, value: .LBB1_2, kind: FK_PCRel_1
6363
; NOPIC-NEXT: # %bb.1: # %t
6464
; NOPIC-NEXT: pushq %rax # encoding: [0x50]
6565
; NOPIC-NEXT: .cfi_def_cfa_offset 16
6666
; NOPIC-NEXT: callq f@PLT # encoding: [0xe8,A,A,A,A]
67-
; NOPIC-NEXT: # fixup A - offset: 1, value: f@PLT-4, kind: FK_PCRel_4
67+
; NOPIC-NEXT: # fixup A - offset: 1, value: f@PLT, kind: FK_PCRel_4
6868
; NOPIC-NEXT: popq %rax # encoding: [0x58]
6969
; NOPIC-NEXT: .cfi_def_cfa_offset 8
7070
; NOPIC-NEXT: .LBB1_2: # %f
@@ -75,12 +75,12 @@ define void @foo32(i64 %val) {
7575
; PIC-NEXT: cmpq $cmp32, %rdi # encoding: [0x48,0x81,0xff,A,A,A,A]
7676
; PIC-NEXT: # fixup A - offset: 3, value: cmp32, kind: reloc_signed_4byte
7777
; PIC-NEXT: ja .LBB1_2 # encoding: [0x77,A]
78-
; PIC-NEXT: # fixup A - offset: 1, value: .LBB1_2-1, kind: FK_PCRel_1
78+
; PIC-NEXT: # fixup A - offset: 1, value: .LBB1_2, kind: FK_PCRel_1
7979
; PIC-NEXT: # %bb.1: # %t
8080
; PIC-NEXT: pushq %rax # encoding: [0x50]
8181
; PIC-NEXT: .cfi_def_cfa_offset 16
8282
; PIC-NEXT: callq f@PLT # encoding: [0xe8,A,A,A,A]
83-
; PIC-NEXT: # fixup A - offset: 1, value: f@PLT-4, kind: FK_PCRel_4
83+
; PIC-NEXT: # fixup A - offset: 1, value: f@PLT, kind: FK_PCRel_4
8484
; PIC-NEXT: popq %rax # encoding: [0x58]
8585
; PIC-NEXT: .cfi_def_cfa_offset 8
8686
; PIC-NEXT: .LBB1_2: # %f

0 commit comments

Comments
 (0)