Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two build warnings in CLANG DataFormats/Math/test/CholeskyInvert_t.cpp #32746

Closed
mrodozov opened this issue Jan 26, 2021 · 8 comments · Fixed by #33355
Closed

Two build warnings in CLANG DataFormats/Math/test/CholeskyInvert_t.cpp #32746

mrodozov opened this issue Jan 26, 2021 · 8 comments · Fixed by #33355

Comments

@mrodozov
Copy link
Contributor

In the Clang IB we have two warnings due to

/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/cff53344cac83c1abd88bb561d95fc5c/opt/cmssw/slc7_amd64_gcc900/cms/cmssw/CMSSW_11_3_CLANG_X_2021-01-25-2300/src/DataFormats/Math/test/CholeskyInvert_t.cpp:48:6: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning]

which says clang unable to vectorize a loop
probably around the pragmas in the same file
https://github.com/cms-sw/cmssw/blob/master/DataFormats/Math/test/CholeskyInvert_t.cpp#L97

Full log is in:
https://cmssdt.cern.ch/SDT/cgi-bin/buildlogs/slc7_amd64_gcc900/CMSSW_11_3_CLANG_X_2021-01-25-2300/DataFormats/Math

One hint is there is a option to be enabled in our llvm build to enable clang to vectorize loops (have not tried yet if the problem is in the llvm external).

@cmsbuild
Copy link
Contributor

A new Issue was created by @mrodozov Mircho Rodozov.

@Dr15Jones, @dpiparo, @silviodonato, @smuzaffar, @makortel, @qliphy can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@makortel
Copy link
Contributor

assign reconstruction

@cmsbuild
Copy link
Contributor

New categories assigned: reconstruction

@slava77,@perrotta,@jpata you have been requested to review this Pull request/Issue and eventually sign? Thanks

@makortel
Copy link
Contributor

I see @smuzaffar silenced the warning in #29790 for LLVM 9. Was it the (already distant) upgrade to LLVM 10 that made the warning to reappear?

@mrodozov
Copy link
Contributor Author

mrodozov commented Feb 10, 2021

I was reading this which
https://lists.llvm.org/pipermail/llvm-dev/2016-March/096291.html
is old, but it says
"If a loop contains a function the loop cannot be vectorized unless the function is inlined"
which in our case is indeed inlined.
https://github.com/cms-sw/cmssw/blob/master/DataFormats/Math/interface/choleskyInversion.h#L340
If I remove line
https://github.com/cms-sw/cmssw/blob/master/DataFormats/Math/test/CholeskyInvert_t.cpp#L103
the warning is gone. If I change the function with any of this:
https://llvm.org/docs/Vectorizers.html#vectorization-of-function-calls
say creating an array;
int * fff = new int[1024];
and change the loop to this:

for (unsigned int i = 0; i < 1024; ++i) {
       fff[i] = pow(i, 2);
}

compiles without warning. The problem is with the cholesky function not being able to work with the vectorization

@slava77
Copy link
Contributor

slava77 commented Feb 10, 2021

@VinInn
it looks like you are the author of the test.
please take a look.
Thank you.

@mrodozov
Copy link
Contributor Author

mrodozov commented Apr 6, 2021

@VinInn would you suggest how to proceed with this, please :) A kind reminder

@VinInn
Copy link
Contributor

VinInn commented Apr 6, 2021

the doc is this one https://llvm.org/docs/Vectorizers.html
Most probably we can just remove the pragma.
More in general: this type of info in tests is something useful to verify "regression".
They will appear as warning (in gcc as well). If we cannot manage we have just to silence them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants