[cfe-dev] Add flags to clang and llvm

Arnaud de Grandmaison arnaud.allarddegrandmaison at parrot.com
Wed Jan 23 09:06:03 PST 2013


On 01/23/2013 03:28 PM, Rinaldini Julien wrote:
> Hi,
>
> I want to add a flag to clang and I want this flag to be passed to llvm... I'm looking in the Driver directory,
> but I'm a bit lost !
>
> I have written an optimisation pass in llvm and I want to be able to call it with my own flag (not the -O) like that for example:
>
> clang input.c -o output -b{1,2,3,4}
>
> Is there some documentation or some example somewhere ? I didn't find any in the doc :(
>
> Thx
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>

Hi Julien,

In order to tweak the 'unroll-threshold' parameter from LLVM's
LoopUnrollPass (lib/Transforms/Scalar/LoopUnrollPass.cpp) here are the
options I pass to clang :

-mllvm -unroll-threshold=4

Cheers,

-- 
Arnaud de Grandmaison




More information about the cfe-dev mailing list