<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/55433>55433</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm-opt-report can’t parse .opt.yaml file
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
juliegaspar
</td>
</tr>
</table>
<pre>
### 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.
- Compilers Clang 14.0.0 and Clang 13.0.1
- Sources are from [https://github.com/hpcgarage/spatter](https://github.com/hpcgarage/spatter)
- Branch: master
- Commit: a9878dc916e77590b99f76c94bdc1606570bd78c.
### 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](https://github.com/llvm/llvm-project/files/8687031/configure_omp_clang.txt)
to change the **./src/openmp/openmp_kernels.c** : put the **openmp_kernels.patch** in /spatter
[openmp_kernels.patch.txt](https://github.com/llvm/llvm-project/files/8685956/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
</pre>
<img width="1px" height="1px" alt="" src="http://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