Skip to content

Commit 1d15bbb

Browse files
committed
Revert "[RISCV] Avoid Splitting MBB in RISCVExpandPseudo"
This reverts commit 97106f9. This is based on feedback from https://reviews.llvm.org/D82988#2147105
1 parent a5405a2 commit 1d15bbb

File tree

9 files changed

+147
-93
lines changed

9 files changed

+147
-93
lines changed

llvm/include/llvm/CodeGen/MachineBasicBlock.h

+11
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ class MachineBasicBlock
143143
/// branch.
144144
bool AddressTaken = false;
145145

146+
/// Indicate that this basic block needs its symbol be emitted regardless of
147+
/// whether the flow just falls-through to it.
148+
bool LabelMustBeEmitted = false;
149+
146150
/// Indicate that this basic block is the entry block of an EH scope, i.e.,
147151
/// the block that used to have a catchpad or cleanuppad instruction in the
148152
/// LLVM IR.
@@ -202,6 +206,13 @@ class MachineBasicBlock
202206
/// branch.
203207
void setHasAddressTaken() { AddressTaken = true; }
204208

209+
/// Test whether this block must have its label emitted.
210+
bool hasLabelMustBeEmitted() const { return LabelMustBeEmitted; }
211+
212+
/// Set this block to reflect that, regardless how we flow to it, we need
213+
/// its label be emitted.
214+
void setLabelMustBeEmitted() { LabelMustBeEmitted = true; }
215+
205216
/// Return the MachineFunction containing this basic block.
206217
const MachineFunction *getParent() const { return xParent; }
207218
MachineFunction *getParent() { return xParent; }

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -3057,13 +3057,16 @@ void AsmPrinter::emitBasicBlockStart(const MachineBasicBlock &MBB) {
30573057

30583058
if (MBB.pred_empty() ||
30593059
(!MF->hasBBLabels() && isBlockOnlyReachableByFallthrough(&MBB) &&
3060-
!MBB.isEHFuncletEntry())) {
3060+
!MBB.isEHFuncletEntry() && !MBB.hasLabelMustBeEmitted())) {
30613061
if (isVerbose()) {
30623062
// NOTE: Want this comment at start of line, don't emit with AddComment.
30633063
OutStreamer->emitRawComment(" %bb." + Twine(MBB.getNumber()) + ":",
30643064
false);
30653065
}
30663066
} else {
3067+
if (isVerbose() && MBB.hasLabelMustBeEmitted()) {
3068+
OutStreamer->AddComment("Label of block must be emitted");
3069+
}
30673070
// Switch to a new section if this basic block must begin a section.
30683071
if (MBB.isBeginSection()) {
30693072
OutStreamer->SwitchSection(

llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp

+62-36
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "llvm/CodeGen/LivePhysRegs.h"
2020
#include "llvm/CodeGen/MachineFunctionPass.h"
2121
#include "llvm/CodeGen/MachineInstrBuilder.h"
22-
#include "llvm/MC/MCContext.h"
2322

2423
using namespace llvm;
2524

@@ -42,18 +41,24 @@ class RISCVExpandPseudo : public MachineFunctionPass {
4241

4342
private:
4443
bool expandMBB(MachineBasicBlock &MBB);
45-
bool expandMI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI);
44+
bool expandMI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
45+
MachineBasicBlock::iterator &NextMBBI);
4646
bool expandAuipcInstPair(MachineBasicBlock &MBB,
4747
MachineBasicBlock::iterator MBBI,
48+
MachineBasicBlock::iterator &NextMBBI,
4849
unsigned FlagsHi, unsigned SecondOpcode);
4950
bool expandLoadLocalAddress(MachineBasicBlock &MBB,
50-
MachineBasicBlock::iterator MBBI);
51+
MachineBasicBlock::iterator MBBI,
52+
MachineBasicBlock::iterator &NextMBBI);
5153
bool expandLoadAddress(MachineBasicBlock &MBB,
52-
MachineBasicBlock::iterator MBBI);
54+
MachineBasicBlock::iterator MBBI,
55+
MachineBasicBlock::iterator &NextMBBI);
5356
bool expandLoadTLSIEAddress(MachineBasicBlock &MBB,
54-
MachineBasicBlock::iterator MBBI);
57+
MachineBasicBlock::iterator MBBI,
58+
MachineBasicBlock::iterator &NextMBBI);
5559
bool expandLoadTLSGDAddress(MachineBasicBlock &MBB,
56-
MachineBasicBlock::iterator MBBI);
60+
MachineBasicBlock::iterator MBBI,
61+
MachineBasicBlock::iterator &NextMBBI);
5762
};
5863

5964
char RISCVExpandPseudo::ID = 0;
@@ -72,64 +77,81 @@ bool RISCVExpandPseudo::expandMBB(MachineBasicBlock &MBB) {
7277
MachineBasicBlock::iterator MBBI = MBB.begin(), E = MBB.end();
7378
while (MBBI != E) {
7479
MachineBasicBlock::iterator NMBBI = std::next(MBBI);
75-
Modified |= expandMI(MBB, MBBI);
80+
Modified |= expandMI(MBB, MBBI, NMBBI);
7681
MBBI = NMBBI;
7782
}
7883

7984
return Modified;
8085
}
8186

8287
bool RISCVExpandPseudo::expandMI(MachineBasicBlock &MBB,
83-
MachineBasicBlock::iterator MBBI) {
88+
MachineBasicBlock::iterator MBBI,
89+
MachineBasicBlock::iterator &NextMBBI) {
8490
switch (MBBI->getOpcode()) {
8591
case RISCV::PseudoLLA:
86-
return expandLoadLocalAddress(MBB, MBBI);
92+
return expandLoadLocalAddress(MBB, MBBI, NextMBBI);
8793
case RISCV::PseudoLA:
88-
return expandLoadAddress(MBB, MBBI);
94+
return expandLoadAddress(MBB, MBBI, NextMBBI);
8995
case RISCV::PseudoLA_TLS_IE:
90-
return expandLoadTLSIEAddress(MBB, MBBI);
96+
return expandLoadTLSIEAddress(MBB, MBBI, NextMBBI);
9197
case RISCV::PseudoLA_TLS_GD:
92-
return expandLoadTLSGDAddress(MBB, MBBI);
98+
return expandLoadTLSGDAddress(MBB, MBBI, NextMBBI);
9399
}
94100

95101
return false;
96102
}
97103

98-
bool RISCVExpandPseudo::expandAuipcInstPair(MachineBasicBlock &MBB,
99-
MachineBasicBlock::iterator MBBI,
100-
unsigned FlagsHi,
101-
unsigned SecondOpcode) {
104+
bool RISCVExpandPseudo::expandAuipcInstPair(
105+
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
106+
MachineBasicBlock::iterator &NextMBBI, unsigned FlagsHi,
107+
unsigned SecondOpcode) {
102108
MachineFunction *MF = MBB.getParent();
103109
MachineInstr &MI = *MBBI;
104110
DebugLoc DL = MI.getDebugLoc();
105111

106112
Register DestReg = MI.getOperand(0).getReg();
107-
Register ScratchReg =
108-
MF->getRegInfo().createVirtualRegister(&RISCV::GPRRegClass);
113+
const MachineOperand &Symbol = MI.getOperand(1);
109114

110-
MachineOperand &Symbol = MI.getOperand(1);
111-
Symbol.setTargetFlags(FlagsHi);
112-
MCSymbol *AUIPCSymbol = MF->getContext().createTempSymbol(false);
115+
MachineBasicBlock *NewMBB = MF->CreateMachineBasicBlock(MBB.getBasicBlock());
113116

114-
MachineInstr *MIAUIPC =
115-
BuildMI(MBB, MBBI, DL, TII->get(RISCV::AUIPC), ScratchReg).add(Symbol);
116-
MIAUIPC->setPreInstrSymbol(*MF, AUIPCSymbol);
117+
// Tell AsmPrinter that we unconditionally want the symbol of this label to be
118+
// emitted.
119+
NewMBB->setLabelMustBeEmitted();
117120

118-
BuildMI(MBB, MBBI, DL, TII->get(SecondOpcode), DestReg)
119-
.addReg(ScratchReg)
120-
.addSym(AUIPCSymbol, RISCVII::MO_PCREL_LO);
121+
MF->insert(++MBB.getIterator(), NewMBB);
121122

123+
BuildMI(NewMBB, DL, TII->get(RISCV::AUIPC), DestReg)
124+
.addDisp(Symbol, 0, FlagsHi);
125+
BuildMI(NewMBB, DL, TII->get(SecondOpcode), DestReg)
126+
.addReg(DestReg)
127+
.addMBB(NewMBB, RISCVII::MO_PCREL_LO);
128+
129+
// Move all the rest of the instructions to NewMBB.
130+
NewMBB->splice(NewMBB->end(), &MBB, std::next(MBBI), MBB.end());
131+
// Update machine-CFG edges.
132+
NewMBB->transferSuccessorsAndUpdatePHIs(&MBB);
133+
// Make the original basic block fall-through to the new.
134+
MBB.addSuccessor(NewMBB);
135+
136+
// Make sure live-ins are correctly attached to this new basic block.
137+
LivePhysRegs LiveRegs;
138+
computeAndAddLiveIns(LiveRegs, *NewMBB);
139+
140+
NextMBBI = MBB.end();
122141
MI.eraseFromParent();
123142
return true;
124143
}
125144

126145
bool RISCVExpandPseudo::expandLoadLocalAddress(
127-
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI) {
128-
return expandAuipcInstPair(MBB, MBBI, RISCVII::MO_PCREL_HI, RISCV::ADDI);
146+
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
147+
MachineBasicBlock::iterator &NextMBBI) {
148+
return expandAuipcInstPair(MBB, MBBI, NextMBBI, RISCVII::MO_PCREL_HI,
149+
RISCV::ADDI);
129150
}
130151

131-
bool RISCVExpandPseudo::expandLoadAddress(MachineBasicBlock &MBB,
132-
MachineBasicBlock::iterator MBBI) {
152+
bool RISCVExpandPseudo::expandLoadAddress(
153+
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
154+
MachineBasicBlock::iterator &NextMBBI) {
133155
MachineFunction *MF = MBB.getParent();
134156

135157
unsigned SecondOpcode;
@@ -142,21 +164,25 @@ bool RISCVExpandPseudo::expandLoadAddress(MachineBasicBlock &MBB,
142164
SecondOpcode = RISCV::ADDI;
143165
FlagsHi = RISCVII::MO_PCREL_HI;
144166
}
145-
return expandAuipcInstPair(MBB, MBBI, FlagsHi, SecondOpcode);
167+
return expandAuipcInstPair(MBB, MBBI, NextMBBI, FlagsHi, SecondOpcode);
146168
}
147169

148170
bool RISCVExpandPseudo::expandLoadTLSIEAddress(
149-
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI) {
171+
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
172+
MachineBasicBlock::iterator &NextMBBI) {
150173
MachineFunction *MF = MBB.getParent();
151174

152175
const auto &STI = MF->getSubtarget<RISCVSubtarget>();
153176
unsigned SecondOpcode = STI.is64Bit() ? RISCV::LD : RISCV::LW;
154-
return expandAuipcInstPair(MBB, MBBI, RISCVII::MO_TLS_GOT_HI, SecondOpcode);
177+
return expandAuipcInstPair(MBB, MBBI, NextMBBI, RISCVII::MO_TLS_GOT_HI,
178+
SecondOpcode);
155179
}
156180

157181
bool RISCVExpandPseudo::expandLoadTLSGDAddress(
158-
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI) {
159-
return expandAuipcInstPair(MBB, MBBI, RISCVII::MO_TLS_GD_HI, RISCV::ADDI);
182+
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
183+
MachineBasicBlock::iterator &NextMBBI) {
184+
return expandAuipcInstPair(MBB, MBBI, NextMBBI, RISCVII::MO_TLS_GD_HI,
185+
RISCV::ADDI);
160186
}
161187

162188
} // end of anonymous namespace

llvm/lib/Target/RISCV/RISCVMCInstLower.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ bool llvm::LowerRISCVMachineOperandToMCOperand(const MachineOperand &MO,
121121
case MachineOperand::MO_ConstantPoolIndex:
122122
MCOp = lowerSymbolOperand(MO, AP.GetCPISymbol(MO.getIndex()), AP);
123123
break;
124-
case MachineOperand::MO_MCSymbol:
125-
MCOp = lowerSymbolOperand(MO, MO.getMCSymbol(), AP);
126-
break;
127124
}
128125
return true;
129126
}

llvm/lib/Target/RISCV/RISCVTargetMachine.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ void RISCVPassConfig::addPreSched2() {}
173173
void RISCVPassConfig::addPreEmitPass() { addPass(&BranchRelaxationPassID); }
174174

175175
void RISCVPassConfig::addPreEmitPass2() {
176+
addPass(createRISCVExpandPseudoPass());
176177
// Schedule the expansion of AMOs at the last possible moment, avoiding the
177178
// possibility for other passes to break the requirements for forward
178179
// progress in the LR/SC block.
179180
addPass(createRISCVExpandAtomicPseudoPass());
180181
}
181182

182183
void RISCVPassConfig::addPreRegAlloc() {
183-
addPass(createRISCVExpandPseudoPass());
184184
addPass(createRISCVMergeBaseOffsetOptPass());
185185
}

llvm/test/CodeGen/RISCV/codemodel-lowering.ll

+11-10
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ define i32 @lower_global(i32 %a) nounwind {
1616
;
1717
; RV32I-MEDIUM-LABEL: lower_global:
1818
; RV32I-MEDIUM: # %bb.0:
19-
; RV32I-MEDIUM-NEXT: .Ltmp0:
19+
; RV32I-MEDIUM-NEXT: .LBB0_1: # Label of block must be emitted
2020
; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(G)
21-
; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Ltmp0)
21+
; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.LBB0_1)
2222
; RV32I-MEDIUM-NEXT: lw a0, 0(a0)
2323
; RV32I-MEDIUM-NEXT: ret
2424
%1 = load volatile i32, i32* @G
@@ -39,9 +39,9 @@ define void @lower_blockaddress() nounwind {
3939
;
4040
; RV32I-MEDIUM-LABEL: lower_blockaddress:
4141
; RV32I-MEDIUM: # %bb.0:
42-
; RV32I-MEDIUM-NEXT: .Ltmp1:
42+
; RV32I-MEDIUM-NEXT: .LBB1_1: # Label of block must be emitted
4343
; RV32I-MEDIUM-NEXT: auipc a0, %pcrel_hi(addr)
44-
; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.Ltmp1)
44+
; RV32I-MEDIUM-NEXT: addi a0, a0, %pcrel_lo(.LBB1_1)
4545
; RV32I-MEDIUM-NEXT: addi a1, zero, 1
4646
; RV32I-MEDIUM-NEXT: sw a1, 0(a0)
4747
; RV32I-MEDIUM-NEXT: ret
@@ -82,16 +82,17 @@ define signext i32 @lower_blockaddress_displ(i32 signext %w) nounwind {
8282
; RV32I-MEDIUM: # %bb.0: # %entry
8383
; RV32I-MEDIUM-NEXT: addi sp, sp, -16
8484
; RV32I-MEDIUM-NEXT: sw ra, 12(sp)
85-
; RV32I-MEDIUM-NEXT: .Ltmp2:
86-
; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(.Ltmp3)
87-
; RV32I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Ltmp2)
85+
; RV32I-MEDIUM-NEXT: .LBB2_5: # %entry
86+
; RV32I-MEDIUM-NEXT: # Label of block must be emitted
87+
; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(.Ltmp0)
88+
; RV32I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.LBB2_5)
8889
; RV32I-MEDIUM-NEXT: addi a2, zero, 101
8990
; RV32I-MEDIUM-NEXT: sw a1, 8(sp)
9091
; RV32I-MEDIUM-NEXT: blt a0, a2, .LBB2_3
9192
; RV32I-MEDIUM-NEXT: # %bb.1: # %if.then
9293
; RV32I-MEDIUM-NEXT: lw a0, 8(sp)
9394
; RV32I-MEDIUM-NEXT: jr a0
94-
; RV32I-MEDIUM-NEXT: .Ltmp3: # Block address taken
95+
; RV32I-MEDIUM-NEXT: .Ltmp0: # Block address taken
9596
; RV32I-MEDIUM-NEXT: .LBB2_2: # %return
9697
; RV32I-MEDIUM-NEXT: addi a0, zero, 4
9798
; RV32I-MEDIUM-NEXT: j .LBB2_4
@@ -139,9 +140,9 @@ define float @lower_constantpool(float %a) nounwind {
139140
;
140141
; RV32I-MEDIUM-LABEL: lower_constantpool:
141142
; RV32I-MEDIUM: # %bb.0:
142-
; RV32I-MEDIUM-NEXT: .Ltmp4:
143+
; RV32I-MEDIUM-NEXT: .LBB3_1: # Label of block must be emitted
143144
; RV32I-MEDIUM-NEXT: auipc a1, %pcrel_hi(.LCPI3_0)
144-
; RV32I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.Ltmp4)
145+
; RV32I-MEDIUM-NEXT: addi a1, a1, %pcrel_lo(.LBB3_1)
145146
; RV32I-MEDIUM-NEXT: flw ft0, 0(a1)
146147
; RV32I-MEDIUM-NEXT: fmv.w.x ft1, a0
147148
; RV32I-MEDIUM-NEXT: fadd.s ft0, ft1, ft0

llvm/test/CodeGen/RISCV/mir-target-flags.ll

+10-10
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,29 @@ define i32 @caller(i32 %a) nounwind {
2727
; RV32-SMALL-NEXT: target-flags(riscv-hi) @g_i
2828
; RV32-SMALL-NEXT: target-flags(riscv-lo) @g_i
2929
; RV32-SMALL: target-flags(riscv-tls-got-hi) @t_un
30-
; RV32-SMALL-NEXT: target-flags(riscv-pcrel-lo)
30+
; RV32-SMALL-NEXT: target-flags(riscv-pcrel-lo) %bb.1
3131
; RV32-SMALL: target-flags(riscv-tls-got-hi) @t_ld
32-
; RV32-SMALL-NEXT: target-flags(riscv-pcrel-lo)
32+
; RV32-SMALL-NEXT: target-flags(riscv-pcrel-lo) %bb.2
3333
; RV32-SMALL: target-flags(riscv-tls-got-hi) @t_ie
34-
; RV32-SMALL-NEXT: target-flags(riscv-pcrel-lo)
34+
; RV32-SMALL-NEXT: target-flags(riscv-pcrel-lo) %bb.3
3535
; RV32-SMALL: target-flags(riscv-tprel-hi) @t_le
3636
; RV32-SMALL-NEXT: target-flags(riscv-tprel-add) @t_le
3737
; RV32-SMALL-NEXT: target-flags(riscv-tprel-lo) @t_le
3838
; RV32-SMALL: target-flags(riscv-call) @callee
3939
;
4040
; RV32-MED-LABEL: name: caller
4141
; RV32-MED: target-flags(riscv-got-hi) @g_e
42-
; RV32-MED-NEXT: target-flags(riscv-pcrel-lo)
42+
; RV32-MED-NEXT: target-flags(riscv-pcrel-lo) %bb.1
4343
; RV32-MED: target-flags(riscv-pcrel-hi) @g_i
44-
; RV32-MED-NEXT: target-flags(riscv-pcrel-lo)
44+
; RV32-MED-NEXT: target-flags(riscv-pcrel-lo) %bb.2
4545
; RV32-MED: target-flags(riscv-tls-gd-hi) @t_un
46-
; RV32-MED-NEXT: target-flags(riscv-pcrel-lo)
47-
; RV32-MED: target-flags(riscv-plt) &__tls_get_addr
46+
; RV32-MED-NEXT: target-flags(riscv-pcrel-lo) %bb.3
47+
; RV32-MED-NEXT: target-flags(riscv-plt) &__tls_get_addr
4848
; RV32-MED: target-flags(riscv-tls-gd-hi) @t_ld
49-
; RV32-MED-NEXT: target-flags(riscv-pcrel-lo)
50-
; RV32-MED: target-flags(riscv-plt) &__tls_get_addr
49+
; RV32-MED-NEXT: target-flags(riscv-pcrel-lo) %bb.4
50+
; RV32-MED-NEXT: target-flags(riscv-plt) &__tls_get_addr
5151
; RV32-MED: target-flags(riscv-tls-got-hi) @t_ie
52-
; RV32-MED-NEXT: target-flags(riscv-pcrel-lo)
52+
; RV32-MED-NEXT: target-flags(riscv-pcrel-lo) %bb.5
5353
; RV32-MED: target-flags(riscv-tprel-hi) @t_le
5454
; RV32-MED-NEXT: target-flags(riscv-tprel-add) @t_le
5555
; RV32-MED-NEXT: target-flags(riscv-tprel-lo) @t_le

llvm/test/CodeGen/RISCV/pic-models.ll

+12-8
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ define i32* @f1() nounwind {
2626
;
2727
; RV32-PIC-LABEL: f1:
2828
; RV32-PIC: # %bb.0: # %entry
29-
; RV32-PIC-NEXT: .Ltmp0:
29+
; RV32-PIC-NEXT: .LBB0_1: # %entry
30+
; RV32-PIC-NEXT: # Label of block must be emitted
3031
; RV32-PIC-NEXT: auipc a0, %got_pcrel_hi(external_var)
31-
; RV32-PIC-NEXT: lw a0, %pcrel_lo(.Ltmp0)(a0)
32+
; RV32-PIC-NEXT: lw a0, %pcrel_lo(.LBB0_1)(a0)
3233
; RV32-PIC-NEXT: ret
3334
;
3435
; RV64-STATIC-LABEL: f1:
@@ -39,9 +40,10 @@ define i32* @f1() nounwind {
3940
;
4041
; RV64-PIC-LABEL: f1:
4142
; RV64-PIC: # %bb.0: # %entry
42-
; RV64-PIC-NEXT: .Ltmp0:
43+
; RV64-PIC-NEXT: .LBB0_1: # %entry
44+
; RV64-PIC-NEXT: # Label of block must be emitted
4345
; RV64-PIC-NEXT: auipc a0, %got_pcrel_hi(external_var)
44-
; RV64-PIC-NEXT: ld a0, %pcrel_lo(.Ltmp0)(a0)
46+
; RV64-PIC-NEXT: ld a0, %pcrel_lo(.LBB0_1)(a0)
4547
; RV64-PIC-NEXT: ret
4648
entry:
4749
ret i32* @external_var
@@ -59,9 +61,10 @@ define i32* @f2() nounwind {
5961
;
6062
; RV32-PIC-LABEL: f2:
6163
; RV32-PIC: # %bb.0: # %entry
62-
; RV32-PIC-NEXT: .Ltmp1:
64+
; RV32-PIC-NEXT: .LBB1_1: # %entry
65+
; RV32-PIC-NEXT: # Label of block must be emitted
6366
; RV32-PIC-NEXT: auipc a0, %pcrel_hi(internal_var)
64-
; RV32-PIC-NEXT: addi a0, a0, %pcrel_lo(.Ltmp1)
67+
; RV32-PIC-NEXT: addi a0, a0, %pcrel_lo(.LBB1_1)
6568
; RV32-PIC-NEXT: ret
6669
;
6770
; RV64-STATIC-LABEL: f2:
@@ -72,9 +75,10 @@ define i32* @f2() nounwind {
7275
;
7376
; RV64-PIC-LABEL: f2:
7477
; RV64-PIC: # %bb.0: # %entry
75-
; RV64-PIC-NEXT: .Ltmp1:
78+
; RV64-PIC-NEXT: .LBB1_1: # %entry
79+
; RV64-PIC-NEXT: # Label of block must be emitted
7680
; RV64-PIC-NEXT: auipc a0, %pcrel_hi(internal_var)
77-
; RV64-PIC-NEXT: addi a0, a0, %pcrel_lo(.Ltmp1)
81+
; RV64-PIC-NEXT: addi a0, a0, %pcrel_lo(.LBB1_1)
7882
; RV64-PIC-NEXT: ret
7983
entry:
8084
ret i32* @internal_var

0 commit comments

Comments
 (0)