[llvm] [AMDGPU] Relax long branches in the assembler on gfx1251 (PR #228363)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 03:56:58 PDT 2026


================
@@ -3089,6 +3089,11 @@ bool SIInstrInfo::isBranchOffsetInRange(unsigned BranchOp,
   // because its dest block is unanalyzable.
   assert(isSOPP(BranchOp) || isSOPK(BranchOp));
 
+  // With s_add_pc_i64, out of range branches are relaxed by the assembler
+  // without needing any registers.
+  if (ST.useAddPC64Inst())
+    return true;
----------------
jayfoad wrote:

MC relaxation also applies to assembler source. Do we want users' handwritten short branches to get relaxed to long form (like X86 does) or vice versa?

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


More information about the llvm-commits mailing list