<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 18, 2018 at 2:21 PM Tim Northover <<a href="mailto:t.p.northover@gmail.com">t.p.northover@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, 18 Dec 2018 at 09:41, Gleb Popov <<a href="mailto:6yearold@gmail.com" target="_blank">6yearold@gmail.com</a>> wrote:<br>
> Changing optimization level for Function main<br>
>         Before: -O2 ; After: -O0<br>
>         FastISel is enabled<br>
<br>
Ah, I think I can guess what's happening. I assume your 1.ll is<br>
Clang's output, and you used the default optimization level (which is<br>
-O0).<br>
<br>
That means your function is actually tagged as "optnone" and LLVM<br>
tries to use a different instruction selector called "FastISel" rather<br>
than create a DAG at all. This speeds up compilation and improve the<br>
debug experience, but not all targets support it. SPARC falls back to<br>
the DAG because FastISel can't handle the function, but x86 is getting<br>
through it ever creating a DAG.<br>
<br>
To see the X86 DAG you can either remove the "optnone" attribute from<br>
the .ll file or override the selector on the llc command-line:<br>
-fast-isel=0.<br>
<br>
Cheers.<br>
<br>
Tim.<br></blockquote><div><br></div><div>You're absolutely right. Thanks a ton for your insights!<br></div></div></div>