[AArch64] A question about rematerialization of simple add

Tim Northover t.p.northover at gmail.com
Thu Jun 26 00:26:47 PDT 2014


Hi Jiangning,

On 26 June 2014 07:42, Jiangning Liu <liujiangning1 at gmail.com> wrote:
> But ADDWri/ADDXri represents "Add (immediate) : Rd = Rn + shift(imm)" and
> shift can be either #0 or #12. For add with "lsl #12", it may not be the
> same cost as mov, so we would have to split Wri/Xri into two separate defs.

This is a microarchitectural property, so splitting the defs won't
really help anyway.

> Since ADDWri/ADDXri are being used around the back-end code, I not sure if
> this change meet your expectation and it seems not a very clean solution for
> me as well. Or do you know is there any smarter method in td file to
> dynamically assign isReMaterializable to 1 based on shift value?

I don't think there is a cleaner method at the moment; just this
comment in MachineInstr.h:

    bool isAsCheapAsAMove(QueryType Type = AllInBundle) const {
      // Only returns true for a bundle if all bundled instructions are cheap.
      // FIXME: This probably requires a target hook.
      return hasProperty(MCID::CheapAsAMove, Type);
    }

Cheers.

Tim.



More information about the llvm-commits mailing list