[llvm-dev] LLVM 3.9 RC2's SCCP pass removing calls to external functions?!

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 24 02:11:52 PDT 2016


On 24 August 2016 at 08:48, Alexandre Isoard via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I am probably stating the obvious, but if the function is side-effect free
> (onlyReadsMemory) it is valid to remove it.
>
> But I am guessing that does not belong to this pass.

I think it does.

This is a very aggressive pass that does all sorts of inter-procedural
cleanups, and unused side-effect free function calls is just the
thing.

It looks to me that the compiler just got a bit more picky and your
original assumption was wrong to begin with.

Maybe your project needs to tell the middle-end (via function
attributes) that the function does have side effects?

cheers,
--renato


More information about the llvm-dev mailing list