[LLVMbugs] [Bug 2174] New: llvm generated code ~20% slower than gcc for sqlite3
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Tue Mar 25 12:53:15 PDT 2008
http://llvm.org/bugs/show_bug.cgi?id=2174
Summary: llvm generated code ~20% slower than gcc for sqlite3
Product: new-bugs
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P2
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: edwintorok at gmail.com
CC: llvmbugs at cs.uiuc.edu
Created an attachment (id=1555)
--> (http://llvm.org/bugs/attachment.cgi?id=1555)
bzip2 packed sqlite.c
I adapted sqlite3's build system to llvm-test.
When running the test I get results like this:
Program | GCCAS Bytecode LLC compile LLC-BETA compile JIT codegen | GCC
CBE LLC LLC-BETA JIT | GCC/CBE GCC/LLC GCC/LLC-BETA LLC/LLC-BETA
sqlite3 | 4.8396 1744588 5.3496 * 3.6930 | 7.08
8.29 8.68 * 13.63 | 0.85 0.82 n/a n/a
To reproduce you can either take the package from here and run 'make
TEST=nightly report':
http://edwintorok.googlepages.com/sqlite_lemon_llvmtest.tar.gz
Or follow these steps (I am attaching all needed files):
$ llvm-gcc -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=0
-DHAVE_FDATASYNC=0 -DHAVE_USLEEP=0 -DHAVE_LOCALTIME_R=0 -DHAVE_GMTIME_R=0
-DHAVE_READLINE=0 -I. -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION=1
-I/home/edwin/llvm-svn/llvm/projects/llvm-test/MultiSource/Applications/sqlite3
-I/home/edwin/llvm-svn/llvm/projects/llvm-test/MultiSource/Applications/sqlite3
-I/home/edwin/llvm-svn/llvm/include
-I/home/edwin/llvm-svn/llvm/projects/llvm-test/include -I../../..//include
-I/home/edwin/llvm-svn/llvm/include -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
-DNDEBUG -O3 sqlite.c -emit-llvm -c -o sqlite3.bc && opt -std-compile-opts -f
sqlite3.bc -o sqlite3_opt.bc && llvm-ld -O2 -native sqlite3_opt.bc -o
sqlite3_llvm
$ gcc-4.3 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=0
-DHAVE_FDATASYNC=0 -DHAVE_USLEEP=0 -DHAVE_LOCALTIME_R=0 -DHAVE_GMTIME_R=0
-DHAVE_READLINE=0 -I. -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION=1
-I/home/edwin/llvm-svn/llvm/projects/llvm-test/MultiSource/Applications/sqlite3
-I/home/edwin/llvm-svn/llvm/projects/llvm-test/MultiSource/Applications/sqlite3
-I/home/edwin/llvm-svn/llvm/include
-I/home/edwin/llvm-svn/llvm/projects/llvm-test/include -I../../..//include
-I/home/edwin/llvm-svn/llvm/include -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
-DNDEBUG -O3 sqlite.c -o sqlite_native
$ time ./sqlite_native :memory: <tst.sql >/dev/null
real 0m1.589s
user 0m1.493s
sys 0m0.010s
$ time ./sqlite_llvm :memory: <tst.sql >/dev/null
real 0m1.970s
user 0m1.890s
sys 0m0.013s
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list