[llvm-commits] Speeding up instruction selection

Roman Levenstein romix.llvm at googlemail.com
Mon Mar 31 05:09:04 PDT 2008


Hi Dan, Hi Evan,

Here is the updated patch.

1) I introduced the SDOperandPtr class, as I suggested in my last
email. This class is a sort of an "intelligent" pointer. With this
class, there is no need to copy the SDOperand arrays into the
temporary SmallVectors. Therefore there is no additional overhead.

2) Additionally, I also finally made SDOperand a member of the SDUse,
instead of using it as a base class. Now we can be sure that no
unintentional conversion of SDUse into SDOperand happens.

3) I also changed the return types of some methods from SDUse to
SDOperand, as it was suggested during the review.

This patch passes all DejaGnu tests.

-Roman

2008/3/31, Evan Cheng <evan.cheng at apple.com>:
> Ok, as long as the compile time increase isn't noticeable I won't
>  sweat it. However, if it happens in a few places, perhaps we need (yet
>  another) a getNode() that takes iterators and hide the copying inside
>  that instead.
>
>
>  Evan
>
>
>  On Mar 28, 2008, at 3:14 PM, Dan Gohman wrote:
>
>  >
>  > On Mar 27, 2008, at 6:04 PM, Evan Cheng wrote:
>  >>
>  >>> OK. This is also my view. I don't think this temporary SmallVectors
>  >>> introduce any significant overhead. According to the profiler (I use
>  >>> Google profiling tools, which do not require to compile with -pg),
>  >>> they consume virtually no time and that even on big testcases,
>  >>> that I
>  >>> like so much :-)
>  >>
>  >> I am not sure about this. For all the places which pass the list of
>  >> SDOperand's as a ptr to an array, you want to make a copy of it into
>  >> an array before passing it?
>  >
>  > Hi Evan,
>  >
>  > The patch is not changing every place that passes lists of
>  > SDOperands to make an extra copy. The copy is only needed when
>  > passing an existing node's operands, which is are now stored as
>  > an array of SDUse, to a function that wants an SDOperand array.
>  > And judging by Roman's current patch, this doesn't happen in
>  > all that many places.
>  >
>  > Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SDNodeUses.patch
Type: text/x-patch
Size: 55908 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080331/c78088e6/attachment.bin>


More information about the llvm-commits mailing list