This is an archive of the discontinued LLVM Phabricator instance.

[llvm][codegen] Fix non-determinism in StackFrameLayoutAnalysisPass output
ClosedPublic

Authored by paulkirth on Jan 19 2023, 8:18 AM.

Details

Summary

We were iterating over a SmallPtrSet when outputting slot variables.
This is still correct but made the test fail under reverse iteration.
This patch replaces the SmallPtrSet with a SmallVector.

Also remove the "Stack Frame Layout" lines from arm64-opt-remarks-lazy-bfi test,
since those also break under reverse iteration.

Diff Detail

Event Timeline

paulkirth created this revision.Jan 19 2023, 8:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2023, 8:18 AM
paulkirth requested review of this revision.Jan 19 2023, 8:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2023, 8:18 AM
myhsu added a subscriber: myhsu.Jan 19 2023, 8:53 AM

You can use llvm::SetVector if elements need to be unique

You can use llvm::SetVector if elements need to be unique

That's a great suggestion. Thanks @myhsu

paulkirth updated this revision to Diff 490551.Jan 19 2023, 9:06 AM

Switch to SetVector from SmallVector, since we'd like to ensure these are unique.

nickdesaulniers accepted this revision.Jan 19 2023, 9:26 AM
This revision is now accepted and ready to land.Jan 19 2023, 9:26 AM
paulkirth updated this revision to Diff 490564.Jan 19 2023, 9:47 AM
paulkirth edited the summary of this revision. (Show Details)

Remove checks added to arm test, since they break under reverse iteration.
The test now just ignores the lines related to Stack Frame Analaysis, which is probably a better choice anyway.

This revision was landed with ongoing or failed builds.Jan 19 2023, 12:04 PM
This revision was automatically updated to reflect the committed changes.