[PATCH] D126455: [FuncSpec] Make the Function Specializer part of the IPSCCP pass.

Alexandros Lamprineas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 01:27:02 PDT 2022


labrinea added a comment.

In D126455#3644307 <https://reviews.llvm.org/D126455#3644307>, @sinan wrote:

> tryToReplaceWithConstant method in SCCP does not update the lattice value map at SCCPSolver, and it might lead to a problem that
>
> if
>
>   %arg = getelementptr %struct, %struct* @Global, i32 0, i32 3
>   %tmp0 = call i64 @func2(i64* %arg)
>
> is folded into
>
>   %tmp0 = call i64 @func2(i64* getelementptr inbounds %struct, %struct* @Global, i32 0, i32 3)
>
> a new callbase argument appears, but it is not recorded at SCCPSolver, and this leads to problems such as D128822 <https://reviews.llvm.org/D128822>.
>
> Suggestion:
> FunctionSpecializer::tryToReplaceWithConstant use the code piece below to update the propagated argument, and maybe we need such a change for tryToReplaceWithConstant as well.
>
>   for (auto *I : UseInsts)
>     Solver.visit(I);

I am doing this in a later patch (see D126456 <https://reviews.llvm.org/D126456>) as I wanted to keep this one as close as possible to the original implementation.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126455/new/

https://reviews.llvm.org/D126455



More information about the llvm-commits mailing list