[FuncSpec] Return changed if function is changed by tryToReplaceWithConstant
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Fri, 6 Aug 2021 07:10:02 +0000 (15:10 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Fri, 6 Aug 2021 09:00:17 +0000 (17:00 +0800)
commit0fd03feb4ba5d86835ac386eebe16cbc3cfb36ec
treef02fe8ff68730cfa5787bb8b18f6ec7c36bc1d12
parent2919ac8971727930d939aeccfc9a4e50ad6b9884
[FuncSpec] Return changed if function is changed by tryToReplaceWithConstant

The may get changed before specialization by RunSCCPSolver. In other
words, the pass may change the function without specialization happens.
Add test and comment to reveal this.
And it may return No Changed if the function get changed by
RunSCCPSolver before the specialization. It looks like a potential bug.

Test Plan: check-all

Reviewed By: https://reviews.llvm.org/D107622

Differential Revision: https://reviews.llvm.org/D107622
llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression.ll [new file with mode: 0644]