0

I'm currently finding a way that can show how software pipelining is applied to the code.

for(int i = 1; i < N; i++)
{
    D[i] = A[i] * B[i] + 1;
}

I found the similar question with the answer using gcc option <-fsel-sched-pipelining>, however, it didn't show any difference after applying the option.

Is there any compiler option that shows software pipelining?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
wookie
  • 79
  • 6

1 Answers1

1

If you are using a llvm-based compiler, machinepipeliner is the pass doing the magic, which it's a back-end pass and may not be enabled on your compiler/ under the optimisation level you used or somehow the compiler deemed that the code fed was not eligible for this particular optimisation.

If you have a debug version of the compiler you are using, you could simply use the --debug-pass=Structure flag to verify if there was a "machine pipeliner" pass run at all, and if it was, using the -mllvm -debug-only=pipeliner flag, you would be able to see the detailed steps of the algorithm, whether it succeeded or failed to produce a schedule and the resulted code.

With a release version, your options are limited though, one thing you could do is to use the -mllvm -print-after-all flag and search for "Modulo Software Pipelining" to verify if the pass was run and the effect of the pass on the IR.

wild_donut
  • 11
  • 2