Files
clang-p2996/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
Alina Sbirlea edeaf41e22 [ConstantHoisting] Cache OptForSize. (#79170)
CacheOptForSize to remove quadratic behavior.

For each constant analyzed, ConstantHoising calls
`shouldOptimizeForSize(F)`, which calls `PSI.getTotalCallCount(F)`.
PSI.getTotalCallCount(F) goes through all the instructions in all basic
blocks, and checks if each is a call, to count them up.

This reduces `llc` time for a very large IR from ~10min to under 3min.
Reproducer testcase is much too large to share.
2024-01-23 09:42:47 -08:00

39 KiB