[PATCH] D106667: SROA: Enhance speculateSelectInstLoads
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 6 12:03:22 PDT 2021
lebedev.ri added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/SROA.cpp:1342-1346
+ BitCastInst *BC = dyn_cast<BitCastInst>(U);
+ if (BC && BC->hasOneUse())
+ LI = dyn_cast<LoadInst>(*BC->user_begin());
+ else
+ LI = dyn_cast<LoadInst>(U);
----------------
cdevadas wrote:
> arsenm wrote:
> > I think other places that handle this use a user worklist and don't have the one use restriction for the bitcast (e.g. PointerReplacer::collectUsers)
> For the transformation to happen, If there are multiple users of Bitcast, they should all be load instructions. That will make the IR non-canonical. The one-use restriction makes sense I guess.
> That will make the IR non-canonical. The one-use restriction makes sense I guess.
Could you expand on that?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106667/new/
https://reviews.llvm.org/D106667
More information about the llvm-commits
mailing list