[PATCH][DAG] Fix non-deterministic code generation

Hal Finkel hfinkel at anl.gov
Sun Nov 17 05:09:54 PST 2013


----- Original Message -----
> From: "Juergen Ributzka" <juergen at apple.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "LLVM Commits" <llvm-commits at cs.uiuc.edu>
> Sent: Sunday, November 17, 2013 1:02:37 AM
> Subject: Re: [PATCH][DAG] Fix non-deterministic code generation
> 
> Hi Hal,
> 
> the availability queue in the list scheduler returns the nodes in IR
> order. If there is more than one node ready to schedule, then the
> difference in the IR order will produce different schedules.

Maybe I'm missing something, but that does not seem to explain the problem. The relative order of the nodes should be the same whether the first node starts with 0 or 29348.

It seems like we should do this anyway (or make the counter 64 bits). For one thing, on really large inputs, the current 32-bit counter could wrap (which would certainly produce this problem). But you're seeing some other issue here.

 -Hal

> 
> -Juergen
> 
> On Nov 16, 2013, at 10:40 PM, Hal Finkel <hfinkel at anl.gov> wrote:
> 
> > Juergen,
> > 
> > Do you happen to know what in CodeGen is sensitive to the absolute
> > value of the node order?
> > 
> > -Hal
> > 
> > ----- Original Message -----
> >> From: "Juergen Ributzka" <juergen at apple.com>
> >> To: "LLVM Commits" <llvm-commits at cs.uiuc.edu>
> >> Sent: Saturday, November 16, 2013 11:04:29 PM
> >> Subject: [PATCH][DAG] Fix non-deterministic code generation
> >> 
> >> 
> >> 
> >> Hi @ll,
> >> 
> >> this patch resets SDNodeOrder in the SelectionDAGBuilder before
> >> processing the IR of a new function. This is required to obtain
> >> deterministic code generation for a function regardless of its
> >> location in the source file.
> >> 
> >> Cheers,
> >> Juergen
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> _______________________________________________
> >> llvm-commits mailing list
> >> llvm-commits at cs.uiuc.edu
> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >> 
> > 
> > --
> > Hal Finkel
> > Assistant Computational Scientist
> > Leadership Computing Facility
> > Argonne National Laboratory
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list