Eric Martin via llvm-dev
2016-Oct-27 18:36 UTC
[llvm-dev] Bug with auto-vectorization of logf
Hi, I intended to file this bug on Bugzilla, but I've received no response from llvm-admin in the 10 days since asking for a Bugzilla account. I've written 2 test functions in C that take in a float array x of size n and output float array f(x), where f is either fabsf or logf. The LLVM 3.9 auto-vectorization docs claim that both functions will be vectorized: llvm.org/releases/3.9.0/docs/Vectorizers.html#vectorization-of-function-calls When running with "clang -O3 -march=x86-64 -mavx2 -ffast-math test.c -S -emit-llvm", the function calling fabsf is vectorized while the function calling logf is not. This is with clang 3.9, but I've also confirmed the bug exists back to at least clang 3.7. I've also observed that logf calls break vectorization of more complex loops, and I provide the comparison with fabsf as a reduced test case. I've attached the C program, a sh script to invoke clang with correct arguments, and an example LLVM IR file I produced by running on my system. If someone makes a Bugzilla account for me, I can refile this bug there. Best, Eric Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: <lists.llvm.org/pipermail/llvm-dev/attachments/20161027/26d0fce0/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: log_autovec_test.tgz Type: application/x-gzip Size: 2813 bytes Desc: not available URL: <lists.llvm.org/pipermail/llvm-dev/attachments/20161027/26d0fce0/attachment.bin>
Mehdi Amini via llvm-dev
2016-Oct-27 18:47 UTC
[llvm-dev] Bug with auto-vectorization of logf
+Tanya for the account issue.> On Oct 27, 2016, at 11:36 AM, Eric Martin via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi, > I intended to file this bug on Bugzilla, but I've received no response from llvm-admin in the 10 days since asking for a Bugzilla account. > > I've written 2 test functions in C that take in a float array x of size n and output float array f(x), where f is either fabsf or logf. The LLVM 3.9 auto-vectorization docs claim that both functions will be vectorized: llvm.org/releases/3.9.0/docs/Vectorizers.html#vectorization-of-function-calls <llvm.org/releases/3.9.0/docs/Vectorizers.html#vectorization-of-function-calls> > > When running with "clang -O3 -march=x86-64 -mavx2 -ffast-math test.c -S -emit-llvm", the function calling fabsf is vectorized while the function calling logf is not. This is with clang 3.9, but I've also confirmed the bug exists back to at least clang 3.7. I've also observed that logf calls break vectorization of more complex loops, and I provide the comparison with fabsf as a reduced test case. > > I've attached the C program, a sh script to invoke clang with correct arguments, and an example LLVM IR file I produced by running on my system. > > If someone makes a Bugzilla account for me, I can refile this bug there. > > Best, > Eric Martin > > <log_autovec_test.tgz>_______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <lists.llvm.org/pipermail/llvm-dev/attachments/20161027/ecf616c6/attachment.html>
Tanya Lattner via llvm-dev
2016-Oct-28 18:43 UTC
[llvm-dev] Bug with auto-vectorization of logf
Eric, I apologize for any delay or confusion. From my records/list archives, I saw that Anton had created an account for you on Oct 17th and responded to your email to llvm-admin. I am not sure what happened after that point as I thought the account was done. I just confirmed there is an account for you in bugzilla, so you should be good to go if you reset your password. -Tanya> On Oct 27, 2016, at 11:47 AM, Mehdi Amini <mehdi.amini at apple.com> wrote: > > +Tanya for the account issue. > >> On Oct 27, 2016, at 11:36 AM, Eric Martin via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: >> >> Hi, >> I intended to file this bug on Bugzilla, but I've received no response from llvm-admin in the 10 days since asking for a Bugzilla account. >> >> I've written 2 test functions in C that take in a float array x of size n and output float array f(x), where f is either fabsf or logf. The LLVM 3.9 auto-vectorization docs claim that both functions will be vectorized: llvm.org/releases/3.9.0/docs/Vectorizers.html#vectorization-of-function-calls <llvm.org/releases/3.9.0/docs/Vectorizers.html#vectorization-of-function-calls> >> >> When running with "clang -O3 -march=x86-64 -mavx2 -ffast-math test.c -S -emit-llvm", the function calling fabsf is vectorized while the function calling logf is not. This is with clang 3.9, but I've also confirmed the bug exists back to at least clang 3.7. I've also observed that logf calls break vectorization of more complex loops, and I provide the comparison with fabsf as a reduced test case. >> >> I've attached the C program, a sh script to invoke clang with correct arguments, and an example LLVM IR file I produced by running on my system. >> >> If someone makes a Bugzilla account for me, I can refile this bug there. >> >> Best, >> Eric Martin >> >> <log_autovec_test.tgz>_______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> >> lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <lists.llvm.org/pipermail/llvm-dev/attachments/20161028/ccaa1fb7/attachment.html>
Apparently Analagous Threads
- Bug with auto-vectorization of logf
- Bug with auto-vectorization of logf
- [PATCH 2/3] Use fabsf() instead of fabs() since we have floats, not double
- using cat to log to file with sapply
- [LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue