<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 19, 2016 at 3:34 PM, Eduard Burtescu via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">eddyb added inline comments.<br>
<span class=""><br>
================<br>
Comment at: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp:516<br>
@@ -515,2 +515,3 @@<br>
     } else {<br>
-      Ty = cast<SequentialType>(Ty)->getElementType();<br>
+      if (Ty->isPointerTy()) {<br>
+        // The only pointer type is for the very first index,<br>
----------------<br>
</span><span class="">dblaikie wrote:<br>
> This seems like a slightly indirect test of the property you describe in the comment.<br>
><br>
> Do you think it might be nicer to check if the iterator is == I->op_begin() + 1? Or to add a flag of some kind before the loop for this first case? Or perhaps to use a gep type iterator in parallel with the operands? (or an assert for any of these conditions)<br>
><br>
> Not necessary, just throwing some ideas around in case any of them seem like an improvement.<br>
</span>I think I would use `gep_type_iterator`, but I would have to rewrite each of these loops (and maybe make `gep_type_iterator` nicer to use, with C++11 range-for sugar perhaps).<br>
<br>
Although, now that I've gotten myself set with a fast rebase/rebuild cycle, it shouldn't be such an ordeal anymore, I might just try it out.<br></blockquote><div><br></div><div>Yeah, by no means a hard requirement - was just wanting to consider a bit if there's something nicer to avoid the repetition. Don't exhaust yourself on it unless it's of interest/looks likely to yield results.<br><br>- Dave</div></div></div></div>