[cfe-dev] How to configure clang, to get const functions out of the loop (like on FreeBSD) ?

Nat! via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 16 03:15:18 PDT 2017


John McCall schrieb:

> I don't know of any reason why this would be different on different platforms, and I can verify that hacking a .ll file to pretend to be freebsd doesn't convince LLVM to hoist it.  Much more likely is that the FreeBSD version is a very old version of Clang; maybe there is a more recent change that prevents hoisting of const calls in some situations.  At any rate, your best bet is to file a bug.
>
> John.
>

Hi John,

Thanks for the reponse.

In the meantime, I've tried various freebsd clang versions. The 
regression happens between 3.8.1 and 3.9.0. I tried 3.8.1 on my own 
linux machine and the compiler also did hoist `foo` out of the loop.

So it seems that the godbolt explorer is somehow fooling with me, since 
there 3.8.1 does not do it. That's so curious though, that I still 
believe it must be a change in the config options somehow. (I tried with 
Firefox and Chrome).

I put up a bug report https://bugs.llvm.org/show_bug.cgi?id=34208 on 
this matter. But filing a bug is likely not my best bet. I say that with 
my experience of another optimizing bug which pains me a lot 
(https://bugs.llvm.org/show_bug.cgi?id=24448). It's been open for ~ 2 
years :)

So is there an easy way for me to narrow this bug down further to the 
commit level ? I read about llvmlab somewhere once, but 
http://lab.llvm.org/ seems closed ...

Ciao
    Nat!






More information about the cfe-dev mailing list