<div dir="ltr">Any idea why Hexagon was so much slower than x86 even when it using a binary search for "wait(r0)"?</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 11, 2016 at 11:30 AM, Colin LeMahieu <span dir="ltr"><<a href="mailto:colinl@codeaurora.org" target="_blank">colinl@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">colinl added a comment.<br>
<br>
Hah, you're right, good catch.  I changed the test to "r0=mpy(r0.l, r0.l):<<1:sat" and it definitely went sub-optimal.<br>
<span class=""><br>
> colinl@COLINL1 ~/llvm-master.ninja<br>
<br>
>  $ time ./bin/llvm-mc.exe -triple=hexagon-unknown-elf -filetype=obj huge.s -o huge.o<br>
<br>
><br>
<br>
</span>> real    8m8.593s<br>
<br>
>  user    0m0.000s<br>
<br>
>  sys     0m0.031s<br>
<br>
<br>
<br>
<br>
> colinl@COLINL1 ~/BRANCH_7_2.ninja<br>
<br>
>  $ time ./bin/llvm-mc.exe -triple=hexagon-unknown-elf -filetype=obj huge.s -o huge.o<br>
<br>
><br>
<br>
> real    0m32.186s<br>
<br>
>  user    0m0.015s<br>
<br>
>  sys     0m0.015s<br>
<br>
<br>
I think the easier part of getting the mnemonic searching technique working is in AsmParser where we're presented with the actual operands and could search through them with a target-specific hook and present the parser with a mnemonic in a canonical way.<br>
<br>
I think the harder part is getting tablegen to produce a match table that comes up with the same mnemonic given what's parsed from the .td files.  In our internal version we placed this code directly in the TI code in tablegen because we were only enabling the hexagon target; this would obviously be unacceptable.  It seems like tablegen in AsmMatcherEmitter.cpp would need to a way to execute target specific code on each parsed instruction text to retrieve what the mnemonic should be.<br>
<br>
I'm not aware of a place where TableGen does this type of thing already to use as a reference, any ideas?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D14257" rel="noreferrer" target="_blank">http://reviews.llvm.org/D14257</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">~Craig</div>
</div>