[PATCH] D89978: Fix SROA with a PHI mergig values from a same block

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 11:47:57 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SROA.cpp:3550
+      Value *NewVal = nullptr;
+      int Idx = NewPN->getBasicBlockIndex(B);
+      if (Idx >= 0) {
----------------
getBasicBlockIndex is linear in the number of operands, so this is overall O(N^2) in the number of PHI operands.  Unlikely to matter in most cases, but maybe we should bail out if there are too many operands.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89978



More information about the llvm-commits mailing list