[PATCH] D24397: Target Power9 bit counting and vector comparison instructions through builtins (front end portion)

Nemanja Ivanovic via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 28 10:07:21 PDT 2016


Well, I don't know much about what Clang will actually do here, but I'll
follow your advice and add -O0 and pipe to opt -S -mem2reg. I'll also add a
test case in LLVM (test/CodeGen/PowerPC) that will test that after opt and
llc, we generate the desired code for these builtins.

Thanks Sanjay and Bjorn.

On Wed, Sep 28, 2016 at 6:53 PM, Sanjay Patel <spatel at rotateright.com>
wrote:

> spatel added a comment.
>
> In https://reviews.llvm.org/D24397#555552, @nemanjai wrote:
>
> > In https://reviews.llvm.org/D24397#555470, @spatel wrote:
> >
> > > Having a clang regression/unit test that depends on optimizer behavior
> is generally viewed as wrong. Can the tests be split into front-end (clang)
> tests and separate tests for the IR optimizer? Both x86 and AArch64 have
> done something like that in the last few months for testing of
> builtins/intrinsics.
> >
> >
> > Yeah, that sounds reasonable. I'll remove the -O2 from the test case and
> remove the checks for the select instructions. That's really the only major
> difference. So am I to understand the nsw/nuw flags will not be added
> without -O2 and the aforementioned changes will suffice?
>
>
> Changing to -O0 or using -disable-llvm-optzns should keep the clang tests
> from breaking due to underlying changes in the IR optimizer. That may lead
> to a lot of bloat though. In http://lists.llvm.org/
> pipermail/cfe-commits/Week-of-Mon-20160307/152324.html , it was viewed as
> ok, if not ideal, to pipe the clang IR output using "opt -S -mem2reg".
>
> Note that clang itself uses APIs like IRBuilder::CreateNUWSub(), so I
> think it's possible to see no-wrap IR even without the IR optimizer kicking
> in (but probably isn't a concern in this case?).
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D24397
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160928/0a82bddb/attachment.html>


More information about the cfe-commits mailing list