[llvm-dev] In ISel, where Constant<0> comes from?

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 18 02:21:06 PST 2018


On Tue, 18 Dec 2018 at 09:41, Gleb Popov <6yearold at gmail.com> wrote:
> Changing optimization level for Function main
>         Before: -O2 ; After: -O0
>         FastISel is enabled

Ah, I think I can guess what's happening. I assume your 1.ll is
Clang's output, and you used the default optimization level (which is
-O0).

That means your function is actually tagged as "optnone" and LLVM
tries to use a different instruction selector called "FastISel" rather
than create a DAG at all. This speeds up compilation and improve the
debug experience, but not all targets support it. SPARC falls back to
the DAG because FastISel can't handle the function, but x86 is getting
through it ever creating a DAG.

To see the X86 DAG you can either remove the "optnone" attribute from
the .ll file or override the selector on the llc command-line:
-fast-isel=0.

Cheers.

Tim.


More information about the llvm-dev mailing list