[PATCH] [CodeGen] Combine shuffle from concat+bitcast scalar to avoid the smaller vector type.

Ahmed Bougacha ahmed.bougacha at gmail.com
Wed Apr 8 10:05:44 PDT 2015


Yes, but there's other combines that can get in the way.  For instance, my go-to example is the _dup testcase, which we'll try to turn into just (concat_vectors (bitcast (i16)), (bitcast (i16)), ...), which, when promoted, gets scalarized, and we never recover from that.  On X86 we do, that's the part I still need to look into.

>From what I see, there's two other alternatives:

- not creating CONCAT_VECTORS of illegal types
- fixing whatever de-scalarizes the legalized code later on for this testcase on X86 but not on AArch64 (intuition says it's the fact that i16 isn't legal on AArch64, whereas it is on X86, so when we promote the scalar input as well, all hell breaks loose).

The latter seems brittle, the former is basically saying "CONCAT_VECTORS is only the canonical way to concat vectors when they're legal", which I found wrong, but isn't that shocking, when you spell it out.

Thoughts?

-Ahmed


http://reviews.llvm.org/D8884

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list