Skip to content

Commit 823ce6a

Browse files
wangleiatSixWeining
authored andcommitted
[LoongArch] Add some comments for expand pseudo-inst pass. NFC
Differential Revision: https://reviews.llvm.org/D134708
1 parent bab129f commit 823ce6a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Target/LoongArch/LoongArchExpandPseudoInsts.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ bool LoongArchPreRAExpandPseudo::expandPcalau12iInstPair(
131131
bool LoongArchPreRAExpandPseudo::expandLoadAddressPcrel(
132132
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
133133
MachineBasicBlock::iterator &NextMBBI) {
134+
// Code Sequence:
135+
// pcalau12i $rd, %pc_hi20(sym)
136+
// addi.w/d $rd, $rd, %pc_lo12(sym)
134137
MachineFunction *MF = MBB.getParent();
135138
const auto &STI = MF->getSubtarget<LoongArchSubtarget>();
136139
unsigned SecondOpcode = STI.is64Bit() ? LoongArch::ADDI_D : LoongArch::ADDI_W;
@@ -141,6 +144,9 @@ bool LoongArchPreRAExpandPseudo::expandLoadAddressPcrel(
141144
bool LoongArchPreRAExpandPseudo::expandLoadAddressGot(
142145
MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
143146
MachineBasicBlock::iterator &NextMBBI) {
147+
// Code Sequence:
148+
// pcalau12i $rd, %got_pc_hi20(sym)
149+
// ld.w/d $rd, $rd, %got_pc_lo12(sym)
144150
MachineFunction *MF = MBB.getParent();
145151
const auto &STI = MF->getSubtarget<LoongArchSubtarget>();
146152
unsigned SecondOpcode = STI.is64Bit() ? LoongArch::LD_D : LoongArch::LD_W;

0 commit comments

Comments
 (0)