[cfe-dev] Converting a clang -cc1 invocation into an llc invocation

Daniel Dunbar daniel at zuster.org
Fri Mar 12 14:07:13 PST 2010


Hi Edmund,

Chip answered this, mostly, but there are some subtle details in how
llc is invoked that aren't always obvious. For example, depending on
the exact arguments to Clang you may need to pass -O0 to llc, or
-mcpu, or target attrs, or the relocation model, or -disable-fp-elim,
etc. Unfortunately there is currently no easy way to get the exact
invocation.

My plan is to eventually extend the Clang driver to support this
directly to solve this problem.

 - Daniel

On Fri, Mar 12, 2010 at 8:50 AM, Edmund Grimley Evans
<Edmund.Grimley-Evans at arm.com> wrote:
> I've been compiling programs by invoking clang -cc1 like this:
>
> clang -cc1 -triple thumbv7-eabi -O3 -target-cpu cortex-a8 t.c -S
>
> I encounter an interesting problem that I want to investigate by looking
> at the SelectionDAGs. However, clang -cc1 doesn't accept the
> -view-legalize-dags option that llc accepts. What should I do?
>
> I notice that (strings `which clang` | grep view-legalize-dags), so is
> there a way of giving that argument to clang -cc1?
>
> Alternatively, is there a way of converting the clang -cc1 invocation
> into an llc invocation that will give exactly the same behaviour so that
> I can do the following?
>
> clang -cc1 -triple thumbv7-eabi -O3 -target-cpu cortex-a8 t.c
> -emit-llvm-bc
> llc t.bc ... -view-legalize-dags
>
>
>
>
>
>
> --
> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list