[PATCH] D30333: Split SimplifyCFG to run obscuring switch transforms only during last phase

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 17:07:00 PDT 2017


mehdi_amini accepted this revision.
mehdi_amini added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: lib/Transforms/Scalar/SimplifyCFGPass.cpp:256
+  }
+};
 }
----------------
joerg wrote:
> mehdi_amini wrote:
> > joerg wrote:
> > > mehdi_amini wrote:
> > > > Why two passes instead of a parameter?
> > > Two passes makes it easier to test it on the command line.
> > I can understand this aspect, but on the other hand that does not scale with adding more options, which is why we rarely do this. What other passes have the same approach?
> I don't think we have a good example where parts of a pass are disabled. I could split them off into a separate pass, but that seems to be even worse. Normally we only have adjustable limits as configuration of passes.
`Normally we only have adjustable limits as configuration of passes` ; I don't understand what you meant here? 

What I was referring to was things like `createFunctionInliningPass(Threshold);`, `createLoopRotatePass(SizeLevel == 2 ? 0 : -1)`, `createSimpleLoopUnrollPass(OptLevel)`, and `createLoopVectorizePass(true, LoopVectorize)`.


https://reviews.llvm.org/D30333





More information about the llvm-commits mailing list