[PATCH] D126532: [SVE] Add a DAG combiner fold to visitADD for vscale with truncate

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 28 12:14:48 PDT 2022


reames added a comment.

I don't claim to fully understand this, so my comment here might be off base.

I suspect your fold can be generalized as: fold a+truncate(vscale(c1))+truncate(vscale(c2)) to a+truncate(vscale(c1)+vscale(c2))

The vscale(c1)+vscale(c2) to vscale(C1 <https://reviews.llvm.org/C1> + C2) is handled separately above already.

If this is true, that your transform reduces to proving that it's legal to common the truncate.  However, as a far as I known trunc(x) + trunc(y) is always equal to trunc(x+y).  So why do we need this transform at all?  Shouldn't this be covered by generic trunc folds and the existing rule?

Anyways, I'm clearly missing something here.  Any idea what?


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

https://reviews.llvm.org/D126532



More information about the llvm-commits mailing list