[PATCH] D60600: [InstCombine] Fix a vector-of-pointers instcombine undef bug.

Neil Henning via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 03:17:54 PDT 2019


sheredom added a comment.

In D60600#1470778 <https://reviews.llvm.org/D60600#1470778>, @reames wrote:

> I think you might be overcomplicating this.  I'd suggest the following:
>
> 1. scan all index types for a gep
> 2. run current code, but if any operand was gep, skip the recursive call on the operand
>
>   It's slightly less powerful, but correct, and easy.  And frankly, optimize geps of struct types is probably rare enough we don't care.
>
>   p.s. Agreed on the location of test file, please add to existing tests.


I don't really understand what your suggestion is here sorry - let me try and rephrase the suggestion and see if we agree?

1. You are saying that vector-of-pointers-to-struct is something that is rarely seen.
2. Your suggestion to fix this issue is to basically bail out of doing the get element ptr recursive simplify call if we see a vector-of-pointers-to-struct?

For 1., the reason I filed this bug is we have a bunch of code that has vector-of-pointers-to-struct, we use this to handle row-major matrices in our graphics stack. I want us to be as optimal as possible in this case, which leads me into 2. - is there any strong reason why we shouldn't do the more powerful thing here? EG. is there something intrinsically wrong/fragile with my approach that worries you going forward?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60600/new/

https://reviews.llvm.org/D60600





More information about the llvm-commits mailing list