[PATCH] D146988: [CodeGen] Enable processing of interconnected complex number operations

Nicholas Guy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 03:51:14 PDT 2023


NickGuy requested changes to this revision.
NickGuy added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/test/CodeGen/AArch64/complex-deinterleaving-multiuses.ll:93
+;   *p2 = (a * b) * c;
+;   return d * c
+define <4 x float> @monster(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d, ptr %p1, ptr %p2) {
----------------
igor.kirillov wrote:
> NickGuy wrote:
> > dmgreen wrote:
> > > It is not obvious to me why d * c should prevent the rest of the tree transforming. Can you precommit the tests to show the differences in the review?
> > I'm not sure it's the `d * c` that's preventing it, so much as the store to %p1 (It doesn't reinterleave, so the store is deemed "outside the graph").
> > Though I agree, pre-commits would be useful to see the difference in the other cases
> The idea is that any external use of complex computation chain prevents deinterleaving. And if one chain stops to be deinterleaved it might effect another chain, which is shown in this test. *p1 prevent for a*b to be deinterleaved, which in its turn prevents (a * b * c)  to be deinterleaved and that in its turn spoils d*c expression. As result nothing is deinterleaved.
> 
> At least that's what I thought before pre-commiting this tests where pre-patch code decided to deinterleaved d * c operation - https://reviews.llvm.org/D147659. Now, I have a question. If shufflevector is used outside, should we still deinterleave code?
> If shufflevector is used outside, should we still deinterleave code?
As long as the shufflevector used is the reinterleaving one we're fine to do so, as it should simply replace only what it can and preserve the rest, but that feels very much like a cost model problem to me. 

> The idea is that any external use of complex computation chain prevents deinterleaving. And if one chain stops to be deinterleaved it might effect another chain, which is shown in this test. *p1 prevent for a*b to be deinterleaved, which in its turn prevents (a * b * c) to be deinterleaved and that in its turn spoils d*c expression. As result nothing is deinterleaved.
In this case though, I don't see a reason why `d * c` shouldn't be replaced, it's not part of any other expression so should be able to be replaced in isolation. For that matter, the assignment to p1 is the only expression that I'd expect not to be transformed, the rest should be able to go through fine (it would be a different story if it was something like `*p2 = (a * b) * p1`, but the lack of data dependencies between them means they can and should be treated in isolation of eachother)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146988



More information about the llvm-commits mailing list