[PATCH] D126455: [FuncSpec] Make the Function Specializer part of the IPSCCP pass.
Alexandros Lamprineas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 28 06:09:06 PDT 2022
labrinea added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/SCCP.cpp:161-172
+ // Record uses of V to avoid visiting irrelevant uses of const later.
+ SmallVector<Instruction *> UseInsts;
+ for (auto *U : V->users())
+ if (auto *I = dyn_cast<Instruction>(U))
+ if (Solver.isBlockExecutable(I->getParent()))
+ UseInsts.push_back(I);
+
----------------
labrinea wrote:
> chill wrote:
> > labrinea wrote:
> > > Just found that we need to do the same inside `replaceSignedInst()` too. I will move this code a function.
> > Would it be possible to call `markUsersAsChanged` here ?
> I think we can't because if we replace the uses first then the users of the old value will be empty. Can we markUsersAsChanged before we replaceAllUsesWith the new value? Btw markUsersAsChanged is private for the SCCPInstVisitor, but I suppose I could make it public if need be.
Actually I could call markUsersAsChanged on the new Instrcution after replacing the uses of the old Instruction with it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126455/new/
https://reviews.llvm.org/D126455
More information about the llvm-commits
mailing list