[cfe-dev] Passing Arguments to Back-End

Justin Holewinski justin.holewinski at gmail.com
Thu Sep 15 05:36:06 PDT 2011


On Wed, Sep 14, 2011 at 3:10 PM, Eli Friedman <eli.friedman at gmail.com>wrote:

> On Wed, Sep 14, 2011 at 11:55 AM, Justin Holewinski
> <justin.holewinski at gmail.com> wrote:
> > On Wed, Sep 14, 2011 at 2:54 PM, Justin Holewinski
> > <justin.holewinski at gmail.com> wrote:
> >>
> >> On Wed, Sep 14, 2011 at 2:42 PM, Eli Friedman <eli.friedman at gmail.com>
> >> wrote:
> >>>
> >>> On Wed, Sep 14, 2011 at 11:30 AM, Justin Holewinski
> >>> <justin.holewinski at gmail.com> wrote:
> >>> > On Wed, Sep 14, 2011 at 12:31 PM, Arnaud Allard de Grandmaison
> >>> > <Arnaud.AllardDeGrandMaison at dibcom.com> wrote:
> >>> >>
> >>> >> Hi Justin
> >>> >>
> >>> >>
> >>> >>
> >>> >> You can try the clang’s hidden ‘-llvm’ switch like this :  ‘-llvm
> >>> >> –mcpu=mycpu’ to pass options to the backend. I do not know for top
> of
> >>> >> tree,
> >>> >> but this works fine with llvm-2.9.
> >>> >
> >>> > Unfortunately, that does not work, at least not with ToT:
> >>> > $ clang -ccc-host-triple ptx32 test1.c -S -O1 -mllvm -mattr=double
> >>> > clang (LLVM option parsing): Unknown command line argument
> >>> > '-mattr=double'.
> >>> >  Try: 'clang (LLVM option parsing) -help'
> >>> > clang (LLVM option parsing): Did you mean '-stats=double'?
> >>> > For reference, what I want to replace is:
> >>> > $ clang -ccc-host-triple ptx32 test1.c -S -O1 -emit-llvm && llc
> >>> > -mattr=double test1.s -o test1.ptx
> >>>
> >>> Try "-Xclang -target-feature -Xclang +double".
> >>
> >> This seems to be on the right track, but now I'm getting another error:
> >> $ clang -ccc-host-triple ptx32 test1.c -S -O1 -Xclang -target-feature
> >> -Xclang sm20
> >> error: invalid target feature 'double'
> >
> > Sorry, bad copy-paste job.  Replace sm20 with double.  sm20 should also
> be a
> > valid option for the back-end.
>
> Oh, right, you also need to implement PTXTargetInfo::setFeatureEnabled
> (in lib/Basic/Targets.cpp).
>
>
Works like a charm now!  Thanks!


> -Eli
>



-- 

Thanks,

Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110915/2d449728/attachment.html>


More information about the cfe-dev mailing list