This is an archive of the discontinued LLVM Phabricator instance.

Fix for bz24500: Avoid non-deterministic code generation triggered by the x86 call frame optimization
ClosedPublic

Authored by DavidKreitzer on Sep 3 2015, 5:44 PM.

Details

Summary

The root cause of the problem in bz24500 is that the x86 call frame optimization uses iteration over a DenseMap with pointer keys to determine the order in which calls are optimized. The immediate effect is a non-deterministic ordering in the virtual register use-def lists. Ultimately, the different list order results in different behavior in the register allocator.

The fix is to change the DenseMap structure that is currently used to hold the calls to be optimized into a SmallVector, which serves its purpose equally well or better but provides a deterministic iteration order.

Diff Detail

Event Timeline

DavidKreitzer retitled this revision from to Fix for bz24500: Avoid non-deterministic code generation triggered by the x86 call frame optimization.
DavidKreitzer updated this object.
DavidKreitzer added reviewers: rnk, mkuper.
DavidKreitzer added a subscriber: llvm-commits.
rnk accepted this revision.Sep 8 2015, 8:26 AM
rnk edited edge metadata.

lgtm

This revision is now accepted and ready to land.Sep 8 2015, 8:26 AM
This revision was automatically updated to reflect the committed changes.