On 7/12/23 01:27, Richard Biener wrote:
Using SSA_NAME_DEF_STMT during expansion is OK, but I don't think you
can rely on REG_EXPR here since you don't know whether any coalescing
happened. That said, maybe the implementation currently guarantees
you'll only see a REG_EXPR SSA name if there's a single definition
of that register, but at least I'm not aware of that and this is also
not documented.
If anyone knows if the implementation guarantees that, it'd probably be
Michael, since he did the revamping of the expansion code years ago.
I wonder if you can recover vlse.v at combine time though?
It may be hard to recover at combine time -- our vector insns aren't in
forms that are easily digested by combine. In this specific case we
have hope though. Essentially combine would need to recognize the
offsets vector as a simple stride and adjust appropriate.
That said, if the ISA supports gather/scatter with an affine offset
the more appropriate way would be to add additional named expanders
for this and deal with the above in the middle-end during RTL
expansion instead.
It's worth a try. I didn't have much luck with this at Tachyum, but I
always expected it was a mis-understanding of some parts of the
vectorizer on my part. I was deep inside this class of problems when I
had to push it on the stack to develop a golang port :(
We were basically going down the path of treating everythign as a
scatter-gather, but trying to recognize strides in the offsets vector as
a degenerate case.
jeff