[PATCH] D134161: [MemorySSA] Reset location size if IsGuaranteedLoopInvariant after phi tranlation

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 20:07:16 PDT 2022


StephenFan added inline comments.


================
Comment at: llvm/include/llvm/Analysis/MemorySSA.h:1273
+            CurrentPair.second =
+                CurrentPair.second.getWithNewSize(Location.Size);
+
----------------
nikic wrote:
> The logic here looks somewhat convoluted -- isn't this equivalent to doing the translation first and then doing the invariance check afterwards (dropping the size adjustment before phi translation entirely)?
Only if the phi translator gets a value different from the original one, line 1271 would be executed. if drop the size adjustment before phi translation entirely, in the case that `Location.Ptr` is not guaranteed loop invariant and can not be phi translated, the location size of `Location.Ptr` would not be adjusted to beforeOrAfterPointer. I hope I understood your question correctly and answered it clearly. :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134161



More information about the llvm-commits mailing list