This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Fix TBAA verfication crash
ClosedPublic

Authored by Dinistro on Feb 9 2023, 7:30 AM.

Details

Summary

This commit fixes a crash of the TBAA verification that happened due to
accessing memory through invalid pointers. A DenseMap does not guarantee
that pointers to its elements remain valid after additional elements
are inserted.

A testcase that caused this crash had more than 100 TBAA metadata
operations and thus no test is added. Instead, there is now an assertion
that ensures that the graph class is used correctly.

Diff Detail

Event Timeline

Dinistro created this revision.Feb 9 2023, 7:30 AM
Herald added a project: Restricted Project. · View Herald Transcript
Dinistro requested review of this revision.Feb 9 2023, 7:30 AM
Dinistro updated this revision to Diff 496147.Feb 9 2023, 8:38 AM

Added a helper vector to ensure that the graph elements have a deterministic order. Otherwise the cycle error message was non-deterministic, which could break tests.

vzakhari accepted this revision.Feb 9 2023, 8:58 AM

Thank you!

This revision is now accepted and ready to land.Feb 9 2023, 8:58 AM
This revision was automatically updated to reflect the committed changes.