[PATCH] D146158: [FuncSpec] Track the return values of specializations.
Momchil Velikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 19 06:36:36 PDT 2023
chill added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/SCCPSolver.cpp:486
+ /// "unknown" on the way.
+ void invalidate(Instruction *I) {
+ SmallVector<Instruction *, 64> ToInvalidate;
----------------
Don't we always call `invalidate` with `CallBase *` ? Then the parameter ought to be `CallBase *`.
================
Comment at: llvm/lib/Transforms/Utils/SCCPSolver.cpp:493
+
+ auto [_, Inserted] = Invalidated.insert(Inst);
+ if (!Inserted)
----------------
if (!Invalidated.insert(Inst).second)
continue;
================
Comment at: llvm/lib/Transforms/Utils/SCCPSolver.cpp:505
+ Function *F = RetInst->getParent()->getParent();
+ auto TFRVI = TrackedRetVals.find(F);
+ if (TFRVI != TrackedRetVals.end()) {
----------------
nit: In C++17 one can use
```
if (auto It = TrackedRetVals.find(F); It != TYrackedRetVals.end()) {
...
```
================
Comment at: llvm/lib/Transforms/Utils/SCCPSolver.cpp:512
+ for (unsigned I = 0, E = STy->getNumElements(); I != E; ++I)
+ TrackedMultipleRetVals[std::make_pair(F, I)] =
+ ValueLatticeElement();
----------------
nit: Some (if not all) of these could be turned into `{F, I}` - less line noise, easier to read.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146158/new/
https://reviews.llvm.org/D146158
More information about the llvm-commits
mailing list