[llvm] [JITLink] Add GOT indirection optimization for SystemZ (PR #171919)

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 15 04:56:59 PST 2025


================
@@ -219,6 +219,24 @@ enum EdgeKind_systemz : Edge::Kind {
   ///
   DeltaPLT32dbl,
 
+  /// Relaxable version of DeltaPLT32dbl.
+  ///
+  /// The edge kind has the same fixup expression as DeltaPLT32dbl,
+  /// but identifies the call/branch as being to a pointer jump stub that may be
+  /// bypassed with a direct jump to the ultimate target if the ultimate target
+  /// is within range of the fixup location.
+  ///
+  /// Fixup expression:
+  ///   Fixup <- (Target - Fixup + Addend) >> 1 : int32
+  ///
+  /// Errors:
+  ///   - The result of the fixup expression before shifting right by 1 must
+  ///     fit into an int33, otherwise an out-of-range error will be returned.
+  ///   - The result of the fixup expression  before shifting right by 1 must
+  ///     be multiple of 2, otherwise an alignment error will be returned.
+  ///
+  Delta32dblToPtrJumpStubBypassable,
----------------
uweigand wrote:

I do not understand this.   Whether the stub has or has not already been created only depends on the ordering of the passes - as long as the PLT pass happens before the GOT optimization pass, they will have been created; if the PLT pass happens too late they will not.  This is true whether or not the fixup kind is renamed inside the PLT pass.  What's the point of renaming the kind first in the PLT pass and then later eliminate it in the GOT optimizer pass?

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


More information about the llvm-commits mailing list