<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div></div><div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><div class=""><br class="">  SDNode &operator*<br class="">  SDNode *operator-><br class=""><br class="">? (because I assume you don't have an SDNode* lvalue to return a reference to) I assume the adapter helper can implement one of those in terms of the other so you only have to implement one of them? I forget how the adapter utility works.<br class=""></div></div></div></div></div></div></blockquote>I think it makes sense to do this.  This will unfortunately be one of the few SDNode & in the entire codebase though, which makes it stand out.  SDNode really does seem to always be a pointer.  I’ll fix up the patch to do this soon.<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br class="">
BTW, been trying to work out if there would ever be a good solution for an iterator combined with isa<> or dyn_cast<>.  If you look at the code this patch touches in AArch64ISelLowering, it is immediately followed by a dyn_cast.  I’d really like to find a clean way to fold that it to the foreach loop, i.e.,<br class="">
<br class="">
for (auto *C : dyn_cast<ConstantSDNode>(N->op_nodes()))<br class="">
<br class="">
just a thought, but thats unrelated to this patch for now.<br class=""></blockquote><div class=""><br class="">Yep, though probably more in the form of a filtered range, I suspect:<br class=""><br class="">  for (auto &C : filtered_transform(N->op_nodes(), [](SDUse *U) { return U->getNode(); }))<br class=""><br class="">It'd be a bit tricky to deal with the value type of this range's iterators - chances are the predicate should return an Optional<T&> (Hmm, don't think our Optional template supports ref parameters yet anyway) or T* (not sure if we could generalize it so it could cope with Optional<T>, maybe - so we could support generators where the values are not already/permanently in-memory) and then the value_type is T.<br class=""></div></div></div></div></div></blockquote>Interesting.  I hadn’t though to use Optional.  I might try to implement something like this if i get time.</div><div><br class=""></div><div>Cheers,</div><div>Pete<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br class="">
Cheers,<br class="">
Pete<br class="">
<br class="">
</blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>