[LLVMdev] Possible SelectionDAG Bug

David Greene dag at cray.com
Wed Mar 3 12:15:11 PST 2010


On Wednesday 03 March 2010 13:26:11 Dan Gohman wrote:

> > Ah, missed a spot in 2.5, which has a few more RAUW implementations.
> > I think we're good.
>
> Ok. Are you able to produce a testcase?  Does it depend on custom changes?

Apparently it does, because I have not been able to get the reduced testcase
I have to fail in any official LLVM release.  I've tried disabling various 
customizations here but have so far been unsuccessful.  I could certainly
contribute the reduced testcase if people think it would be useful.  It did
after all find a problem.

> Where does the failure happen (legalize, dagcombine, selection, etc.)?

DAGCombine.

> The interesting case happens when the "++UI;" code in the patch gets
> executed, so you could put a breakpoint there and look at the graph at
> that point, or insert an abort and use bugpoint.

Right.  I used bugpoint to reduce the testcase, but this was with our modified
LLVM.  I can submit that even though it never failed with stock LLVM code.

> Anyway, here's the theoretical situation I imagined:

> CSE and recursive RAUW are now done, so control transfers back to
> the original RAUW call. C was where the the first RAUW call's
> iterator was pointing, and it's now deleted, so that iterator is
> now invalid.

That makes sense.  In my particular situation it was a combinations of loads,
stores and chains.  Would it help to dump and/or graphviz the DAG before the
offending combine?  Is there some way we could construct a testcase given
a SelectionDAG?

                                                   -Dave





More information about the llvm-dev mailing list