[PATCH] D133739: [RISCV][WIP] Form more VW instructions

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 11:24:32 PDT 2022


craig.topper added a comment.

In D133739#3790115 <https://reviews.llvm.org/D133739#3790115>, @reames wrote:

> Have you looked at allowing the fold into the widening version without the one-use check at all?  This would allow users of the extend which could be widen instructions to use the input of the extend while leaving the extend around for any non-wideable users.
>
> Under the assumption that the widening variants execute at least as fast as the non-widening variants, this wouldn't seem to be problematic from a latency/throughput perspective.
>
> There is a register pressure concern - as we potentially have to keep both extended and non-extended version alive where previously, the unextended version might have been dead.  But in principle we have that problem every time we fold e.g. a splat into a .v.x variant of any instruction, and we don't seem to be burnt there.

The register pressure is worse for large LMUL. We do have an early clobber on the extend instructions anyway, so the dest already can't reuse the source register.

We can only fold one 2x stage of widening. If the original sext/zext is from i8->i32/i64 or from i16->i64, the fold will create a smaller extend for the remaining part. If the original extend doesn't fold into all uses, this increases the number of instructions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133739



More information about the llvm-commits mailing list