[llvm] [LSR] Recognize vscale-relative immediates (PR #88124)

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 04:10:38 PDT 2024


huntergr-arm wrote:

> Hi - I have been looking at something that is related but mostly orthogonal to this in the generation of chains for vscale addressing modes recently. I've put the patch up at #94453. I don't think it changes alot of the same code as this patch, which is altering a lot more. That probably turned out to mostly be about how chains are generated. It does make use of the existing isLegalAddressingMode changes which have made it a lot easier since the last time I looked into it.
> 
> My high level comment for this patch, after looking into the chains, is the same as it has been elsewhere - that it feels like it is useful to at least conceptually be able to model `Base + Imm + vscale * ScalableImm` with both an Offset and a ScalableOffset treated independently. Even if it is unlikely that they are supported by the assembly, being able to represent them so that it can reason about things like `(Base+Imm) + vscale*ScalableImm` vs `(Base+vscale*ScalableImm) + imm` can be useful. I obviously could be wrong though, as I haven't seen the alternative version and am not sure how difficult it would be in practice.

I'm assuming by independently representing fixed and scalable immediates you mean we would have (potentially) two separate instances of `Immediate` (or whatever else we end up using)? I suppose there could be a use in terms of finding a legal add immediate followed up with a legal folded addressing mode, but I think that's outside the scope of this patch (which is just aimed at getting vscale-relative immediates off the ground).

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


More information about the llvm-commits mailing list