Skip to content

llvm-opt-report can’t parse .opt.yaml file #55433

@juliegaspar

Description

@juliegaspar

Description:

While analysing the Spatter Benchmark for possible optimizations, we came across a conflict with llvm-opt-report. We focus on the loops contained in openmp_kernels.c.

Issue:

After compiling the original code with the option -fsave-optimization-record and -march=armv8.4-a+sve we could visualize the openmp_kernels.opt.yaml file correctly using the llvm-opt-report tool.
When the OpenMP #pragma omp simd is added in the source code (just before each inner loop of the openmp_kernels.c file), the files generated by clang 13.0.1 and clang 14.0.0, contain empty parameters. It causes the reader llvm-opt-report to not be able to parse the files:

error: YAML:4830:1: error: Type, Pass, Name or Function missing.

Pass:            ''
^

Steps to reproduce:

$ git clone https://github.com/hpcgarage/spatter.git
$ cd spatter
$ git checkout a9878dc916e77590b99f76c94bdc1606570bd78c

copy the configure_omp_clang file in ./configure/
configure_omp_clang.txt
to change the ./src/openmp/openmp_kernels.c : put the openmp_kernels.patch in /spatter
openmp_kernels.patch.txt

$ patch -p1 < openmp_kernels.patch
$ ./configure/configure_omp_clang
$ cd build_omp_clang/
$ make
$ cd ..
$ llvm-opt-report build_omp_clang/CMakeFiles/spatter.dir/src/openmp/openmp_kernels.c.opt.yaml

Metadata

Metadata

Assignees

No one assigned

    Labels

    llvm-toolsAll llvm tools that do not have corresponding tagrejects-valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions