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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 01:59:43 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;
----------------
arsenm wrote:

Alternatively could we select the long branch by default and refine into the short branch? 

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


More information about the llvm-commits mailing list