[PATCH] D14257: [AsmParser] Generalize matching for grammars without mnemonic-lead statements.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 10:27:08 PST 2016


Is that the full instruction "wait(r0)"? Wouldn't the "wait" be considered
a mnemonic for the Mnemonic.empty() check in the match function which would
send it through the binary search?

On Mon, Jan 11, 2016 at 9:45 AM, Colin LeMahieu <colinl at codeaurora.org>
wrote:

> colinl added a comment.
>
> I hadn't run a benchmark before though I made a file with 1 million
> wait(r0) instructions, this is the last entry in the table so it should
> trigger the worst case.  The file amounts to 10mb and assembles to an
> object around 4mb.  For comparison I made an x86 file with 1 million "mov
> eax, cs" instructions.
>
> New parser:
> ===========
>
> colinl at COLINL1 ~/llvm-master.ninja
> $ time ./bin/llvm-mc.exe -triple=hexagon-unknown-elf -filetype=obj huge.s
> -o huge.o
>
> real    0m6.627s
> user    0m0.000s
>
> sys     0m0.031s
> ================
>
> Old parser:
> ===========
>
> colinl at COLINL1 ~/BRANCH_7_2.ninja
> $ time ./bin/llvm-mc.exe -triple=hexagon-unknown-elf -filetype=obj
> ../llvm-master.ninja/huge.s -o huge.o
>
> real    0m8.421s
> user    0m0.016s
>
> sys     0m0.015s
> ================
>
> X86 parser:
> ===========
>
> colinl at COLINL1 ~/llvm-trunk.ninja
> $ time ./bin/llvm-mc.exe -triple=i386 -x86-asm-syntax=intel -filetype=obj
> -o huge.o huge.s
>
> real    0m1.989s
> user    0m0.015s
>
> sys     0m0.015s
> ================
>
> The current parser exceeds the speed of our old parser and in the worst
> case the Hexagon parsing seems to be 3x slower than mnemonic lead targets
> which are all other targets.
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D14257
>
>
>
>


-- 
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160111/a3d8cc2e/attachment.html>


More information about the llvm-commits mailing list