[llvm-commits] Speeding up instruction selection

Gabor Greif gabor at mac.com
Fri Mar 7 11:41:19 PST 2008


Dan wrote:
 > Hmm, SDNode's Uses list doesn't track result numbers, so
 > SDNode::hasNUsesOfValue has to iterate through every operand of
 > every user of a node, calling SDOperand::operator== on each one.
 > It doesn't explain why this function doesn't show up in the profile
 > with your set approach, but it does seem like something that could

Because std::set does not use operator== to find the node in question.
Instead it uses operator< and assumes equality if !(a<b) && !(b<a).

	Gabor

 > be causing trouble. It would be interesting to try extending Uses to
 > hold result numbers along with the users, which would make the inner
 > loop of hasNUsesOfValue unnecessary. It looks like there are several
 > other places in codegen where this would apply as well.
 >
 > Dan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080307/f82d7f34/attachment.html>


More information about the llvm-commits mailing list