Re: Disable LTO for now ?
by Steven Munroe
Jakub Jelinek writes:
> For targets which do support the target attribute, each
> function should be marked with the right set of options
> before streaming it,
Looking at the source (opencv 4.3.0) I can not find any usage of
__attribute__ ((target)) or #pragma ... optimization associated with ppc
specific code.
What I did find was a blind usage of
// absolute difference
#ifndef vec_absd
# define vec_absd(a, b) vec_sub(vec_max(a, b), vec_min(a, b))
#endif
ie if vec_absd is defined use it otherwise fake it.
and vec_absd will be defined in altivec,h (for gcc 9/10) #ifdef
__POWER9_VECTOR__
As I have found (repeatedly) this is not good enough. PVECLIB Building
Multi-target Libraries
<https://munroesj52.github.io/index.html#main_libary_issues_0_0> I suspect
this is another case that does not work when mixing targeted objects in LTO.
3 years, 8 months
Re: Disable LTO for now ?
by Steven Munroe
Sergio writes:
> Hello opencv [1] build also failed around LTO
Looking at the build logs:
https://koji.fedoraproject.org/koji/taskinfo?taskID=48055082
For the build.log that ends with:
lto1: error: '__builtin_altivec_vadub' requires the '-mcpu=power9' option
lto1: fatal error: target specific builtin not available
compilation terminated.
The build uses a mix of compiler options.
-mcpu=power8 -mtune=power8
and
-mcpu=power9 -mtune=power9
and sometimes
-mcpu=power8 ... -mcpu=power9 -mtune=power9
I suspect this works at the level of individual object (*.o)
generation but this might cause problems when a mix of -mcpu=power8
and -mcpu=power9 objects are combined in LTO optimization.
The compiler might get confused.
3 years, 8 months
Re: Disable LTO for now ?
by Steven Munroe
Jeff Law wrote:
> For ppc64le is that the build was done with p8, but there is one
> function (__builtin_altivec_vadub) that requires p9. This seems
> like a package bug at first glance, not an LTO issue.
Yup __builtin_altivec_vadub is POWER9_VECTOR only.
For P8/6 use something like this:
vmin = vec_min (a, b);
vmax = vec_max (a, b);
result = vec_sub (vmax, vmin);
executes in 4 cycles.
3 years, 9 months