[llvm-commits] [llvm] r167942 - /llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp

Chandler Carruth chandlerc at google.com
Wed Nov 14 13:20:21 PST 2012


On Wed, Nov 14, 2012 at 10:38 AM, Hal Finkel <hfinkel at anl.gov> wrote:
> Author: hfinkel
> Date: Wed Nov 14 12:38:11 2012
> New Revision: 167942
>
> URL: http://llvm.org/viewvc/llvm-project?rev=167942&view=rev
> Log:
> Fix the largest offender of determinism in BBVectorize
>
> Iterating over the children of each node in the potential vectorization
> plan must happen in a deterministic order (because it affects which children
> are erased when two children conflict). There was no need for this data
> structure to be a map in the first place, so replacing it with a vector
> is a small change.
>
> I believe that this was the last remaining instance if iterating over the
> elements of a Dense* container where the iteration order could matter.
> There are some remaining iterations over std::*map containers where the order
> might matter, but so long as the Value* for instructions in a block increase
> with the order of the instructions in the block (or decrease) monotonically,
> then this will appear to be deterministic.

Pointers should not be assumed to be deterministically ordered. Any
ordering which is based on the numerical sort of addresses is a
non-determinism bug.



More information about the llvm-commits mailing list