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

Colin LeMahieu via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 09:45:17 PST 2016


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





More information about the llvm-commits mailing list