[PATCH] [AArch64] Enhance rematerialization by adding a new API isAsCheapAsAMove in TargetInstroInfo

Jiangning Liu liujiangning1 at gmail.com
Wed Jul 9 18:15:39 PDT 2014


Hi Eric,

It looks like we're just conflating isRematerializable and
> isAsCheapAsAMove, especially in the somewhat random addition of
> isRematerializable to some of the instructions and then adding the
> rest to isAsCheapAsAMove (and are they universally cheap or is it
> really subtarget dependent here?) and I haven't really seen an answer
> to Quentin's question about that? Are these actually rematerializable
> or is it just cheaper/etc?
>
> I think I answered this question previously. RegisterCoalescer pass has
the following checks,

  if (!TII->isAsCheapAsAMove(DefMI))
    return false;
  if (!TII->isTriviallyReMaterializable(DefMI, AA))
    return false;

They are cheap, so they are rematerializable.

isAsCheapAsAMove is overridden to make sure those instructions are cheap as
move.
isTriviallyReMaterializable is check if they are rematerializable, so
isRematerializable flag is added in .td file.

"I tried to move the check of isAsCheapAsMove to be insde
isReallyTriviallyReMaterializable(), but this semantic change obviously
could introduce a lot of "make check-all" regressions. I think, even if we
want to change this, it would be much better we do it separately."

Thanks,
-Jiangning

Thanks!
>
> -eric
>
> http://reviews.llvm.org/D4361
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140710/d184aa16/attachment.html>


More information about the llvm-commits mailing list