1 year ago

#372563

test-img

Afif Ishamsyah

In LLVM IR with OpenMP, how do I get all the omp loops and the Instructions?

I managed to use clang with "-fopenmp" to get the LLVM IR of an OpenMP program. I saw the content and there are so much "omp" loops inside. I need to get all Instructions only from inside those omp loops. How do I do that?

For example, I want to get only the omp ones from :

for.end28:                                        ; preds = %for.cond
  br label %omp.body.continue, !dbg !468

omp.body.continue:                                ; preds = %for.end28
  br label %omp.inner.for.inc, !dbg !423

omp.inner.for.inc:                                ; preds = %omp.body.continue
  %47 = load i32, i32* %.omp.iv, align 4, !dbg !419
  %add29 = add nsw i32 %47, 1, !dbg !414
  store i32 %add29, i32* %.omp.iv, align 4, !dbg !414
  br label %omp.inner.for.cond, !dbg !423, !llvm.loop !469

clang

openmp

llvm

llvm-ir

0 Answers

Your Answer

Accepted video resources