[llvm] [RISCV][GISEL] Legalize G_VSCALE (PR #85967)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 10:29:23 PDT 2024


michaelmaitland wrote:

> The MachineVerifier only forbids 0 IIRC. It is a common pattern sub(x, C) -> add(x, -C).

I see that it only forbids 0. I would have thought it makes sense to forbid <= 0. I find it weird for someone to say "give me a negative vscale". I can understand someone to say "give me a positive vscale and negate it"

It looks like we allow negative vscale so that we can fold early. I would have expected that we would fold in that negative after the G_VSCALE is lowered. But I can update this so we are 1:1 with SDAG in this case.

https://github.com/llvm/llvm-project/pull/85967


More information about the llvm-commits mailing list