Compilation error targeting Power8

We are trying to run an OpenACC code on a Power8 machine. The code is perfectly working when targeting Intel CPU and NVIDIA GPUs, but when compiling for Power8 with PGI 18.1 we see this compilation error:

/opt/pgi/linuxpower/18.1/share/llvm/bin/opt -O2 -disable-slp-vectorization /tmp/pgccWdMpq5Zfxj3r.ll -S -o /tmp/pgccWdMpqDRgEKUC.llvm
/tmp/pgccWdMpq5Zfxj3r.ll:2483:29: error: use of undefined value '%res_I_p.addr'
        %54 = load double, double* %res_I_p.addr, align 8, !tbaa !86, !dbg !108
pgcc-Fatal-llvmopt completed with exit code 1

The piece of code generating this error seems to be this one, performing a reduction over the real part of complex double precision values:

  double res_R_p = 0.0;
  double res_I_p = 0.0;
  double resR = 0.0;
  int t;
#pragma acc kernels present(tr_local_plaqs)
#pragma acc loop reduction(+:res_R_p) reduction(+:res_I_p)
  for(t=(LNH_SIZEH-LOC_SIZEH)/2; t  < (LNH_SIZEH+LOC_SIZEH)/2; t++) {
    res_R_p += creal(tr_local_plaqs[0].c[t]);
    res_R_p += creal(tr_local_plaqs[1].c[t]);

  return res_R_p;

Do you have some hints about what could be causing this problem? And possibly how to avoid it?



Hi Enrico,

It looks like a compiler LLVM code generation error. Can you send a reproducing example to PGI Customer Service ( so we can file a problem report?

As for the error, without a reproducer I can’t tell what’s wrong. Though the error appears to be in the host code generation as opposed to the device code, so you could try reducing optimization (i.e use -O0 instead of -O2) to see if it gets past this error.


It is quite hard to create a reproducing example since the application is a bit large, but I will try… concerning the optimization level, how could I change it? It does not use the one I give as an argument to pgcc.

When calling:

pgcc -acc=noautopar -v -O0 -Minfo=all -ta=multicore

it ends up with the same error, using -O2:

/opt/pgi/linuxpower/18.1/share/llvm/bin/opt -O2 -disable-slp-vectorization /tmp/pgccbIrmdnnF5fSh.ll -S -o /tmp/pgccrIrmZGTWVqd3.llvm