This is an archive of the discontinued LLVM Phabricator instance.

[GVNSink] Fix failing GVNSink tests in the reverse iteration bot
ClosedPublic

Authored by mgrang on Oct 17 2017, 5:16 PM.

Details

Summary
The elts of ActivePreds which is defined as a SmallPtrSet are copied into
Blocks using std::copy. This makes the resultant order of Blocks
non-deterministic. We cannot simply sort Blocks as they need to match the
corresponding Values. So a better approach is to define ActivePreds as
SmallSetVector.

This fixes the following failures in http://lab.llvm.org:8011/builders/reverse-iteration:
        LLVM :: Transforms/GVNSink/indirect-call.ll
        LLVM :: Transforms/GVNSink/sink-common-code.ll
        LLVM :: Transforms/GVNSink/struct.ll

Diff Detail

Repository
rL LLVM

Event Timeline

mgrang created this revision.Oct 17 2017, 5:16 PM
efriedma edited edge metadata.Oct 17 2017, 5:29 PM

This is right in the sense that it's deterministic, which is definitely an improvement. I'm not sure equality comparisons on ModelledPHI really work the way they're supposed to, even with this patch, but I guess we don't need to fix that here.

Looks fine, but I'll wait for @dberlin to comment.

@dberlin Could you please review this?

dberlin edited edge metadata.Oct 23 2017, 11:13 AM

This seems reasonable to me,
I'd just add a comment to explain why it's a small set vector (so nobody breaks this future)

dberlin accepted this revision.Oct 23 2017, 11:13 AM
This revision is now accepted and ready to land.Oct 23 2017, 11:13 AM
This revision was automatically updated to reflect the committed changes.