[PATCH] D89978: Fix SROA with a constant value PHI
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 22 16:56:06 PDT 2020
rampitec added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/SROA.cpp:3527
PHINode *PHI = cast<PHINode>(GEPI.getPointerOperand());
- if (GEPI.getParent() != PHI->getParent() ||
+ if (GEPI.getParent() != PHI->getParent() || PHI->hasConstantValue() ||
llvm::any_of(PHI->incoming_values(), [](Value *In)
----------------
efriedma wrote:
> I don't think that's what you want to check. In particular, it doesn't handle the case where a block has multiple predecessors containing a construct like `br i1 undef, label %cond.end.i, label %cond.end.i` (or more commonly, a switch).
Do you mean it is legal to have several incoming values from a same block and then some from another?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89978/new/
https://reviews.llvm.org/D89978
More information about the llvm-commits
mailing list