[llvm-dev] Virtual register defs don't dominate all uses

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Wed May 1 00:41:27 PDT 2019


On Wed, 1 May 2019 at 04:52, Josh Sharp via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> What's the difference between running clang with the -emit-llvm option vs running it with the --target=<mytarget> option.
> The error I described happens only if I run: clang --target=<mytarget> <inputfile>.c
> However if I do clang -emit-llvm <inputfile>.c -o <outputfile>.bc
> and then llc -march=<mytarget> <outputfile>.bc, no error occurs

The target does affect what IR gets generated in some respects
(particularly around function calls), so to reproduce an issue with
llc you often need to use both "-target" and "-emit-llvm" on Clang
(and then you can usually drop "-march" for llc since the triple is in
the IR).

You sometimes also need to add options to llc to make it behave more
like Clang (-O0 to enable FastISel for example, or some -reloc-model).
But that's not especially common. Finally, the full triple can matter
(especially if you're cross-compiling for a different OS), so using
-mtriple when invoking llc is sometimes needed.

Cheers.

Tim.


More information about the llvm-dev mailing list