[llvm-branch-commits] [llvm] [LoongArch] Avoid scheduling relaxable code sequence and attach relax relocs (PR #121330)

Zhaoxin Yang via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 7 23:59:57 PST 2025


================
@@ -443,6 +443,89 @@ bool LoongArchInstrInfo::isSchedulingBoundary(const MachineInstr &MI,
     break;
   }
 
+  const auto &STI = MF.getSubtarget<LoongArchSubtarget>();
+  if (STI.hasFeature(LoongArch::FeatureRelax)) {
+    // When linker relaxation enabled, the following instruction patterns are
+    // prohibited from being reordered:
+    //
+    // * pcalau12i $a0, %pc_hi20(s)
+    //   addi.w/d $a0, $a0, %pc_lo12(s)
+    //
+    // * pcalau12i $a0, %got_pc_hi20(s)
+    //   ld.w/d $a0, $a0, %got_pc_lo12(s)
+    //
+    // * pcalau12i $a0, %ie_pc_hi20(s)
+    //   ld.w/d $a0, $a0, %ie_pc_lo12(s)
----------------
ylzsx wrote:

I think tls ie can be scheduled. 

https://github.com/llvm/llvm-project/pull/121330


More information about the llvm-branch-commits mailing list