[llvm-dev] How to know pass dependencies?

cszide via llvm-dev llvm-dev at lists.llvm.org
Tue Apr 23 23:43:30 PDT 2019


You do not need to add the dependencies of a transform pass in command line, since they will be added by the pass manager.
If a pass , like "-loop-interchange", can optimize the code, there must have optimization points in the code that can be optimized by this pass.

If you want to know the dependencies of a transform pass, you can read it's source code . In the getAnalysisUsage function, you will find the required dependencies of the pass.

At 2019-04-24 00:18:54, "Wang, Luyuan \\(MU-Student\\) via llvm-dev" <llvm-dev at lists.llvm.org> wrote:

Dear LLVM developers,


I'm a beginner with LLVM, and I want to see how different loop optimization passes influence the performance. For example, I've generated IR code, and I would like to use "Loop Interchange" as the only loop optimization pass.


However, when I simply used `opt -loop-interchange input.ll -S -o output.ll` command, the IR code didn't change. I guess the reason may be the "-loop-interchange" pass also depends on other passes, so I should also specify some other passes before the loop interchange pass. But how do I know these dependencies?


Here is my C program to test loop interchange:


int main() {

  int i=0;

  int j=0;

  int a[333][222];

  for (i=0; i <222; i++) {

        for (j=0; j <333; j++) {

                a[j][i] = i * j;

        } 
  }

  return 0; 
}





I also tried this command, but still no influence: 
opt -mem2reg -simplifycfg -loops -lcssa -loop-simplify -loop-rotate -loop-
interchange input.ll -S -o output.ll
Thank you so much.

Best,
Luyuan Wang



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190424/1d90712f/attachment.html>


More information about the llvm-dev mailing list