[llvm] [AMDGPU] Add s_delay_alu in relocated PC-relative symbol sequence (PR #71061)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 03:23:06 PDT 2023


================
@@ -2405,13 +2405,22 @@ bool SIInstrInfo::expandPostRAPseudo(MachineInstr &MI) const {
     // the encoding of $symbol starts 12 bytes after the start of the s_add_u32
     // instruction.
 
+    int64_t Adjust = 0;
+    if (ST.hasDelayAlu()) {
+      // Manually add the 1 cycle delay before using RegLo. AMDGPUInsertDelayAlu
+      // will not add this automatically inside a bundle:
+      //   s_delay_alu instid0(SALU_CYCLE_1)
+      Bundler.append(BuildMI(MF, DL, get(AMDGPU::S_DELAY_ALU)).addImm(9));
----------------
jayfoad wrote:

Done. Though now I'm wondering if this should also be disabled by `-O0`, like `AMDGPUInsertDelayAlu` is.

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


More information about the llvm-commits mailing list