[llvm-dev] LLVM 3.9 RC2's SCCP pass removing calls to external functions?!
Félix Cloutier via llvm-dev
llvm-dev at lists.llvm.org
Wed Aug 24 07:51:55 PDT 2016
Yes, there is no way for any pass to find out by itself whether that function has side effects, and I didn't tell it that it doesn't have any, so that seems overly aggressive.
As far as finding and fixing the problem goes: I used to build LLVM and Clang from source, but I stopped because a full build takes around 3 hours on this machine and I don't get a lot out of it. I use LLVM on my spare time and I'm about as casual as a compiler back-end user can be. Sanjoy, I'd be happy if you looked into it.
Félix
> Le 24 août 2016 à 05:47:46, Renato Golin <renato.golin at linaro.org> a écrit :
>
> On 24 August 2016 at 11:45, Alexandre Isoard <alexandre.isoard at gmail.com> wrote:
>> However, he also stated that in the case the functions returns void it is
>> not removed, which suggest there is something fishier going on.
>
> Looking back at the example (and LangRef, for function attributes),
> looks like it's not legal to remove because the function does *not*
> have "readnone" or "readonly", so LLVM can't prove it side-effect
> free.
>
> Sanjoy's fix is probably on the right track.
>
> --renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160824/5327d096/attachment.html>
More information about the llvm-dev
mailing list