[PATCH] D98316: [rs4gc] Simplify code by cloning existing instructions when inserting base chain [NFC]

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 15 20:02:41 PDT 2021


skatkov added a comment.

As I see the difference between old and new behavior is as follows:
Before we created new instruction which are not constructed yet (PHI node and verifier will complain if we missed anything) or are initialized with undefs.
Now we just create a new instructions containing the same values as derived pointer.

In both cases, later we fill the new instructions with detected bases. If there is not bugs the result should be the same.
In case we missed anything in the old case we get undef and with this patch we get old value.

If we take into account the patch https://reviews.llvm.org/D98315 which may skip setting second operand for ShuffleVector, with this patch
we can get the second operand equal to the old value instead of undef. I do not see how bad it can be but it is a difference.
So the main difference I see is related to ShuffleVector but not phi.

Not sure but original way seems a bit more protective than new one,
What kind of "some spurious test changes" do you observe?

Generally I do not have strong preference what is better, so I'm ok with this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98316



More information about the llvm-commits mailing list