This is an archive of the discontinued LLVM Phabricator instance.

[JITLink] Relax zero-fill edge assertions.
ClosedPublic

Authored by sunho on Jul 24 2022, 6:54 PM.

Details

Summary

Relax zero-fill edge assertions to only consider relocation edges. Keep-alive edges to zero-fill blocks can cause this assertion which is too strict.

Diff Detail

Event Timeline

sunho created this revision.Jul 24 2022, 6:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2022, 6:54 PM
sunho requested review of this revision.Jul 24 2022, 6:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2022, 6:54 PM
lhames accepted this revision.Jul 25 2022, 5:24 PM

Otherwise LGTM.

llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
306–307

Can this specifically check for K == Edge::KeepAlive for now? Invalid is also a non-relocation edge, but we wouldn't want it sneaking through here.

llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.h
131–132

We don't want to drop this entirely. I think it should be rewritten as:

assert((!B->isZeroFill() ||
        all_of(B->edges(), [](const Edge &E) { return E.getKind() == Edge::KeepAlive; })) &&
       "Non-KeepAlive edges in zero-fill block?");
This revision is now accepted and ready to land.Jul 25 2022, 5:24 PM
sunho updated this revision to Diff 448822.Jul 30 2022, 4:33 PM
sunho marked 2 inline comments as done.
This revision was landed with ongoing or failed builds.Jul 30 2022, 4:34 PM
This revision was automatically updated to reflect the committed changes.