How to make clang stop before a specified LLVM pass and dump the LLVM IR -


how run clang , have stop before pass, loop-vectorize, , dump ir .ll file can later fed opt?

opt has -stop-after= option, clang seems missing equivalent option. here failed attempt clang 3.7.0rc2:

$ ../build/bin/clang -o2 -mllvm -stop-after=loop-vectorize a.cpp clang (llvm option parsing): unknown command line argument '-stop-after=loop-vectorize'.  try: 'clang (llvm option parsing) -help' clang (llvm option parsing): did mean '-print-after=loop-vectorize'? 

i've tried running clang -o0 -emit-llvm -s , running opt -o2, results different running clang -o2 directly.

i'm not aware of way stop after specific pass when compiling clang, instead can offer helpful alternative.

first, address opt , clang producing different ir files, may helpful compare pass lists clang -o2 , opt -o2 manually. can done both passing -debug-pass=arguments. when running clang need -mllvm pass argument along.

having done myself appears different set of passes being run each of them suggest confirming yourself.

to address initial question, might copy list of passes run during -o2 through loop-vectorize , run opt manually passing reduced list.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -