forked from OSchip/llvm-project
[JITLink][x86-64] Rename BranchPCRel32ToPtrJumpStub(Relaxable -> Bypassable).
ELF allows for branch optimizations other than bypass, so rename this edge kind to avoid any confusion.
This commit is contained in:
parent
29e11a1aa3
commit
632135acae
|
@ -132,7 +132,7 @@ enum EdgeKind_x86_64 : Edge::Kind {
|
|||
/// This edge kind has the same fixup expression as BranchPCRel32, but further
|
||||
/// identifies the call/branch as being to a pointer jump stub. For edges of
|
||||
/// this kind the jump stub should not be bypassed (use
|
||||
/// BranchPCRel32ToPtrJumpStubRelaxable for that), but the pointer location
|
||||
/// BranchPCRel32ToPtrJumpStubBypassable for that), but the pointer location
|
||||
/// target may be recorded to allow manipulation at runtime.
|
||||
///
|
||||
/// Fixup expression:
|
||||
|
@ -148,7 +148,8 @@ enum EdgeKind_x86_64 : Edge::Kind {
|
|||
///
|
||||
/// The edge kind has the same fixup expression as BranchPCRel32ToPtrJumpStub,
|
||||
/// but identifies the call/branch as being to a pointer jump stub that may be
|
||||
/// bypassed if the ultimate target is within range of the fixup location.
|
||||
/// 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 - 4: int32
|
||||
|
@ -157,7 +158,7 @@ enum EdgeKind_x86_64 : Edge::Kind {
|
|||
/// - The result of the fixup expression must fit into an int32, otherwise
|
||||
/// an out-of-range error will be returned.
|
||||
///
|
||||
BranchPCRel32ToPtrJumpStubRelaxable,
|
||||
BranchPCRel32ToPtrJumpStubBypassable,
|
||||
|
||||
/// A GOT entry getter/constructor, transformed to Delta32 pointing at the GOT
|
||||
/// entry for the original target.
|
||||
|
@ -338,7 +339,7 @@ inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E,
|
|||
|
||||
case BranchPCRel32:
|
||||
case BranchPCRel32ToPtrJumpStub:
|
||||
case BranchPCRel32ToPtrJumpStubRelaxable:
|
||||
case BranchPCRel32ToPtrJumpStubBypassable:
|
||||
case PCRel32GOTLoadRelaxable:
|
||||
case PCRel32TLVPLoadRelaxable: {
|
||||
int64_t Value =
|
||||
|
|
|
@ -107,10 +107,9 @@ public:
|
|||
void fixPLTEdge(Edge &E, Symbol &Stub) {
|
||||
assert(E.getKind() == x86_64::BranchPCRel32 && "Not a Branch32 edge?");
|
||||
|
||||
// Set the edge kind to Branch32ToStub. We will use this to check for stub
|
||||
// optimization opportunities in the optimize ELF_x86_64_GOTAndStubs pass
|
||||
// below.
|
||||
E.setKind(x86_64::BranchPCRel32ToPtrJumpStubRelaxable);
|
||||
// Set the edge kind to Branch32ToPtrJumpStubRelaxable to enable it to be
|
||||
// optimized when the target is in-range.
|
||||
E.setKind(x86_64::BranchPCRel32ToPtrJumpStubBypassable);
|
||||
E.setTarget(Stub);
|
||||
}
|
||||
|
||||
|
@ -191,7 +190,7 @@ static Error optimizeELF_x86_64_GOTAndStubs(LinkGraph &G) {
|
|||
dbgs() << "\n";
|
||||
});
|
||||
}
|
||||
} else if (E.getKind() == x86_64::BranchPCRel32ToPtrJumpStubRelaxable) {
|
||||
} else if (E.getKind() == x86_64::BranchPCRel32ToPtrJumpStubBypassable) {
|
||||
auto &StubBlock = E.getTarget().getBlock();
|
||||
assert(
|
||||
StubBlock.getSize() ==
|
||||
|
|
|
@ -466,10 +466,10 @@ public:
|
|||
assert(E.getAddend() == 0 &&
|
||||
"BranchPCRel32 edge has unexpected addend value");
|
||||
|
||||
// Set the edge kind to BranchPCRel32ToPtrJumpStubRelaxable. We will use
|
||||
// Set the edge kind to BranchPCRel32ToPtrJumpStubBypassable. We will use
|
||||
// this to check for stub optimization opportunities in the
|
||||
// optimizeMachO_x86_64_GOTAndStubs pass below.
|
||||
E.setKind(x86_64::BranchPCRel32ToPtrJumpStubRelaxable);
|
||||
E.setKind(x86_64::BranchPCRel32ToPtrJumpStubBypassable);
|
||||
E.setTarget(Stub);
|
||||
}
|
||||
|
||||
|
@ -535,7 +535,7 @@ static Error optimizeMachO_x86_64_GOTAndStubs(LinkGraph &G) {
|
|||
dbgs() << "\n";
|
||||
});
|
||||
}
|
||||
} else if (E.getKind() == x86_64::BranchPCRel32ToPtrJumpStubRelaxable) {
|
||||
} else if (E.getKind() == x86_64::BranchPCRel32ToPtrJumpStubBypassable) {
|
||||
auto &StubBlock = E.getTarget().getBlock();
|
||||
assert(StubBlock.getSize() == sizeof(x86_64::PointerJumpStubContent) &&
|
||||
"Stub block should be stub sized");
|
||||
|
|
|
@ -38,8 +38,8 @@ const char *getEdgeKindName(Edge::Kind K) {
|
|||
return "BranchPCRel32";
|
||||
case BranchPCRel32ToPtrJumpStub:
|
||||
return "BranchPCRel32ToPtrJumpStub";
|
||||
case BranchPCRel32ToPtrJumpStubRelaxable:
|
||||
return "BranchPCRel32ToPtrJumpStubRelaxable";
|
||||
case BranchPCRel32ToPtrJumpStubBypassable:
|
||||
return "BranchPCRel32ToPtrJumpStubBypassable";
|
||||
case RequestGOTAndTransformToDelta32:
|
||||
return "RequestGOTAndTransformToDelta32";
|
||||
case RequestGOTAndTransformToDelta64:
|
||||
|
|
Loading…
Reference in New Issue