I want to dump the whole module before specific LLVM pass (namely, loop-vectorize), so that I can then pass the dumped module to
opt -loop-vectorize and debug the pass.
clang -O2 test.c -mllvm -stop-before=loop-vectorize does not work; the error I get is that the pass is not registered.
I tried to use
-print-before-all and manually extract the IR before the pass, but the output does not contain metadata, which makes the pass behave differently.
I also tried
-mllvm -disable-llvm-passes to get pristine IR and
-mllvm -debug-pass=arguments to figure out what passes are executed before loop-vectorize (so that I can pass them to
opt and get the desired input to loop-vectorize), but it does not show which LLVM passes are being run, i.e. it only shows passes added by the backend.
So, how can I tell clang to dump the module before a specific pass? Sorry for dummy question, but google didn’t help this time.