[PATCH] D12640: [RewriteStatepointsForGC] Make base pointer inference deterministic

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 4 11:31:38 PDT 2015


reames created this revision.
reames added a reviewer: sanjoy.
reames added a subscriber: llvm-commits.

Previously, the base pointer algorithm wasn't deterministic.  The core fixed point was (of course), but we were inserting new nodes and optimizing them in an order which was unspecified and variable.  We'd somewhat hacked around this for testing by sorting by value name, but that doesn't solve the general determinism problem.

Instead, we can use the order of traversal over the def/use graph to give us a single consistent ordering.  Today, this is a DFS order, but the exact order doesn't mater provided it's deterministic for a given input.  

(Q: It is safe to rely on a deterministic order of operands right?)

Note that this only fixes the determinism within a single inference step.  The inference step is currently invoked many times in a non-deterministic order.  That's the next change in the sequence.  :)

http://reviews.llvm.org/D12640

Files:
  lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12640.34051.patch
Type: text/x-patch
Size: 7655 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150904/5de9ae5a/attachment.bin>


More information about the llvm-commits mailing list