[llvm-commits] [llvm] r85369 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Dan Gohman gohman at apple.com
Tue Oct 27 21:40:00 PDT 2009


On Oct 27, 2009, at 8:55 PM, Chris Lattner wrote:

> 
> On Oct 27, 2009, at 8:44 PM, Dan Gohman wrote:
> 
>> Author: djg
>> Date: Tue Oct 27 22:44:30 2009
>> New Revision: 85369
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=85369&view=rev
>> Log:
>> Rewrite SelectionDAG::isPredecessorOf to be iterative instead of
>> recursive to avoid consuming extraordinary amounts of stack space
>> when processing tall graphs.
> 
> Hi Dan,
> 
> Would it make sense or be possible to make this be a tri-state method that returns "yes, no or don't know"?  That way it could bail out if the search depth gets too bad, bounding the amount of work.

isPredecessorOf is used in contexts where true is a conservative
answer. So yes, this could be done, if anyone is interested.

Another optimization would be to check if the loads have no
chain users. In that case, no searching is necessary. That might
be a fairly common case.

Dan





More information about the llvm-commits mailing list