[PATCH] D76983: [InstCombine] Transform extractelement-trunc -> bitcast-extractelement

Daan Sprenkels via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 28 10:12:19 PDT 2020


dsprenkels marked 2 inline comments as done.
dsprenkels added a comment.

> I didn't look at the logic closely, but seems to be on the right track from the tests (feel free to include Alive2 links in the review if you tested any/all of these).
>  I see at least 2 variations where we need more code logic (and more tests):

I added these cases to the patch.

For the case of the crazy types I added a check that requires the respective sizes of the vector and the truncated value to be compatible. This should prevent against an invalid bitcast being created. However, I still kinda allow really crazy types. Would it be better to just disable this canonicalization for types that don't look nice ? (Are "nice" types somehow even defined?)

Some examples that I checked with Alive2:

  Little endian
    - <3 x i64> to i32: http://volta.cs.utah.edu:8080/z/tt-qpe
    - <3 x i64> to i32: http://volta.cs.utah.edu:8080/z/KAkFBh (idx=1)
    - <3 x i64> to i16: http://volta.cs.utah.edu:8080/z/EqzJSY (idx=2)
  
  Big endian:
    - <3 x i64> to i32: http://volta.cs.utah.edu:8080/z/FRbHAA
    - <3 x i64> to i32: http://volta.cs.utah.edu:8080/z/oFvAdt (idx=1)
    - <3 x i64> to i16: http://volta.cs.utah.edu:8080/z/yB7Hng (idx=2)


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

https://reviews.llvm.org/D76983





More information about the llvm-commits mailing list