[llvm-dev] Is there a way to pass Optimization passes to clang?

Phil Tomson via llvm-dev llvm-dev at lists.llvm.org
Wed Dec 2 10:30:21 PST 2015


On Wed, Dec 2, 2015 at 10:17 AM, David Chisnall <David.Chisnall at cl.cam.ac.uk
> wrote:

> On 2 Dec 2015, at 17:56, Phil Tomson via llvm-dev <llvm-dev at lists.llvm.org>
> wrote:
> >
> > Now my intent is to figure out which optimization pass is causing the
> problem by trying each one until I hit the same problem as with -O1, but
> clang itself doesn't seem to allow these commandline options, for example:
> >
> > clang -loops -lcssa ....
> >
> >
>
> If you want to pass LLVM arguments to clang, then you must prefix them
> with -llvm (e.g. -mllvm -loops -mllvm lcssa).
>
>
I just tried this:
CFLAGS += -mllvm adce -mllvm loops -mllvm loop-simplify -mllvm lcssa -mllvm
simplify-libcalls

And get:

clang (LLVM option parsing): Unknown command line argument 'adce'.  Try:
'clang (LLVM option parsing) -help'
clang (LLVM option parsing): Unknown command line argument 'loops'.  Try:
'clang (LLVM option parsing) -help'
clang (LLVM option parsing): Unknown command line argument
'loop-simplify'.  Try: 'clang (LLVM option parsing) -help'
clang (LLVM option parsing): Unknown command line argument 'lcssa'.  Try:
'clang (LLVM option parsing) -help'
clang (LLVM option parsing): Unknown command line argument
'simplify-libcalls'.  Try: 'clang (LLVM option parsing) -help'



> David
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151202/7f8a6f0a/attachment.html>


More information about the llvm-dev mailing list