[PATCH] [PPC64LE] Remove unnecessary swaps from lane-insensitive vector computations

hfinkel at anl.gov hfinkel at anl.gov
Sat Apr 25 03:01:13 PDT 2015

This looks good, but we need to get rid of the

  let BaseName = "BLA" in
  def BLA: XForm_n<whatever...>

pattern. Here's one way to do it:

Change the definition of LaneSensitive to something like this:

  class LaneSensitive {
    bit SwapFlag = 1;
    string BaseName = NAME;

(this is similar to what MUBUFAddr64Table does in R600/SIInstrInfo.td).

Now the problem is that LaneSensitive will only work properly when used inside of a multiclass definition. For that, you'll need some multclass wrappers for the XForm classes (we already have a few of these, see the definition of XForm_6r and friends in PPCInstrInfo.td). We can then make the multiclass something like this:

  multiclass XForm_nls<whatever...> {
    def NAME : XForm_n<whatever...>, LaneSensitive;

and then you just need to change the definitions of the lane-sensitive instructions to something like:

  defm BLA : XForm_nls<whatever...>




More information about the llvm-commits mailing list