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

Alexandre Isoard via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 24 03:45:03 PDT 2016


On Wed, Aug 24, 2016 at 10:11 AM, Renato Golin <renato.golin at linaro.org>
wrote:

> 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.

I see. Then I agree.

>
> It looks to me that the compiler just got a bit more picky and your
> original assumption was wrong to begin with.
>
However, he also stated that in the case the functions returns void it is
not removed, which suggest there is something fishier going on.

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



-- 
*Alexandre Isoard*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160824/5ff0172a/attachment.html>


More information about the llvm-dev mailing list