‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Thursday, December 5, 2019 4:44 AM, Richard Biener <richard.guent...@gmail.com> wrote:
... ... ... > > > > I'm trying to identify the source code which needs modification but I need > > help proceeding. > > I am comparing two compilations: The first is a simple file with a call to > > sin in a loop. > > Vectorization succeeds. The second is an almost identical file but with a > > call to sincos > > in the loop. Vectorization fails. > > In gdb, the earliest code location where the two compilations differ is in > > function > > number_of_iterations_exit_assumptions in file tree-ssa-loop-niter.c. Line > > op0 = gimple_cond_lhs (stmt); > > returns a tree which when analyzed in function instantiate_scev_r (in file > > tree-scalar-evolution.c) > > results in the first branch of the switch being taken for sincos. For sin, > > the 2nd branch of the > > switch is taken. > > How can I correlate stmt in the source line above to the relevant line in > > any dump among those created > > using debugging dump option -fdump-tree-all? > > grep ;) > > Can you provide a testcase with a simd attribute annotated cexpi that > one can play with? > On an x86_64 system, run Example 2 at this link: sourceware.org/glibc/wiki/libmvec After verifying vectorization (by finding a name with prefix _ZGV and suffix _sin in a.out), replace the call to sin by one to sincos. The file should be similar to this: ================ #include <math.h> int N = 3200; double c[3200]; double b[3200]; double a[3200]; int main (void) { int i; for (i = 0; i < N; i += 1) { sincos (a[i], &b[i], &c[i]); } return (0); } ================ In addition to the options shown in Example 2, I passed GCC flags -fopt-info-all, -fopt-info-internal and -fdump-tree-all to obtain more verbose messages. That should show vectorization failing for sincos, and diagnostics on the screen indicating reason(s) for the failure. To perform the runs on PPC64 requires building both GCC and GLIBC with modifications not yet accepted into the main development branches of the projects. Please let me know if you are able to run on x86_64; if not, then perhaps I can push the local GCC changes to some github repository. GLIBC changes are available at branch tuliom/libmvec of the development repository. Bert.