<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">I believe if you pass(iirc) -pass-remarks-missed=“gisel-*”, it’ll print the instruction it failed to legalize.<br><br><div id="AppleMailSignature">Sent from my iPhone</div><div><br>On Oct 11, 2017, at 6:44 PM, S. Bharadwaj Yadavalli via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">Thanks for your quick reply.<div><br></div><div>Here its is:</div><div><br></div><div>===========</div><div><br></div><div><div>; ModuleID = 'simple_foo.c'</div><div>source_filename = "simple_foo.c"</div><div>target datalayout = "e-m:o-i64:64-f80:128-n8:16:<wbr>32:64-S128"</div><div>target triple = "x86_64-apple-macosx10.13.0"</div><div><br></div><div>; Function Attrs: noinline nounwind optnone ssp uwtable</div><div>define i32 @foo(i32 %a, i32 %b, i32 %c) #0 {</div><div>entry:</div><div> %retval = alloca i32, align 4</div><div> %a.addr = alloca i32, align 4</div><div> %b.addr = alloca i32, align 4</div><div> %c.addr = alloca i32, align 4</div><div> %sum = alloca i32, align 4</div><div> %sum1 = alloca i32, align 4</div><div> store i32 %a, i32* %a.addr, align 4</div><div> store i32 %b, i32* %b.addr, align 4</div><div> store i32 %c, i32* %c.addr, align 4</div><div> %0 = load i32, i32* %c.addr, align 4</div><div> %cmp = icmp ne i32 %0, 0</div><div> br i1 %cmp, label %if.then, label %if.else</div><div><br></div><div>if.then: ; preds = %entry</div><div> %1 = load i32, i32* %a.addr, align 4</div><div> %2 = load i32, i32* %b.addr, align 4</div><div> %add = add nsw i32 %1, %2</div><div> store i32 %add, i32* %sum, align 4</div><div> %3 = load i32, i32* %sum, align 4</div><div> %4 = load i32, i32* %c.addr, align 4</div><div> %div = sdiv i32 %3, %4</div><div> store i32 %div, i32* %retval, align 4</div><div> br label %return</div><div><br></div><div>if.else: ; preds = %entry</div><div> %5 = load i32, i32* %a.addr, align 4</div><div> %6 = load i32, i32* %b.addr, align 4</div><div> %add2 = add nsw i32 %5, %6</div><div> store i32 %add2, i32* %sum1, align 4</div><div> %7 = load i32, i32* %sum1, align 4</div><div> store i32 %7, i32* %retval, align 4</div><div> br label %return</div><div><br></div><div>return: ; preds = %if.else, %if.then</div><div> %8 = load i32, i32* %retval, align 4</div><div> ret i32 %8</div><div>}</div><div><br></div><div>attributes #0 = { noinline nounwind optnone ssp uwtable "correctly-rounded-divide-<wbr>sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-<wbr>leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="<wbr>false" "no-trapping-math"="false" "stack-protector-buffer-size"=<wbr>"8" "target-cpu"="penryn" "target-features"="+cx16,+<wbr>fxsr,+mmx,+sse,+sse2,+sse3,+<wbr>sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }</div><div><br></div><div>!llvm.module.flags = !{!0, !1}</div><div>!llvm.ident = !{!2}</div><div><br></div><div>!0 = !{i32 1, !"wchar_size", i32 4}</div><div>!1 = !{i32 7, !"PIC Level", i32 2}</div><div>!2 = !{!"clang version 6.0.0 (<a href="https://github.com/llvm-mirror/clang.git" target="_blank">https://github.com/llvm-<wbr>mirror/clang.git</a> 9563977e8bce81b1dd88ce7579e36a<wbr>055e3ff90b) (<a href="https://github.com/llvm-mirror/llvm.git" target="_blank">https://github.com/llvm-<wbr>mirror/llvm.git</a> 761e543ac73ddc55d2cf3c6892fe18<wbr>eecb0c89d9)"}</div></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 11, 2017 at 5:50 PM, Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">global-isel for x86 is still very much a work in progress. What was the content for simple_foo.ll?</div><div class="gmail_extra"><br clear="all"><div><div class="m_8133404827609359290m_2158687250864505093gmail_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br><div class="gmail_quote"><div><div class="m_8133404827609359290h5">On Wed, Oct 11, 2017 at 5:39 PM, S. Bharadwaj Yadavalli via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_8133404827609359290h5"><div dir="ltr"><span style="font-size:12.8px">Hi,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Can someone please let me know if I can expect GlobalISel to be functional for x86/x86-64 targets?</div><div style="font-size:12.8px"><p class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-p1"><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s1">$ uname -a</span></p><p class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-p1"><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s1">Darwin <Machine-Name> 17.0.0 Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X<wbr>86_64 x86_64</span></p></div><div style="font-size:12.8px">Following is the command I used that resulted in an error :</div><div style="font-size:12.8px"><p class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-p1"><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s1">~/github/build/llvm/Debug/bin/<wbr>llc -global-isel -O0 simple_foo.ll<span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-Apple-converted-space"> </span></span></p><p class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-p1"><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s1">LLVM ERROR: unable to legalize instruction (in function: foo)</span></p><p class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-p1"><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s1">llc without the -global-isel option works fine.</span></p></div><div style="font-size:12.8px">I built clang/llc using the sources with the following tips:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">LLVM</div><div style="font-size:12.8px"><p class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-p1"><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s1">761e543ac73 (</span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s2">HEAD -> </span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s3">master</span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s1">, </span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s4">origin/master</span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s1">, </span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s4">orig<wbr>in/HEAD</span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s1">)</span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s5"> [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).</span></p><p class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-p1">clang</p><p class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-p1"></p><p class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-p1"><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s1">9563977e8b (</span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s2">HEAD -> </span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s3">master</span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s1">, </span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s4">origin/master</span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s1">, </span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s4">orig<wbr>in/HEAD</span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s1">)</span><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s5"> [X86] Add support for 'amdfam17h' to __builtin_cpu_is to match gcc.</span></p><p class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-p1"><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s5">Thanks,</span></p><p class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-p1"><span class="m_8133404827609359290m_2158687250864505093m_4943174164200076565m_-1944124178244478270gmail-m_9063869700091709013m_-3236036515415256820gmail-s5">Bharadwaj</span></p></div></div>
<br></div></div>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>LLVM Developers mailing list</span><br><span><a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a></span><br><span><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></span><br></div></blockquote></body></html>