[PATCH] D134708: [LoongArch] Add some comments for expand pseudo-inst pass. NFC

Lu Weining via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 05:26:45 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG823ce6ad18d3: [LoongArch] Add some comments for expand pseudo-inst pass. NFC (authored by wangleiat, committed by SixWeining).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134708/new/

https://reviews.llvm.org/D134708

Files:
  llvm/lib/Target/LoongArch/LoongArchExpandPseudoInsts.cpp


Index: llvm/lib/Target/LoongArch/LoongArchExpandPseudoInsts.cpp
===================================================================
--- llvm/lib/Target/LoongArch/LoongArchExpandPseudoInsts.cpp
+++ llvm/lib/Target/LoongArch/LoongArchExpandPseudoInsts.cpp
@@ -131,6 +131,9 @@
 bool LoongArchPreRAExpandPseudo::expandLoadAddressPcrel(
     MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
     MachineBasicBlock::iterator &NextMBBI) {
+  // Code Sequence:
+  // pcalau12i $rd, %pc_hi20(sym)
+  // addi.w/d $rd, $rd, %pc_lo12(sym)
   MachineFunction *MF = MBB.getParent();
   const auto &STI = MF->getSubtarget<LoongArchSubtarget>();
   unsigned SecondOpcode = STI.is64Bit() ? LoongArch::ADDI_D : LoongArch::ADDI_W;
@@ -141,6 +144,9 @@
 bool LoongArchPreRAExpandPseudo::expandLoadAddressGot(
     MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
     MachineBasicBlock::iterator &NextMBBI) {
+  // Code Sequence:
+  // pcalau12i $rd, %got_pc_hi20(sym)
+  // ld.w/d $rd, $rd, %got_pc_lo12(sym)
   MachineFunction *MF = MBB.getParent();
   const auto &STI = MF->getSubtarget<LoongArchSubtarget>();
   unsigned SecondOpcode = STI.is64Bit() ? LoongArch::LD_D : LoongArch::LD_W;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134708.463198.patch
Type: text/x-patch
Size: 1188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220927/08b670b7/attachment.bin>


More information about the llvm-commits mailing list