[PATCH] D136332: [FuncSpec][NFC] Avoid redundant computations of DominatorTree/LoopInfo

Momchil Velikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 20 03:55:48 PDT 2022


chill created this revision.
Herald added subscribers: snehasish, ormris, hiraditya.
Herald added a project: All.
chill requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The `FunctionSpecialization` pass needs loop analysis results for its
cost function. For this purpose, it computes the `DominatorTree` and
`LoopInfo` for a function in `getSpecializationBonus`.  This function,
however, is called O(number of call sites x number of arguments), but
the DominatorTree/LoopInfo can be computed just once.

This patch plugs into the PassManager infrastructure to obtain
LoopInfo for a function and removes ad-hoc computation from
`getSpecializatioBonus`.


https://reviews.llvm.org/D136332

Files:
  llvm/include/llvm/Transforms/Utils/SCCPSolver.h
  llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
  llvm/lib/Transforms/IPO/SCCP.cpp
  llvm/lib/Transforms/Utils/SCCPSolver.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136332.469157.patch
Type: text/x-patch
Size: 7810 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221020/c2eda5d9/attachment-0001.bin>


More information about the llvm-commits mailing list