[FuncSpec] Improve the accuracy of the cost model.
authorAlexandros Lamprineas <alexandros.lamprineas@arm.com>
Thu, 11 May 2023 23:07:49 +0000 (00:07 +0100)
committerAlexandros Lamprineas <alexandros.lamprineas@arm.com>
Wed, 24 May 2023 10:40:12 +0000 (11:40 +0100)
commitced90d1ff64a89a13479a37a3b17a411a3259f9f
tree562b4c470249174e57e523fca797e391feeeea79
parent4447b82b897ad5dda3a7a4178520731bcc6f22ec
[FuncSpec] Improve the accuracy of the cost model.

Instead of blindly traversing the use-def chain of constant arguments,
compute known constants along the way. Stop as soon as a user cannot
be replaced by a constant. Keep it light-weight by handling some basic
instruction types.

Differential Revision: https://reviews.llvm.org/D150464
llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h
llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
llvm/unittests/Transforms/IPO/CMakeLists.txt
llvm/unittests/Transforms/IPO/FunctionSpecializationTest.cpp [new file with mode: 0644]