15#define DEBUG_TYPE "jitlink"
22 0x00, 0x00, 0x00, 0x00};
25 static_cast<char>(0xC4u),
31 static_cast<char>(0x07u),
32 static_cast<char>(0xF1u),
68 return "DeltaPLT32dbl";
70 return "DeltaPLT24dbl";
72 return "DeltaPLT16dbl";
74 return "DeltaPLT12dbl";
80 return "Delta64FromGOT";
82 return "Delta32FromGOT";
84 return "Delta16FromGOT";
86 return "Delta64PLTFromGOT";
88 return "Delta32PLTFromGOT";
90 return "Delta16PLTFromGOT";
92 return "Delta32GOTBase";
94 return "Delta32dblGOTBase";
96 return "RequestGOTAndTransformToDelta64FromGOT";
98 return "RequestGOTAndTransformToDelta32FromGOT";
100 return "RequestGOTAndTransformToDelta20FromGOT";
102 return "RequestGOTAndTransformToDelta16FromGOT";
104 return "RequestGOTAndTransformToDelta12FromGOT";
106 return "RequestGOTAndTransformToDelta32dbl";
108 return "RequestTLSDescInGOTAndTransformToDelta64FromGOT";
117 for (
auto *
B :
G.blocks())
118 for (
auto &E :
B->edges()) {
120 auto &StubBlock = E.getTarget().getBlock();
122 StubBlock.edges_size() == 1) {
123 auto &GOTBlock = StubBlock.edges().begin()->getTarget().getBlock();
124 assert(GOTBlock.getSize() ==
G.getPointerSize() &&
125 "GOT block should be pointer sized");
126 assert(GOTBlock.edges_size() == 1 &&
127 "GOT block should only have one outgoing edge");
129 auto &GOTTarget = GOTBlock.edges().begin()->getTarget();
133 int64_t Displacement = TargetAddr + E.getAddend() - EdgeAddr;
136 E.setTarget(GOTTarget);
138 dbgs() <<
" Replaced stub branch with direct branch:\n ";
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Represents an address in the executor process.
const char NullPointerContent[8]
SystemZ null pointer content.
@ DeltaPLT32
A 32-bit Delta.
@ Delta64PLTFromGOT
A 64-bit offset from GOT to PLT.
@ Pointer16
A plain 16-bit pointer value relocation.
@ RequestGOTAndTransformToDelta32FromGOT
A GOT entry getter/constructor, transformed to Delta32FromGOT pointing at the GOT entry for the origi...
@ RequestGOTAndTransformToDelta32dbl
A GOT entry getter/constructor, transformed to Delta32dbl pointing at the GOT entry for the original ...
@ Pointer64
A plain 64-bit pointer value relocation.
@ Pointer20
A plain 20-bit pointer value relocation.
@ RequestGOTAndTransformToDelta16FromGOT
A GOT entry getter/constructor, transformed to Delta16FromGOT pointing at the GOT entry for the origi...
@ RequestGOTAndTransformToDelta12FromGOT
A GOT entry getter/constructor, transformed to Delta12FromGOT pointing at the GOT entry for the origi...
@ RequestGOTAndTransformToDelta64FromGOT
A GOT entry getter/constructor, transformed to Delta64FromGOT pointing at the GOT entry for the origi...
@ DeltaPLT16dbl
A 16-bit Delta shifted by 1.
@ Delta16FromGOT
A 16-bit offset from GOT.
@ Pointer8
A plain 8-bit pointer value relocation.
@ Delta16PLTFromGOT
A 16-bit offset from GOT to PLT.
@ NegDelta64
A 64-bit negative delta.
@ Delta32PLTFromGOT
A 32-bit offset from GOT to PLT.
@ Delta32dblGOTBase
A 32-bit Delta to GOT base shifted by 1.
@ Delta32FromGOT
A 32-bit offset from GOT.
@ Delta32GOTBase
A 32-bit Delta to GOT base.
@ DeltaPLT12dbl
A 12-bit Delta shifted by 1.
@ RequestGOTAndTransformToDelta20FromGOT
A GOT entry getter/constructor, transformed to Delta20FromGOT pointing at the GOT entry for the origi...
@ Delta16dbl
A 16-bit delta shifted by 1.
@ DeltaPLT32dbl
A 32-bit Delta shifted by 1.
@ NegDelta32
A 32-bit negative delta.
@ Delta24dbl
A 24-bit delta shifted by 1.
@ RequestTLSDescInGOTAndTransformToDelta64FromGOT
A TLSInfo entry getter/constructor, transformed to Delta64FromGOT.
@ DeltaPLT64
A 64-bit Delta.
@ DeltaPLT24dbl
A 24-bit Delta shifted by 1.
@ Pointer12
A plain 12-bit pointer value relocation.
@ Delta12dbl
A 12-bit delta shifted by 1.
@ Pointer32
A plain 32-bit pointer value relocation.
@ Delta32dbl
A 32-bit delta shifted by 1.
@ Delta64FromGOT
A 64-bit offset from GOT.
const char * getEdgeKindName(Edge::Kind K)
Returns a string name for the given systemz edge.
LLVM_ABI Error optimizeGOTAndStubAccesses(LinkGraph &G)
Optimize the GOT and Stub relocations edge kind DeltaPLT32dbl if the edge target address is in range.
const char Pointer64JumpStubContent[StubEntrySize]
LLVM_ABI const char * getGenericEdgeKindName(Edge::Kind K)
Returns the string name of the given generic edge kind, or "unknown" otherwise.
LLVM_ABI void printEdge(raw_ostream &OS, const Block &B, const Edge &E, StringRef EdgeKindName)
This is an optimization pass for GlobalISel generic memory operations.
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.