[llvm-dev] Suboptimal code generated by clang+llc in quite a common scenario (?)

Jakub (Kuba) Kuderski via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 8 10:23:04 PDT 2019


You can add __builtin_assume(scscx == pp); if that's your invariant -- this
causes the loads to be gone using the clang from trunk.

On Thu, Aug 8, 2019 at 1:01 PM Joan Lluch via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi Tim and Alex
>
> Thanks for your replies.
>
> So just to make it clear for me: does this imply that there’s indeed no
> way on the current version to tell the compiler or Clang to optimize this?
>
> Thanks,
>
> Joan
>
>
> > On 8 Aug 2019, at 18:30, Tim Northover via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
> >
> > On Thu, 8 Aug 2019 at 17:08, Alex Brachet-Mialot via llvm-dev
> > <llvm-dev at lists.llvm.org> wrote:
> >> This might not be the workaround you want because it is only available
> in C, but you can use restrict to allow such optimizations.
> >
> > It also doesn't work in Clang unfortunately. We can only represent
> > restrict on function arguments at the moment.
> >
> > Cheers.
> >
> > Tim.
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>


-- 
Jakub Kuderski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190808/c0a0d60e/attachment.html>


More information about the llvm-dev mailing list