From criswell at cs.uiuc.edu Mon Sep 29 09:06:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 09:06:01 2003 Subject: [llvm-commits] CVS: llvm/www/docs/CommandGuide/analyze.html Message-ID: <200309291405.JAA04627@tank.cs.uiuc.edu> Changes in directory llvm/www/docs/CommandGuide: analyze.html updated: 1.5 -> 1.6 --- Log message: Added explanation of where analyze gets its input, where it sends its output, and how it decides to interpret its input. --- Diffs of the changes: Index: llvm/www/docs/CommandGuide/analyze.html diff -u llvm/www/docs/CommandGuide/analyze.html:1.5 llvm/www/docs/CommandGuide/analyze.html:1.6 --- llvm/www/docs/CommandGuide/analyze.html:1.5 Thu Sep 25 14:50:04 2003 +++ llvm/www/docs/CommandGuide/analyze.html Mon Sep 29 09:05:08 2003 @@ -20,15 +20,20 @@ SYNOPSIS -analyze [options] < filename> +analyze [options] [filename]

DESCRIPTION

-The analyze command performs various analysis of LLVM bytecode. It will -usually print the results on standard output, but in a few cases it will print -output to standard error or generate a file with the analysis output (which is -usually done when generating output for another program). +The analyze command performs various analysis of LLVM assembly code or +bytecode. It will usually print the results on standard output, but in a few +cases, it will print output to standard error or generate a file with the +analysis output (which is usually done when the output is meant for another +program). +

+If filename is omitted or is -, analyze reads its input from standard input. +It first attempts to interpret its input as LLVM bytecode. If it encounters an +error, it then attempts to parse the input as LLVM assembly language.

OPTIONS

From criswell at cs.uiuc.edu Mon Sep 29 09:48:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 09:48:01 2003 Subject: [llvm-commits] CVS: llvm/utils/Burg/Doc/Makefile doc.aux doc.dvi doc.log doc.tex Message-ID: <200309291447.JAA20434@choi.cs.uiuc.edu> Changes in directory llvm/utils/Burg/Doc: Makefile (r1.1) removed doc.aux (r1.1) removed doc.dvi (r1.1) removed doc.log (r1.1) removed doc.tex (r1.1) removed --- Log message: Moved to llvm/support/tools/Burg. --- Diffs of the changes: From criswell at cs.uiuc.edu Mon Sep 29 09:48:03 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 09:48:03 2003 Subject: [llvm-commits] CVS: llvm/utils/Burg/.cvsignore COPYRIGHT LOG_CHANGES Makefile README b.h be.c burg.shar.gz burs.c closure.c delta.c fe.c fe.h gram.yc item.c lex.c list.c main.c map.c nonterminal.c operator.c pattern.c plank.c queue.c rule.c sample.gr string.c symtab.c table.c trim.c zalloc.c Message-ID: <200309291447.JAA20429@choi.cs.uiuc.edu> Changes in directory llvm/utils/Burg: .cvsignore (r1.2) removed COPYRIGHT (r1.1) removed LOG_CHANGES (r1.2) removed Makefile (r1.20) removed README (r1.1) removed b.h (r1.2) removed be.c (r1.3) removed burg.shar.gz (r1.1) removed burs.c (r1.1) removed closure.c (r1.1) removed delta.c (r1.1) removed fe.c (r1.1) removed fe.h (r1.3) removed gram.yc (r1.2) removed item.c (r1.1) removed lex.c (r1.2) removed list.c (r1.1) removed main.c (r1.2) removed map.c (r1.2) removed nonterminal.c (r1.2) removed operator.c (r1.1) removed pattern.c (r1.1) removed plank.c (r1.3) removed queue.c (r1.1) removed rule.c (r1.1) removed sample.gr (r1.1) removed string.c (r1.1) removed symtab.c (r1.1) removed table.c (r1.1) removed trim.c (r1.1) removed zalloc.c (r1.2) removed --- Log message: Moved to llvm/support/tools/Burg. --- Diffs of the changes: From criswell at cs.uiuc.edu Mon Sep 29 09:49:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 09:49:01 2003 Subject: [llvm-commits] CVS: llvm/support/tools/TableGen/Makefile Message-ID: <200309291448.JAA20487@choi.cs.uiuc.edu> Changes in directory llvm/support/tools/TableGen: Makefile updated: 1.6 -> 1.7 --- Log message: Updated Makefiles to reflect new location in llvm/support/tools. --- Diffs of the changes: Index: llvm/support/tools/TableGen/Makefile diff -u llvm/support/tools/TableGen/Makefile:1.6 llvm/support/tools/TableGen/Makefile:1.7 --- llvm/support/tools/TableGen/Makefile:1.6 Tue Aug 19 11:11:38 2003 +++ llvm/support/tools/TableGen/Makefile Mon Sep 29 09:48:29 2003 @@ -1,4 +1,4 @@ -LEVEL = ../.. +LEVEL = ../../.. TOOLNAME = tblgen USEDLIBS = support.a From criswell at cs.uiuc.edu Mon Sep 29 09:49:03 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 09:49:03 2003 Subject: [llvm-commits] CVS: llvm/support/tools/Burg/Makefile Message-ID: <200309291448.JAA20480@choi.cs.uiuc.edu> Changes in directory llvm/support/tools/Burg: Makefile updated: 1.20 -> 1.21 --- Log message: Updated Makefiles to reflect new location in llvm/support/tools. --- Diffs of the changes: Index: llvm/support/tools/Burg/Makefile diff -u llvm/support/tools/Burg/Makefile:1.20 llvm/support/tools/Burg/Makefile:1.21 --- llvm/support/tools/Burg/Makefile:1.20 Wed Sep 17 13:20:35 2003 +++ llvm/support/tools/Burg/Makefile Mon Sep 29 09:48:28 2003 @@ -1,4 +1,4 @@ -LEVEL = ../.. +LEVEL = ../../.. TOOLNAME = burg ExtraSource = gram.tab.c From criswell at cs.uiuc.edu Mon Sep 29 09:49:04 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 09:49:04 2003 Subject: [llvm-commits] CVS: llvm/utils/TableGen/.cvsignore CodeEmitterGen.cpp CodeEmitterGen.h CodeGenWrappers.cpp CodeGenWrappers.h FileLexer.l FileParser.y InstrInfoEmitter.cpp InstrInfoEmitter.h InstrSelectorEmitter.cpp InstrSelectorEmitter.h Makefile Record.cpp Record.h RegisterInfoEmitter.cpp RegisterInfoEmitter.h TableGen.cpp TableGenBackend.cpp TableGenBackend.h Message-ID: <200309291448.JAA20462@choi.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: .cvsignore (r1.1) removed CodeEmitterGen.cpp (r1.27) removed CodeEmitterGen.h (r1.8) removed CodeGenWrappers.cpp (r1.3) removed CodeGenWrappers.h (r1.5) removed FileLexer.l (r1.15) removed FileParser.y (r1.23) removed InstrInfoEmitter.cpp (r1.4) removed InstrInfoEmitter.h (r1.3) removed InstrSelectorEmitter.cpp (r1.34) removed InstrSelectorEmitter.h (r1.21) removed Makefile (r1.6) removed Record.cpp (r1.28) removed Record.h (r1.36) removed RegisterInfoEmitter.cpp (r1.12) removed RegisterInfoEmitter.h (r1.4) removed TableGen.cpp (r1.21) removed TableGenBackend.cpp (r1.3) removed TableGenBackend.h (r1.4) removed --- Log message: Moved to llvm/support/tools/TableGen. --- Diffs of the changes: From criswell at cs.uiuc.edu Mon Sep 29 09:50:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 09:50:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Annotation.cpp CommandLine.cpp ConstantRange.cpp Debug.cpp FileUtilities.cpp LeakDetector.cpp Mangler.cpp PluginLoader.cpp Signals.cpp Statistic.cpp SystemUtils.cpp Timer.cpp ValueHolder.cpp Message-ID: <200309291449.JAA20521@choi.cs.uiuc.edu> Changes in directory llvm/lib/Support: Annotation.cpp (r1.9) removed CommandLine.cpp (r1.38) removed ConstantRange.cpp (r1.5) removed Debug.cpp (r1.2) removed FileUtilities.cpp (r1.7) removed LeakDetector.cpp (r1.3) removed Mangler.cpp (r1.5) removed PluginLoader.cpp (r1.4) removed Signals.cpp (r1.8) removed Statistic.cpp (r1.10) removed SystemUtils.cpp (r1.15) removed Timer.cpp (r1.24) removed ValueHolder.cpp (r1.1) removed --- Log message: Moved to llvm/support/lib. --- Diffs of the changes: From criswell at cs.uiuc.edu Mon Sep 29 09:50:03 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 09:50:03 2003 Subject: [llvm-commits] CVS: llvm/support/Makefile Message-ID: <200309291449.JAA20505@choi.cs.uiuc.edu> Changes in directory llvm/support: Makefile added (r1.1) --- Log message: Updating Makefiles for new location in llvm/support. --- Diffs of the changes: Index: llvm/support/Makefile diff -c /dev/null llvm/support/Makefile:1.1 *** /dev/null Mon Sep 29 09:49:19 2003 --- llvm/support/Makefile Mon Sep 29 09:49:09 2003 *************** *** 0 **** --- 1,6 ---- + LEVEL = .. + + DIRS = lib tools + + include $(LEVEL)/Makefile.common + From criswell at cs.uiuc.edu Mon Sep 29 09:52:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 09:52:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Makefile Message-ID: <200309291451.JAA20546@choi.cs.uiuc.edu> Changes in directory llvm/lib/Support: Makefile (r1.3) removed --- Log message: Moved to llvm/support/lib. --- Diffs of the changes: From criswell at cs.uiuc.edu Mon Sep 29 09:53:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 09:53:02 2003 Subject: [llvm-commits] CVS: llvm/Makefile Message-ID: <200309291452.JAA20587@choi.cs.uiuc.edu> Changes in directory llvm: Makefile updated: 1.6 -> 1.7 --- Log message: Moved llvm/lib/Support to llvm/support/lib/Support. Moved llvm/utils/Burg and llvm/utils/TableGen to llvm/support/tools. --- Diffs of the changes: Index: llvm/Makefile diff -u llvm/Makefile:1.6 llvm/Makefile:1.7 --- llvm/Makefile:1.6 Thu Aug 14 23:53:45 2003 +++ llvm/Makefile Mon Sep 29 09:52:28 2003 @@ -1,5 +1,5 @@ LEVEL = . -DIRS = lib/Support utils lib tools runtime +DIRS = support lib tools runtime OPTIONAL_DIRS = projects include $(LEVEL)/Makefile.common From criswell at cs.uiuc.edu Mon Sep 29 09:53:04 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 09:53:04 2003 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200309291452.JAA20571@choi.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.24 -> 1.25 --- Log message: Moved llvm/lib/Support to llvm/support/lib/Support. Moved llvm/utils/Burg and llvm/utils/TableGen to llvm/support/tools. --- Diffs of the changes: Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.24 llvm/autoconf/configure.ac:1.25 --- llvm/autoconf/configure.ac:1.24 Fri Sep 26 14:51:42 2003 +++ llvm/autoconf/configure.ac Mon Sep 29 09:52:11 2003 @@ -54,7 +54,6 @@ AC_CONFIG_MAKEFILE(lib/ExecutionEngine/Makefile) AC_CONFIG_MAKEFILE(lib/ExecutionEngine/Interpreter/Makefile) AC_CONFIG_MAKEFILE(lib/ExecutionEngine/JIT/Makefile) -AC_CONFIG_MAKEFILE(lib/Support/Makefile) AC_CONFIG_MAKEFILE(lib/Target/Makefile) AC_CONFIG_MAKEFILE(lib/Target/Sparc/Makefile) AC_CONFIG_MAKEFILE(lib/Target/X86/Makefile) @@ -193,9 +192,6 @@ AC_CONFIG_MAKEFILE(tools/llvm-link/Makefile) AC_CONFIG_MAKEFILE(tools/opt/Makefile) AC_CONFIG_MAKEFILE(utils/Makefile) -AC_CONFIG_MAKEFILE(utils/Burg/Makefile) -AC_CONFIG_MAKEFILE(utils/Burg/Doc/Makefile) -AC_CONFIG_MAKEFILE(utils/TableGen/Makefile) AC_CONFIG_MAKEFILE(www/docs/Makefile) AC_CONFIG_MAKEFILE(projects/Makefile) AC_CONFIG_MAKEFILE(projects/sample/Makefile) @@ -209,6 +205,13 @@ AC_CONFIG_MAKEFILE(projects/ModuleMaker/Makefile.common) AC_CONFIG_MAKEFILE(projects/ModuleMaker/tools/Makefile) AC_CONFIG_MAKEFILE(projects/ModuleMaker/tools/ModuleMaker/Makefile) +AC_CONFIG_MAKEFILE(support/Makefile) +AC_CONFIG_MAKEFILE(support/lib/Makefile) +AC_CONFIG_MAKEFILE(support/lib/Support/Makefile) +AC_CONFIG_MAKEFILE(support/tools/Makefile) +AC_CONFIG_MAKEFILE(support/tools/Burg/Makefile) +AC_CONFIG_MAKEFILE(support/tools/Burg/Doc/Makefile) +AC_CONFIG_MAKEFILE(support/tools/TableGen/Makefile) dnl ************************************************************************** dnl * Determine which system we are building on From criswell at cs.uiuc.edu Mon Sep 29 09:53:05 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 09:53:05 2003 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200309291452.JAA20564@choi.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.32 -> 1.33 --- Log message: Moved llvm/lib/Support to llvm/support/lib/Support. Moved llvm/utils/Burg and llvm/utils/TableGen to llvm/support/tools. --- Diffs of the changes: Index: llvm/configure diff -u llvm/configure:1.32 llvm/configure:1.33 --- llvm/configure:1.32 Fri Sep 26 14:51:41 2003 +++ llvm/configure Mon Sep 29 09:52:09 2003 @@ -1587,9 +1587,6 @@ ac_config_commands="$ac_config_commands lib/ExecutionEngine/JIT/Makefile" - ac_config_commands="$ac_config_commands lib/Support/Makefile" - - ac_config_commands="$ac_config_commands lib/Target/Makefile" @@ -2004,15 +2001,6 @@ ac_config_commands="$ac_config_commands utils/Makefile" - ac_config_commands="$ac_config_commands utils/Burg/Makefile" - - - ac_config_commands="$ac_config_commands utils/Burg/Doc/Makefile" - - - ac_config_commands="$ac_config_commands utils/TableGen/Makefile" - - ac_config_commands="$ac_config_commands www/docs/Makefile" @@ -2052,6 +2040,27 @@ ac_config_commands="$ac_config_commands projects/ModuleMaker/tools/ModuleMaker/Makefile" + ac_config_commands="$ac_config_commands support/Makefile" + + + ac_config_commands="$ac_config_commands support/lib/Makefile" + + + ac_config_commands="$ac_config_commands support/lib/Support/Makefile" + + + ac_config_commands="$ac_config_commands support/tools/Makefile" + + + ac_config_commands="$ac_config_commands support/tools/Burg/Makefile" + + + ac_config_commands="$ac_config_commands support/tools/Burg/Doc/Makefile" + + + ac_config_commands="$ac_config_commands support/tools/TableGen/Makefile" + + # Find a good install program. We prefer a C program (faster), @@ -4399,7 +4408,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4402 "configure"' > conftest.$ac_ext + echo '#line 4411 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5240,7 +5249,7 @@ # Provide some information about the compiler. -echo "$as_me:5243:" \ +echo "$as_me:5252:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -6249,11 +6258,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6252: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6261: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6256: \$? = $ac_status" >&5 + echo "$as_me:6265: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6481,11 +6490,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6484: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6493: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6488: \$? = $ac_status" >&5 + echo "$as_me:6497: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6548,11 +6557,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6551: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6560: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6555: \$? = $ac_status" >&5 + echo "$as_me:6564: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8560,7 +8569,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:10806: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10801: \$? = $ac_status" >&5 + echo "$as_me:10810: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10861,11 +10870,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10864: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10873: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10868: \$? = $ac_status" >&5 + echo "$as_me:10877: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12104,7 +12113,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13036: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13031: \$? = $ac_status" >&5 + echo "$as_me:13040: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13091,11 +13100,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13094: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13103: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13098: \$? = $ac_status" >&5 + echo "$as_me:13107: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15035,11 +15044,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15038: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15047: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15042: \$? = $ac_status" >&5 + echo "$as_me:15051: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15267,11 +15276,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15270: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15279: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15274: \$? = $ac_status" >&5 + echo "$as_me:15283: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15334,11 +15343,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15337: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15346: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15341: \$? = $ac_status" >&5 + echo "$as_me:15350: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17346,7 +17355,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} @@ -24400,7 +24415,6 @@ lib/ExecutionEngine/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/ExecutionEngine/Makefile lib/ExecutionEngine/Makefile ;; lib/ExecutionEngine/Interpreter/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/ExecutionEngine/Interpreter/Makefile lib/ExecutionEngine/Interpreter/Makefile ;; lib/ExecutionEngine/JIT/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/ExecutionEngine/JIT/Makefile lib/ExecutionEngine/JIT/Makefile ;; - lib/Support/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Support/Makefile lib/Support/Makefile ;; lib/Target/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Target/Makefile lib/Target/Makefile ;; lib/Target/Sparc/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Target/Sparc/Makefile lib/Target/Sparc/Makefile ;; lib/Target/X86/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Target/X86/Makefile lib/Target/X86/Makefile ;; @@ -24539,9 +24553,6 @@ tools/llvm-link/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/tools/llvm-link/Makefile tools/llvm-link/Makefile ;; tools/opt/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/tools/opt/Makefile tools/opt/Makefile ;; utils/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/utils/Makefile utils/Makefile ;; - utils/Burg/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/utils/Burg/Makefile utils/Burg/Makefile ;; - utils/Burg/Doc/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/utils/Burg/Doc/Makefile utils/Burg/Doc/Makefile ;; - utils/TableGen/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/utils/TableGen/Makefile utils/TableGen/Makefile ;; www/docs/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/www/docs/Makefile www/docs/Makefile ;; projects/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/projects/Makefile projects/Makefile ;; projects/sample/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/projects/sample/Makefile projects/sample/Makefile ;; @@ -24555,6 +24566,13 @@ projects/ModuleMaker/Makefile.common ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/projects/ModuleMaker/Makefile.common projects/ModuleMaker/Makefile.common ;; projects/ModuleMaker/tools/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/projects/ModuleMaker/tools/Makefile projects/ModuleMaker/tools/Makefile ;; projects/ModuleMaker/tools/ModuleMaker/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/projects/ModuleMaker/tools/ModuleMaker/Makefile projects/ModuleMaker/tools/ModuleMaker/Makefile ;; + support/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/Makefile support/Makefile ;; + support/lib/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/lib/Makefile support/lib/Makefile ;; + support/lib/Support/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/lib/Support/Makefile support/lib/Support/Makefile ;; + support/tools/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/tools/Makefile support/tools/Makefile ;; + support/tools/Burg/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/tools/Burg/Makefile support/tools/Burg/Makefile ;; + support/tools/Burg/Doc/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/tools/Burg/Doc/Makefile support/tools/Burg/Doc/Makefile ;; + support/tools/TableGen/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/tools/TableGen/Makefile support/tools/TableGen/Makefile ;; esac done _ACEOF From criswell at cs.uiuc.edu Mon Sep 29 09:54:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 09:54:02 2003 Subject: [llvm-commits] CVS: llvm/utils/Makefile Message-ID: <200309291453.JAA20601@choi.cs.uiuc.edu> Changes in directory llvm/utils: Makefile (r1.1) removed --- Log message: Moved llvm/utils/Burg and llvm/utils/TableGen to llvm/support/tools. --- Diffs of the changes: From criswell at cs.uiuc.edu Mon Sep 29 10:03:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 10:03:01 2003 Subject: [llvm-commits] CVS: llvm/support/lib/Support/Makefile Message-ID: <200309291502.KAA04800@choi.cs.uiuc.edu> Changes in directory llvm/support/lib/Support: Makefile updated: 1.3 -> 1.4 --- Log message: Moved code from llvm/lib/Support to llvm/support/lib/Support. --- Diffs of the changes: Index: llvm/support/lib/Support/Makefile diff -u llvm/support/lib/Support/Makefile:1.3 llvm/support/lib/Support/Makefile:1.4 --- llvm/support/lib/Support/Makefile:1.3 Tue Jul 23 12:52:34 2002 +++ llvm/support/lib/Support/Makefile Mon Sep 29 10:02:30 2003 @@ -1,4 +1,4 @@ -LEVEL = ../.. +LEVEL = ../../.. LIBRARYNAME = support BUILD_ARCHIVE = 1 From criswell at cs.uiuc.edu Mon Sep 29 10:22:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 10:22:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/transforms.qms/lowerswitch.qms/2003-08-23-emptyswitch.qmt Message-ID: <200309291521.KAA04859@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/transforms.qms/lowerswitch.qms: 2003-08-23-emptyswitch.qmt added (r1.1) --- Log message: Adding new test. --- Diffs of the changes: Index: llvm/test/QMTestDB/regression.qms/transforms.qms/lowerswitch.qms/2003-08-23-emptyswitch.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/transforms.qms/lowerswitch.qms/2003-08-23-emptyswitch.qmt:1.1 *** /dev/null Mon Sep 29 10:21:12 2003 --- llvm/test/QMTestDB/regression.qms/transforms.qms/lowerswitch.qms/2003-08-23-emptyswitch.qmt Mon Sep 29 10:21:02 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/Transforms/LowerSwitch/2003-08-23-EmptySwitch.ll From criswell at cs.uiuc.edu Mon Sep 29 10:25:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 10:25:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/ Message-ID: <200309291524.KAA04896@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms added to the repository --- Diffs of the changes: From criswell at cs.uiuc.edu Mon Sep 29 10:29:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 10:29:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/2003-09-14-externalcall.qmt recursivetest.qmt simpletest.qmt Message-ID: <200309291528.KAA04961@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms: 2003-09-14-externalcall.qmt updated: 1.1 -> 1.2 recursivetest.qmt updated: 1.1 -> 1.2 simpletest.qmt updated: 1.1 -> 1.2 --- Log message: Corrected pathnames. --- Diffs of the changes: Index: llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/2003-09-14-externalcall.qmt diff -u llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/2003-09-14-externalcall.qmt:1.1 llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/2003-09-14-externalcall.qmt:1.2 --- llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/2003-09-14-externalcall.qmt:1.1 Mon Sep 29 10:28:21 2003 +++ llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/2003-09-14-externalcall.qmt Mon Sep 29 10:28:43 2003 @@ -1,2 +1,2 @@ -.*test/Regression/Transforms/PruneEH/2003-09-14-ExternalCall.ll +.*test/Regression/Transforms/PruneEH/2003-09-14-ExternalCall.llx Index: llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/recursivetest.qmt diff -u llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/recursivetest.qmt:1.1 llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/recursivetest.qmt:1.2 --- llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/recursivetest.qmt:1.1 Mon Sep 29 10:28:21 2003 +++ llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/recursivetest.qmt Mon Sep 29 10:28:43 2003 @@ -1,2 +1,2 @@ -.*test/Regression/Transforms/PruneEH/recursivetest.ll +.*test/Regression/Transforms/PruneEH/recursivetest.llx Index: llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/simpletest.qmt diff -u llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/simpletest.qmt:1.1 llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/simpletest.qmt:1.2 --- llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/simpletest.qmt:1.1 Mon Sep 29 10:28:21 2003 +++ llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/simpletest.qmt Mon Sep 29 10:28:43 2003 @@ -1,2 +1,2 @@ -.*test/Regression/Transforms/PruneEH/simpletest.ll +.*test/Regression/Transforms/PruneEH/simpletest.llx From criswell at cs.uiuc.edu Mon Sep 29 10:29:03 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 10:29:03 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/2003-09-14-externalcall.qmt recursivetest.qmt simpletest.qmt Message-ID: <200309291528.KAA04942@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms: 2003-09-14-externalcall.qmt added (r1.1) recursivetest.qmt added (r1.1) simpletest.qmt added (r1.1) --- Log message: Adding new PruneEH tests. --- Diffs of the changes: Index: llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/2003-09-14-externalcall.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/2003-09-14-externalcall.qmt:1.1 *** /dev/null Mon Sep 29 10:28:31 2003 --- llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/2003-09-14-externalcall.qmt Mon Sep 29 10:28:21 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/Transforms/PruneEH/2003-09-14-ExternalCall.ll Index: llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/recursivetest.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/recursivetest.qmt:1.1 *** /dev/null Mon Sep 29 10:28:31 2003 --- llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/recursivetest.qmt Mon Sep 29 10:28:21 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/Transforms/PruneEH/recursivetest.ll Index: llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/simpletest.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/simpletest.qmt:1.1 *** /dev/null Mon Sep 29 10:28:31 2003 --- llvm/test/QMTestDB/regression.qms/transforms.qms/pruneeh.qms/simpletest.qmt Mon Sep 29 10:28:21 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/Transforms/PruneEH/simpletest.ll From criswell at cs.uiuc.edu Mon Sep 29 10:35:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 10:35:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/transforms.qms/reassociate.qms/2003-08-12-infiniteloop.qmt Message-ID: <200309291534.KAA05016@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/transforms.qms/reassociate.qms: 2003-08-12-infiniteloop.qmt added (r1.1) --- Log message: Adding new test. --- Diffs of the changes: Index: llvm/test/QMTestDB/regression.qms/transforms.qms/reassociate.qms/2003-08-12-infiniteloop.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/transforms.qms/reassociate.qms/2003-08-12-infiniteloop.qmt:1.1 *** /dev/null Mon Sep 29 10:34:52 2003 --- llvm/test/QMTestDB/regression.qms/transforms.qms/reassociate.qms/2003-08-12-infiniteloop.qmt Mon Sep 29 10:34:42 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/Transforms/Reassociate/2003-08-12-InfiniteLoop.ll From lattner at cs.uiuc.edu Mon Sep 29 10:40:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Sep 29 10:40:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.micro.Makefile Message-ID: <200309291539.KAA28439@neo.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.micro.Makefile updated: 1.2 -> 1.3 --- Log message: Do not kill the report if a program doesn't JIT correctly --- Diffs of the changes: Index: llvm/test/Programs/TEST.micro.Makefile diff -u llvm/test/Programs/TEST.micro.Makefile:1.2 llvm/test/Programs/TEST.micro.Makefile:1.3 --- llvm/test/Programs/TEST.micro.Makefile:1.2 Sun Jun 22 15:11:18 2003 +++ llvm/test/Programs/TEST.micro.Makefile Mon Sep 29 10:39:48 2003 @@ -14,7 +14,7 @@ $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \ Output/%.$(TEST).report.txt: Output/%.llvm.bc Output/%.LOC.txt Output/%.out-nat Output/%.out-jit $(LLI) $(LOPT) @echo -n "LOC: " > $@ - @cat Output/$*.LOC.txt >> $@ + - at cat Output/$*.LOC.txt >> $@ @echo -n "LLC SIZE: " >> $@ #- at wc -c Output/$*.llc >> $@ @echo >> $@ @@ -22,7 +22,7 @@ - at grep real Output/$*.out-nat.time >> $@ @echo -n "JIT TIME: " >> $@ - at grep real Output/$*.out-jit.time >> $@ - @cat Output/$*.out-jit.info >> $@ + - at cat Output/$*.out-jit.info >> $@ $(LOPT) -strip -stats -o /dev/null -f $< >> $@ 2>&1 $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \ From criswell at cs.uiuc.edu Mon Sep 29 10:55:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 10:55:02 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/transforms.qms/sccp.qms/2003-08-26-invokehandling.qmt Message-ID: <200309291554.KAA08950@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/transforms.qms/sccp.qms: 2003-08-26-invokehandling.qmt added (r1.1) --- Log message: Adding new test. --- Diffs of the changes: Index: llvm/test/QMTestDB/regression.qms/transforms.qms/sccp.qms/2003-08-26-invokehandling.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/transforms.qms/sccp.qms/2003-08-26-invokehandling.qmt:1.1 *** /dev/null Mon Sep 29 10:54:33 2003 --- llvm/test/QMTestDB/regression.qms/transforms.qms/sccp.qms/2003-08-26-invokehandling.qmt Mon Sep 29 10:54:23 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/Transforms/SCCP/2003-08-26-InvokeHandling.ll From lattner at cs.uiuc.edu Mon Sep 29 10:59:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Sep 29 10:59:02 2003 Subject: [llvm-commits] CVS: llvm/support/lib/Makefile Message-ID: <200309291558.KAA28146@zion.cs.uiuc.edu> Changes in directory llvm/support/lib: Makefile added (r1.1) --- Log message: Initial checkin of makefile for this directory --- Diffs of the changes: Index: llvm/support/lib/Makefile diff -c /dev/null llvm/support/lib/Makefile:1.1 *** /dev/null Mon Sep 29 10:58:26 2003 --- llvm/support/lib/Makefile Mon Sep 29 10:58:16 2003 *************** *** 0 **** --- 1,6 ---- + LEVEL = ../.. + + DIRS = Support + + include $(LEVEL)/Makefile.common + From criswell at cs.uiuc.edu Mon Sep 29 11:01:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 11:01:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms/2003-08-17-branchfold.qmt 2003-08-17-branchfoldordering.qmt 2003-08-17-foldswitch.qmt invokeeliminate.qmt Message-ID: <200309291600.LAA09235@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms: 2003-08-17-branchfold.qmt added (r1.1) 2003-08-17-branchfoldordering.qmt added (r1.1) 2003-08-17-foldswitch.qmt added (r1.1) invokeeliminate.qmt added (r1.1) --- Log message: Added new tests. --- Diffs of the changes: Index: llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms/2003-08-17-branchfold.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms/2003-08-17-branchfold.qmt:1.1 *** /dev/null Mon Sep 29 11:00:29 2003 --- llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms/2003-08-17-branchfold.qmt Mon Sep 29 11:00:19 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/Transforms/SimplifyCFG/2003-08-17-BranchFoldOrdering.ll Index: llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms/2003-08-17-branchfoldordering.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms/2003-08-17-branchfoldordering.qmt:1.1 *** /dev/null Mon Sep 29 11:00:29 2003 --- llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms/2003-08-17-branchfoldordering.qmt Mon Sep 29 11:00:19 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll Index: llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms/2003-08-17-foldswitch.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms/2003-08-17-foldswitch.qmt:1.1 *** /dev/null Mon Sep 29 11:00:29 2003 --- llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms/2003-08-17-foldswitch.qmt Mon Sep 29 11:00:19 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/Transforms/SimplifyCFG/2003-08-17-FoldSwitch.ll Index: llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms/invokeeliminate.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms/invokeeliminate.qmt:1.1 *** /dev/null Mon Sep 29 11:00:29 2003 --- llvm/test/QMTestDB/regression.qms/transforms.qms/simplifycfg.qms/invokeeliminate.qmt Mon Sep 29 11:00:19 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/Transforms/SimplifyCFG/InvokeEliminate.ll From criswell at cs.uiuc.edu Mon Sep 29 11:01:08 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 11:01:08 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/transforms.qms/scalarrepl.qms/2003-09-12-incorrectpromote.qmt Message-ID: <200309291600.LAA09222@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/transforms.qms/scalarrepl.qms: 2003-09-12-incorrectpromote.qmt added (r1.1) --- Log message: Added new tests. --- Diffs of the changes: Index: llvm/test/QMTestDB/regression.qms/transforms.qms/scalarrepl.qms/2003-09-12-incorrectpromote.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/transforms.qms/scalarrepl.qms/2003-09-12-incorrectpromote.qmt:1.1 *** /dev/null Mon Sep 29 11:00:28 2003 --- llvm/test/QMTestDB/regression.qms/transforms.qms/scalarrepl.qms/2003-09-12-incorrectpromote.qmt Mon Sep 29 11:00:18 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll From lattner at cs.uiuc.edu Mon Sep 29 11:04:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Sep 29 11:04:03 2003 Subject: [llvm-commits] CVS: llvm/support/tools/Makefile Message-ID: <200309291603.LAA31021@zion.cs.uiuc.edu> Changes in directory llvm/support/tools: Makefile added (r1.1) --- Log message: Check in missing makefile --- Diffs of the changes: Index: llvm/support/tools/Makefile diff -c /dev/null llvm/support/tools/Makefile:1.1 *** /dev/null Mon Sep 29 11:03:11 2003 --- llvm/support/tools/Makefile Mon Sep 29 11:03:01 2003 *************** *** 0 **** --- 1,6 ---- + LEVEL = ../.. + + DIRS = Burg TableGen + + include $(LEVEL)/Makefile.common + From criswell at cs.uiuc.edu Mon Sep 29 11:08:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 11:08:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/transforms.qms/tailcallelim.qms/ Message-ID: <200309291607.LAA00840@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/transforms.qms/tailcallelim.qms: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/QMTestDB/regression.qms/transforms.qms/tailcallelim.qms added to the repository --- Diffs of the changes: From criswell at cs.uiuc.edu Mon Sep 29 11:11:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 11:11:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Makefile Message-ID: <200309291610.LAA07088@choi.cs.uiuc.edu> Changes in directory llvm/lib: Makefile updated: 1.14 -> 1.15 --- Log message: Removed Support directory. It now lives in llvm/support/lib. --- Diffs of the changes: Index: llvm/lib/Makefile diff -u llvm/lib/Makefile:1.14 llvm/lib/Makefile:1.15 --- llvm/lib/Makefile:1.14 Fri Sep 5 14:39:49 2003 +++ llvm/lib/Makefile Mon Sep 29 11:10:43 2003 @@ -1,6 +1,6 @@ LEVEL = .. -PARALLEL_DIRS = VMCore Analysis Transforms AsmParser Bytecode Support CodeGen Target CWriter ExecutionEngine +PARALLEL_DIRS = VMCore Analysis Transforms AsmParser Bytecode CodeGen Target CWriter ExecutionEngine include $(LEVEL)/Makefile.common From criswell at cs.uiuc.edu Mon Sep 29 11:18:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 11:18:02 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/transforms.qms/tailcallelim.qms/ackermann.qmt Message-ID: <200309291617.LAA31353@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/transforms.qms/tailcallelim.qms: ackermann.qmt added (r1.1) --- Log message: Adding new tests. --- Diffs of the changes: Index: llvm/test/QMTestDB/regression.qms/transforms.qms/tailcallelim.qms/ackermann.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/transforms.qms/tailcallelim.qms/ackermann.qmt:1.1 *** /dev/null Mon Sep 29 11:17:11 2003 --- llvm/test/QMTestDB/regression.qms/transforms.qms/tailcallelim.qms/ackermann.qmt Mon Sep 29 11:17:01 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/Transforms/TailCallElim/ackermann.ll From lattner at cs.uiuc.edu Mon Sep 29 11:43:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Sep 29 11:43:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.micro.Makefile TEST.micro.report Message-ID: <200309291642.LAA21095@zion.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.micro.Makefile updated: 1.3 -> 1.4 TEST.micro.report updated: 1.2 -> 1.3 --- Log message: Update scripts to generate real numbers! --- Diffs of the changes: Index: llvm/test/Programs/TEST.micro.Makefile diff -u llvm/test/Programs/TEST.micro.Makefile:1.3 llvm/test/Programs/TEST.micro.Makefile:1.4 --- llvm/test/Programs/TEST.micro.Makefile:1.3 Mon Sep 29 10:39:48 2003 +++ llvm/test/Programs/TEST.micro.Makefile Mon Sep 29 11:42:26 2003 @@ -12,11 +12,11 @@ EXTRA_LLI_OPTS = $(TIMEOPT) $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \ -Output/%.$(TEST).report.txt: Output/%.llvm.bc Output/%.LOC.txt Output/%.out-nat Output/%.out-jit $(LLI) $(LOPT) +Output/%.$(TEST).report.txt: Output/%.llvm.bc Output/%.LOC.txt Output/%.out-nat Output/%.out-jit Output/%.llc $(LLI) $(LOPT) @echo -n "LOC: " > $@ - at cat Output/$*.LOC.txt >> $@ @echo -n "LLC SIZE: " >> $@ - #- at wc -c Output/$*.llc >> $@ + - at wc -c Output/$*.llc >> $@ @echo >> $@ @echo -n "NAT TIME: " >> $@ - at grep real Output/$*.out-nat.time >> $@ Index: llvm/test/Programs/TEST.micro.report diff -u llvm/test/Programs/TEST.micro.report:1.2 llvm/test/Programs/TEST.micro.report:1.3 --- llvm/test/Programs/TEST.micro.report:1.2 Sun Jun 22 15:11:18 2003 +++ llvm/test/Programs/TEST.micro.report Mon Sep 29 11:42:26 2003 @@ -69,6 +69,16 @@ return sprintf("%0.3f", shift); } +# FormatTime - Convert a time from 1m23.45 into 83.45 +sub FormatTime { + my $Time = shift; + if ($Time =~ m/([0-9]+)[m:]([0-9.]+)/) { + $Time = sprintf("%7.3f", $1*60.0+$2); + } + return $Time; +} + + @LatexColumns = (1, 15, 12, # LOC, LLC Size, BytecodeSize 10, 9, 11, # #LLVM Insts, # MachineInsts, Ratio 5, 4, 6); # JIT Time, Nat Run Time, Ratio @@ -127,8 +137,8 @@ ["LOC:" , 'LOC: *([0-9]+)'], [], # Times - ["Total" , 'JIT TIME: real ([0-9.]+)'], - ["NatTotal", 'NAT TIME: real ([0-9.]+)'], + ["Total" , 'JIT TIME: real\s*([.0-9m:]+)', \&FormatTime], + ["NatTotal", 'NAT TIME: real\s*([.0-9m:]+)', \&FormatTime], ["CodeGen", 'Total Execution Time: ([0-9.]+)'], ["CodeGenRatio", \&InvRatio], [], From criswell at cs.uiuc.edu Mon Sep 29 15:11:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 15:11:01 2003 Subject: [llvm-commits] CVS: llvm/www/docs/CommandGuide/llc.html lli.html Message-ID: <200309292010.PAA12079@tank.cs.uiuc.edu> Changes in directory llvm/www/docs/CommandGuide: llc.html updated: 1.2 -> 1.3 lli.html updated: 1.3 -> 1.4 --- Log message: Added information on input and output filenames. Added periods to the end of sentence fragments describing options. Added information to llc about which target architecture is selected for assembly language code generation. --- Diffs of the changes: Index: llvm/www/docs/CommandGuide/llc.html diff -u llvm/www/docs/CommandGuide/llc.html:1.2 llvm/www/docs/CommandGuide/llc.html:1.3 --- llvm/www/docs/CommandGuide/llc.html:1.2 Thu Sep 25 14:50:04 2003 +++ llvm/www/docs/CommandGuide/llc.html Mon Sep 29 15:10:08 2003 @@ -20,7 +20,7 @@ SYNOPSIS -llc [options] < filename> +llc [options] [filename]

DESCRIPTION

@@ -28,6 +28,62 @@ The llc command compiles LLVM bytecode into assembly language for a specified architecture. The assembly language output can then be passed through a native assembler and linker to generate native code. +

+The choice of architecture for the output assembly code is determined as +follows: + +

    +
  • + If the user has specified an architecture with the -m option, use that + architecture. +

    + +

  • + Examine the input LLVM bytecode file: +
      +
    • + If it specifies little endian and a pointer size of 32 bits, select the + x86 architecture. +

      + +

    • + If it specifies big endian and a pointer size of 64 bit pointers, + select the SparcV9 architecture. +
    +

    + +

  • + If llc was compiled on an architecture for which it can generate code, + select the architecture upon which llc was compiled. +

    + +

  • + Print a message to the user asking him or her to specify the output + architecture explicitly. +
+ +

+ +If filename is not specified, or if filename is -, llc reads its input from +standard input. Otherwise, it will read its input from filename. +

+ +If the -o option is left unspecified, then llc will send its output to standard +output if the input is from standard input. If the -o option specifies -, then +the output will also be sent to standard output. +

+ +If no -o option is specified and an input file other than - is specified, then +llc creates the output filename as follows: + +

    +
  • + If the file ends in .bc, then the .bc suffix is removed, and the .s suffix + is appended. +

    +

  • + Otherwise, the .s suffix is appended to the input filename. +

OPTIONS @@ -36,42 +92,42 @@
  • -disable-fp-elim
    - Disable frame pointer elimination optimization + Disable frame pointer elimination optimization.

  • -disable-local-ra
    - Use Simple RA instead of Local RegAlloc + Use Simple RA instead of Local RegAlloc.

  • -disable-pattern-isel
    - Use the 'simple' X86 instruction selector + Use the 'simple' X86 instruction selector.

  • -disable-peephole
    - Disable peephole optimization pass + Disable peephole optimization pass.

  • -disable-preopt
    - Disable optimizations prior to instruction selection + Disable optimizations prior to instruction selection.

  • -disable-sched
    - Disable local scheduling pass + Disable local scheduling pass.

  • -disable-strip
    - Do not strip the LLVM bytecode included in executable + Do not strip the LLVM bytecode included in executable.

  • -enable-maps
    - Emit LLVM-to-MachineCode mapping info to assembly + Emit LLVM-to-MachineCode mapping info to assembly.

  • -f @@ -81,13 +137,12 @@
  • -load=<plugin.so>
    - Load the specified plugin + Load the specified plugin.

  • -m<arch>
    Specify the architecture for which to generate assembly. Valid -

    architectures are:

    @@ -103,12 +158,12 @@
  • -o <filename>
    - Output filename + Specify the output filename.

  • -print-machineinstrs
    - Print generated machine code + Print generated machine code.

  • -help Index: llvm/www/docs/CommandGuide/lli.html diff -u llvm/www/docs/CommandGuide/lli.html:1.3 llvm/www/docs/CommandGuide/lli.html:1.4 --- llvm/www/docs/CommandGuide/lli.html:1.3 Thu Sep 25 14:50:04 2003 +++ llvm/www/docs/CommandGuide/lli.html Mon Sep 29 15:10:08 2003 @@ -20,14 +20,43 @@ SYNOPSIS

-lli [options] < filename> +lli [options] [filename] [args ...]

DESCRIPTION

The lli command is the LLVM interpreter. It takes a program in LLVM bytecode -format and executes it, either using an interpreter or a Just In Time (JIT) -compiler. +format and executes it using an interpreter or a Just In Time (JIT) compiler. +

+ +If filename is not specified, then lli reads its input from standard input. +

+The optional arguments specified on the command line are passed to the executed +program as arguments. +

+ +

+MAIN FUNCTION +

+ +The main() function of the bytecode program is where execution starts. It +is passed three arguments: + +
    +
  • + int argc - The number of command line arguments. +

    + +

  • + char ** argv - The arguments to the program. +

    + +

  • + char ** envp - An array of environment variables used by the program. +
+ +The first argument to the program is the name of the executed bytecode file +(with the .bc suffix removed).

OPTIONS From lattner at cs.uiuc.edu Mon Sep 29 16:10:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Sep 29 16:10:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CINT2000/300.twolf/Makefile Message-ID: <200309292109.QAA05769@zion.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CINT2000/300.twolf: Makefile updated: 1.2 -> 1.3 --- Log message: Fix this to work with large problem size --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/CINT2000/300.twolf/Makefile diff -u llvm/test/Programs/External/SPEC/CINT2000/300.twolf/Makefile:1.2 llvm/test/Programs/External/SPEC/CINT2000/300.twolf/Makefile:1.3 --- llvm/test/Programs/External/SPEC/CINT2000/300.twolf/Makefile:1.2 Mon Jun 16 07:01:12 2003 +++ llvm/test/Programs/External/SPEC/CINT2000/300.twolf/Makefile Mon Sep 29 16:09:16 2003 @@ -1,6 +1,6 @@ LEVEL = ../../../../../.. LDFLAGS = -lm -RUN_OPTIONS = test -STDOUT_FILENAME := test.net.stdout +RUN_OPTIONS = $(RUN_TYPE) +STDOUT_FILENAME = $(RUN_TYPE).net.stdout include ../../Makefile.spec From lattner at cs.uiuc.edu Mon Sep 29 16:19:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Sep 29 16:19:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp Message-ID: <200309292118.QAA21333@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C++/CompileFail: 2003-09-29-ArgumentNumberMismatch.cpp added (r1.1) --- Log message: New testcase, distilled by John --- Diffs of the changes: Index: llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp diff -c /dev/null llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp:1.1 *** /dev/null Mon Sep 29 16:18:46 2003 --- llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp Mon Sep 29 16:18:36 2003 *************** *** 0 **** --- 1,11 ---- + struct C { + int A, B; + ~C() {} + + void operator^(C b) const { } + }; + + void test(C *P) { + *P ^ *P; + } + From criswell at cs.uiuc.edu Mon Sep 29 16:23:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 16:23:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/transforms.qms/decomposemultidimrefs.qms/multidim.qmt Message-ID: <200309292122.QAA23066@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/transforms.qms/decomposemultidimrefs.qms: multidim.qmt updated: 1.1 -> 1.2 --- Log message: Fixed test to be a TestRunner test like it always has been. --- Diffs of the changes: Index: llvm/test/QMTestDB/regression.qms/transforms.qms/decomposemultidimrefs.qms/multidim.qmt diff -u llvm/test/QMTestDB/regression.qms/transforms.qms/decomposemultidimrefs.qms/multidim.qmt:1.1 llvm/test/QMTestDB/regression.qms/transforms.qms/decomposemultidimrefs.qms/multidim.qmt:1.2 --- llvm/test/QMTestDB/regression.qms/transforms.qms/decomposemultidimrefs.qms/multidim.qmt:1.1 Mon Aug 25 10:21:45 2003 +++ llvm/test/QMTestDB/regression.qms/transforms.qms/decomposemultidimrefs.qms/multidim.qmt Mon Sep 29 16:22:18 2003 @@ -1,2 +1,2 @@ -.*test/Regression/Transforms/DecomposeMultiDimRefs/multidim.ll +.*test/Regression/Transforms/DecomposeMultiDimRefs/multidim.ll From criswell at cs.uiuc.edu Mon Sep 29 16:23:04 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 16:23:04 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/DecomposeMultiDimRefs/multidim.ll Message-ID: <200309292122.QAA23054@choi.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/DecomposeMultiDimRefs: multidim.ll updated: 1.7 -> 1.8 --- Log message: Updated for the new QMTest test suite. Temporary output file is now placed inside the temporary file directory. --- Diffs of the changes: Index: llvm/test/Regression/Transforms/DecomposeMultiDimRefs/multidim.ll diff -u llvm/test/Regression/Transforms/DecomposeMultiDimRefs/multidim.ll:1.7 llvm/test/Regression/Transforms/DecomposeMultiDimRefs/multidim.ll:1.8 --- llvm/test/Regression/Transforms/DecomposeMultiDimRefs/multidim.ll:1.7 Tue Sep 16 10:29:25 2003 +++ llvm/test/Regression/Transforms/DecomposeMultiDimRefs/multidim.ll Mon Sep 29 16:21:59 2003 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -f -lowerrefs -o Output/%s.bc +; RUN: llvm-as < %s | opt -f -lowerrefs -o %t1.bc ; %Flat_struct = type { sbyte, float } %Flat_t = type { sbyte, float } From criswell at cs.uiuc.edu Mon Sep 29 16:35:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 16:35:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C++/CompileFail/Makefile Message-ID: <200309292134.QAA02525@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C++/CompileFail: Makefile updated: 1.2 -> 1.3 --- Log message: Adding Makefiles for llvm/test/Programs/SingleSource/Regression/C++/EH and llvm/test/Programs/SingleSource/Regression/C++/CompileFail. --- Diffs of the changes: Index: llvm/test/Programs/SingleSource/Regression/C++/CompileFail/Makefile diff -u /dev/null llvm/test/Programs/SingleSource/Regression/C++/CompileFail/Makefile:1.3 --- /dev/null Mon Sep 29 16:34:59 2003 +++ llvm/test/Programs/SingleSource/Regression/C++/CompileFail/Makefile Mon Sep 29 16:34:49 2003 @@ -0,0 +1,4 @@ +LEVEL = ../../../../../.. +include $(LEVEL)/test/Programs/SingleSource/Makefile.singlesrc +CFLAGS += -std=c99 + From criswell at cs.uiuc.edu Mon Sep 29 16:35:03 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 16:35:03 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C++/EH/Makefile Message-ID: <200309292134.QAA02518@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C++/EH: Makefile updated: 1.3 -> 1.4 --- Log message: Adding Makefiles for llvm/test/Programs/SingleSource/Regression/C++/EH and llvm/test/Programs/SingleSource/Regression/C++/CompileFail. --- Diffs of the changes: Index: llvm/test/Programs/SingleSource/Regression/C++/EH/Makefile diff -u /dev/null llvm/test/Programs/SingleSource/Regression/C++/EH/Makefile:1.4 --- /dev/null Mon Sep 29 16:34:58 2003 +++ llvm/test/Programs/SingleSource/Regression/C++/EH/Makefile Mon Sep 29 16:34:48 2003 @@ -0,0 +1,4 @@ +LEVEL = ../../../../../.. +include $(LEVEL)/test/Programs/SingleSource/Makefile.singlesrc +CFLAGS += -std=c99 + From criswell at cs.uiuc.edu Mon Sep 29 16:36:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 16:36:01 2003 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200309292135.QAA02549@choi.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.25 -> 1.26 --- Log message: Added Makefiles to llvm/test/Programs/SingleSource/Regression/C++/EH and llvm/test/Programs/SingleSource/Regression/C++/CompileFail. --- Diffs of the changes: Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.25 llvm/autoconf/configure.ac:1.26 --- llvm/autoconf/configure.ac:1.25 Mon Sep 29 09:52:11 2003 +++ llvm/autoconf/configure.ac Mon Sep 29 16:35:32 2003 @@ -177,6 +177,8 @@ AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Regression/Makefile) AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Regression/C/Makefile) AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Regression/C++/Makefile) +AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Regression/C++/EH/Makefile) +AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Regression/C++/CompileFail/Makefile) AC_CONFIG_MAKEFILE(tools/Makefile) AC_CONFIG_MAKEFILE(tools/analyze/Makefile) AC_CONFIG_MAKEFILE(tools/bugpoint/Makefile) From criswell at cs.uiuc.edu Mon Sep 29 16:36:03 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Sep 29 16:36:03 2003 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200309292135.QAA02542@choi.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.33 -> 1.34 --- Log message: Added Makefiles to llvm/test/Programs/SingleSource/Regression/C++/EH and llvm/test/Programs/SingleSource/Regression/C++/CompileFail. --- Diffs of the changes: Index: llvm/configure diff -u llvm/configure:1.33 llvm/configure:1.34 --- llvm/configure:1.33 Mon Sep 29 09:52:09 2003 +++ llvm/configure Mon Sep 29 16:35:30 2003 @@ -1956,6 +1956,12 @@ ac_config_commands="$ac_config_commands test/Programs/SingleSource/Regression/C++/Makefile" + ac_config_commands="$ac_config_commands test/Programs/SingleSource/Regression/C++/EH/Makefile" + + + ac_config_commands="$ac_config_commands test/Programs/SingleSource/Regression/C++/CompileFail/Makefile" + + ac_config_commands="$ac_config_commands tools/Makefile" @@ -4408,7 +4414,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4411 "configure"' > conftest.$ac_ext + echo '#line 4417 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5249,7 +5255,7 @@ # Provide some information about the compiler. -echo "$as_me:5252:" \ +echo "$as_me:5258:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -6258,11 +6264,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6261: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6267: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6265: \$? = $ac_status" >&5 + echo "$as_me:6271: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6490,11 +6496,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6493: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6499: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6497: \$? = $ac_status" >&5 + echo "$as_me:6503: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6557,11 +6563,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6560: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6566: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6564: \$? = $ac_status" >&5 + echo "$as_me:6570: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8569,7 +8575,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:10812: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10810: \$? = $ac_status" >&5 + echo "$as_me:10816: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10870,11 +10876,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10873: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10879: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10877: \$? = $ac_status" >&5 + echo "$as_me:10883: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12113,7 +12119,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13042: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13040: \$? = $ac_status" >&5 + echo "$as_me:13046: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13100,11 +13106,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13103: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13109: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13107: \$? = $ac_status" >&5 + echo "$as_me:13113: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15044,11 +15050,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15047: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15053: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15051: \$? = $ac_status" >&5 + echo "$as_me:15057: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15276,11 +15282,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15279: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15285: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15283: \$? = $ac_status" >&5 + echo "$as_me:15289: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15343,11 +15349,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15346: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15352: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15350: \$? = $ac_status" >&5 + echo "$as_me:15356: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17355,7 +17361,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < Changes in directory llvm/test/Programs/SingleSource/Regression/C++/CompileFail: 2003-09-29-ArgumentNumberMismatch.cpp updated: 1.1 -> 1.2 --- Log message: Simplify test, include problem analysis --- Diffs of the changes: Index: llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp diff -u llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp:1.1 llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp:1.2 --- llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp:1.1 Mon Sep 29 16:18:36 2003 +++ llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-29-ArgumentNumberMismatch.cpp Mon Sep 29 16:53:04 2003 @@ -1,11 +1,15 @@ +// Non-POD classes cannot be passed into a function by component, because their +// dtors must be run. Instead, pass them in by reference. The C++ front-end +// was mistakenly "thinking" that 'foo' took a structure by component. + struct C { int A, B; ~C() {} - - void operator^(C b) const { } }; +void foo(C b); + void test(C *P) { - *P ^ *P; + foo(*P); } From brukman at cs.uiuc.edu Mon Sep 29 17:17:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Sep 29 17:17:01 2003 Subject: [llvm-commits] CVS: llvm/tools/gccld/linker.cpp Message-ID: <200309292216.RAA14472@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: linker.cpp updated: 1.1 -> 1.2 --- Log message: * Ordered includes according to LLVM programmers' guide * Made code layout more verbose: no more '{' on a line by itself * Pruned extra whitespace --- Diffs of the changes: Index: llvm/tools/gccld/linker.cpp diff -u llvm/tools/gccld/linker.cpp:1.1 llvm/tools/gccld/linker.cpp:1.2 --- llvm/tools/gccld/linker.cpp:1.1 Fri Sep 19 15:24:23 2003 +++ llvm/tools/gccld/linker.cpp Mon Sep 29 17:16:43 2003 @@ -13,7 +13,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Transforms/Utils/Linker.h" +#include "gccld.h" #include "llvm/Module.h" #include "llvm/PassManager.h" #include "llvm/Bytecode/Reader.h" @@ -21,17 +21,16 @@ #include "llvm/Target/TargetData.h" #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Scalar.h" -#include "Support/FileUtilities.h" -#include "Support/SystemUtils.h" +#include "llvm/Transforms/Utils/Linker.h" #include "Support/CommandLine.h" +#include "Support/FileUtilities.h" #include "Support/Signals.h" +#include "Support/SystemUtils.h" #include "Config/stdlib.h" -#include "gccld.h" - +#include #include #include #include -#include // // Function: FileExists () @@ -49,9 +48,7 @@ // TRUE - The file exists and is readable. // FALSE - The file does not exist or is unreadable. // -static inline bool -FileExists(const std::string &FN) -{ +static inline bool FileExists(const std::string &FN) { return access(FN.c_str(), R_OK | F_OK) != -1; } @@ -72,12 +69,10 @@ // TRUE - The file is an archive. // FALSE - The file is not an archive. // -static inline bool -IsArchive (const std::string &filename) +static inline bool IsArchive (const std::string &filename) { std::string ArchiveMagic("!\012"); char buf[1 + ArchiveMagic.size()]; - std::ifstream f(filename.c_str()); f.read(buf, ArchiveMagic.size()); buf[ArchiveMagic.size()] = '\0'; @@ -105,57 +100,36 @@ static std::string FindLib (const std::string & Filename, const std::vector & Paths) { - // // Determine if the pathname can be found as it stands. - // if (FileExists (Filename)) - { return Filename; - } - // // If that doesn't work, convert the name into a library name. - // std::string LibName = "lib" + Filename; - // // Iterate over the directories in Paths to see if we can find the library // there. - // - for (unsigned Index = 0; Index != Paths.size(); ++Index) - { + for (unsigned Index = 0; Index != Paths.size(); ++Index) { std::string Directory = Paths[Index] + "/"; if (FileExists (Directory + LibName + ".bc")) - { return Directory + LibName + ".bc"; - } if (FileExists (Directory + LibName + ".so")) - { return Directory + LibName + ".so"; - } if (FileExists (Directory + LibName + ".a")) - { return Directory + LibName + ".a"; - } } - // // One last hope: Check LLVM_LIB_SEARCH_PATH. - // char *SearchPath = getenv("LLVM_LIB_SEARCH_PATH"); if (SearchPath == NULL) - { - return std::string(); - } + return std::string(); LibName = std::string(SearchPath) + "/" + LibName; if (FileExists (LibName)) - { return LibName; - } return std::string(); } @@ -254,12 +228,10 @@ // If an error occurs, the pointer is 0. // std::auto_ptr -LoadObject (const std::string & FN, std::string &OutErrorMessage) -{ +LoadObject (const std::string & FN, std::string &OutErrorMessage) { std::string ErrorMessage; Module *Result = ParseBytecodeFile(FN, &ErrorMessage); if (Result) return std::auto_ptr(Result); - OutErrorMessage = "Bytecode file '" + FN + "' corrupt!"; if (ErrorMessage.size()) OutErrorMessage += ": " + ErrorMessage; return std::auto_ptr(); @@ -285,9 +257,9 @@ // FALSE - No errors. // static bool -LinkInArchive (Module * M, - const std::string & Filename, - std::string & ErrorMessage, +LinkInArchive (Module *M, + const std::string &Filename, + std::string &ErrorMessage, bool Verbose) { // @@ -297,8 +269,7 @@ // std::set UndefinedSymbols; GetAllUndefinedSymbols (M, UndefinedSymbols); - if (UndefinedSymbols.empty()) - { + if (UndefinedSymbols.empty()) { if (Verbose) std::cerr << " No symbols undefined, don't link library!\n"; return false; // No need to link anything in! } @@ -309,24 +280,20 @@ if (Verbose) std::cerr << " Loading '" << Filename << "'\n"; std::vector Objects; if (ReadArchiveFile (Filename, Objects, &ErrorMessage)) - { return true; - } // // Figure out which symbols are defined by all of the modules in the archive. // std::vector > DefinedSymbols; DefinedSymbols.resize (Objects.size()); - for (unsigned i = 0; i != Objects.size(); ++i) - { + for (unsigned i = 0; i != Objects.size(); ++i) { GetAllDefinedSymbols(Objects[i], DefinedSymbols[i]); } // While we are linking in object files, loop. bool Linked = true; - while (Linked) - { + while (Linked) { Linked = false; for (unsigned i = 0; i != Objects.size(); ++i) { @@ -388,19 +355,14 @@ // FALSE - No errors. // static bool -LinkInFile (Module * HeadModule, - const std::string & Filename, - std::string & ErrorMessage, +LinkInFile (Module *HeadModule, + const std::string &Filename, + std::string &ErrorMessage, bool Verbose) { std::auto_ptr M(LoadObject(Filename, ErrorMessage)); - if (M.get() == 0) - { - return true; - } - + if (M.get() == 0) return true; if (Verbose) std::cerr << "Linking in '" << Filename << "'\n"; - return (LinkModules (HeadModule, M.get(), &ErrorMessage)); } @@ -429,11 +391,10 @@ // FALSE - No errors. // TRUE - Some error occurred. // -bool -LinkFiles (const char * progname, - Module * HeadModule, - const std::vector & Files, - bool Verbose) +bool LinkFiles(const char *progname, + Module *HeadModule, + const std::vector &Files, + bool Verbose) { // String in which to receive error messages. std::string ErrorMessage; @@ -444,26 +405,18 @@ // Get the library search path from the environment char *SearchPath = getenv("LLVM_LIB_SEARCH_PATH"); - for (unsigned i = 1; i < Files.size(); ++i) - { - // + for (unsigned i = 1; i < Files.size(); ++i) { // Determine where this file lives. - // - if (FileExists (Files[i])) - { + if (FileExists (Files[i])) { Pathname = Files[i]; - } - else - { - if (SearchPath == NULL) - { + } else { + if (SearchPath == NULL) { std::cerr << "Cannot find " << Files[i]; return true; } Pathname = std::string(SearchPath)+"/"+Files[i]; - if (!FileExists (Pathname)) - { + if (!FileExists (Pathname)) { std::cerr << "Cannot find " << Files[i]; return true; } @@ -473,29 +426,20 @@ // A user may specify an ar archive without -l, perhaps because it // is not installed as a library. Detect that and link the library. // - if (IsArchive(Pathname)) - { + if (IsArchive(Pathname)) { if (Verbose) - { std::cerr << "Linking archive '" << Files[i] << "'\n"; - } - if (LinkInArchive (HeadModule, Pathname, ErrorMessage, Verbose)) - { + if (LinkInArchive (HeadModule, Pathname, ErrorMessage, Verbose)) { PrintAndReturn(progname, ErrorMessage, ": Error linking in '" + Files[i] + "'"); return true; } - } - else - { + } else { if (Verbose) - { std::cerr << "Linking file '" << Files[i] << "'\n"; - } - if (LinkInFile (HeadModule, Pathname, ErrorMessage, Verbose)) - { + if (LinkInFile (HeadModule, Pathname, ErrorMessage, Verbose)) { PrintAndReturn(progname, ErrorMessage, ": error linking in '" + Files[i] + "'"); return true; @@ -528,37 +472,25 @@ // FALSE - No error. // TRUE - Error. // -bool -LinkLibraries (const char * progname, - Module * HeadModule, - const std::vector & Libraries, - const std::vector & LibPaths, - bool Verbose, - bool Native) +bool LinkLibraries (const char *progname, + Module *HeadModule, + const std::vector &Libraries, + const std::vector &LibPaths, + bool Verbose, + bool Native) { // String in which to receive error messages. std::string ErrorMessage; - for (unsigned i = 1; i < Libraries.size(); ++i) - { - // + for (unsigned i = 1; i < Libraries.size(); ++i) { // Determine where this library lives. - // - std::string Pathname = FindLib (Libraries[i], LibPaths); - if (Pathname.empty()) - { - // + std::string Pathname = FindLib(Libraries[i], LibPaths); + if (Pathname.empty()) { // If the pathname does not exist, then continue to the next one if // we're doing a native link and give an error if we're doing a bytecode // link. - // - if (Native) - { - continue; - } - else - { - PrintAndReturn (progname, "Cannot find " + Libraries[i]); + if (!Native) { + PrintAndReturn(progname, "Cannot find " + Libraries[i]); return true; } } @@ -567,31 +499,22 @@ // A user may specify an ar archive without -l, perhaps because it // is not installed as a library. Detect that and link the library. // - if (IsArchive(Pathname)) - { + if (IsArchive(Pathname)) { if (Verbose) - { std::cerr << "Linking archive '" << Libraries[i] << "'\n"; - } - if (LinkInArchive (HeadModule, Pathname, ErrorMessage, Verbose)) - { + if (LinkInArchive(HeadModule, Pathname, ErrorMessage, Verbose)) { PrintAndReturn(progname, ErrorMessage, - ": Error linking in '" + Libraries[i] + "'"); + ": Error linking in '" + Libraries[i] + "'"); return true; } - } - else - { + } else { if (Verbose) - { std::cerr << "Linking file '" << Libraries[i] << "'\n"; - } - if (LinkInFile (HeadModule, Pathname, ErrorMessage, Verbose)) - { + if (LinkInFile(HeadModule, Pathname, ErrorMessage, Verbose)) { PrintAndReturn(progname, ErrorMessage, - ": error linking in '" + Libraries[i] + "'"); + ": error linking in '" + Libraries[i] + "'"); return true; } } From lattner at cs.uiuc.edu Mon Sep 29 17:18:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Sep 29 17:18:03 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-08-24-Cleanup.cpp.tr Message-ID: <200309292217.RAA29322@neo.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C++/CompileFail: 2003-08-24-Cleanup.cpp.tr updated: 1.1 -> 1.2 --- Log message: update run command --- Diffs of the changes: Index: llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-08-24-Cleanup.cpp.tr diff -u llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-08-24-Cleanup.cpp.tr:1.1 llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-08-24-Cleanup.cpp.tr:1.2 --- llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-08-24-Cleanup.cpp.tr:1.1 Sun Aug 24 15:23:21 2003 +++ llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-08-24-Cleanup.cpp.tr Mon Sep 29 17:17:12 2003 @@ -1,4 +1,4 @@ -// RUN: llvmg++ -xc++ 2003-08-24-Cleanup.cpp.tr -c -o - | dis | grep 'call void %llvm.unwind' +// RUN: llvmg++ -xc++ %s -c -o - | llvm-dis | grep unwind struct S { ~S(); }; From brukman at cs.uiuc.edu Mon Sep 29 17:27:02 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Sep 29 17:27:02 2003 Subject: [llvm-commits] CVS: llvm/tools/gccld/linker.cpp Message-ID: <200309292226.RAA15936@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: linker.cpp updated: 1.2 -> 1.3 --- Log message: Tersified code: * Removed space between function name and its argument list * Removed space between '&' and variable name * Removed empty comment lines: `//' --- Diffs of the changes: Index: llvm/tools/gccld/linker.cpp diff -u llvm/tools/gccld/linker.cpp:1.2 llvm/tools/gccld/linker.cpp:1.3 --- llvm/tools/gccld/linker.cpp:1.2 Mon Sep 29 17:16:43 2003 +++ llvm/tools/gccld/linker.cpp Mon Sep 29 17:26:24 2003 @@ -69,7 +69,7 @@ // TRUE - The file is an archive. // FALSE - The file is not an archive. // -static inline bool IsArchive (const std::string &filename) +static inline bool IsArchive(const std::string &filename) { std::string ArchiveMagic("!\012"); char buf[1 + ArchiveMagic.size()]; @@ -98,10 +98,10 @@ // If the file is not found, an empty string is returned. // static std::string -FindLib (const std::string & Filename, const std::vector & Paths) +FindLib(const std::string &Filename, const std::vector &Paths) { // Determine if the pathname can be found as it stands. - if (FileExists (Filename)) + if (FileExists(Filename)) return Filename; // If that doesn't work, convert the name into a library name. @@ -112,13 +112,13 @@ for (unsigned Index = 0; Index != Paths.size(); ++Index) { std::string Directory = Paths[Index] + "/"; - if (FileExists (Directory + LibName + ".bc")) + if (FileExists(Directory + LibName + ".bc")) return Directory + LibName + ".bc"; - if (FileExists (Directory + LibName + ".so")) + if (FileExists(Directory + LibName + ".so")) return Directory + LibName + ".so"; - if (FileExists (Directory + LibName + ".a")) + if (FileExists(Directory + LibName + ".a")) return Directory + LibName + ".a"; } @@ -128,7 +128,7 @@ return std::string(); LibName = std::string(SearchPath) + "/" + LibName; - if (FileExists (LibName)) + if (FileExists(LibName)) return LibName; return std::string(); @@ -151,7 +151,7 @@ // None. // void -GetAllDefinedSymbols (Module *M, std::set &DefinedSymbols) +GetAllDefinedSymbols(Module *M, std::set &DefinedSymbols) { for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) if (I->hasName() && !I->isExternal() && !I->hasInternalLinkage()) @@ -228,7 +228,7 @@ // If an error occurs, the pointer is 0. // std::auto_ptr -LoadObject (const std::string & FN, std::string &OutErrorMessage) { +LoadObject(const std::string & FN, std::string &OutErrorMessage) { std::string ErrorMessage; Module *Result = ParseBytecodeFile(FN, &ErrorMessage); if (Result) return std::auto_ptr(Result); @@ -256,11 +256,10 @@ // TRUE - An error occurred. // FALSE - No errors. // -static bool -LinkInArchive (Module *M, - const std::string &Filename, - std::string &ErrorMessage, - bool Verbose) +static bool LinkInArchive(Module *M, + const std::string &Filename, + std::string &ErrorMessage, + bool Verbose) { // // Find all of the symbols currently undefined in the bytecode program. @@ -268,7 +267,7 @@ // no reason to link in any archive files. // std::set UndefinedSymbols; - GetAllUndefinedSymbols (M, UndefinedSymbols); + GetAllUndefinedSymbols(M, UndefinedSymbols); if (UndefinedSymbols.empty()) { if (Verbose) std::cerr << " No symbols undefined, don't link library!\n"; return false; // No need to link anything in! @@ -279,14 +278,14 @@ // if (Verbose) std::cerr << " Loading '" << Filename << "'\n"; std::vector Objects; - if (ReadArchiveFile (Filename, Objects, &ErrorMessage)) + if (ReadArchiveFile(Filename, Objects, &ErrorMessage)) return true; // // Figure out which symbols are defined by all of the modules in the archive. // std::vector > DefinedSymbols; - DefinedSymbols.resize (Objects.size()); + DefinedSymbols.resize(Objects.size()); for (unsigned i = 0; i != Objects.size(); ++i) { GetAllDefinedSymbols(Objects[i], DefinedSymbols[i]); } @@ -354,16 +353,15 @@ // TRUE - An error occurred. // FALSE - No errors. // -static bool -LinkInFile (Module *HeadModule, - const std::string &Filename, - std::string &ErrorMessage, - bool Verbose) +static bool LinkInFile(Module *HeadModule, + const std::string &Filename, + std::string &ErrorMessage, + bool Verbose) { std::auto_ptr M(LoadObject(Filename, ErrorMessage)); if (M.get() == 0) return true; if (Verbose) std::cerr << "Linking in '" << Filename << "'\n"; - return (LinkModules (HeadModule, M.get(), &ErrorMessage)); + return LinkModules(HeadModule, M.get(), &ErrorMessage); } // @@ -407,7 +405,7 @@ for (unsigned i = 1; i < Files.size(); ++i) { // Determine where this file lives. - if (FileExists (Files[i])) { + if (FileExists(Files[i])) { Pathname = Files[i]; } else { if (SearchPath == NULL) { @@ -416,32 +414,30 @@ } Pathname = std::string(SearchPath)+"/"+Files[i]; - if (!FileExists (Pathname)) { + if (!FileExists(Pathname)) { std::cerr << "Cannot find " << Files[i]; return true; } } - // // A user may specify an ar archive without -l, perhaps because it // is not installed as a library. Detect that and link the library. - // if (IsArchive(Pathname)) { if (Verbose) std::cerr << "Linking archive '" << Files[i] << "'\n"; - if (LinkInArchive (HeadModule, Pathname, ErrorMessage, Verbose)) { + if (LinkInArchive(HeadModule, Pathname, ErrorMessage, Verbose)) { PrintAndReturn(progname, ErrorMessage, - ": Error linking in '" + Files[i] + "'"); + ": Error linking in '" + Files[i] + "'"); return true; } } else { if (Verbose) std::cerr << "Linking file '" << Files[i] << "'\n"; - if (LinkInFile (HeadModule, Pathname, ErrorMessage, Verbose)) { + if (LinkInFile(HeadModule, Pathname, ErrorMessage, Verbose)) { PrintAndReturn(progname, ErrorMessage, - ": error linking in '" + Files[i] + "'"); + ": error linking in '" + Files[i] + "'"); return true; } } @@ -472,12 +468,12 @@ // FALSE - No error. // TRUE - Error. // -bool LinkLibraries (const char *progname, - Module *HeadModule, - const std::vector &Libraries, - const std::vector &LibPaths, - bool Verbose, - bool Native) +bool LinkLibraries(const char *progname, + Module *HeadModule, + const std::vector &Libraries, + const std::vector &LibPaths, + bool Verbose, + bool Native) { // String in which to receive error messages. std::string ErrorMessage; @@ -495,10 +491,8 @@ } } - // // A user may specify an ar archive without -l, perhaps because it // is not installed as a library. Detect that and link the library. - // if (IsArchive(Pathname)) { if (Verbose) std::cerr << "Linking archive '" << Libraries[i] << "'\n"; From brukman at cs.uiuc.edu Mon Sep 29 17:38:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Sep 29 17:38:01 2003 Subject: [llvm-commits] CVS: llvm/tools/llee/OSInterface.h StorageProxy.c ExecveHandler.c Makefile SysUtils.c SysUtils.h llee Message-ID: <200309292237.RAA16058@zion.cs.uiuc.edu> Changes in directory llvm/tools/llee: OSInterface.h added (r1.1) StorageProxy.c added (r1.1) ExecveHandler.c updated: 1.3 -> 1.4 Makefile updated: 1.2 -> 1.3 SysUtils.c updated: 1.3 -> 1.4 SysUtils.h updated: 1.2 -> 1.3 llee (r1.1) removed --- Log message: * Added an interface for how LLEE would communicate with the OS * Implemented the interface in StorageProxy.c * Removed the script `llee' as it is now created by the Makefile * Makefile now compiles a shared object version of the library, but only if using gcc-3.3, linking fails under gcc-3.2 --- Diffs of the changes: Index: llvm/tools/llee/OSInterface.h diff -c /dev/null llvm/tools/llee/OSInterface.h:1.1 *** /dev/null Mon Sep 29 17:37:10 2003 --- llvm/tools/llee/OSInterface.h Mon Sep 29 17:37:00 2003 *************** *** 0 **** --- 1,48 ---- + /*===- OSInterface.h - Interface to query OS for functionality ---*- C -*--===*\ + * * + * This file defines the prototype interface that we will expect operating * + * systems to implement if they wish to support offline cachine. * + * * + \*===----------------------------------------------------------------------===*/ + + #ifndef OS_INTERFACE_H + #define OS_INTERFACE_H + + #include "Config/sys/types.h" + + struct stat; + + /* + * llvmStat - equivalent to stat(3), except the key may not necessarily + * correspond to a file by that name, implementation is up to the OS. + * Values returned in buf are similar as they are in Unix. + */ + void llvmStat(const char *key, struct stat *buf); + + /* + * llvmWriteFile - implements a 'save' of a file in the OS. 'key' may not + * necessarily map to a file of the same name. + * Returns: + * 0 - success + * non-zero - error + */ + int llvmWriteFile(const char *key, const void *data, size_t len); + + /* + * llvmLoadFile - tells the OS to load data corresponding to a particular key + * somewhere into memory. + * Returns: + * 0 - failure + * non-zero - address of loaded file + * + * Value of size is the length of data loaded into memory. + */ + void* llvmReadFile(const char *key, size_t *size); + + /* + * llvmExecve - execute a file from cache. This is a temporary proof-of-concept + * because we do not relocate what we can read from disk. + */ + int llvmExecve(const char *filename, char *const argv[], char *const envp[]); + + #endif Index: llvm/tools/llee/StorageProxy.c diff -c /dev/null llvm/tools/llee/StorageProxy.c:1.1 *** /dev/null Mon Sep 29 17:37:10 2003 --- llvm/tools/llee/StorageProxy.c Mon Sep 29 17:37:00 2003 *************** *** 0 **** --- 1,101 ---- + /*===- StorageProxy.c - OS implementation of the caching interface --------===*\ + * * + * This file implements the interface that we will expect operating * + * systems to implement if they wish to support offline cachine. * + * * + \*===----------------------------------------------------------------------===*/ + + #include "OSInterface.h" + #include "SysUtils.h" + #include "Config/fcntl.h" + #include "Config/stdlib.h" + #include "Config/unistd.h" + #include "Config/sys/types.h" + #include "Config/sys/stat.h" + #include + #include + + static const char CacheRoot[] = "/tmp/LLVMCache"; + static const char ExeSuffix[] = ".exe"; + + char* computeCachedFile(const char *key) { + /* CacheRoot + "/" + std::string(key) + ExeSuffix; */ + char *cacheFile = (char*) malloc(strlen(CacheRoot) + 1 + strlen(key) + + strlen(ExeSuffix) + 1); + char *pCacheFile = cacheFile; + if (!cacheFile) return 0; + memcpy(cacheFile, CacheRoot, strlen(CacheRoot)); + pCacheFile += strlen(CacheRoot); + *pCacheFile++ = '/'; + memcpy(pCacheFile, key, strlen(key)); + pCacheFile += strlen(key); + memcpy(pCacheFile, ExeSuffix, strlen(ExeSuffix)); + pCacheFile += strlen(ExeSuffix); + *pCacheFile = 0; // Null-terminate + return cacheFile; + } + + /* + * llvmStat - equivalent to stat(3), except the key may not necessarily + * correspond to a file by that name, implementation is up to the OS. + * Values returned in buf are similar as they are in Unix. + */ + void llvmStat(const char *key, struct stat *buf) { + char* cacheFile = computeCachedFile(key); + fprintf(stderr, "llvmStat(%s)\n", cacheFile); + stat(cacheFile, buf); + free(cacheFile); + } + + /* + * llvmWriteFile - implements a 'save' of a file in the OS. 'key' may not + * necessarily map to a file of the same name. + * Returns: + * 0 - success + * non-zero - error + */ + int llvmWriteFile(const char *key, const void *data, size_t len) + { + char* cacheFile = computeCachedFile(key); + int fd = open(cacheFile, O_CREAT|O_WRONLY|O_TRUNC); + free(cacheFile); + if (fd < 0) return -1; // encountered an error + if (write(fd, data, len)) return -1; + if (fsync(fd)) return -1; + if (close(fd)) return -1; + return 0; + } + + /* + * llvmReadFile - tells the OS to load data corresponding to a particular key + * somewhere into memory. + * Returns: + * 0 - failure + * non-zero - address of loaded file + * + * Value of size is the length of data loaded into memory. + */ + void* llvmReadFile(const char *key, size_t *size) { + char* cacheFile = computeCachedFile(key); + if (!cacheFile) return 0; + struct stat buf; + stat(cacheFile, &buf); + int fd = open(cacheFile, O_RDONLY); + if (fd < 0) return 0; // encountered an error + void* data = malloc(buf.st_size); + if (read(fd, data, buf.st_size)) { + free(data); + return 0; + } + *size = buf.st_size; + return data; + } + + /* + * llvmExecve - execute a file from cache. This is a temporary proof-of-concept + * because we do not relocate what we can read from disk. + */ + int llvmExecve(const char *filename, char *const argv[], char *const envp[]) { + char* cacheFile = computeCachedFile(filename); + executeProgram(cacheFile, argv, envp); + } Index: llvm/tools/llee/ExecveHandler.c diff -u llvm/tools/llee/ExecveHandler.c:1.3 llvm/tools/llee/ExecveHandler.c:1.4 --- llvm/tools/llee/ExecveHandler.c:1.3 Sat Sep 27 17:26:37 2003 +++ llvm/tools/llee/ExecveHandler.c Mon Sep 29 17:36:59 2003 @@ -5,8 +5,8 @@ // //===----------------------------------------------------------------------===// +#include "OSInterface.h" #include "SysUtils.h" -#include "Config/dlfcn.h" #include "Config/errno.h" #include "Config/stdlib.h" #include "Config/unistd.h" @@ -21,32 +21,6 @@ static const char llvmHeader[] = "llvm"; /* - * The type of the execve() function is long and boring, but required. - */ -typedef int(*execveTy)(const char*, char *const[], char *const[]); - -/* - * This method finds the real `execve' call in the C library and executes the - * given program. - */ -int executeProgram(const char *filename, char *const argv[], char *const envp[]) -{ - /* - * Find a pointer to the *real* execve() function starting the search in the - * next library and forward, to avoid finding the one defined in this file. - */ - char *error; - execveTy execvePtr = (execveTy) dlsym(RTLD_NEXT, "execve"); - if ((error = dlerror()) != NULL) { - fprintf(stderr, "%s\n", error); - return -1; - } - - /* Really execute the program */ - return execvePtr(filename, argv, envp); -} - -/* * This replacement execve() function first checks the file to be executed * to see if it is a valid LLVM bytecode file, and then either invokes our * execution environment or passes it on to the system execve() call. @@ -56,8 +30,21 @@ /* Open the file, test to see if first four characters are "llvm" */ size_t headerSize = strlen(llvmHeader); char header[headerSize]; + char* realFilename = 0; + /* + * If the program is specified with a relative or absolute path, + * then just use the path and filename as is, otherwise search for it. + */ + if (filename[0] != '.' && filename[0] != '/') + realFilename = FindExecutable(filename); + else + realFilename = (char*) filename; + if (!realFilename) { + fprintf(stderr, "Cannot find path to `%s', exiting.\n", filename); + return -1; + } errno = 0; - int file = open(filename, O_RDONLY); + int file = open(realFilename, O_RDONLY); /* Check validity of `file' */ if (errno) return EIO; /* Read the header from the file */ @@ -65,6 +52,27 @@ close(file); if (bytesRead != (ssize_t)headerSize) return EIO; if (!memcmp(llvmHeader, header, headerSize)) { + /* + * Check if we have a cached translation on disk + */ + struct stat buf; + llvmStat(realFilename, &buf); + if (isExecutable(&buf)) { + size_t size; + void *fileAddr = llvmReadFile(realFilename, &size); + fprintf(stderr, "Found in cache: '%s'\n", realFilename); + if (fileAddr) { + free(fileAddr); + } + llvmExecve(realFilename, argv, envp); + } else { + /* + * Not in cache: save translation + */ + //llvmSaveFile(realFilename, addr, len); + //fprintf(stderr, "Cached: '%s'\n", realFilename); + } + /* * This is a bytecode file, so execute the JIT with the program and * parameters. @@ -73,26 +81,13 @@ for (argvSize = 0, idx = 0; argv[idx] && argv[idx][0]; ++idx) ++argvSize; char **LLIargs = (char**) malloc(sizeof(char*) * (argvSize+2)); - char *BCpath; - /* - * If the program is specified with a relative or absolute path, - * then just use the path and filename as is, otherwise search for it. - */ - if (filename[0] != '.' && filename[0] != '/') - BCpath = FindExecutable(filename); - else - BCpath = (char*) filename; - if (!BCpath) { - fprintf(stderr, "Cannot find path to `%s', exiting.\n", filename); - return -1; - } char *LLIpath = FindExecutable("lli"); if (!LLIpath) { fprintf(stderr, "Cannot find path to `lli', exiting.\n"); return -1; } LLIargs[0] = LLIpath; - LLIargs[1] = BCpath; + LLIargs[1] = realFilename; for (idx = 1; idx != argvSize; ++idx) LLIargs[idx+1] = argv[idx]; LLIargs[argvSize + 1] = '\0'; Index: llvm/tools/llee/Makefile diff -u llvm/tools/llee/Makefile:1.2 llvm/tools/llee/Makefile:1.3 --- llvm/tools/llee/Makefile:1.2 Fri Aug 15 18:31:54 2003 +++ llvm/tools/llee/Makefile Mon Sep 29 17:37:00 2003 @@ -1,21 +1,15 @@ LEVEL = ../.. -include $(LEVEL)/Makefile.config +LIBRARYNAME = execve +SHARED_LIBRARY = 1 +include $(LEVEL)/Makefile.common -SRCS = ExecveHandler.c SysUtils.c +all:: llee -OBJS = $(SRCS:%.c=%.o) -SO = execve.so +llee: $(DESTTOOLCURRENT)/llee -all: $(SO) - -%.o: %.c - gcc -g -I../../include -D_GNU_SOURCE $< -c -o $@ +$(DESTTOOLCURRENT)/llee: Makefile + echo exec env LD_PRELOAD=$(DESTLIBCURRENT)/execve.so $$\* > $@ + chmod u+x $@ -$(SO): $(OBJS) - gcc -g -shared -ldl -rdynamic $(OBJS) -o $@ - -execve_test: execve_test.c - gcc -g $< -o $@ - -clean: - rm -f $(OBJS) $(SO) +clean:: + rm -f $(DESTTOOLCURRENT)/llee Index: llvm/tools/llee/SysUtils.c diff -u llvm/tools/llee/SysUtils.c:1.3 llvm/tools/llee/SysUtils.c:1.4 --- llvm/tools/llee/SysUtils.c:1.3 Sat Sep 27 17:26:37 2003 +++ llvm/tools/llee/SysUtils.c Mon Sep 29 17:37:00 2003 @@ -6,35 +6,46 @@ //===----------------------------------------------------------------------===// #include "SysUtils.h" -#include "Config/sys/types.h" -#include "Config/sys/stat.h" +#include "Config/dlfcn.h" +#include "Config/errno.h" #include "Config/fcntl.h" -#include "Config/sys/wait.h" #include "Config/unistd.h" -#include "Config/errno.h" +#include "Config/sys/stat.h" +#include "Config/sys/types.h" +#include "Config/sys/wait.h" +#include #include #include /* + * isExecutable - This function returns true if given struct stat describes the + * file as being executable. + */ +unsigned isExecutable(const struct stat *buf) { + if (!(buf->st_mode & S_IFREG)) + return 0; // Not a regular file? + + if (buf->st_uid == getuid()) // Owner of file? + return buf->st_mode & S_IXUSR; + else if (buf->st_gid == getgid()) // In group of file? + return buf->st_mode & S_IXGRP; + else // Unrelated to file? + return buf->st_mode & S_IXOTH; +} + +/* * isExecutableFile - This function returns true if the filename specified * exists and is executable. */ unsigned isExecutableFile(const char *ExeFileName) { - struct stat Buf; - if (stat(ExeFileName, &Buf)) + struct stat buf; + if (stat(ExeFileName, &buf)) return 0; // Must not be executable! - if (!(Buf.st_mode & S_IFREG)) - return 0; // Not a regular file? - - if (Buf.st_uid == getuid()) // Owner of file? - return Buf.st_mode & S_IXUSR; - else if (Buf.st_gid == getgid()) // In group of file? - return Buf.st_mode & S_IXGRP; - else // Unrelated to file? - return Buf.st_mode & S_IXOTH; + return isExecutable(&buf); } + /* * FindExecutable - Find a named executable in the directories listed in $PATH. * If the executable cannot be found, returns NULL. @@ -80,4 +91,30 @@ /* If we fell out, we ran out of directories to search, return failure. */ return NULL; +} + +/* + * The type of the execve() function is long and boring, but required. + */ +typedef int(*execveTy)(const char*, char *const[], char *const[]); + +/* + * This method finds the real `execve' call in the C library and executes the + * given program. + */ +int executeProgram(const char *filename, char *const argv[], char *const envp[]) +{ + /* + * Find a pointer to the *real* execve() function starting the search in the + * next library and forward, to avoid finding the one defined in this file. + */ + char *error; + execveTy execvePtr = (execveTy) dlsym(RTLD_NEXT, "execve"); + if ((error = dlerror()) != NULL) { + fprintf(stderr, "%s\n", error); + return -1; + } + + /* Really execute the program */ + return execvePtr(filename, argv, envp); } Index: llvm/tools/llee/SysUtils.h diff -u llvm/tools/llee/SysUtils.h:1.2 llvm/tools/llee/SysUtils.h:1.3 --- llvm/tools/llee/SysUtils.h:1.2 Fri Aug 15 18:31:16 2003 +++ llvm/tools/llee/SysUtils.h Mon Sep 29 17:37:00 2003 @@ -8,6 +8,14 @@ #ifndef SYSUTILS_H #define SYSUTILS_H +struct stat; + +/* + * isExecutable - This function returns true if given struct stat describes the + * file as being executable. + */ +unsigned isExecutable(const struct stat *buf); + /* * isExecutableFile - This function returns true if the filename specified * exists and is executable. @@ -18,5 +26,12 @@ * FindExecutable - Find a named executable in the path. */ char *FindExecutable(const char *ExeName); + +/* + * This method finds the real `execve' call in the C library and executes the + * given program. + */ +int +executeProgram(const char *filename, char *const argv[], char *const envp[]); #endif From brukman at cs.uiuc.edu Mon Sep 29 17:39:02 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Sep 29 17:39:02 2003 Subject: [llvm-commits] CVS: llvm/include/Support/SystemUtils.h Message-ID: <200309292238.RAA16088@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: SystemUtils.h updated: 1.5 -> 1.6 --- Log message: Tersified and fixed whitespace (tabs -> spaces). --- Diffs of the changes: Index: llvm/include/Support/SystemUtils.h diff -u llvm/include/Support/SystemUtils.h:1.5 llvm/include/Support/SystemUtils.h:1.6 --- llvm/include/Support/SystemUtils.h:1.5 Wed Sep 17 14:02:49 2003 +++ llvm/include/Support/SystemUtils.h Mon Sep 29 17:37:57 2003 @@ -21,7 +21,7 @@ /// in the PATH. If the executable cannot be found, return an empty string. /// std::string FindExecutable(const std::string &ExeName, - const std::string &ProgramPath); + const std::string &ProgramPath); /// RunProgramWithTimeout - This function executes the specified program, with /// the specified null-terminated argument array, with the stdin/out/err fd's @@ -30,16 +30,12 @@ /// It returns the return value of the program, or -1 if a timeout is detected. /// int RunProgramWithTimeout(const std::string &ProgramPath, const char **Args, - const std::string &StdInFile = "", - const std::string &StdOutFile = "", - const std::string &StdErrFile = ""); + const std::string &StdInFile = "", + const std::string &StdOutFile = "", + const std::string &StdErrFile = ""); -/// -/// Function: ExecWait() -/// -/// Description: -/// Execute a program with the given arguments and environment and -/// wait for it to terminate. +/// ExecWait - Execute a program with the given arguments and environment and +/// wait for it to terminate. /// int ExecWait (const char * const argv[], const char * const envp[]); #endif From brukman at cs.uiuc.edu Mon Sep 29 17:40:10 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Sep 29 17:40:10 2003 Subject: [llvm-commits] CVS: llvm/support/lib/Support/ToolRunner.cpp Message-ID: <200309292239.RAA16126@zion.cs.uiuc.edu> Changes in directory llvm/support/lib/Support: ToolRunner.cpp added (r1.1) --- Log message: Implementation of the abstraction of running our tools + gcc, taken out of bugpoint for general usage and enjoyment. --- Diffs of the changes: Index: llvm/support/lib/Support/ToolRunner.cpp diff -c /dev/null llvm/support/lib/Support/ToolRunner.cpp:1.1 *** /dev/null Mon Sep 29 17:39:35 2003 --- llvm/support/lib/Support/ToolRunner.cpp Mon Sep 29 17:39:25 2003 *************** *** 0 **** --- 1,374 ---- + #include "Support/Debug.h" + #include "Support/FileUtilities.h" + #include "Support/ToolRunner.h" + + //===---------------------------------------------------------------------===// + // LLI Implementation of AbstractIntepreter interface + // + class LLI : public AbstractInterpreter { + std::string LLIPath; // The path to the LLI executable + public: + LLI(const std::string &Path) : LLIPath(Path) { } + + + virtual int ExecuteProgram(const std::string &Bytecode, + const cl::list &Args, + const std::string &InputFile, + const std::string &OutputFile, + const std::string &SharedLib = ""); + }; + + int LLI::ExecuteProgram(const std::string &Bytecode, + const cl::list &Args, + const std::string &InputFile, + const std::string &OutputFile, + const std::string &SharedLib) { + if (!SharedLib.empty()) { + std::cerr << "LLI currently does not support loading shared libraries.\n" + << "Exiting.\n"; + exit(1); + } + + std::vector LLIArgs; + LLIArgs.push_back(LLIPath.c_str()); + LLIArgs.push_back("-abort-on-exception"); + LLIArgs.push_back("-quiet"); + LLIArgs.push_back("-force-interpreter=true"); + LLIArgs.push_back(Bytecode.c_str()); + // Add optional parameters to the running program from Argv + for (unsigned i=0, e = Args.size(); i != e; ++i) + LLIArgs.push_back(Args[i].c_str()); + LLIArgs.push_back(0); + + std::cout << "" << std::flush; + DEBUG(std::cerr << "\nAbout to run:\n\t"; + for (unsigned i=0, e = LLIArgs.size(); i != e; ++i) + std::cerr << " " << LLIArgs[i]; + std::cerr << "\n"; + ); + return RunProgramWithTimeout(LLIPath, &LLIArgs[0], + InputFile, OutputFile, OutputFile); + } + + // LLI create method - Try to find the LLI executable + AbstractInterpreter *createLLItool(const std::string &ProgramPath, + std::string &Message) { + std::string LLIPath = FindExecutable("lli", ProgramPath); + if (!LLIPath.empty()) { + Message = "Found lli: " + LLIPath + "\n"; + return new LLI(LLIPath); + } + + Message = "Cannot find `lli' in executable directory or PATH!\n"; + return 0; + } + + //===----------------------------------------------------------------------===// + // LLC Implementation of AbstractIntepreter interface + // + int LLC::OutputAsm(const std::string &Bytecode, + std::string &OutputAsmFile) { + OutputAsmFile = getUniqueFilename(Bytecode+".llc.s"); + const char *LLCArgs[] = { + LLCPath.c_str(), + "-o", OutputAsmFile.c_str(), // Output to the Asm file + "-f", // Overwrite as necessary... + Bytecode.c_str(), // This is the input bytecode + 0 + }; + + std::cout << "" << std::flush; + if (RunProgramWithTimeout(LLCPath, LLCArgs, "/dev/null", "/dev/null", + "/dev/null")) { + // If LLC failed on the bytecode, print error... + std::cerr << "Error: `llc' failed!\n"; + removeFile(OutputAsmFile); + return 1; + } + + return 0; + } + + int LLC::ExecuteProgram(const std::string &Bytecode, + const cl::list &Args, + const std::string &InputFile, + const std::string &OutputFile, + const std::string &SharedLib) { + + std::string OutputAsmFile; + if (OutputAsm(Bytecode, OutputAsmFile)) { + std::cerr << "Could not generate asm code with `llc', exiting.\n"; + exit(1); + } + + // Assuming LLC worked, compile the result with GCC and run it. + int Result = gcc->ExecuteProgram(OutputAsmFile, Args, AsmFile, + InputFile, OutputFile, SharedLib); + removeFile(OutputAsmFile); + return Result; + } + + /// createLLCtool - Try to find the LLC executable + /// + LLC *createLLCtool(const std::string &ProgramPath, std::string &Message) + { + std::string LLCPath = FindExecutable("llc", ProgramPath); + if (LLCPath.empty()) { + Message = "Cannot find `llc' in executable directory or PATH!\n"; + return 0; + } + + Message = "Found llc: " + LLCPath + "\n"; + GCC *gcc = createGCCtool(ProgramPath, Message); + if (!gcc) { + std::cerr << Message << "\n"; + exit(1); + } + return new LLC(LLCPath, gcc); + } + + //===---------------------------------------------------------------------===// + // JIT Implementation of AbstractIntepreter interface + // + class JIT : public AbstractInterpreter { + std::string LLIPath; // The path to the LLI executable + public: + JIT(const std::string &Path) : LLIPath(Path) { } + + + virtual int ExecuteProgram(const std::string &Bytecode, + const cl::list &Args, + const std::string &InputFile, + const std::string &OutputFile, + const std::string &SharedLib = ""); + }; + + int JIT::ExecuteProgram(const std::string &Bytecode, + const cl::list &Args, + const std::string &InputFile, + const std::string &OutputFile, + const std::string &SharedLib) { + // Construct a vector of parameters, incorporating those from the command-line + std::vector JITArgs; + JITArgs.push_back(LLIPath.c_str()); + JITArgs.push_back("-quiet"); + JITArgs.push_back("-force-interpreter=false"); + if (!SharedLib.empty()) { + JITArgs.push_back("-load"); + JITArgs.push_back(SharedLib.c_str()); + } + JITArgs.push_back(Bytecode.c_str()); + // Add optional parameters to the running program from Argv + for (unsigned i=0, e = Args.size(); i != e; ++i) + JITArgs.push_back(Args[i].c_str()); + JITArgs.push_back(0); + + std::cout << "" << std::flush; + DEBUG(std::cerr << "\nAbout to run:\n\t"; + for (unsigned i=0, e = JITArgs.size(); i != e; ++i) + std::cerr << " " << JITArgs[i]; + std::cerr << "\n"; + ); + DEBUG(std::cerr << "\nSending output to " << OutputFile << "\n"); + return RunProgramWithTimeout(LLIPath, &JITArgs[0], + InputFile, OutputFile, OutputFile); + } + + /// createJITtool - Try to find the LLI executable + /// + AbstractInterpreter *createJITtool(const std::string &ProgramPath, + std::string &Message) { + std::string LLIPath = FindExecutable("lli", ProgramPath); + if (!LLIPath.empty()) { + Message = "Found lli: " + LLIPath + "\n"; + return new JIT(LLIPath); + } + + Message = "Cannot find `lli' in executable directory or PATH!\n"; + return 0; + } + + int CBE::OutputC(const std::string &Bytecode, + std::string &OutputCFile) { + OutputCFile = getUniqueFilename(Bytecode+".cbe.c"); + const char *DisArgs[] = { + DISPath.c_str(), + "-o", OutputCFile.c_str(), // Output to the C file + "-c", // Output to C + "-f", // Overwrite as necessary... + Bytecode.c_str(), // This is the input bytecode + 0 + }; + + std::cout << "" << std::flush; + if (RunProgramWithTimeout(DISPath, DisArgs, "/dev/null", "/dev/null", + "/dev/null")) { + // If dis failed on the bytecode, print error... + std::cerr << "Error: `llvm-dis -c' failed!\n"; + return 1; + } + + return 0; + } + + int CBE::ExecuteProgram(const std::string &Bytecode, + const cl::list &Args, + const std::string &InputFile, + const std::string &OutputFile, + const std::string &SharedLib) { + std::string OutputCFile; + if (OutputC(Bytecode, OutputCFile)) { + std::cerr << "Could not generate C code with `llvm-dis', exiting.\n"; + exit(1); + } + + int Result = gcc->ExecuteProgram(OutputCFile, Args, CFile, + InputFile, OutputFile, SharedLib); + removeFile(OutputCFile); + + return Result; + } + + /// createCBEtool - Try to find the 'dis' executable + /// + CBE *createCBEtool(const std::string &ProgramPath, std::string &Message) { + std::string DISPath = FindExecutable("llvm-dis", ProgramPath); + if (DISPath.empty()) { + Message = + "Cannot find `llvm-dis' in executable directory or PATH!\n"; + return 0; + } + + Message = "Found llvm-dis: " + DISPath + "\n"; + GCC *gcc = createGCCtool(ProgramPath, Message); + if (!gcc) { + std::cerr << Message << "\n"; + exit(1); + } + return new CBE(DISPath, gcc); + } + + //===---------------------------------------------------------------------===// + // GCC abstraction + // + // This is not a *real* AbstractInterpreter as it does not accept bytecode + // files, but only input acceptable to GCC, i.e. C, C++, and assembly files + // + int GCC::ExecuteProgram(const std::string &ProgramFile, + const cl::list &Args, + FileType fileType, + const std::string &InputFile, + const std::string &OutputFile, + const std::string &SharedLib) { + std::string OutputBinary = getUniqueFilename(ProgramFile+".gcc.exe"); + std::vector GCCArgs; + + GCCArgs.push_back(GCCPath.c_str()); + if (!SharedLib.empty()) // Specify the shared library to link in... + GCCArgs.push_back(SharedLib.c_str()); + GCCArgs.push_back("-x"); + if (fileType == CFile) { + GCCArgs.push_back("c"); + GCCArgs.push_back("-fno-strict-aliasing"); + } else { + GCCArgs.push_back("assembler"); + } + GCCArgs.push_back(ProgramFile.c_str()); // Specify the input filename... + GCCArgs.push_back("-o"); + GCCArgs.push_back(OutputBinary.c_str()); // Output to the right file... + GCCArgs.push_back("-lm"); // Hard-code the math library... + GCCArgs.push_back("-O2"); // Optimize the program a bit... + GCCArgs.push_back(0); // NULL terminator + + std::cout << "" << std::flush; + if (RunProgramWithTimeout(GCCPath, &GCCArgs[0], "/dev/null", "/dev/null", + "/dev/null")) { + ProcessFailure(&GCCArgs[0]); + exit(1); + } + + std::vector ProgramArgs; + ProgramArgs.push_back(OutputBinary.c_str()); + // Add optional parameters to the running program from Argv + for (unsigned i=0, e = Args.size(); i != e; ++i) + ProgramArgs.push_back(Args[i].c_str()); + ProgramArgs.push_back(0); // NULL terminator + + // Now that we have a binary, run it! + std::cout << "" << std::flush; + DEBUG(std::cerr << "\nAbout to run:\n\t"; + for (unsigned i=0, e = ProgramArgs.size(); i != e; ++i) + std::cerr << " " << ProgramArgs[i]; + std::cerr << "\n"; + ); + int ProgramResult = RunProgramWithTimeout(OutputBinary, &ProgramArgs[0], + InputFile, OutputFile, OutputFile); + removeFile(OutputBinary); + return ProgramResult; + } + + int GCC::MakeSharedObject(const std::string &InputFile, + FileType fileType, + std::string &OutputFile) { + OutputFile = getUniqueFilename(InputFile+".so"); + // Compile the C/asm file into a shared object + const char* GCCArgs[] = { + GCCPath.c_str(), + "-x", (fileType == AsmFile) ? "assembler" : "c", + "-fno-strict-aliasing", + InputFile.c_str(), // Specify the input filename... + #if defined(sparc) || defined(__sparc__) || defined(__sparcv9) + "-G", // Compile a shared library, `-G' for Sparc + #else + "-shared", // `-shared' for Linux/X86, maybe others + #endif + "-o", OutputFile.c_str(), // Output to the right filename... + "-O2", // Optimize the program a bit... + 0 + }; + + std::cout << "" << std::flush; + if(RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", "/dev/null", + "/dev/null")) { + ProcessFailure(GCCArgs); + exit(1); + } + return 0; + } + + void GCC::ProcessFailure(const char** GCCArgs) { + std::cerr << "\n*** Error: invocation of the C compiler failed!\n"; + for (const char **Arg = GCCArgs; *Arg; ++Arg) + std::cerr << " " << *Arg; + std::cerr << "\n"; + + // Rerun the compiler, capturing any error messages to print them. + std::string ErrorFilename = getUniqueFilename("gcc.errors"); + RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", ErrorFilename.c_str(), + ErrorFilename.c_str()); + + // Print out the error messages generated by GCC if possible... + std::ifstream ErrorFile(ErrorFilename.c_str()); + if (ErrorFile) { + std::copy(std::istreambuf_iterator(ErrorFile), + std::istreambuf_iterator(), + std::ostreambuf_iterator(std::cerr)); + ErrorFile.close(); + std::cerr << "\n"; + } + + removeFile(ErrorFilename); + } + + /// createGCCtool - Try to find the `gcc' executable + /// + GCC *createGCCtool(const std::string &ProgramPath, std::string &Message) { + std::string GCCPath = FindExecutable("gcc", ProgramPath); + if (GCCPath.empty()) { + Message = "Cannot find `gcc' in executable directory or PATH!\n"; + return 0; + } + + Message = "Found gcc: " + GCCPath + "\n"; + return new GCC(GCCPath); + } From brukman at cs.uiuc.edu Mon Sep 29 17:40:13 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Sep 29 17:40:13 2003 Subject: [llvm-commits] CVS: llvm/include/Support/ToolRunner.h Message-ID: <200309292239.RAA16116@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: ToolRunner.h added (r1.1) --- Log message: Abstracted away the process of running our tools + gcc from bugpoint. --- Diffs of the changes: Index: llvm/include/Support/ToolRunner.h diff -c /dev/null llvm/include/Support/ToolRunner.h:1.1 *** /dev/null Mon Sep 29 17:39:07 2003 --- llvm/include/Support/ToolRunner.h Mon Sep 29 17:38:57 2003 *************** *** 0 **** --- 1,115 ---- + #ifndef TOOLRUNNER_H + #define TOOLRUNNER_H + + #include "Support/CommandLine.h" + #include "Support/SystemUtils.h" + #include + #include + #include + #include + + enum FileType { AsmFile, CFile }; + + //===---------------------------------------------------------------------===// + // GCC abstraction + // + // This is not a *real* AbstractInterpreter as it does not accept bytecode + // files, but only input acceptable to GCC, i.e. C, C++, and assembly files + // + class GCC { + std::string GCCPath; // The path to the gcc executable + public: + GCC(const std::string &gccPath) : GCCPath(gccPath) { } + virtual ~GCC() {} + + virtual int ExecuteProgram(const std::string &ProgramFile, + const cl::list &Args, + FileType fileType, + const std::string &InputFile, + const std::string &OutputFile, + const std::string &SharedLib = ""); + + int MakeSharedObject(const std::string &InputFile, + FileType fileType, + std::string &OutputFile); + + void ProcessFailure(const char **Args); + }; + + GCC* createGCCtool(const std::string &ProgramPath, + std::string &Message); + + /// AbstractInterpreter Class - Subclasses of this class are used to execute + /// LLVM bytecode in a variety of ways. This abstract interface hides this + /// complexity behind a simple interface. + /// + struct AbstractInterpreter { + + virtual ~AbstractInterpreter() {} + + /// ExecuteProgram - Run the specified bytecode file, emitting output to the + /// specified filename. This returns the exit code of the program. + /// + virtual int ExecuteProgram(const std::string &Bytecode, + const cl::list &Args, + const std::string &InputFile, + const std::string &OutputFile, + const std::string &SharedLib = "") = 0; + }; + + //===---------------------------------------------------------------------===// + // CBE Implementation of AbstractIntepreter interface + // + class CBE : public AbstractInterpreter { + std::string DISPath; // The path to the `llvm-dis' executable + GCC *gcc; + public: + CBE(const std::string &disPath, GCC *Gcc) : DISPath(disPath), gcc(Gcc) { } + ~CBE() { delete gcc; } + + virtual int ExecuteProgram(const std::string &Bytecode, + const cl::list &Args, + const std::string &InputFile, + const std::string &OutputFile, + const std::string &SharedLib = ""); + + // Sometimes we just want to go half-way and only generate the C file, + // not necessarily compile it with GCC and run the program + virtual int OutputC(const std::string &Bytecode, + std::string &OutputCFile); + + }; + + CBE* createCBEtool(const std::string &ProgramPath, std::string &Message); + + //===---------------------------------------------------------------------===// + // LLC Implementation of AbstractIntepreter interface + // + class LLC : public AbstractInterpreter { + std::string LLCPath; // The path to the LLC executable + GCC *gcc; + public: + LLC(const std::string &llcPath, GCC *Gcc) + : LLCPath(llcPath), gcc(Gcc) { } + ~LLC() { delete gcc; } + + virtual int ExecuteProgram(const std::string &Bytecode, + const cl::list &Args, + const std::string &InputFile, + const std::string &OutputFile, + const std::string &SharedLib = ""); + + int OutputAsm(const std::string &Bytecode, + std::string &OutputAsmFile); + }; + + LLC* createLLCtool(const std::string &ProgramPath, std::string &Message); + + AbstractInterpreter* createLLItool(const std::string &ProgramPath, + std::string &Message); + + AbstractInterpreter* createJITtool(const std::string &ProgramPath, + std::string &Message); + + + #endif From brukman at cs.uiuc.edu Mon Sep 29 17:41:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Sep 29 17:41:01 2003 Subject: [llvm-commits] CVS: llvm/support/lib/Support/SystemUtils.cpp Message-ID: <200309292240.RAA16150@zion.cs.uiuc.edu> Changes in directory llvm/support/lib/Support: SystemUtils.cpp updated: 1.15 -> 1.16 --- Log message: Fixed space issues, code alignment, tabs -> spaces. --- Diffs of the changes: Index: llvm/support/lib/Support/SystemUtils.cpp diff -u llvm/support/lib/Support/SystemUtils.cpp:1.15 llvm/support/lib/Support/SystemUtils.cpp:1.16 --- llvm/support/lib/Support/SystemUtils.cpp:1.15 Wed Sep 17 14:02:48 2003 +++ llvm/support/lib/Support/SystemUtils.cpp Mon Sep 29 17:40:07 2003 @@ -36,14 +36,14 @@ return Buf.st_mode & S_IXOTH; } - /// FindExecutable - Find a named executable, giving the argv[0] of program -/// being executed. This allows us to find another LLVM tool if it is built into -/// the same directory, but that directory is neither the current directory, nor -/// in the PATH. If the executable cannot be found, return an empty string. +/// being executed. This allows us to find another LLVM tool if it is built +/// into the same directory, but that directory is neither the current +/// directory, nor in the PATH. If the executable cannot be found, return an +/// empty string. /// std::string FindExecutable(const std::string &ExeName, - const std::string &ProgramPath) { + const std::string &ProgramPath) { // First check the directory that bugpoint is in. We can do this if // BugPointPath contains at least one / character, indicating that it is a // relative path to bugpoint itself. @@ -93,7 +93,7 @@ int InFD = open(File.c_str(), FD == 0 ? O_RDONLY : O_WRONLY|O_CREAT, 0666); if (InFD == -1) { std::cerr << "Error opening file '" << File << "' for " - << (FD == 0 ? "input" : "output") << "!\n"; + << (FD == 0 ? "input" : "output") << "!\n"; exit(1); } @@ -108,9 +108,9 @@ /// It returns the return value of the program, or -1 if a timeout is detected. /// int RunProgramWithTimeout(const std::string &ProgramPath, const char **Args, - const std::string &StdInFile, - const std::string &StdOutFile, - const std::string &StdErrFile) { + const std::string &StdInFile, + const std::string &StdOutFile, + const std::string &StdErrFile) { // FIXME: install sigalarm handler here for timeout... @@ -141,12 +141,12 @@ if (errno == EINTR) { static bool FirstTimeout = true; if (FirstTimeout) { - std::cout << + std::cout << "*** Program execution timed out! This mechanism is designed to handle\n" " programs stuck in infinite loops gracefully. The -timeout option\n" " can be used to change the timeout threshold or disable it completely\n" " (with -timeout=0). This message is only displayed once.\n"; - FirstTimeout = false; + FirstTimeout = false; } return -1; // Timeout detected } From brukman at cs.uiuc.edu Mon Sep 29 17:42:02 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon Sep 29 17:42:02 2003 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ExecutionDriver.cpp Message-ID: <200309292241.RAA16183@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: ExecutionDriver.cpp updated: 1.20 -> 1.21 --- Log message: Use the newly abstracted interface for running our tools and gcc. --- Diffs of the changes: Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.20 llvm/tools/bugpoint/ExecutionDriver.cpp:1.21 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.20 Thu Aug 28 17:14:16 2003 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Mon Sep 29 17:40:52 2003 @@ -15,6 +15,7 @@ */ #include "BugDriver.h" +#include "Support/ToolRunner.h" #include "Support/CommandLine.h" #include "Support/Debug.h" #include "Support/FileUtilities.h" @@ -29,6 +30,7 @@ enum OutputType { RunLLI, RunJIT, RunLLC, RunCBE }; + cl::opt InterpreterSel(cl::desc("Specify how LLVM code should be executed:"), cl::values(clEnumValN(RunLLI, "run-lli", "Execute with LLI"), @@ -40,8 +42,6 @@ cl::opt InputFile("input", cl::init("/dev/null"), cl::desc("Filename to pipe in as stdin (default: /dev/null)")); - - enum FileType { AsmFile, CFile }; } // Anything specified after the --args option are taken as arguments to the @@ -50,426 +50,6 @@ InputArgv("args", cl::Positional, cl::desc("..."), cl::ZeroOrMore); -/// AbstractInterpreter Class - Subclasses of this class are used to execute -/// LLVM bytecode in a variety of ways. This abstract interface hides this -/// complexity behind a simple interface. -/// -struct AbstractInterpreter { - - virtual ~AbstractInterpreter() {} - - /// ExecuteProgram - Run the specified bytecode file, emitting output to the - /// specified filename. This returns the exit code of the program. - /// - virtual int ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile, - const std::string &SharedLib = "") = 0; -}; - - -//===----------------------------------------------------------------------===// -// LLI Implementation of AbstractIntepreter interface -// -class LLI : public AbstractInterpreter { - std::string LLIPath; // The path to the LLI executable -public: - LLI(const std::string &Path) : LLIPath(Path) { } - - // LLI create method - Try to find the LLI executable - static LLI *create(BugDriver *BD, std::string &Message) { - std::string LLIPath = FindExecutable("lli", BD->getToolName()); - if (!LLIPath.empty()) { - Message = "Found lli: " + LLIPath + "\n"; - return new LLI(LLIPath); - } - - Message = "Cannot find `lli' in bugpoint executable directory or PATH!\n"; - return 0; - } - virtual int ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile, - const std::string &SharedLib = ""); -}; - -int LLI::ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile, - const std::string &SharedLib) { - if (!SharedLib.empty()) { - std::cerr << "LLI currently does not support loading shared libraries.\n" - << "Exiting.\n"; - exit(1); - } - - std::vector LLIArgs; - LLIArgs.push_back(LLIPath.c_str()); - LLIArgs.push_back("-abort-on-exception"); - LLIArgs.push_back("-quiet"); - LLIArgs.push_back("-force-interpreter=true"); - LLIArgs.push_back(Bytecode.c_str()); - // Add optional parameters to the running program from Argv - for (unsigned i=0, e = InputArgv.size(); i != e; ++i) - LLIArgs.push_back(InputArgv[i].c_str()); - LLIArgs.push_back(0); - - std::cout << "" << std::flush; - DEBUG(std::cerr << "\nAbout to run:\n\t"; - for (unsigned i=0, e = LLIArgs.size(); i != e; ++i) - std::cerr << " " << LLIArgs[i]; - std::cerr << "\n"; - ); - return RunProgramWithTimeout(LLIPath, &LLIArgs[0], - InputFile, OutputFile, OutputFile); -} - -//===----------------------------------------------------------------------===// -// GCC abstraction -// -// This is not a *real* AbstractInterpreter as it does not accept bytecode -// files, but only input acceptable to GCC, i.e. C, C++, and assembly files -// -class GCC { - std::string GCCPath; // The path to the gcc executable -public: - GCC(const std::string &gccPath) : GCCPath(gccPath) { } - virtual ~GCC() {} - - // GCC create method - Try to find the `gcc' executable - static GCC *create(BugDriver *BD, std::string &Message) { - std::string GCCPath = FindExecutable("gcc", BD->getToolName()); - if (GCCPath.empty()) { - Message = "Cannot find `gcc' in bugpoint executable directory or PATH!\n"; - return 0; - } - - Message = "Found gcc: " + GCCPath + "\n"; - return new GCC(GCCPath); - } - - virtual int ExecuteProgram(const std::string &ProgramFile, - FileType fileType, - const std::string &OutputFile, - const std::string &SharedLib = ""); - - int MakeSharedObject(const std::string &InputFile, - FileType fileType, - std::string &OutputFile); - - void ProcessFailure(const char **Args); -}; - -int GCC::ExecuteProgram(const std::string &ProgramFile, - FileType fileType, - const std::string &OutputFile, - const std::string &SharedLib) { - std::string OutputBinary = getUniqueFilename("bugpoint.gcc.exe"); - std::vector GCCArgs; - - GCCArgs.push_back(GCCPath.c_str()); - if (!SharedLib.empty()) // Specify the shared library to link in... - GCCArgs.push_back(SharedLib.c_str()); - GCCArgs.push_back("-x"); - if (fileType == CFile) { - GCCArgs.push_back("c"); - GCCArgs.push_back("-fno-strict-aliasing"); - } else { - GCCArgs.push_back("assembler"); - } - GCCArgs.push_back(ProgramFile.c_str()); // Specify the input filename... - GCCArgs.push_back("-o"); - GCCArgs.push_back(OutputBinary.c_str()); // Output to the right file... - GCCArgs.push_back("-lm"); // Hard-code the math library... - GCCArgs.push_back("-O2"); // Optimize the program a bit... - GCCArgs.push_back(0); // NULL terminator - - std::cout << "" << std::flush; - if (RunProgramWithTimeout(GCCPath, &GCCArgs[0], "/dev/null", "/dev/null", - "/dev/null")) { - ProcessFailure(&GCCArgs[0]); - exit(1); - } - - std::vector ProgramArgs; - ProgramArgs.push_back(OutputBinary.c_str()); - // Add optional parameters to the running program from Argv - for (unsigned i=0, e = InputArgv.size(); i != e; ++i) - ProgramArgs.push_back(InputArgv[i].c_str()); - ProgramArgs.push_back(0); // NULL terminator - - // Now that we have a binary, run it! - std::cout << "" << std::flush; - DEBUG(std::cerr << "\nAbout to run:\n\t"; - for (unsigned i=0, e = ProgramArgs.size(); i != e; ++i) - std::cerr << " " << ProgramArgs[i]; - std::cerr << "\n"; - ); - int ProgramResult = RunProgramWithTimeout(OutputBinary, &ProgramArgs[0], - InputFile, OutputFile, OutputFile); - removeFile(OutputBinary); - return ProgramResult; -} - -int GCC::MakeSharedObject(const std::string &InputFile, - FileType fileType, - std::string &OutputFile) { - OutputFile = getUniqueFilename("./bugpoint.so"); - // Compile the C/asm file into a shared object - const char* GCCArgs[] = { - GCCPath.c_str(), - "-x", (fileType == AsmFile) ? "assembler" : "c", - "-fno-strict-aliasing", - InputFile.c_str(), // Specify the input filename... -#if defined(sparc) || defined(__sparc__) || defined(__sparcv9) - "-G", // Compile a shared library, `-G' for Sparc -#else - "-shared", // `-shared' for Linux/X86, maybe others -#endif - "-o", OutputFile.c_str(), // Output to the right filename... - "-O2", // Optimize the program a bit... - 0 - }; - - std::cout << "" << std::flush; - if(RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", "/dev/null", - "/dev/null")) { - ProcessFailure(GCCArgs); - exit(1); - } - return 0; -} - -void GCC::ProcessFailure(const char** GCCArgs) { - std::cerr << "\n*** bugpoint error: invocation of the C compiler failed!\n"; - for (const char **Arg = GCCArgs; *Arg; ++Arg) - std::cerr << " " << *Arg; - std::cerr << "\n"; - - // Rerun the compiler, capturing any error messages to print them. - std::string ErrorFilename = getUniqueFilename("bugpoint.gcc.errors"); - RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", ErrorFilename.c_str(), - ErrorFilename.c_str()); - - // Print out the error messages generated by GCC if possible... - std::ifstream ErrorFile(ErrorFilename.c_str()); - if (ErrorFile) { - std::copy(std::istreambuf_iterator(ErrorFile), - std::istreambuf_iterator(), - std::ostreambuf_iterator(std::cerr)); - ErrorFile.close(); - std::cerr << "\n"; - } - - removeFile(ErrorFilename); -} - -//===----------------------------------------------------------------------===// -// LLC Implementation of AbstractIntepreter interface -// -class LLC : public AbstractInterpreter { - std::string LLCPath; // The path to the LLC executable - GCC *gcc; -public: - LLC(const std::string &llcPath, GCC *Gcc) - : LLCPath(llcPath), gcc(Gcc) { } - ~LLC() { delete gcc; } - - // LLC create method - Try to find the LLC executable - static LLC *create(BugDriver *BD, std::string &Message) { - std::string LLCPath = FindExecutable("llc", BD->getToolName()); - if (LLCPath.empty()) { - Message = "Cannot find `llc' in bugpoint executable directory or PATH!\n"; - return 0; - } - - Message = "Found llc: " + LLCPath + "\n"; - GCC *gcc = GCC::create(BD, Message); - if (!gcc) { - std::cerr << Message << "\n"; - exit(1); - } - return new LLC(LLCPath, gcc); - } - - virtual int ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile, - const std::string &SharedLib = ""); - - int OutputAsm(const std::string &Bytecode, - std::string &OutputAsmFile); -}; - -int LLC::OutputAsm(const std::string &Bytecode, - std::string &OutputAsmFile) { - OutputAsmFile = "bugpoint.llc.s"; - const char *LLCArgs[] = { - LLCPath.c_str(), - "-o", OutputAsmFile.c_str(), // Output to the Asm file - "-f", // Overwrite as necessary... - Bytecode.c_str(), // This is the input bytecode - 0 - }; - - std::cout << "" << std::flush; - if (RunProgramWithTimeout(LLCPath, LLCArgs, "/dev/null", "/dev/null", - "/dev/null")) { - // If LLC failed on the bytecode, print error... - std::cerr << "bugpoint error: `llc' failed!\n"; - removeFile(OutputAsmFile); - return 1; - } - - return 0; -} - -int LLC::ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile, - const std::string &SharedLib) { - - std::string OutputAsmFile; - if (OutputAsm(Bytecode, OutputAsmFile)) { - std::cerr << "Could not generate asm code with `llc', exiting.\n"; - exit(1); - } - - // Assuming LLC worked, compile the result with GCC and run it. - int Result = gcc->ExecuteProgram(OutputAsmFile,AsmFile,OutputFile,SharedLib); - removeFile(OutputAsmFile); - return Result; -} - - -//===----------------------------------------------------------------------===// -// JIT Implementation of AbstractIntepreter interface -// -class JIT : public AbstractInterpreter { - std::string LLIPath; // The path to the LLI executable -public: - JIT(const std::string &Path) : LLIPath(Path) { } - - // JIT create method - Try to find the LLI executable - static JIT *create(BugDriver *BD, std::string &Message) { - std::string LLIPath = FindExecutable("lli", BD->getToolName()); - if (!LLIPath.empty()) { - Message = "Found lli: " + LLIPath + "\n"; - return new JIT(LLIPath); - } - - Message = "Cannot find `lli' in bugpoint executable directory or PATH!\n"; - return 0; - } - virtual int ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile, - const std::string &SharedLib = ""); -}; - -int JIT::ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile, - const std::string &SharedLib) { - // Construct a vector of parameters, incorporating those from the command-line - std::vector JITArgs; - JITArgs.push_back(LLIPath.c_str()); - JITArgs.push_back("-quiet"); - JITArgs.push_back("-force-interpreter=false"); - if (!SharedLib.empty()) { - JITArgs.push_back("-load"); - JITArgs.push_back(SharedLib.c_str()); - } - JITArgs.push_back(Bytecode.c_str()); - // Add optional parameters to the running program from Argv - for (unsigned i=0, e = InputArgv.size(); i != e; ++i) - JITArgs.push_back(InputArgv[i].c_str()); - JITArgs.push_back(0); - - std::cout << "" << std::flush; - DEBUG(std::cerr << "\nAbout to run:\n\t"; - for (unsigned i=0, e = JITArgs.size(); i != e; ++i) - std::cerr << " " << JITArgs[i]; - std::cerr << "\n"; - ); - DEBUG(std::cerr << "\nSending output to " << OutputFile << "\n"); - return RunProgramWithTimeout(LLIPath, &JITArgs[0], - InputFile, OutputFile, OutputFile); -} - -//===----------------------------------------------------------------------===// -// CBE Implementation of AbstractIntepreter interface -// -class CBE : public AbstractInterpreter { - std::string DISPath; // The path to the `llvm-dis' executable - GCC *gcc; -public: - CBE(const std::string &disPath, GCC *Gcc) : DISPath(disPath), gcc(Gcc) { } - ~CBE() { delete gcc; } - - // CBE create method - Try to find the 'dis' executable - static CBE *create(BugDriver *BD, std::string &Message) { - std::string DISPath = FindExecutable("llvm-dis", BD->getToolName()); - if (DISPath.empty()) { - Message = - "Cannot find `llvm-dis' in bugpoint executable directory or PATH!\n"; - return 0; - } - - Message = "Found llvm-dis: " + DISPath + "\n"; - - GCC *gcc = GCC::create(BD, Message); - if (!gcc) { - std::cerr << Message << "\n"; - exit(1); - } - return new CBE(DISPath, gcc); - } - - virtual int ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile, - const std::string &SharedLib = ""); - - // Sometimes we just want to go half-way and only generate the C file, - // not necessarily compile it with GCC and run the program - virtual int OutputC(const std::string &Bytecode, - std::string &OutputCFile); - -}; - -int CBE::OutputC(const std::string &Bytecode, - std::string &OutputCFile) { - OutputCFile = "bugpoint.cbe.c"; - const char *DisArgs[] = { - DISPath.c_str(), - "-o", OutputCFile.c_str(), // Output to the C file - "-c", // Output to C - "-f", // Overwrite as necessary... - Bytecode.c_str(), // This is the input bytecode - 0 - }; - - std::cout << "" << std::flush; - if (RunProgramWithTimeout(DISPath, DisArgs, "/dev/null", "/dev/null", - "/dev/null")) { - // If dis failed on the bytecode, print error... - std::cerr << "bugpoint error: `llvm-dis -c' failed!\n"; - return 1; - } - - return 0; -} - - -int CBE::ExecuteProgram(const std::string &Bytecode, - const std::string &OutputFile, - const std::string &SharedLib) { - std::string OutputCFile; - if (OutputC(Bytecode, OutputCFile)) { - std::cerr << "Could not generate C code with `llvm-dis', exiting.\n"; - exit(1); - } - - int Result = gcc->ExecuteProgram(OutputCFile, CFile, OutputFile, SharedLib); - removeFile(OutputCFile); - - return Result; -} - - //===----------------------------------------------------------------------===// // BugDriver method implementation // @@ -483,25 +63,24 @@ // FIXME: This should default to searching for the best interpreter to use on // this platform, which would be JIT, then LLC, then CBE, then LLI. - // Create an instance of the AbstractInterpreter interface as specified on the - // command line + // Create an instance of the AbstractInterpreter interface as specified on + // the command line std::string Message; switch (InterpreterSel) { - case RunLLI: Interpreter = LLI::create(this, Message); break; - case RunLLC: Interpreter = LLC::create(this, Message); break; - case RunJIT: Interpreter = JIT::create(this, Message); break; - case RunCBE: Interpreter = CBE::create(this, Message); break; + case RunLLI: Interpreter = createLLItool(getToolName(), Message); break; + case RunLLC: Interpreter = createLLCtool(getToolName(), Message); break; + case RunJIT: Interpreter = createJITtool(getToolName(), Message); break; + case RunCBE: Interpreter = createCBEtool(getToolName(), Message); break; default: - Message = " Sorry, this back-end is not supported by bugpoint right now!\n"; + Message = "Sorry, this back-end is not supported by bugpoint right now!\n"; break; } - - std::cout << Message; + std::cerr << Message; // Initialize auxiliary tools for debugging - cbe = CBE::create(this, Message); + cbe = createCBEtool(getToolName(), Message); if (!cbe) { std::cout << Message << "\nExiting.\n"; exit(1); } - gcc = GCC::create(this, Message); + gcc = createGCCtool(getToolName(), Message); if (!gcc) { std::cout << Message << "\nExiting.\n"; exit(1); } // If there was an error creating the selected interpreter, quit with error. @@ -517,7 +96,7 @@ std::string BytecodeFile, std::string SharedObject, AbstractInterpreter *AI) { - assert((Interpreter || AI) &&"Interpreter should have been created already!"); + assert((Interpreter||AI) && "Interpreter should have been created already!"); bool CreatedBytecode = false; if (BytecodeFile.empty()) { // Emit the program to a bytecode file... @@ -538,8 +117,10 @@ // Actually execute the program! int RetVal = (AI != 0) ? - AI->ExecuteProgram(BytecodeFile, OutputFile, SharedObject) : - Interpreter->ExecuteProgram(BytecodeFile, OutputFile, SharedObject); + AI->ExecuteProgram(BytecodeFile, InputArgv, InputFile, OutputFile, + SharedObject) : + Interpreter->ExecuteProgram(BytecodeFile, InputArgv, + InputFile, OutputFile, SharedObject); // Remove the temporary bytecode file. if (CreatedBytecode) removeFile(BytecodeFile); @@ -564,7 +145,7 @@ #if 0 /* This is an alternative, as yet unimplemented */ // Using LLC - LLC *llc = LLC::create(this, Message); + LLC *llc = createLLCtool(Message); if (llc->OutputAsm(BytecodeFile, OutputFile)) { std::cerr << "Could not generate asm code with `llc', exiting.\n"; exit(1); From lattner at cs.uiuc.edu Mon Sep 29 18:14:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Sep 29 18:14:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C++/2003-09-29-NonPODsByValue.cpp Message-ID: <200309292313.SAA30794@neo.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C++: 2003-09-29-NonPODsByValue.cpp added (r1.1) --- Log message: New testcase fixed by C++ front-end update --- Diffs of the changes: Index: llvm/test/Programs/SingleSource/Regression/C++/2003-09-29-NonPODsByValue.cpp diff -c /dev/null llvm/test/Programs/SingleSource/Regression/C++/2003-09-29-NonPODsByValue.cpp:1.1 *** /dev/null Mon Sep 29 18:13:11 2003 --- llvm/test/Programs/SingleSource/Regression/C++/2003-09-29-NonPODsByValue.cpp Mon Sep 29 18:13:01 2003 *************** *** 0 **** --- 1,18 ---- + #include + + struct C { + unsigned bv; + ~C() {} + }; + + static unsigned test(C b) { + return b.bv; + } + + + int main() { + C c; + c.bv = 1234; + printf("%d\n", test(c)); + return 0; + } From lattner at cs.uiuc.edu Mon Sep 29 22:25:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Sep 29 22:25:01 2003 Subject: [llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp Linker.cpp Message-ID: <200309300324.WAA29352@apoc.cs.uiuc.edu> Changes in directory llvm/tools/gccld: GenerateCode.cpp updated: 1.2 -> 1.3 Linker.cpp updated: 1.3 -> 1.4 --- Log message: Update file headers for renamed files. --- Diffs of the changes: Index: llvm/tools/gccld/GenerateCode.cpp diff -u llvm/tools/gccld/GenerateCode.cpp:1.2 llvm/tools/gccld/GenerateCode.cpp:1.3 --- llvm/tools/gccld/GenerateCode.cpp:1.2 Fri Sep 19 15:24:23 2003 +++ llvm/tools/gccld/GenerateCode.cpp Mon Sep 29 22:24:28 2003 @@ -1,4 +1,4 @@ -//===- gencode.cpp - Functions for generating executable files -----------===// +//===- GenerateCode.cpp - Functions for generating executable files ------===// // // This file contains functions for generating executable files once linking // has finished. This includes generating a shell script to run the JIT or Index: llvm/tools/gccld/Linker.cpp diff -u llvm/tools/gccld/Linker.cpp:1.3 llvm/tools/gccld/Linker.cpp:1.4 --- llvm/tools/gccld/Linker.cpp:1.3 Mon Sep 29 17:26:24 2003 +++ llvm/tools/gccld/Linker.cpp Mon Sep 29 22:24:28 2003 @@ -1,15 +1,7 @@ -//===- gccld.cpp - LLVM 'ld' compatible linker ----------------------------===// +//===- Linker.cpp - Link together LLVM objects and libraries --------------===// // -// This utility is intended to be compatible with GCC, and follows standard -// system 'ld' conventions. As such, the default output file is ./a.out. -// Additionally, this program outputs a shell script that is used to invoke LLI -// to execute the program. In this manner, the generated executable (a.out for -// example), is directly executable, whereas the bytecode file actually lives in -// the a.out.bc file generated by this program. Also, Force is on by default. -// -// Note that if someone (or a script) deletes the executable program generated, -// the .bc file will be left around. Considering that this is a temporary hack, -// I'm not too worried about this. +// This file contains routines to handle linking together LLVM bytecode files, +// and to handle annoying things like static libraries. // //===----------------------------------------------------------------------===// From criswell at cs.uiuc.edu Tue Sep 30 08:53:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 08:53:01 2003 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200309301352.IAA10518@choi.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.26 -> 1.27 --- Log message: Removed the utils/Makefile file from being copied to the object root tree. --- Diffs of the changes: Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.26 llvm/autoconf/configure.ac:1.27 --- llvm/autoconf/configure.ac:1.26 Mon Sep 29 16:35:32 2003 +++ llvm/autoconf/configure.ac Tue Sep 30 08:52:11 2003 @@ -193,7 +193,6 @@ AC_CONFIG_MAKEFILE(tools/llvm-dis/Makefile) AC_CONFIG_MAKEFILE(tools/llvm-link/Makefile) AC_CONFIG_MAKEFILE(tools/opt/Makefile) -AC_CONFIG_MAKEFILE(utils/Makefile) AC_CONFIG_MAKEFILE(www/docs/Makefile) AC_CONFIG_MAKEFILE(projects/Makefile) AC_CONFIG_MAKEFILE(projects/sample/Makefile) From criswell at cs.uiuc.edu Tue Sep 30 08:53:07 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 08:53:07 2003 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200309301352.IAA10511@choi.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.34 -> 1.35 --- Log message: Removed the utils/Makefile file from being copied to the object root tree. --- Diffs of the changes: Index: llvm/configure diff -u llvm/configure:1.34 llvm/configure:1.35 --- llvm/configure:1.34 Mon Sep 29 16:35:30 2003 +++ llvm/configure Tue Sep 30 08:52:09 2003 @@ -2004,9 +2004,6 @@ ac_config_commands="$ac_config_commands tools/opt/Makefile" - ac_config_commands="$ac_config_commands utils/Makefile" - - ac_config_commands="$ac_config_commands www/docs/Makefile" @@ -4414,7 +4411,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4417 "configure"' > conftest.$ac_ext + echo '#line 4414 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5255,7 +5252,7 @@ # Provide some information about the compiler. -echo "$as_me:5258:" \ +echo "$as_me:5255:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -6264,11 +6261,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6267: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6264: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6271: \$? = $ac_status" >&5 + echo "$as_me:6268: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6496,11 +6493,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6499: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6496: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6503: \$? = $ac_status" >&5 + echo "$as_me:6500: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6563,11 +6560,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6566: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6563: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6570: \$? = $ac_status" >&5 + echo "$as_me:6567: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8575,7 +8572,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:10809: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10816: \$? = $ac_status" >&5 + echo "$as_me:10813: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10876,11 +10873,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10879: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10876: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10883: \$? = $ac_status" >&5 + echo "$as_me:10880: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12119,7 +12116,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13039: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13046: \$? = $ac_status" >&5 + echo "$as_me:13043: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13106,11 +13103,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13109: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13106: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13113: \$? = $ac_status" >&5 + echo "$as_me:13110: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15050,11 +15047,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15053: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15050: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15057: \$? = $ac_status" >&5 + echo "$as_me:15054: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15282,11 +15279,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15285: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15282: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15289: \$? = $ac_status" >&5 + echo "$as_me:15286: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15349,11 +15346,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15352: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15349: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15356: \$? = $ac_status" >&5 + echo "$as_me:15353: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17361,7 +17358,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < Changes in directory llvm/tools/gccld: Linker.cpp updated: 1.4 -> 1.5 gccld.cpp updated: 1.52 -> 1.53 --- Log message: 1. Use better error messages in LinkFiles(). 2. I think the caller of LinkFiles() should not ignore a true return value. (If you have a good reason why it ought to, feel free to revert this. It's just something that's been bugging me for a while.) --- Diffs of the changes: Index: llvm/tools/gccld/Linker.cpp diff -u llvm/tools/gccld/Linker.cpp:1.4 llvm/tools/gccld/Linker.cpp:1.5 --- llvm/tools/gccld/Linker.cpp:1.4 Mon Sep 29 22:24:28 2003 +++ llvm/tools/gccld/Linker.cpp Tue Sep 30 09:03:48 2003 @@ -401,13 +401,13 @@ Pathname = Files[i]; } else { if (SearchPath == NULL) { - std::cerr << "Cannot find " << Files[i]; + std::cerr << "Cannot find linker input file '" << Files[i] << "'"; return true; } Pathname = std::string(SearchPath)+"/"+Files[i]; if (!FileExists(Pathname)) { - std::cerr << "Cannot find " << Files[i]; + std::cerr << "Cannot find linker input file '" << Files[i] << "'"; return true; } } Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.52 llvm/tools/gccld/gccld.cpp:1.53 --- llvm/tools/gccld/gccld.cpp:1.52 Mon Sep 22 15:21:34 2003 +++ llvm/tools/gccld/gccld.cpp Tue Sep 30 09:03:48 2003 @@ -256,7 +256,8 @@ Libraries.end()); // Link in all of the files - LinkFiles(argv[0], Composite.get(), InputFilenames, Verbose); + if (LinkFiles(argv[0], Composite.get(), InputFilenames, Verbose)) + return 1; // Error already printed LinkLibraries(argv[0], Composite.get(), Libraries, LibPaths, Verbose, Native); // Link in all of the libraries next... From criswell at cs.uiuc.edu Tue Sep 30 10:32:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 10:32:02 2003 Subject: [llvm-commits] CVS: reopt/autoconf/aclocal.m4 configure.ac Message-ID: <200309301531.KAA04753@choi.cs.uiuc.edu> Changes in directory reopt/autoconf: aclocal.m4 updated: 1.1.1.1 -> 1.2 configure.ac updated: 1.2 -> 1.3 --- Log message: Added the ability to configure reopt with separate source and object root directories. --- Diffs of the changes: Index: reopt/autoconf/aclocal.m4 diff -u reopt/autoconf/aclocal.m4:1.1.1.1 reopt/autoconf/aclocal.m4:1.2 --- reopt/autoconf/aclocal.m4:1.1.1.1 Mon Aug 11 16:29:15 2003 +++ reopt/autoconf/aclocal.m4 Tue Sep 30 10:31:12 2003 @@ -6156,3 +6156,13 @@ fi ]) +# +# Configure a Makefile without clobbering it if it exists and is not out of +# date. This is modified from: +# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html +# +AC_DEFUN([AC_CONFIG_MAKEFILE], +[AC_CONFIG_COMMANDS($1,${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/$1 $1,${srcdir}/autoconf/mkinstalldirs `dirname $1`) +]) + + Index: reopt/autoconf/configure.ac diff -u reopt/autoconf/configure.ac:1.2 reopt/autoconf/configure.ac:1.3 --- reopt/autoconf/configure.ac:1.2 Wed Sep 10 10:05:14 2003 +++ reopt/autoconf/configure.ac Tue Sep 30 10:31:12 2003 @@ -21,7 +21,24 @@ AC_CONFIG_AUX_DIR([autoconf]) dnl Configure a header file -dnl AC_CONFIG_HEADERS(include/Config/config.h) + +dnl Configure Makefiles +AC_CONFIG_MAKEFILE(Makefile) +AC_CONFIG_MAKEFILE(lib/Makefile) +AC_CONFIG_MAKEFILE(lib/BinInterface/Makefile) +AC_CONFIG_MAKEFILE(lib/Inst/Makefile) +AC_CONFIG_MAKEFILE(lib/Inst/lib/Makefile) +AC_CONFIG_MAKEFILE(lib/Inst/lib/Phase1/Makefile) +AC_CONFIG_MAKEFILE(lib/Inst/rtl/Makefile) +AC_CONFIG_MAKEFILE(lib/LightWtProfiling/Makefile) +AC_CONFIG_MAKEFILE(lib/Mapping/Makefile) +AC_CONFIG_MAKEFILE(lib/ScratchMemory/Makefile) +AC_CONFIG_MAKEFILE(lib/TraceCache/Makefile) +AC_CONFIG_MAKEFILE(lib/Trigger/Makefile) +AC_CONFIG_MAKEFILE(test/Makefile) +AC_CONFIG_MAKEFILE(test/TEST.reopt.Makefile) +AC_CONFIG_MAKEFILE(tools/Makefile) +AC_CONFIG_MAKEFILE(tools/mkexcl/Makefile) dnl ************************************************************************** dnl * Determine which system we are building on @@ -69,7 +86,7 @@ AC_ARG_WITH(llvmsrc,AC_HELP_STRING([--with-llvmsrc],[Location of LLVM Source Code]),AC_SUBST(LLVM_SRC,[$withval]),AC_SUBST(LLVM_SRC,[/home/vadve/${USER}/llvm])) dnl Location of LLVM object code -AC_ARG_WITH(llvmobj,AC_HELP_STRING([--with-llvmobj],[Location of LLVM Object Code]),AC_SUBST(LLVM_OBJ,[$withval]),AC_SUBST(LLVM_OBJ,[/home/vadve/${USER}/llvm])) +AC_ARG_WITH(llvmobj,AC_HELP_STRING([--with-llvmobj],[Location of LLVM Object Code]),AC_SUBST(LLVM_OBJ,[$withval]),AC_SUBST(LLVM_OBJ,[`cd ../..; pwd`])) dnl ************************************************************************** dnl * Create the output files From criswell at cs.uiuc.edu Tue Sep 30 10:32:06 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 10:32:06 2003 Subject: [llvm-commits] CVS: reopt/configure Message-ID: <200309301531.KAA04743@choi.cs.uiuc.edu> Changes in directory reopt: configure updated: 1.3 -> 1.4 --- Log message: Added the ability to configure reopt with separate source and object root directories. --- Diffs of the changes: Index: reopt/configure diff -u reopt/configure:1.3 reopt/configure:1.4 --- reopt/configure:1.3 Wed Sep 10 10:05:13 2003 +++ reopt/configure Tue Sep 30 10:31:10 2003 @@ -1231,6 +1231,55 @@ + ac_config_commands="$ac_config_commands Makefile" + + + ac_config_commands="$ac_config_commands lib/Makefile" + + + ac_config_commands="$ac_config_commands lib/BinInterface/Makefile" + + + ac_config_commands="$ac_config_commands lib/Inst/Makefile" + + + ac_config_commands="$ac_config_commands lib/Inst/lib/Makefile" + + + ac_config_commands="$ac_config_commands lib/Inst/lib/Phase1/Makefile" + + + ac_config_commands="$ac_config_commands lib/Inst/rtl/Makefile" + + + ac_config_commands="$ac_config_commands lib/LightWtProfiling/Makefile" + + + ac_config_commands="$ac_config_commands lib/Mapping/Makefile" + + + ac_config_commands="$ac_config_commands lib/ScratchMemory/Makefile" + + + ac_config_commands="$ac_config_commands lib/TraceCache/Makefile" + + + ac_config_commands="$ac_config_commands lib/Trigger/Makefile" + + + ac_config_commands="$ac_config_commands test/Makefile" + + + ac_config_commands="$ac_config_commands test/TEST.reopt.Makefile" + + + ac_config_commands="$ac_config_commands tools/Makefile" + + + ac_config_commands="$ac_config_commands tools/mkexcl/Makefile" + + + @@ -1259,7 +1308,7 @@ LLVM_OBJ=$withval else - LLVM_OBJ=/home/vadve/${USER}/llvm + LLVM_OBJ=`cd ../..; pwd` fi; @@ -1705,6 +1754,9 @@ Configuration files: $config_files +Configuration commands: +$config_commands + Report bugs to ." _ACEOF @@ -1804,7 +1856,29 @@ _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +${srcdir}/autoconf/mkinstalldirs `dirname Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/BinInterface/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/Inst/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/Inst/lib/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/Inst/lib/Phase1/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/Inst/rtl/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/LightWtProfiling/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/Mapping/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/ScratchMemory/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/TraceCache/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/Trigger/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname test/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname test/TEST.reopt.Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname tools/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname tools/mkexcl/Makefile` +_ACEOF @@ -1814,6 +1888,22 @@ case "$ac_config_target" in # Handling of arguments. "Makefile.common" ) CONFIG_FILES="$CONFIG_FILES Makefile.common" ;; + "Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; + "lib/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;; + "lib/BinInterface/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/BinInterface/Makefile" ;; + "lib/Inst/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Inst/Makefile" ;; + "lib/Inst/lib/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Inst/lib/Makefile" ;; + "lib/Inst/lib/Phase1/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Inst/lib/Phase1/Makefile" ;; + "lib/Inst/rtl/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Inst/rtl/Makefile" ;; + "lib/LightWtProfiling/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/LightWtProfiling/Makefile" ;; + "lib/Mapping/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Mapping/Makefile" ;; + "lib/ScratchMemory/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/ScratchMemory/Makefile" ;; + "lib/TraceCache/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/TraceCache/Makefile" ;; + "lib/Trigger/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Trigger/Makefile" ;; + "test/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS test/Makefile" ;; + "test/TEST.reopt.Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS test/TEST.reopt.Makefile" ;; + "tools/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS tools/Makefile" ;; + "tools/mkexcl/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS tools/mkexcl/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; @@ -1826,6 +1916,7 @@ # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -2099,6 +2190,81 @@ rm -f $tmp/out fi +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/Makefile Makefile ;; + lib/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Makefile lib/Makefile ;; + lib/BinInterface/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/BinInterface/Makefile lib/BinInterface/Makefile ;; + lib/Inst/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Inst/Makefile lib/Inst/Makefile ;; + lib/Inst/lib/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Inst/lib/Makefile lib/Inst/lib/Makefile ;; + lib/Inst/lib/Phase1/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Inst/lib/Phase1/Makefile lib/Inst/lib/Phase1/Makefile ;; + lib/Inst/rtl/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Inst/rtl/Makefile lib/Inst/rtl/Makefile ;; + lib/LightWtProfiling/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/LightWtProfiling/Makefile lib/LightWtProfiling/Makefile ;; + lib/Mapping/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Mapping/Makefile lib/Mapping/Makefile ;; + lib/ScratchMemory/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/ScratchMemory/Makefile lib/ScratchMemory/Makefile ;; + lib/TraceCache/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/TraceCache/Makefile lib/TraceCache/Makefile ;; + lib/Trigger/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Trigger/Makefile lib/Trigger/Makefile ;; + test/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/test/Makefile test/Makefile ;; + test/TEST.reopt.Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/test/TEST.reopt.Makefile test/TEST.reopt.Makefile ;; + tools/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/tools/Makefile tools/Makefile ;; + tools/mkexcl/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/tools/mkexcl/Makefile tools/mkexcl/Makefile ;; + esac done _ACEOF From lattner at cs.uiuc.edu Tue Sep 30 10:41:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 10:41:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-30-NestedFunctionDecl.cpp Message-ID: <200309301540.KAA00566@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C++/CompileFail: 2003-09-30-NestedFunctionDecl.cpp added (r1.1) --- Log message: New fixed bug, distilled from 252.eon --- Diffs of the changes: Index: llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-30-NestedFunctionDecl.cpp diff -c /dev/null llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-30-NestedFunctionDecl.cpp:1.1 *** /dev/null Tue Sep 30 10:40:35 2003 --- llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-09-30-NestedFunctionDecl.cpp Tue Sep 30 10:40:25 2003 *************** *** 0 **** --- 1,10 ---- + // The C++ front-end thinks the two foo's are different, the LLVM emitter + // thinks they are the same. The disconnect causes problems. + + void foo() { } + + void bar() { + void foo(); + + foo(); + } From criswell at cs.uiuc.edu Tue Sep 30 10:56:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 10:56:01 2003 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200309301555.KAA03103@choi.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.27 -> 1.28 --- Log message: Added the ability to conditionally configure the reopt project if it is checked out under projects/reopt. --- Diffs of the changes: Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.27 llvm/autoconf/configure.ac:1.28 --- llvm/autoconf/configure.ac:1.27 Tue Sep 30 08:52:11 2003 +++ llvm/autoconf/configure.ac Tue Sep 30 10:55:44 2003 @@ -30,6 +30,11 @@ fi fi +if test -d ${srcdir}/projects/reopt +then + AC_CONFIG_SUBDIRS(projects/reopt) +fi + dnl Configure a header file AC_CONFIG_HEADERS(include/Config/config.h) AC_CONFIG_MAKEFILE(Makefile) From criswell at cs.uiuc.edu Tue Sep 30 10:56:05 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 10:56:05 2003 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200309301555.KAA03096@choi.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.35 -> 1.36 --- Log message: Added the ability to conditionally configure the reopt project if it is checked out under projects/reopt. --- Diffs of the changes: Index: llvm/configure diff -u llvm/configure:1.35 llvm/configure:1.36 --- llvm/configure:1.35 Tue Sep 30 08:52:09 2003 +++ llvm/configure Tue Sep 30 10:55:42 2003 @@ -426,6 +426,7 @@ PACKAGE_STRING='[LLVM] [1.0]' PACKAGE_BUGREPORT='llvmbugs at cs.uiuc.edu' +ac_subdirs_all="$ac_subdirs_all projects/reopt" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -464,7 +465,7 @@ #endif" ac_unique_file=""Makefile.config.in"" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVMGCCDIR ARCH CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT YACC EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL RPWD SED RM MKDIR DATE MV DOT ETAGS PURIFY PYTHON QMTEST ALLOCA LIBOBJS MMAP_FILE ENABLE_PURIFY ENABLE_OPTIMIZED USE_SPEC UPB DISABLE_LLC_DIFFS JIT SPEC_ROOT BCR PAPIDIR LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS subdirs INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVMGCCDIR ARCH CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT YACC EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL RPWD SED RM MKDIR DATE MV DOT ETAGS PURIFY PYTHON QMTEST ALLOCA LIBOBJS MMAP_FILE ENABLE_PURIFY ENABLE_OPTIMIZED USE_SPEC UPB DISABLE_LLC_DIFFS JIT SPEC_ROOT BCR PAPIDIR LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1519,6 +1520,14 @@ fi fi +if test -d ${srcdir}/projects/reopt +then + + +subdirs="$subdirs projects/reopt" + +fi + ac_config_headers="$ac_config_headers include/Config/config.h" ac_config_commands="$ac_config_commands Makefile" @@ -4411,7 +4420,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4414 "configure"' > conftest.$ac_ext + echo '#line 4423 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5252,7 +5261,7 @@ # Provide some information about the compiler. -echo "$as_me:5255:" \ +echo "$as_me:5264:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -6261,11 +6270,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6264: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6273: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6268: \$? = $ac_status" >&5 + echo "$as_me:6277: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6493,11 +6502,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6496: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6505: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6500: \$? = $ac_status" >&5 + echo "$as_me:6509: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6560,11 +6569,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6563: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6572: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6567: \$? = $ac_status" >&5 + echo "$as_me:6576: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8572,7 +8581,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:10818: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10813: \$? = $ac_status" >&5 + echo "$as_me:10822: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10873,11 +10882,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10876: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10885: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10880: \$? = $ac_status" >&5 + echo "$as_me:10889: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12116,7 +12125,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13048: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13043: \$? = $ac_status" >&5 + echo "$as_me:13052: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13103,11 +13112,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13106: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13115: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13110: \$? = $ac_status" >&5 + echo "$as_me:13119: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15047,11 +15056,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15050: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15059: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15054: \$? = $ac_status" >&5 + echo "$as_me:15063: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15279,11 +15288,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15282: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15291: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15286: \$? = $ac_status" >&5 + echo "$as_me:15295: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15346,11 +15355,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15349: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15358: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15353: \$? = $ac_status" >&5 + echo "$as_me:15362: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17358,7 +17367,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5 +echo "$as_me: configuring in $ac_dir" >&6;} + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + cd $ac_dir + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'" + elif test -f $ac_srcdir/configure; then + ac_sub_configure="$SHELL '$ac_srcdir/configure'" + elif test -f $ac_srcdir/configure.in; then + ac_sub_configure=$ac_configure + else + { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5 +echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + # Make the cache file name correct relative to the subdirectory. + case $cache_file in + [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file=$ac_top_builddir$cache_file ;; + esac + + { echo "$as_me:$LINENO: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +echo "$as_me: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} + # The eval makes quoting arguments work. + eval $ac_sub_configure $ac_sub_configure_args \ + --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir || + { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 +echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} + { (exit 1); exit 1; }; } + fi + + cd $ac_popdir + done fi From lattner at cs.uiuc.edu Tue Sep 30 11:08:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 11:08:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CFP2000/177.mesa/ Message-ID: <200309301607.LAA02502@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CFP2000/177.mesa: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/Programs/External/SPEC/CFP2000/177.mesa added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Tue Sep 30 11:09:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 11:09:04 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CFP2000/177.mesa/Makefile Message-ID: <200309301608.LAA02548@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CFP2000/177.mesa: Makefile added (r1.1) --- Log message: initial checkin of mesa makefile --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/CFP2000/177.mesa/Makefile diff -c /dev/null llvm/test/Programs/External/SPEC/CFP2000/177.mesa/Makefile:1.1 *** /dev/null Tue Sep 30 11:08:21 2003 --- llvm/test/Programs/External/SPEC/CFP2000/177.mesa/Makefile Tue Sep 30 11:08:11 2003 *************** *** 0 **** --- 1,12 ---- + LEVEL = ../../../../../.. + ifdef LARGE_PROBLEM_SIZE + RUN_OPTIONS := -frames 500 + else + RUN_OPTIONS := -frames 10 + endif + + RUN_OPTIONS += -meshfile mesa.in -ppmfile mesa.ppm + #STDIN_FILENAME = ammp.in + #STDOUT_FILENAME = ammp.out + CPPFLAGS = + include ../../Makefile.spec From criswell at cs.uiuc.edu Tue Sep 30 11:18:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 11:18:01 2003 Subject: [llvm-commits] CVS: reopt/autoconf/configure.ac Message-ID: <200309301617.LAA14492@choi.cs.uiuc.edu> Changes in directory reopt/autoconf: configure.ac updated: 1.3 -> 1.4 --- Log message: Added dynamic configuration of default LLVM source root directory. --- Diffs of the changes: Index: reopt/autoconf/configure.ac diff -u reopt/autoconf/configure.ac:1.3 reopt/autoconf/configure.ac:1.4 --- reopt/autoconf/configure.ac:1.3 Tue Sep 30 10:31:12 2003 +++ reopt/autoconf/configure.ac Tue Sep 30 11:17:48 2003 @@ -83,7 +83,7 @@ dnl ************************************************************************** dnl Location of LLVM source code -AC_ARG_WITH(llvmsrc,AC_HELP_STRING([--with-llvmsrc],[Location of LLVM Source Code]),AC_SUBST(LLVM_SRC,[$withval]),AC_SUBST(LLVM_SRC,[/home/vadve/${USER}/llvm])) +AC_ARG_WITH(llvmsrc,AC_HELP_STRING([--with-llvmsrc],[Location of LLVM Source Code]),AC_SUBST(LLVM_SRC,[$withval]),AC_SUBST(LLVM_SRC,[`cd ${srcdir}/../..; pwd`])) dnl Location of LLVM object code AC_ARG_WITH(llvmobj,AC_HELP_STRING([--with-llvmobj],[Location of LLVM Object Code]),AC_SUBST(LLVM_OBJ,[$withval]),AC_SUBST(LLVM_OBJ,[`cd ../..; pwd`])) From criswell at cs.uiuc.edu Tue Sep 30 11:18:05 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 11:18:05 2003 Subject: [llvm-commits] CVS: reopt/configure Message-ID: <200309301617.LAA14485@choi.cs.uiuc.edu> Changes in directory reopt: configure updated: 1.4 -> 1.5 --- Log message: Added dynamic configuration of default LLVM source root directory. --- Diffs of the changes: Index: reopt/configure diff -u reopt/configure:1.4 reopt/configure:1.5 --- reopt/configure:1.4 Tue Sep 30 10:31:10 2003 +++ reopt/configure Tue Sep 30 11:17:47 2003 @@ -1297,7 +1297,7 @@ LLVM_SRC=$withval else - LLVM_SRC=/home/vadve/${USER}/llvm + LLVM_SRC=`cd ${srcdir}/../..; pwd` fi; From criswell at cs.uiuc.edu Tue Sep 30 11:32:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 11:32:01 2003 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200309301631.LAA28267@choi.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.28 -> 1.29 --- Log message: Added conditional configuration of poolalloc. --- Diffs of the changes: Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.28 llvm/autoconf/configure.ac:1.29 --- llvm/autoconf/configure.ac:1.28 Tue Sep 30 10:55:44 2003 +++ llvm/autoconf/configure.ac Tue Sep 30 11:31:48 2003 @@ -35,6 +35,11 @@ AC_CONFIG_SUBDIRS(projects/reopt) fi +if test -d ${srcdir}/projects/poolalloc +then + AC_CONFIG_SUBDIRS(projects/poolalloc) +fi + dnl Configure a header file AC_CONFIG_HEADERS(include/Config/config.h) AC_CONFIG_MAKEFILE(Makefile) From criswell at cs.uiuc.edu Tue Sep 30 11:32:04 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 11:32:04 2003 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200309301631.LAA28260@choi.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.36 -> 1.37 --- Log message: Added conditional configuration of poolalloc. --- Diffs of the changes: Index: llvm/configure diff -u llvm/configure:1.36 llvm/configure:1.37 --- llvm/configure:1.36 Tue Sep 30 10:55:42 2003 +++ llvm/configure Tue Sep 30 11:31:47 2003 @@ -427,6 +427,7 @@ PACKAGE_BUGREPORT='llvmbugs at cs.uiuc.edu' ac_subdirs_all="$ac_subdirs_all projects/reopt" +ac_subdirs_all="$ac_subdirs_all projects/poolalloc" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -1528,6 +1529,14 @@ fi +if test -d ${srcdir}/projects/poolalloc +then + + +subdirs="$subdirs projects/poolalloc" + +fi + ac_config_headers="$ac_config_headers include/Config/config.h" ac_config_commands="$ac_config_commands Makefile" @@ -4420,7 +4429,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4423 "configure"' > conftest.$ac_ext + echo '#line 4432 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5261,7 +5270,7 @@ # Provide some information about the compiler. -echo "$as_me:5264:" \ +echo "$as_me:5273:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -6270,11 +6279,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6273: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6282: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6277: \$? = $ac_status" >&5 + echo "$as_me:6286: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6502,11 +6511,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6505: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6514: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6509: \$? = $ac_status" >&5 + echo "$as_me:6518: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6569,11 +6578,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6572: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6581: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6576: \$? = $ac_status" >&5 + echo "$as_me:6585: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8581,7 +8590,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:10827: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10822: \$? = $ac_status" >&5 + echo "$as_me:10831: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10882,11 +10891,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10885: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10894: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10889: \$? = $ac_status" >&5 + echo "$as_me:10898: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12125,7 +12134,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13057: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13052: \$? = $ac_status" >&5 + echo "$as_me:13061: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13112,11 +13121,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13115: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13124: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13119: \$? = $ac_status" >&5 + echo "$as_me:13128: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15056,11 +15065,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15059: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15068: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15063: \$? = $ac_status" >&5 + echo "$as_me:15072: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15288,11 +15297,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15291: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15300: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15295: \$? = $ac_status" >&5 + echo "$as_me:15304: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15355,11 +15364,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15358: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15367: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15362: \$? = $ac_status" >&5 + echo "$as_me:15371: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17367,7 +17376,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < Changes in directory poolalloc/autoconf: aclocal.m4 updated: 1.1.1.1 -> 1.2 configure.ac updated: 1.2 -> 1.3 --- Log message: Updated poolalloc so that it can configure for multiple object roots and can be configured by the LLVM tree configure script. --- Diffs of the changes: Index: poolalloc/autoconf/aclocal.m4 diff -u poolalloc/autoconf/aclocal.m4:1.1.1.1 poolalloc/autoconf/aclocal.m4:1.2 --- poolalloc/autoconf/aclocal.m4:1.1.1.1 Mon Aug 11 16:29:15 2003 +++ poolalloc/autoconf/aclocal.m4 Tue Sep 30 11:31:25 2003 @@ -6156,3 +6156,13 @@ fi ]) +# +# Configure a Makefile without clobbering it if it exists and is not out of +# date. This is modified from: +# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html +# +AC_DEFUN([AC_CONFIG_MAKEFILE], +[AC_CONFIG_COMMANDS($1,${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/$1 $1,${srcdir}/autoconf/mkinstalldirs `dirname $1`) +]) + + Index: poolalloc/autoconf/configure.ac diff -u poolalloc/autoconf/configure.ac:1.2 poolalloc/autoconf/configure.ac:1.3 --- poolalloc/autoconf/configure.ac:1.2 Wed Sep 10 10:13:02 2003 +++ poolalloc/autoconf/configure.ac Tue Sep 30 11:31:25 2003 @@ -15,13 +15,19 @@ dnl ************************************************************************** dnl * Initialize dnl ************************************************************************** -AC_INIT([[[LLVM]]],[[[1.0]]],[llvmbugs at cs.uiuc.edu]) +AC_INIT([[[Pool Allocation]]],[[[1.0]]],[llvmbugs at cs.uiuc.edu]) dnl Place all of the extra autoconf files into the config subdirectory AC_CONFIG_AUX_DIR([autoconf]) -dnl Configure a header file -dnl AC_CONFIG_HEADERS(include/Config/config.h) +dnl Configure Makefiles +AC_CONFIG_MAKEFILE(Makefile) +AC_CONFIG_MAKEFILE(lib/Makefile) +AC_CONFIG_MAKEFILE(lib/PoolAllocate/Makefile) +AC_CONFIG_MAKEFILE(runtime/Makefile) +AC_CONFIG_MAKEFILE(runtime/PoolAllocator/Makefile) +AC_CONFIG_MAKEFILE(test/Makefile) +AC_CONFIG_MAKEFILE(test/TEST.poolalloc.Makefile) dnl ************************************************************************** dnl * Determine which system we are building on @@ -66,10 +72,10 @@ dnl ************************************************************************** dnl Location of LLVM source code -AC_ARG_WITH(llvmsrc,AC_HELP_STRING([--with-llvmsrc],[Location of LLVM Source Code]),AC_SUBST(LLVM_SRC,[$withval]),AC_SUBST(LLVM_SRC,[/home/vadve/${USER}/llvm])) +AC_ARG_WITH(llvmsrc,AC_HELP_STRING([--with-llvmsrc],[Location of LLVM Source Code]),AC_SUBST(LLVM_SRC,[$withval]),AC_SUBST(LLVM_SRC,[`cd ${srcdir}/../..; pwd`])) dnl Location of LLVM object code -AC_ARG_WITH(llvmobj,AC_HELP_STRING([--with-llvmobj],[Location of LLVM Object Code]),AC_SUBST(LLVM_OBJ,[$withval]),AC_SUBST(LLVM_OBJ,[/home/vadve/${USER}/llvm])) +AC_ARG_WITH(llvmobj,AC_HELP_STRING([--with-llvmobj],[Location of LLVM Object Code]),AC_SUBST(LLVM_OBJ,[$withval]),AC_SUBST(LLVM_OBJ,[`cd ../..; pwd`])) dnl ************************************************************************** dnl * Create the output files From criswell at cs.uiuc.edu Tue Sep 30 11:32:11 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 11:32:11 2003 Subject: [llvm-commits] CVS: poolalloc/Makefile.common.in configure Message-ID: <200309301631.LAA28234@choi.cs.uiuc.edu> Changes in directory poolalloc: Makefile.common.in updated: 1.4 -> 1.5 configure updated: 1.3 -> 1.4 --- Log message: Updated poolalloc so that it can configure for multiple object roots and can be configured by the LLVM tree configure script. --- Diffs of the changes: Index: poolalloc/Makefile.common.in diff -u poolalloc/Makefile.common.in:1.4 poolalloc/Makefile.common.in:1.5 --- poolalloc/Makefile.common.in:1.4 Wed Sep 10 10:13:01 2003 +++ poolalloc/Makefile.common.in Tue Sep 30 11:31:24 2003 @@ -12,7 +12,7 @@ # # Include LLVM's Master Makefile. # -include $(LLVM_SRC_ROOT)/Makefile.config +include $(LLVM_OBJ_ROOT)/Makefile.config # # Set the source root and source directory pathnames Index: poolalloc/configure diff -u poolalloc/configure:1.3 poolalloc/configure:1.4 --- poolalloc/configure:1.3 Wed Sep 10 10:13:01 2003 +++ poolalloc/configure Tue Sep 30 11:31:24 2003 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57 for [LLVM] [1.0]. +# Generated by GNU Autoconf 2.57 for [Pool Allocation] [1.0]. # # Report bugs to . # @@ -266,10 +266,10 @@ : ${ac_max_here_lines=38} # Identity of this package. -PACKAGE_NAME='[LLVM]' -PACKAGE_TARNAME='--llvm--' +PACKAGE_NAME='[Pool Allocation]' +PACKAGE_TARNAME='--pool-allocation--' PACKAGE_VERSION='[1.0]' -PACKAGE_STRING='[LLVM] [1.0]' +PACKAGE_STRING='[Pool Allocation] [1.0]' PACKAGE_BUGREPORT='llvmbugs at cs.uiuc.edu' ac_unique_file=""Makefile.common.in"" @@ -722,7 +722,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures [LLVM] [1.0] to adapt to many kinds of systems. +\`configure' configures [Pool Allocation] [1.0] to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -779,7 +779,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of [LLVM] [1.0]:";; + short | recursive ) echo "Configuration of [Pool Allocation] [1.0]:";; esac cat <<\_ACEOF @@ -852,7 +852,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -[LLVM] configure [1.0] +[Pool Allocation] configure [1.0] generated by GNU Autoconf 2.57 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 @@ -867,7 +867,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by [LLVM] $as_me [1.0], which was +It was created by [Pool Allocation] $as_me [1.0], which was generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ @@ -1230,6 +1230,27 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + ac_config_commands="$ac_config_commands Makefile" + + + ac_config_commands="$ac_config_commands lib/Makefile" + + + ac_config_commands="$ac_config_commands lib/PoolAllocate/Makefile" + + + ac_config_commands="$ac_config_commands runtime/Makefile" + + + ac_config_commands="$ac_config_commands runtime/PoolAllocator/Makefile" + + + ac_config_commands="$ac_config_commands test/Makefile" + + + ac_config_commands="$ac_config_commands test/TEST.poolalloc.Makefile" + + @@ -1248,7 +1269,7 @@ LLVM_SRC=$withval else - LLVM_SRC=/home/vadve/${USER}/llvm + LLVM_SRC=`cd ${srcdir}/../..; pwd` fi; @@ -1259,7 +1280,7 @@ LLVM_OBJ=$withval else - LLVM_OBJ=/home/vadve/${USER}/llvm + LLVM_OBJ=`cd ../..; pwd` fi; @@ -1655,7 +1676,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by [LLVM] $as_me [1.0], which was +This file was extended by [Pool Allocation] $as_me [1.0], which was generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -1705,12 +1726,15 @@ Configuration files: $config_files +Configuration commands: +$config_commands + Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -[LLVM] config.status [1.0] +[Pool Allocation] config.status [1.0] configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -1804,7 +1828,20 @@ _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +${srcdir}/autoconf/mkinstalldirs `dirname Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/PoolAllocate/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname runtime/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname runtime/PoolAllocator/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname test/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname test/TEST.poolalloc.Makefile` +_ACEOF @@ -1814,6 +1851,13 @@ case "$ac_config_target" in # Handling of arguments. "Makefile.common" ) CONFIG_FILES="$CONFIG_FILES Makefile.common" ;; + "Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; + "lib/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;; + "lib/PoolAllocate/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/PoolAllocate/Makefile" ;; + "runtime/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS runtime/Makefile" ;; + "runtime/PoolAllocator/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS runtime/PoolAllocator/Makefile" ;; + "test/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS test/Makefile" ;; + "test/TEST.poolalloc.Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS test/TEST.poolalloc.Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; @@ -1826,6 +1870,7 @@ # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -2099,6 +2144,72 @@ rm -f $tmp/out fi +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/Makefile Makefile ;; + lib/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Makefile lib/Makefile ;; + lib/PoolAllocate/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/PoolAllocate/Makefile lib/PoolAllocate/Makefile ;; + runtime/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/runtime/Makefile runtime/Makefile ;; + runtime/PoolAllocator/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/runtime/PoolAllocator/Makefile runtime/PoolAllocator/Makefile ;; + test/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/test/Makefile test/Makefile ;; + test/TEST.poolalloc.Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/test/TEST.poolalloc.Makefile test/TEST.poolalloc.Makefile ;; + esac done _ACEOF From lattner at cs.uiuc.edu Tue Sep 30 12:14:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 12:14:03 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2003-09-30-StructLayout.c Message-ID: <200309301713.MAA04350@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2003-09-30-StructLayout.c added (r1.1) --- Log message: new testcase distilled from 177.mesa --- Diffs of the changes: Index: llvm/test/Regression/CFrontend/2003-09-30-StructLayout.c diff -c /dev/null llvm/test/Regression/CFrontend/2003-09-30-StructLayout.c:1.1 *** /dev/null Tue Sep 30 12:13:44 2003 --- llvm/test/Regression/CFrontend/2003-09-30-StructLayout.c Tue Sep 30 12:13:34 2003 *************** *** 0 **** --- 1,16 ---- + enum En { + ENUM_VAL + }; + + struct St { + unsigned char A; + enum En B; + unsigned char C; + enum En D; + float E; + }; + + + void func(struct St* A) { + A->D = ENUM_VAL; + } From lattner at cs.uiuc.edu Tue Sep 30 12:30:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 12:30:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CFP2000/177.mesa/Makefile Message-ID: <200309301729.MAA04733@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CFP2000/177.mesa: Makefile updated: 1.1 -> 1.2 --- Log message: As if spec weren't irritating enough, this benchmark also has extra cruft laying around in it's source directory. --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/CFP2000/177.mesa/Makefile diff -u llvm/test/Programs/External/SPEC/CFP2000/177.mesa/Makefile:1.1 llvm/test/Programs/External/SPEC/CFP2000/177.mesa/Makefile:1.2 --- llvm/test/Programs/External/SPEC/CFP2000/177.mesa/Makefile:1.1 Tue Sep 30 11:08:11 2003 +++ llvm/test/Programs/External/SPEC/CFP2000/177.mesa/Makefile Tue Sep 30 12:29:18 2003 @@ -9,4 +9,15 @@ #STDIN_FILENAME = ammp.in #STDOUT_FILENAME = ammp.out CPPFLAGS = + +Source = $(addprefix $(SPEC_BENCH_DIR)/src/, \ + accum.c alpha.c alphabuf.c api1.c api2.c attrib.c bitmap.c blend.c \ + clip.c colortab.c context.c copypix.c depth.c dlist.c drawpix.c \ + enable.c eval.c feedback.c fog.c get.c hash.c image.c light.c \ + lines.c logic.c masking.c matrix.c misc.c mmath.c osmesa.c pb.c \ + pixel.c pointers.c points.c polygon.c quads.c rastpos.c readpix.c \ + rect.c scissor.c shade.c span.c stencil.c teximage.c texobj.c \ + texstate.c texture.c triangle.c varray.c vb.c vbfill.c vbrender.c \ + vbxform.c winpos.c xform.c mesa4.c) + include ../../Makefile.spec From brukman at cs.uiuc.edu Tue Sep 30 12:34:02 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue Sep 30 12:34:02 2003 Subject: [llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp Message-ID: <200309301733.MAA22578@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: GenerateCode.cpp updated: 1.3 -> 1.4 --- Log message: Make code more terse: * Remove extra blank lines * Delete space between function call and arg list * Delete non-content comment lines ("//") --- Diffs of the changes: Index: llvm/tools/gccld/GenerateCode.cpp diff -u llvm/tools/gccld/GenerateCode.cpp:1.3 llvm/tools/gccld/GenerateCode.cpp:1.4 --- llvm/tools/gccld/GenerateCode.cpp:1.3 Mon Sep 29 22:24:28 2003 +++ llvm/tools/gccld/GenerateCode.cpp Tue Sep 30 12:33:12 2003 @@ -6,15 +6,15 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Transforms/Utils/Linker.h" -#include "llvm/Transforms/IPO.h" -#include "llvm/Transforms/Scalar.h" -#include "llvm/Target/TargetData.h" +#include "gccld.h" #include "llvm/Module.h" #include "llvm/PassManager.h" #include "llvm/Bytecode/WriteBytecodePass.h" +#include "llvm/Target/TargetData.h" +#include "llvm/Transforms/IPO.h" +#include "llvm/Transforms/Scalar.h" +#include "llvm/Transforms/Utils/Linker.h" #include "Support/SystemUtils.h" -#include "gccld.h" // // Function: GenerateBytecode () @@ -36,11 +36,7 @@ // 1 - Error. // int -GenerateBytecode (Module * M, - bool Strip, - bool Internalize, - std::ostream * Out) -{ +GenerateBytecode (Module *M, bool Strip, bool Internalize, std::ostream *Out) { // In addition to just linking the input from GCC, we also want to spiff it up // a little bit. Do this now. PassManager Passes; @@ -50,13 +46,11 @@ // Linking modules together can lead to duplicated global constants, only keep // one copy of each constant... - // Passes.add(createConstantMergePass()); // If the -s command line option was specified, strip the symbols out of the // resulting program to make it smaller. -s is a GCC option that we are // supporting. - // if (Strip) Passes.add(createSymbolStrippingPass()); @@ -64,32 +58,26 @@ // functions they are calling, they end up calling a vararg version of the // function that does not get a body filled in (the real function has typed // arguments). This pass merges the two functions. - // Passes.add(createFunctionResolvingPass()); if (Internalize) { // Now that composite has been compiled, scan through the module, looking // for a main function. If main is defined, mark all other functions // internal. - // Passes.add(createInternalizePass()); } // Remove unused arguments from functions... - // Passes.add(createDeadArgEliminationPass()); // The FuncResolve pass may leave cruft around if functions were prototyped // differently than they were defined. Remove this cruft. - // Passes.add(createInstructionCombiningPass()); // Delete basic blocks, which optimization passes may have killed... - // Passes.add(createCFGSimplificationPass()); // Now that we have optimized the program, discard unreachable functions... - // Passes.add(createGlobalDCEPass()); // Add the pass that writes bytecode to the output file... @@ -122,15 +110,13 @@ // 1 - Failure // int -GenerateAssembly (const std::string & OutputFilename, - const std::string & InputFilename, - const std::string & llc, - char ** const envp) +GenerateAssembly(const std::string &OutputFilename, + const std::string &InputFilename, + const std::string &llc, + char ** const envp) { - // // Run LLC to convert the bytecode file into assembly code. - // - const char * cmd[8]; + const char *cmd[8]; cmd[0] = llc.c_str(); cmd[1] = "-f"; @@ -139,7 +125,7 @@ cmd[4] = InputFilename.c_str(); cmd[5] = NULL; - return (ExecWait (cmd, envp)); + return ExecWait(cmd, envp); } // @@ -165,49 +151,41 @@ // 1 - Failure // int -GenerateNative (const std::string & OutputFilename, - const std::string & InputFilename, - const std::vector & Libraries, - const std::vector & LibPaths, - const std::string & gcc, - char ** const envp) -{ - // +GenerateNative(const std::string &OutputFilename, + const std::string &InputFilename, + const std::vector &Libraries, + const std::vector &LibPaths, + const std::string &gcc, + char ** const envp) { // Remove these environment variables from the environment of the // programs that we will execute. It appears that GCC sets these // environment variables so that the programs it uses can configure // themselves identically. // - // However, when we invoke GCC below, we want it to use its normal - // configuration. Hence, we must sanitize it's environment. - // - char ** clean_env = CopyEnv (envp); + // However, when we invoke GCC below, we want it to use its normal + // configuration. Hence, we must sanitize its environment. + char ** clean_env = CopyEnv(envp); if (clean_env == NULL) - { return 1; - } - RemoveEnv ("LIBRARY_PATH", clean_env); - RemoveEnv ("COLLECT_GCC_OPTIONS", clean_env); - RemoveEnv ("GCC_EXEC_PREFIX", clean_env); - RemoveEnv ("COMPILER_PATH", clean_env); - RemoveEnv ("COLLECT_GCC", clean_env); + RemoveEnv("LIBRARY_PATH", clean_env); + RemoveEnv("COLLECT_GCC_OPTIONS", clean_env); + RemoveEnv("GCC_EXEC_PREFIX", clean_env); + RemoveEnv("COMPILER_PATH", clean_env); + RemoveEnv("COLLECT_GCC", clean_env); std::vector cmd; - // // Run GCC to assemble and link the program into native code. // // Note: // We can't just assemble and link the file with the system assembler // and linker because we don't know where to put the _start symbol. // GCC mysteriously knows how to do it. - // - cmd.push_back (gcc.c_str()); - cmd.push_back ("-o"); - cmd.push_back (OutputFilename.c_str()); - cmd.push_back (InputFilename.c_str()); + cmd.push_back(gcc.c_str()); + cmd.push_back("-o"); + cmd.push_back(OutputFilename.c_str()); + cmd.push_back(InputFilename.c_str()); - // // JTC: // Adding the library paths creates a problem for native generation. If we // include the search paths from llvmgcc, then we'll be telling normal gcc @@ -215,31 +193,22 @@ // bad because those libraries hold only bytecode files (not native object // files). In the end, we attempt to link the bytecode libgcc into a native // program. - // #ifdef ndef - // // Add in the library path options. - // - for (unsigned index=0; index < LibPaths.size(); index++) - { - cmd.push_back ("-L"); - cmd.push_back (LibPaths[index].c_str()); + for (unsigned index=0; index < LibPaths.size(); index++) { + cmd.push_back("-L"); + cmd.push_back(LibPaths[index].c_str()); } #endif - // // Add in the libraries to link. - // - std::vector Libs (Libraries); - for (unsigned index = 0; index < Libs.size(); index++) - { + std::vector Libs(Libraries); + for (unsigned index = 0; index < Libs.size(); index++) { Libs[index] = "-l" + Libs[index]; - cmd.push_back (Libs[index].c_str()); + cmd.push_back(Libs[index].c_str()); } - cmd.push_back (NULL); + cmd.push_back(NULL); - // // Run the compiler to assembly and link together the program. - // - return (ExecWait (&(cmd[0]), clean_env)); + return ExecWait(&(cmd[0]), clean_env); } From lattner at cs.uiuc.edu Tue Sep 30 12:38:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 12:38:02 2003 Subject: [llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp Message-ID: <200309301737.MAA04817@apoc.cs.uiuc.edu> Changes in directory llvm/tools/gccld: GenerateCode.cpp updated: 1.4 -> 1.5 --- Log message: Remove initials from source file --- Diffs of the changes: Index: llvm/tools/gccld/GenerateCode.cpp diff -u llvm/tools/gccld/GenerateCode.cpp:1.4 llvm/tools/gccld/GenerateCode.cpp:1.5 --- llvm/tools/gccld/GenerateCode.cpp:1.4 Tue Sep 30 12:33:12 2003 +++ llvm/tools/gccld/GenerateCode.cpp Tue Sep 30 12:36:51 2003 @@ -186,14 +186,13 @@ cmd.push_back(OutputFilename.c_str()); cmd.push_back(InputFilename.c_str()); - // JTC: // Adding the library paths creates a problem for native generation. If we // include the search paths from llvmgcc, then we'll be telling normal gcc // to look inside of llvmgcc's library directories for libraries. This is // bad because those libraries hold only bytecode files (not native object // files). In the end, we attempt to link the bytecode libgcc into a native // program. -#ifdef ndef +#if 0 // Add in the library path options. for (unsigned index=0; index < LibPaths.size(); index++) { cmd.push_back("-L"); From brukman at cs.uiuc.edu Tue Sep 30 12:41:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue Sep 30 12:41:01 2003 Subject: [llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp Message-ID: <200309301740.MAA22690@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: GenerateCode.cpp updated: 1.5 -> 1.6 --- Log message: Removed extra space in comments. --- Diffs of the changes: Index: llvm/tools/gccld/GenerateCode.cpp diff -u llvm/tools/gccld/GenerateCode.cpp:1.5 llvm/tools/gccld/GenerateCode.cpp:1.6 --- llvm/tools/gccld/GenerateCode.cpp:1.5 Tue Sep 30 12:36:51 2003 +++ llvm/tools/gccld/GenerateCode.cpp Tue Sep 30 12:40:12 2003 @@ -118,12 +118,12 @@ // Run LLC to convert the bytecode file into assembly code. const char *cmd[8]; - cmd[0] = llc.c_str(); - cmd[1] = "-f"; - cmd[2] = "-o"; - cmd[3] = OutputFilename.c_str(); - cmd[4] = InputFilename.c_str(); - cmd[5] = NULL; + cmd[0] = llc.c_str(); + cmd[1] = "-f"; + cmd[2] = "-o"; + cmd[3] = OutputFilename.c_str(); + cmd[4] = InputFilename.c_str(); + cmd[5] = NULL; return ExecWait(cmd, envp); } @@ -186,12 +186,12 @@ cmd.push_back(OutputFilename.c_str()); cmd.push_back(InputFilename.c_str()); - // Adding the library paths creates a problem for native generation. If we - // include the search paths from llvmgcc, then we'll be telling normal gcc - // to look inside of llvmgcc's library directories for libraries. This is - // bad because those libraries hold only bytecode files (not native object - // files). In the end, we attempt to link the bytecode libgcc into a native - // program. + // Adding the library paths creates a problem for native generation. If we + // include the search paths from llvmgcc, then we'll be telling normal gcc + // to look inside of llvmgcc's library directories for libraries. This is + // bad because those libraries hold only bytecode files (not native object + // files). In the end, we attempt to link the bytecode libgcc into a native + // program. #if 0 // Add in the library path options. for (unsigned index=0; index < LibPaths.size(); index++) { From brukman at cs.uiuc.edu Tue Sep 30 12:44:02 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue Sep 30 12:44:02 2003 Subject: [llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp Message-ID: <200309301743.MAA22768@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: GenerateCode.cpp updated: 1.6 -> 1.7 --- Log message: Doxygen-ified function comments. --- Diffs of the changes: Index: llvm/tools/gccld/GenerateCode.cpp diff -u llvm/tools/gccld/GenerateCode.cpp:1.6 llvm/tools/gccld/GenerateCode.cpp:1.7 --- llvm/tools/gccld/GenerateCode.cpp:1.6 Tue Sep 30 12:40:12 2003 +++ llvm/tools/gccld/GenerateCode.cpp Tue Sep 30 12:42:57 2003 @@ -16,25 +16,19 @@ #include "llvm/Transforms/Utils/Linker.h" #include "Support/SystemUtils.h" -// -// Function: GenerateBytecode () -// -// Description: -// This function generates a bytecode file from the specified module. -// -// Inputs: -// M - The module for which bytecode should be generated. -// Strip - Flags whether symbols should be stripped from the output. -// Internalize - Flags whether all symbols should be marked internal. -// Out - Pointer to file stream to which to write the output. -// -// Outputs: -// None. -// -// Return value: -// 0 - No error. -// 1 - Error. -// +/// GenerateBytecode - generates a bytecode file from the specified module. +/// +/// Inputs: +/// M - The module for which bytecode should be generated. +/// Strip - Flags whether symbols should be stripped from the output. +/// Internalize - Flags whether all symbols should be marked internal. +/// Out - Pointer to file stream to which to write the output. +/// +/// Outputs: +/// None. +/// +/// Returns non-zero value on error. +/// int GenerateBytecode (Module *M, bool Strip, bool Internalize, std::ostream *Out) { // In addition to just linking the input from GCC, we also want to spiff it up @@ -89,26 +83,20 @@ return 0; } -// -// Function: GenerateAssembly () -// -// Description: -// This function generates a native assembly language source file from the -// specified bytecode file. -// -// Inputs: -// InputFilename - The name of the output bytecode file. -// OutputFilename - The name of the file to generate. -// llc - The pathname to use for LLC. -// envp - The environment to use when running LLC. -// -// Outputs: -// None. -// -// Return value: -// 0 - Success -// 1 - Failure -// +/// GenerateAssembly - generates a native assembly language source file from the +/// specified bytecode file. +/// +/// Inputs: +/// InputFilename - The name of the output bytecode file. +/// OutputFilename - The name of the file to generate. +/// llc - The pathname to use for LLC. +/// envp - The environment to use when running LLC. +/// +/// Outputs: +/// None. +/// +/// Return non-zero value on error. +/// int GenerateAssembly(const std::string &OutputFilename, const std::string &InputFilename, @@ -128,28 +116,22 @@ return ExecWait(cmd, envp); } -// -// Function: GenerateNative () -// -// Description: -// This function generates a native assembly language source file from the -// specified assembly source file. -// -// Inputs: -// InputFilename - The name of the output bytecode file. -// OutputFilename - The name of the file to generate. -// Libraries - The list of libraries with which to link. -// LibPaths - The list of directories in which to find libraries. -// gcc - The pathname to use for GGC. -// envp - A copy of the process's current environment. -// -// Outputs: -// None. -// -// Return value: -// 0 - Success -// 1 - Failure -// +/// GenerateNative - generates a native assembly language source file from the +/// specified assembly source file. +/// +/// Inputs: +/// InputFilename - The name of the output bytecode file. +/// OutputFilename - The name of the file to generate. +/// Libraries - The list of libraries with which to link. +/// LibPaths - The list of directories in which to find libraries. +/// gcc - The pathname to use for GGC. +/// envp - A copy of the process's current environment. +/// +/// Outputs: +/// None. +/// +/// Returns non-zero value on error. +/// int GenerateNative(const std::string &OutputFilename, const std::string &InputFilename, From gaeke at cs.uiuc.edu Tue Sep 30 12:50:01 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue Sep 30 12:50:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp Message-ID: <200309301749.MAA25285@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcV9CodeEmitter.cpp updated: 1.32 -> 1.33 --- Log message: Add statistic for # of emitWord() calls. --- Diffs of the changes: Index: llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp diff -u llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.32 llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.33 --- llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp:1.32 Fri Sep 5 17:59:31 2003 +++ llvm/lib/Target/Sparc/SparcV9CodeEmitter.cpp Tue Sep 30 12:49:41 2003 @@ -26,6 +26,7 @@ Statistic<> OverwrittenCalls("call-ovwr", "Number of over-written calls"); Statistic<> UnmodifiedCalls("call-skip", "Number of unmodified calls"); Statistic<> CallbackCalls("callback", "Number CompilationCallback() calls"); + Statistic<> WordsEmitted("words-emitted", "No. of words emitted to memory"); } bool UltraSparc::addPassesToEmitMachineCode(FunctionPassManager &PM, @@ -440,6 +441,7 @@ void SparcV9CodeEmitter::emitWord(unsigned Val) { // Output the constant in big endian byte order... + ++WordsEmitted; unsigned byteVal; for (int i = 3; i >= 0; --i) { byteVal = Val >> 8*i; From brukman at cs.uiuc.edu Tue Sep 30 12:52:02 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue Sep 30 12:52:02 2003 Subject: [llvm-commits] CVS: llvm/tools/gccld/Linker.cpp Message-ID: <200309301751.MAA25728@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: Linker.cpp updated: 1.5 -> 1.6 --- Log message: Made code more terse: * Deleted empty comment lines * No single begin-braces '{' on a line by themselves --- Diffs of the changes: Index: llvm/tools/gccld/Linker.cpp diff -u llvm/tools/gccld/Linker.cpp:1.5 llvm/tools/gccld/Linker.cpp:1.6 --- llvm/tools/gccld/Linker.cpp:1.5 Tue Sep 30 09:03:48 2003 +++ llvm/tools/gccld/Linker.cpp Tue Sep 30 12:51:20 2003 @@ -61,8 +61,7 @@ // TRUE - The file is an archive. // FALSE - The file is not an archive. // -static inline bool IsArchive(const std::string &filename) -{ +static inline bool IsArchive(const std::string &filename) { std::string ArchiveMagic("!\012"); char buf[1 + ArchiveMagic.size()]; std::ifstream f(filename.c_str()); @@ -90,8 +89,7 @@ // If the file is not found, an empty string is returned. // static std::string -FindLib(const std::string &Filename, const std::vector &Paths) -{ +FindLib(const std::string &Filename, const std::vector &Paths) { // Determine if the pathname can be found as it stands. if (FileExists(Filename)) return Filename; @@ -142,9 +140,7 @@ // Return value: // None. // -void -GetAllDefinedSymbols(Module *M, std::set &DefinedSymbols) -{ +void GetAllDefinedSymbols(Module *M, std::set &DefinedSymbols) { for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) if (I->hasName() && !I->isExternal() && !I->hasInternalLinkage()) DefinedSymbols.insert(I->getName()); @@ -173,8 +169,7 @@ // None. // void -GetAllUndefinedSymbols(Module *M, std::set &UndefinedSymbols) -{ +GetAllUndefinedSymbols(Module *M, std::set &UndefinedSymbols) { std::set DefinedSymbols; UndefinedSymbols.clear(); // Start out empty @@ -253,11 +248,9 @@ std::string &ErrorMessage, bool Verbose) { - // // Find all of the symbols currently undefined in the bytecode program. // If all the symbols are defined, the program is complete, and there is // no reason to link in any archive files. - // std::set UndefinedSymbols; GetAllUndefinedSymbols(M, UndefinedSymbols); if (UndefinedSymbols.empty()) { @@ -265,17 +258,13 @@ return false; // No need to link anything in! } - // // Load in the archive objects. - // if (Verbose) std::cerr << " Loading '" << Filename << "'\n"; std::vector Objects; if (ReadArchiveFile(Filename, Objects, &ErrorMessage)) return true; - // // Figure out which symbols are defined by all of the modules in the archive. - // std::vector > DefinedSymbols; DefinedSymbols.resize(Objects.size()); for (unsigned i = 0; i != Objects.size(); ++i) { From lattner at cs.uiuc.edu Tue Sep 30 12:54:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 12:54:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/ModuleProvider.h Message-ID: <200309301753.MAA04891@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: ModuleProvider.h updated: 1.2 -> 1.3 --- Log message: make the header comment more useful --- Diffs of the changes: Index: llvm/include/llvm/ModuleProvider.h diff -u llvm/include/llvm/ModuleProvider.h:1.2 llvm/include/llvm/ModuleProvider.h:1.3 --- llvm/include/llvm/ModuleProvider.h:1.2 Mon Sep 22 18:35:23 2003 +++ llvm/include/llvm/ModuleProvider.h Tue Sep 30 12:53:30 2003 @@ -1,6 +1,10 @@ //===-- llvm/ModuleProvider.h - Interface for module providers --*- C++ -*-===// // -// Abstract interface for providing a module. +// This file provides an abstract interface for loading a module from some +// place. This interface allows incremental or random access loading of +// functions from the file. This is useful for applications like JIT compilers +// or interprocedural optimizers that do not need the entire program in memory +// at the same time. // //===----------------------------------------------------------------------===// @@ -39,7 +43,6 @@ TheModule = 0; return tempM; } - }; #endif From brukman at cs.uiuc.edu Tue Sep 30 13:01:18 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue Sep 30 13:01:18 2003 Subject: [llvm-commits] CVS: llvm/tools/gccld/gccld.cpp Message-ID: <200309301759.MAA26060@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: gccld.cpp updated: 1.53 -> 1.54 --- Log message: * Ordered includes according to LLVM style * Put function signatures on one line if possible * Deleted empty comment lines (^//$) * Deleted braces around single statements * Deleted space between function call and argument list --- Diffs of the changes: Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.53 llvm/tools/gccld/gccld.cpp:1.54 --- llvm/tools/gccld/gccld.cpp:1.53 Tue Sep 30 09:03:48 2003 +++ llvm/tools/gccld/gccld.cpp Tue Sep 30 12:59:25 2003 @@ -14,7 +14,6 @@ //===----------------------------------------------------------------------===// #include "gccld.h" -#include "llvm/Transforms/Utils/Linker.h" #include "llvm/Module.h" #include "llvm/PassManager.h" #include "llvm/Bytecode/Reader.h" @@ -22,11 +21,11 @@ #include "llvm/Target/TargetData.h" #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Scalar.h" -#include "Support/FileUtilities.h" -#include "Support/SystemUtils.h" +#include "llvm/Transforms/Utils/Linker.h" #include "Support/CommandLine.h" +#include "Support/FileUtilities.h" #include "Support/Signals.h" - +#include "Support/SystemUtils.h" #include #include @@ -107,7 +106,6 @@ return 1; } - // // // Function: CopyEnv() @@ -130,46 +128,29 @@ // in the array is a duplicate of the one in the original array (i.e. we do // not copy the char *'s from one array to another). // -char ** -CopyEnv (char ** const envp) -{ - // +char ** CopyEnv(char ** const envp) { // Count the number of entries in the old list; - // unsigned entries; // The number of entries in the old environment list for (entries = 0; envp[entries] != NULL; entries++) { ; } - // // Add one more entry for the NULL pointer that ends the list. - // ++entries; - // // If there are no entries at all, just return NULL. - // if (entries == 0) - { return NULL; - } - // // Allocate a new environment list. - // char **newenv; if ((newenv = new (char *) [entries]) == NULL) - { return NULL; - } - // // Make a copy of the list. Don't forget the NULL that ends the list. - // entries = 0; - while (envp[entries] != NULL) - { + while (envp[entries] != NULL) { newenv[entries] = new char[strlen (envp[entries]) + 1]; strcpy (newenv[entries], envp[entries]); ++entries; @@ -202,41 +183,28 @@ // seem to have an unsetenv() function or a setenv() function (or they are // undocumented if they do exist). // -void -RemoveEnv (const char * name, char ** const envp) -{ +void RemoveEnv(const char * name, char ** const envp) { for (unsigned index=0; envp[index] != NULL; index++) { // Find the first equals sign in the array and make it an EOS character. char *p = strchr (envp[index], '='); if (p == NULL) - { continue; - } else - { *p = '\0'; - } // Compare the two strings. If they are equal, zap this string. // Otherwise, restore it. - // - if (!strcmp (name, envp[index])) - { + if (!strcmp(name, envp[index])) *envp[index] = '\0'; - } else - { *p = '='; - } } return; } -int -main(int argc, char **argv, char ** envp) -{ +int main(int argc, char **argv, char **envp) { cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n"); std::string ErrorMessage; @@ -262,9 +230,7 @@ // Link in all of the libraries next... - // // Create the output file. - // std::string RealBytecodeOutput = OutputFilename; if (!LinkAsLibrary) RealBytecodeOutput += ".bc"; std::ofstream Out(RealBytecodeOutput.c_str()); @@ -272,69 +238,51 @@ return PrintAndReturn(argv[0], "error opening '" + RealBytecodeOutput + "' for writing!"); - // // Ensure that the bytecode file gets removed from the disk if we get a // SIGINT signal. - // RemoveFileOnSignal(RealBytecodeOutput); - // // Generate the bytecode file. - // - if (GenerateBytecode (Composite.get(), Strip, !NoInternalize, &Out)) { + if (GenerateBytecode(Composite.get(), Strip, !NoInternalize, &Out)) { Out.close(); return PrintAndReturn(argv[0], "error generating bytcode"); } - // // Close the bytecode file. - // Out.close(); - // // If we are not linking a library, generate either a native executable // or a JIT shell script, depending upon what the user wants. - // if (!LinkAsLibrary) { - // // If the user wants to generate a native executable, compile it from the // bytecode file. // // Otherwise, create a script that will run the bytecode through the JIT. - // if (Native) { // Name of the Assembly Language output file std::string AssemblyFile = OutputFilename + ".s"; - // // Mark the output files for removal if we get an interrupt. - // - RemoveFileOnSignal (AssemblyFile); - RemoveFileOnSignal (OutputFilename); + RemoveFileOnSignal(AssemblyFile); + RemoveFileOnSignal(OutputFilename); - // // Determine the locations of the llc and gcc programs. - // - std::string llc=FindExecutable ("llc", argv[0]); - std::string gcc=FindExecutable ("gcc", argv[0]); + std::string llc = FindExecutable("llc", argv[0]); + std::string gcc = FindExecutable("gcc", argv[0]); if (llc.empty()) - return PrintAndReturn (argv[0], "Failed to find llc"); + return PrintAndReturn(argv[0], "Failed to find llc"); if (gcc.empty()) - return PrintAndReturn (argv[0], "Failed to find gcc"); + return PrintAndReturn(argv[0], "Failed to find gcc"); - // // Generate an assembly language file for the bytecode. - // if (Verbose) std::cout << "Generating Assembly Code\n"; GenerateAssembly(AssemblyFile, RealBytecodeOutput, llc, envp); if (Verbose) std::cout << "Generating Native Code\n"; GenerateNative(OutputFilename, AssemblyFile, Libraries, LibPaths, gcc, envp); - // // Remove the assembly language file. - // removeFile (AssemblyFile); } else { // Output the script to start the program... @@ -347,11 +295,11 @@ } // Make the script executable... - MakeFileExecutable (OutputFilename); + MakeFileExecutable(OutputFilename); // Make the bytecode file readable and directly executable in LLEE as well - MakeFileExecutable (RealBytecodeOutput); - MakeFileReadable (RealBytecodeOutput); + MakeFileExecutable(RealBytecodeOutput); + MakeFileReadable(RealBytecodeOutput); } return 0; From lattner at cs.uiuc.edu Tue Sep 30 13:06:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:06:02 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/FunctionLiveVarInfo.h Message-ID: <200309301805.NAA04983@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: FunctionLiveVarInfo.h updated: 1.28 -> 1.29 --- Log message: Fix header file comment --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/FunctionLiveVarInfo.h diff -u llvm/include/llvm/CodeGen/FunctionLiveVarInfo.h:1.28 llvm/include/llvm/CodeGen/FunctionLiveVarInfo.h:1.29 --- llvm/include/llvm/CodeGen/FunctionLiveVarInfo.h:1.28 Tue Aug 12 18:39:08 2003 +++ llvm/include/llvm/CodeGen/FunctionLiveVarInfo.h Tue Sep 30 13:05:30 2003 @@ -1,62 +1,29 @@ -/* Title: FunctionLiveVarInfo.h -*- C++ -*- - Author: Ruchira Sasanka - Date: Jun 30, 01 - Purpose: - - This is the interface for live variable info of a function that is required - by any other part of the compiler - - It must be called like: - - FunctionLiveVarInfo FLVI(Function *); // initializes data structures - FLVI.analyze(); // do the actural live variable anal - - After the analysis, getInSetOfBB or getOutSetofBB can be called to get - live var info of a BB. - - The live var set before an instruction can be obtained in 2 ways: - - 1. Use the method getLiveVarSetAfterInst(Instruction *) to get the LV Info - just after an instruction. (also exists getLiveVarSetBeforeInst(..)) - - This function caluclates the LV info for a BB only once and caches that - info. If the cache does not contain the LV info of the instruction, it - calculates the LV info for the whole BB and caches them. - - Getting liveVar info this way uses more memory since, LV info should be - cached. However, if you need LV info of nearly all the instructions of a - BB, this is the best and simplest interfrace. - - - 2. Use the OutSet and applyTranferFuncForInst(const Instruction *const Inst) - declared in LiveVarSet and traverse the instructions of a basic block in - reverse (using const_reverse_iterator in the BB class). - - This is the most memory efficient method if you need LV info for - only several instructions in a BasicBlock. An example is given below: - - - LiveVarSet LVSet; // this will be the set used to traverse through each BB - - // Initialize LVSet so that it is the same as OutSet of the BB - LVSet.setUnion( LVI->getOutSetOfBB( *BBI ) ); - - BasicBlock::InstListType::const_reverse_iterator - InstIterator = InstListInBB.rbegin(); // get the rev iter for inst in BB - - // iterate over all the instructions in BB in reverse - for( ; InstIterator != InstListInBB.rend(); InstIterator++) { - - //...... all code here which uses LVSet ........ - - LVSet.applyTranferFuncForInst(*InstIterator); - - // Now LVSet contains live vars ABOVE the current instrution - } - - See buildInterferenceGraph() for the above example. -*/ - +//===-- CodeGen/FunctionLiveVarInfo.h - LiveVar Analysis --------*- C++ -*-===// +// +// This is the interface for live variable info of a function that is required +// by any other part of the compiler +// +// After the analysis, getInSetOfBB or getOutSetofBB can be called to get +// live var info of a BB. +// +// The live var set before an instruction can be obtained in 2 ways: +// +// 1. Use the method getLiveVarSetAfterInst(Instruction *) to get the LV Info +// just after an instruction. (also exists getLiveVarSetBeforeInst(..)) +// +// This function caluclates the LV info for a BB only once and caches that +// info. If the cache does not contain the LV info of the instruction, it +// calculates the LV info for the whole BB and caches them. +// +// Getting liveVar info this way uses more memory since, LV info should be +// cached. However, if you need LV info of nearly all the instructions of a +// BB, this is the best and simplest interfrace. +// +// 2. Use the OutSet and applyTranferFuncForInst(const Instruction *const Inst) +// declared in LiveVarSet and traverse the instructions of a basic block in +// reverse (using const_reverse_iterator in the BB class). +// +//===----------------------------------------------------------------------===// #ifndef FUNCTION_LIVE_VAR_INFO_H #define FUNCTION_LIVE_VAR_INFO_H From lattner at cs.uiuc.edu Tue Sep 30 13:07:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:07:04 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/InstrSelection.h Message-ID: <200309301807.NAA05015@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: InstrSelection.h updated: 1.27 -> 1.28 --- Log message: Fix header, remove dead decl --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/InstrSelection.h diff -u llvm/include/llvm/CodeGen/InstrSelection.h:1.27 llvm/include/llvm/CodeGen/InstrSelection.h:1.28 --- llvm/include/llvm/CodeGen/InstrSelection.h:1.27 Thu Aug 21 17:09:31 2003 +++ llvm/include/llvm/CodeGen/InstrSelection.h Tue Sep 30 13:06:51 2003 @@ -1,4 +1,4 @@ -//===-- llvm/CodeGen/InstrSelection.h --------------------------*- C++ -*--===// +//===-- llvm/CodeGen/InstrSelection.h ---------------------------*- C++ -*-===// // // External interface to instruction selection. // @@ -20,8 +20,6 @@ //===--------------------- Required Functions --------------------------------- // Target-dependent functions that MUST be implemented for each target. // - -const unsigned MAX_INSTR_PER_VMINSTR = 8; extern void GetInstructionsByRule (InstructionNode* subtreeRoot, int ruleForNode, From brukman at cs.uiuc.edu Tue Sep 30 13:10:04 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue Sep 30 13:10:04 2003 Subject: [llvm-commits] CVS: llvm/tools/gccld/Linker.cpp Message-ID: <200309301809.NAA26213@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: Linker.cpp updated: 1.6 -> 1.7 --- Log message: Doxygen-ified comments. --- Diffs of the changes: Index: llvm/tools/gccld/Linker.cpp diff -u llvm/tools/gccld/Linker.cpp:1.6 llvm/tools/gccld/Linker.cpp:1.7 --- llvm/tools/gccld/Linker.cpp:1.6 Tue Sep 30 12:51:20 2003 +++ llvm/tools/gccld/Linker.cpp Tue Sep 30 13:09:32 2003 @@ -24,43 +24,35 @@ #include #include -// -// Function: FileExists () -// -// Description: -// Determine if the specified filename exists and is readable. -// -// Inputs: -// FN - The name of the file. -// -// Outputs: -// None. -// -// Return Value: -// TRUE - The file exists and is readable. -// FALSE - The file does not exist or is unreadable. -// +/// FileExists - determines if the specified filename exists and is readable. +/// +/// Inputs: +/// FN - The name of the file. +/// +/// Outputs: +/// None. +/// +/// Return Value: +/// TRUE - The file exists and is readable. +/// FALSE - The file does not exist or is unreadable. +/// static inline bool FileExists(const std::string &FN) { return access(FN.c_str(), R_OK | F_OK) != -1; } -// -// Function: IsArchive () -// -// Description: -// Determine if the specified file is an ar archive. It determines this by -// checking the magic string at the beginning of the file. -// -// Inputs: -// filename - A C++ string containing the name of the file. -// -// Outputs: -// None. -// -// Return value: -// TRUE - The file is an archive. -// FALSE - The file is not an archive. -// +/// IsArchive - determines if the specified file is an ar archive +/// by checking the magic string at the beginning of the file. +/// +/// Inputs: +/// filename - A C++ string containing the name of the file. +/// +/// Outputs: +/// None. +/// +/// Return value: +/// TRUE - The file is an archive. +/// FALSE - The file is not an archive. +/// static inline bool IsArchive(const std::string &filename) { std::string ArchiveMagic("!\012"); char buf[1 + ArchiveMagic.size()]; @@ -70,24 +62,20 @@ return ArchiveMagic == buf; } -// -// Function: FindLib () -// -// Description: -// This function locates a particular library. It will prepend and append -// various directories, prefixes, and suffixes until it can find the library. -// -// Inputs: -// Filename - Name of the file to find. -// Paths - List of directories to search. -// -// Outputs: -// None. -// -// Return value: -// The name of the file is returned. -// If the file is not found, an empty string is returned. -// +/// FindLib - locates a particular library. It will prepend and append +/// various directories, prefixes, and suffixes until it can find the library. +/// +/// Inputs: +/// Filename - Name of the file to find. +/// Paths - List of directories to search. +/// +/// Outputs: +/// None. +/// +/// Return value: +/// The name of the file is returned. +/// If the file is not found, an empty string is returned. +/// static std::string FindLib(const std::string &Filename, const std::vector &Paths) { // Determine if the pathname can be found as it stands. @@ -124,22 +112,19 @@ return std::string(); } -// -// Function: GetAllDefinedSymbols () -// -// Description: -// Find all of the defined symbols in the specified module. -// -// Inputs: -// M - The module in which to find defined symbols. -// -// Outputs: -// DefinedSymbols - A set of C++ strings that will contain the name of all -// defined symbols. -// -// Return value: -// None. -// +/// GetAllDefinedSymbols - finds all of the defined symbols in the specified +/// module. +/// +/// Inputs: +/// M - The module in which to find defined symbols. +/// +/// Outputs: +/// DefinedSymbols - A set of C++ strings that will contain the name of all +/// defined symbols. +/// +/// Return value: +/// None. +/// void GetAllDefinedSymbols(Module *M, std::set &DefinedSymbols) { for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) if (I->hasName() && !I->isExternal() && !I->hasInternalLinkage()) @@ -149,25 +134,21 @@ DefinedSymbols.insert(I->getName()); } -// -// Function: GetAllUndefinedSymbols () -// -// Description: -// This calculates the set of undefined symbols that still exist in an LLVM -// module. This is a bit tricky because there may be two symbols with the -// same name but different LLVM types that will be resolved to each other but -// aren't currently (thus we need to treat it as resolved). -// -// Inputs: -// M - The module in which to find undefined symbols. -// -// Outputs: -// UndefinedSymbols - A set of C++ strings containing the name of all -// undefined symbols. -// -// Return value: -// None. -// +/// GetAllUndefinedSymbols - calculates the set of undefined symbols that still +/// exist in an LLVM module. This is a bit tricky because there may be two +/// symbols with the same name but different LLVM types that will be resolved to +/// each other but aren't currently (thus we need to treat it as resolved). +/// +/// Inputs: +/// M - The module in which to find undefined symbols. +/// +/// Outputs: +/// UndefinedSymbols - A set of C++ strings containing the name of all +/// undefined symbols. +/// +/// Return value: +/// None. +/// void GetAllUndefinedSymbols(Module *M, std::set &UndefinedSymbols) { std::set DefinedSymbols; @@ -198,22 +179,18 @@ } -// -// Function: LoadObject () -// -// Description: -// Read the specified bytecode object file. -// -// Inputs: -// FN - The name of the file to load. -// -// Outputs: -// OutErrorMessage - The error message to give back to the caller. -// -// Return Value: -// A pointer to a module represening the bytecode file is returned. -// If an error occurs, the pointer is 0. -// +/// LoadObject - reads the specified bytecode object file. +/// +/// Inputs: +/// FN - The name of the file to load. +/// +/// Outputs: +/// OutErrorMessage - The error message to give back to the caller. +/// +/// Return Value: +/// A pointer to a module represening the bytecode file is returned. +/// If an error occurs, the pointer is 0. +/// std::auto_ptr LoadObject(const std::string & FN, std::string &OutErrorMessage) { std::string ErrorMessage; @@ -224,25 +201,21 @@ return std::auto_ptr(); } -// -// Function: LinkInArchive () -// -// Description: -// This function will open an archive library and link in all objects which -// provide symbols that are currently undefined. -// -// Inputs: -// M - The module in which to link the archives. -// Filename - The pathname of the archive. -// Verbose - Flags whether verbose messages should be printed. -// -// Outputs: -// ErrorMessage - A C++ string detailing what error occurred, if any. -// -// Return Value: -// TRUE - An error occurred. -// FALSE - No errors. -// +/// LinkInArchive - opens an archive library and link in all objects which +/// provide symbols that are currently undefined. +/// +/// Inputs: +/// M - The module in which to link the archives. +/// Filename - The pathname of the archive. +/// Verbose - Flags whether verbose messages should be printed. +/// +/// Outputs: +/// ErrorMessage - A C++ string detailing what error occurred, if any. +/// +/// Return Value: +/// TRUE - An error occurred. +/// FALSE - No errors. +/// static bool LinkInArchive(Module *M, const std::string &Filename, std::string &ErrorMessage, @@ -315,25 +288,21 @@ return false; } -// -// Function: LinkInFile () -// -// Description: -// This function will open an archive library and link in all objects which -// provide symbols that are currently undefined. -// -// Inputs: -// HeadModule - The module in which to link the archives. -// Filename - The pathname of the archive. -// Verbose - Flags whether verbose messages should be printed. -// -// Outputs: -// ErrorMessage - A C++ string detailing what error occurred, if any. -// -// Return Value: -// TRUE - An error occurred. -// FALSE - No errors. -// +/// LinkInFile - opens an archive library and link in all objects which +/// provide symbols that are currently undefined. +/// +/// Inputs: +/// HeadModule - The module in which to link the archives. +/// Filename - The pathname of the archive. +/// Verbose - Flags whether verbose messages should be printed. +/// +/// Outputs: +/// ErrorMessage - A C++ string detailing what error occurred, if any. +/// +/// Return Value: +/// TRUE - An error occurred. +/// FALSE - No errors. +/// static bool LinkInFile(Module *HeadModule, const std::string &Filename, std::string &ErrorMessage, @@ -345,31 +314,26 @@ return LinkModules(HeadModule, M.get(), &ErrorMessage); } -// -// Function: LinkFiles () -// -// Description: -// This function takes a module and a list of files and links them all -// together. It locates the file either in the current directory, as it's -// absolute or relative pathname, or as a file somewhere in -// LLVM_LIB_SEARCH_PATH. -// -// Inputs: -// progname - The name of the program (infamous argv[0]). -// HeadModule - The module under which all files will be linked. -// Files - A vector of C++ strings indicating the LLVM bytecode filenames -// to be linked. The names can refer to a mixture of pure LLVM -// bytecode files and archive (ar) formatted files. -// Verbose - Flags whether verbose output should be printed while linking. -// -// Outputs: -// HeadModule - The module will have the specified LLVM bytecode files linked -// in. -// -// Return value: -// FALSE - No errors. -// TRUE - Some error occurred. -// +/// LinkFiles - takes a module and a list of files and links them all together. +/// It locates the file either in the current directory, as its absolute +/// or relative pathname, or as a file somewhere in LLVM_LIB_SEARCH_PATH. +/// +/// Inputs: +/// progname - The name of the program (infamous argv[0]). +/// HeadModule - The module under which all files will be linked. +/// Files - A vector of C++ strings indicating the LLVM bytecode filenames +/// to be linked. The names can refer to a mixture of pure LLVM +/// bytecode files and archive (ar) formatted files. +/// Verbose - Flags whether verbose output should be printed while linking. +/// +/// Outputs: +/// HeadModule - The module will have the specified LLVM bytecode files linked +/// in. +/// +/// Return value: +/// FALSE - No errors. +/// TRUE - Some error occurred. +/// bool LinkFiles(const char *progname, Module *HeadModule, const std::vector &Files, @@ -427,28 +391,24 @@ return false; } -// -// Function: LinkLibraries () -// -// Description: -// This function takes the specified library files and links them into the -// main bytecode object file. -// -// Inputs: -// progname - The name of the program (infamous argv[0]). -// HeadModule - The module into which all necessary libraries will be linked. -// Libraries - The list of libraries to link into the module. -// LibPaths - The list of library paths in which to find libraries. -// Verbose - Flags whether verbose messages should be printed. -// Native - Flags whether native code is being generated. -// -// Outputs: -// HeadModule - The module will have all necessary libraries linked in. -// -// Return value: -// FALSE - No error. -// TRUE - Error. -// +/// LinkLibraries - takes the specified library files and links them into the +/// main bytecode object file. +/// +/// Inputs: +/// progname - The name of the program (infamous argv[0]). +/// HeadModule - The module into which all necessary libraries will be linked. +/// Libraries - The list of libraries to link into the module. +/// LibPaths - The list of library paths in which to find libraries. +/// Verbose - Flags whether verbose messages should be printed. +/// Native - Flags whether native code is being generated. +/// +/// Outputs: +/// HeadModule - The module will have all necessary libraries linked in. +/// +/// Return value: +/// FALSE - No error. +/// TRUE - Error. +/// bool LinkLibraries(const char *progname, Module *HeadModule, const std::vector &Libraries, From lattner at cs.uiuc.edu Tue Sep 30 13:13:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:13:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueSet.h Message-ID: <200309301812.NAA12378@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: ValueSet.h updated: 1.11 -> 1.12 --- Log message: Fix header comment --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/ValueSet.h diff -u llvm/include/llvm/CodeGen/ValueSet.h:1.11 llvm/include/llvm/CodeGen/ValueSet.h:1.12 --- llvm/include/llvm/CodeGen/ValueSet.h:1.11 Tue Jan 14 16:56:14 2003 +++ llvm/include/llvm/CodeGen/ValueSet.h Tue Sep 30 13:12:25 2003 @@ -1,7 +1,10 @@ +//===-- llvm/CodeGen/ValueSet.h ---------------------------------*- C++ -*-===// // -// VALUESET.H - This header is OBSOLETE, do not use it for new code. +// This header is OBSOLETE, do not use it for new code. // // FIXME: Eliminate this file. +// +//===----------------------------------------------------------------------===// #ifndef VALUE_SET_H #define VALUE_SET_H @@ -17,7 +20,6 @@ RAV(const Value &v) : V(v) {} }; std::ostream &operator<<(std::ostream &out, RAV Val); - typedef std::set ValueSet; void printSet(const ValueSet &S); From lattner at cs.uiuc.edu Tue Sep 30 13:20:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:20:03 2003 Subject: [llvm-commits] CVS: llvm/include/Support/Alloca.h Message-ID: <200309301819.NAA27450@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: Alloca.h (r1.3) removed --- Log message: Remove unused header --- Diffs of the changes: From lattner at cs.uiuc.edu Tue Sep 30 13:30:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:30:03 2003 Subject: [llvm-commits] CVS: llvm/include/Support/ToolRunner.h Message-ID: <200309301829.NAA29251@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: ToolRunner.h updated: 1.1 -> 1.2 --- Log message: Add a file header --- Diffs of the changes: Index: llvm/include/Support/ToolRunner.h diff -u llvm/include/Support/ToolRunner.h:1.1 llvm/include/Support/ToolRunner.h:1.2 --- llvm/include/Support/ToolRunner.h:1.1 Mon Sep 29 17:38:57 2003 +++ llvm/include/Support/ToolRunner.h Tue Sep 30 13:28:53 2003 @@ -1,3 +1,9 @@ +//===-- Support/ToolRunner.h ------------------------------------*- C++ -*-===// +// +// FIXME: document +// +//===----------------------------------------------------------------------===// + #ifndef TOOLRUNNER_H #define TOOLRUNNER_H From lattner at cs.uiuc.edu Tue Sep 30 13:38:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:38:00 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h TargetMachine.h TargetRegInfo.h TargetSchedInfo.h Message-ID: <200309301837.NAA18238@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetData.h updated: 1.18 -> 1.19 TargetMachine.h updated: 1.34 -> 1.35 TargetRegInfo.h updated: 1.44 -> 1.45 TargetSchedInfo.h updated: 1.18 -> 1.19 --- Log message: Standardize header file comments --- Diffs of the changes: Index: llvm/include/llvm/Target/TargetData.h diff -u llvm/include/llvm/Target/TargetData.h:1.18 llvm/include/llvm/Target/TargetData.h:1.19 --- llvm/include/llvm/Target/TargetData.h:1.18 Mon Aug 18 09:28:37 2003 +++ llvm/include/llvm/Target/TargetData.h Tue Sep 30 13:37:47 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Target/TargetData.h - Data size & alignment routines-*- C++ -*-==// +//===-- llvm/Target/TargetData.h - Data size & alignment info ---*- C++ -*-===// // // This file defines target properties related to datatype size/offset/alignment // information. It uses lazy annotations to cache information about how Index: llvm/include/llvm/Target/TargetMachine.h diff -u llvm/include/llvm/Target/TargetMachine.h:1.34 llvm/include/llvm/Target/TargetMachine.h:1.35 --- llvm/include/llvm/Target/TargetMachine.h:1.34 Mon Sep 1 15:40:43 2003 +++ llvm/include/llvm/Target/TargetMachine.h Tue Sep 30 13:37:47 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Target/TargetMachine.h - General Target Information -*- C++ -*-==// +//===-- llvm/Target/TargetMachine.h - Target Information --------*- C++ -*-===// // // This file describes the general parts of a Target machine. // Index: llvm/include/llvm/Target/TargetRegInfo.h diff -u llvm/include/llvm/Target/TargetRegInfo.h:1.44 llvm/include/llvm/Target/TargetRegInfo.h:1.45 --- llvm/include/llvm/Target/TargetRegInfo.h:1.44 Tue Jul 29 14:41:23 2003 +++ llvm/include/llvm/Target/TargetRegInfo.h Tue Sep 30 13:37:47 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Target/TargetRegInfo.h - Target Register Info -------*- C++ -*-==// +//===-- llvm/Target/TargetRegInfo.h - Target Register Info ------*- C++ -*-===// // // This file is used to describe the register system of a target to the // register allocator. Index: llvm/include/llvm/Target/TargetSchedInfo.h diff -u llvm/include/llvm/Target/TargetSchedInfo.h:1.18 llvm/include/llvm/Target/TargetSchedInfo.h:1.19 --- llvm/include/llvm/Target/TargetSchedInfo.h:1.18 Sat Jun 21 22:06:38 2003 +++ llvm/include/llvm/Target/TargetSchedInfo.h Tue Sep 30 13:37:47 2003 @@ -1,4 +1,4 @@ -//===- Target/TargetSchedInfo.h - Target Instruction Sched Info --*- C++ -*-==// +//===- Target/TargetSchedInfo.h - Target Instruction Sched Info -*- C++ -*-===// // // This file describes the target machine to the instruction scheduler. // From lattner at cs.uiuc.edu Tue Sep 30 13:38:05 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:38:05 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/CFG.h InstIterator.h InstVisitor.h Mangler.h Message-ID: <200309301837.NAA18225@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: CFG.h updated: 1.13 -> 1.14 InstIterator.h updated: 1.6 -> 1.7 InstVisitor.h updated: 1.21 -> 1.22 Mangler.h updated: 1.5 -> 1.6 --- Log message: Standardize header file comments --- Diffs of the changes: Index: llvm/include/llvm/Support/CFG.h diff -u llvm/include/llvm/Support/CFG.h:1.13 llvm/include/llvm/Support/CFG.h:1.14 --- llvm/include/llvm/Support/CFG.h:1.13 Sat Sep 20 09:39:18 2003 +++ llvm/include/llvm/Support/CFG.h Tue Sep 30 13:37:46 2003 @@ -1,12 +1,12 @@ -//===-- llvm/Support/CFG.h - Process LLVM structures as graphs ---*- C++ -*--=// +//===-- llvm/Support/CFG.h - Process LLVM structures as graphs --*- C++ -*-===// // // This file defines specializations of GraphTraits that allow Function and // BasicBlock graphs to be treated as proper graphs for generic algorithms. // //===----------------------------------------------------------------------===// -#ifndef LLVM_CFG_H -#define LLVM_CFG_H +#ifndef LLVM_SUPPORT_CFG_H +#define LLVM_SUPPORT_CFG_H #include "Support/GraphTraits.h" #include "llvm/Function.h" Index: llvm/include/llvm/Support/InstIterator.h diff -u llvm/include/llvm/Support/InstIterator.h:1.6 llvm/include/llvm/Support/InstIterator.h:1.7 --- llvm/include/llvm/Support/InstIterator.h:1.6 Tue Sep 23 23:09:50 2003 +++ llvm/include/llvm/Support/InstIterator.h Tue Sep 30 13:37:46 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Support/InstIterator.h - Classes for inst iteration -*- C++ -*--=// +//===- llvm/Support/InstIterator.h - Classes for inst iteration -*- C++ -*-===// // // This file contains definitions of two iterators for iterating over the // instructions in a function. This is effectively a wrapper around a two level Index: llvm/include/llvm/Support/InstVisitor.h diff -u llvm/include/llvm/Support/InstVisitor.h:1.21 llvm/include/llvm/Support/InstVisitor.h:1.22 --- llvm/include/llvm/Support/InstVisitor.h:1.21 Mon Sep 8 13:54:16 2003 +++ llvm/include/llvm/Support/InstVisitor.h Tue Sep 30 13:37:46 2003 @@ -1,4 +1,4 @@ -//===- llvm/Support/InstVisitor.h - Define instruction visitors --*- C++ -*--=// +//===- llvm/Support/InstVisitor.h - Define instruction visitors -*- C++ -*-===// // // This template class is used to define instruction visitors in a typesafe // manner without having to use lots of casts and a big switch statement (in Index: llvm/include/llvm/Support/Mangler.h diff -u llvm/include/llvm/Support/Mangler.h:1.5 llvm/include/llvm/Support/Mangler.h:1.6 --- llvm/include/llvm/Support/Mangler.h:1.5 Mon Aug 11 14:34:27 2003 +++ llvm/include/llvm/Support/Mangler.h Tue Sep 30 13:37:46 2003 @@ -1,4 +1,4 @@ -//===-- Mangler.h - Self-contained c/asm llvm name mangler -*- C++ -*- ----===// +//===-- Mangler.h - Self-contained c/asm llvm name mangler ------*- C++ -*-===// // // Unified name mangler for CWriter and assembly backends. // From lattner at cs.uiuc.edu Tue Sep 30 13:38:09 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:38:09 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/InstrForest.h InstrScheduling.h MachineInstr.h RegisterAllocation.h SchedGraphCommon.h Message-ID: <200309301837.NAA18212@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: InstrForest.h updated: 1.29 -> 1.30 InstrScheduling.h updated: 1.11 -> 1.12 MachineInstr.h updated: 1.112 -> 1.113 RegisterAllocation.h updated: 1.5 -> 1.6 SchedGraphCommon.h updated: 1.4 -> 1.5 --- Log message: Standardize header file comments --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/InstrForest.h diff -u llvm/include/llvm/CodeGen/InstrForest.h:1.29 llvm/include/llvm/CodeGen/InstrForest.h:1.30 --- llvm/include/llvm/CodeGen/InstrForest.h:1.29 Sat Jul 26 18:18:11 2003 +++ llvm/include/llvm/CodeGen/InstrForest.h Tue Sep 30 13:37:44 2003 @@ -1,4 +1,4 @@ -//===-- llvm/CodeGen/InstForest.h ------------------------------*- C++ -*--===// +//===-- llvm/CodeGen/InstForest.h -------------------------------*- C++ -*-===// // // Purpose: // Convert SSA graph to instruction trees for instruction selection. Index: llvm/include/llvm/CodeGen/InstrScheduling.h diff -u llvm/include/llvm/CodeGen/InstrScheduling.h:1.11 llvm/include/llvm/CodeGen/InstrScheduling.h:1.12 --- llvm/include/llvm/CodeGen/InstrScheduling.h:1.11 Thu Aug 14 01:09:27 2003 +++ llvm/include/llvm/CodeGen/InstrScheduling.h Tue Sep 30 13:37:44 2003 @@ -1,4 +1,4 @@ -//===-- InstrScheduling.h - Interface To Instruction Scheduling --*- C++ -*-==// +//===-- InstrScheduling.h - Interface To Instruction Scheduling -*- C++ -*-===// // // This file defines a minimal, but complete, interface to instruction // scheduling. @@ -21,6 +21,6 @@ // are still in SSA form. //--------------------------------------------------------------------------- -FunctionPass *createInstructionSchedulingWithSSAPass(const TargetMachine &Target); +FunctionPass *createInstructionSchedulingWithSSAPass(const TargetMachine &TM); #endif Index: llvm/include/llvm/CodeGen/MachineInstr.h diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.112 llvm/include/llvm/CodeGen/MachineInstr.h:1.113 --- llvm/include/llvm/CodeGen/MachineInstr.h:1.112 Thu Aug 21 17:09:31 2003 +++ llvm/include/llvm/CodeGen/MachineInstr.h Tue Sep 30 13:37:44 2003 @@ -1,4 +1,4 @@ -//===-- llvm/CodeGen/MachineInstr.h - MachineInstr class ---------*- C++ -*--=// +//===-- llvm/CodeGen/MachineInstr.h - MachineInstr class --------*- C++ -*-===// // // This file contains the declaration of the MachineInstr class, which is the // basic representation for all target dependent machine instructions used by @@ -12,7 +12,6 @@ #include "llvm/Target/MRegisterInfo.h" #include "Support/Annotation.h" #include "Support/iterator" -#include class Value; class Function; Index: llvm/include/llvm/CodeGen/RegisterAllocation.h diff -u llvm/include/llvm/CodeGen/RegisterAllocation.h:1.5 llvm/include/llvm/CodeGen/RegisterAllocation.h:1.6 --- llvm/include/llvm/CodeGen/RegisterAllocation.h:1.5 Thu Aug 14 01:09:27 2003 +++ llvm/include/llvm/CodeGen/RegisterAllocation.h Tue Sep 30 13:37:44 2003 @@ -1,4 +1,4 @@ -//===-- CodeGen/RegisterAllocation.h - RegAlloc Pass -------------*- C++ -*--=// +//===-- CodeGen/RegisterAllocation.h - RegAlloc Pass ------------*- C++ -*-===// // // This pass register allocates a module, a method at a time. // Index: llvm/include/llvm/CodeGen/SchedGraphCommon.h diff -u llvm/include/llvm/CodeGen/SchedGraphCommon.h:1.4 llvm/include/llvm/CodeGen/SchedGraphCommon.h:1.5 --- llvm/include/llvm/CodeGen/SchedGraphCommon.h:1.4 Thu Aug 28 10:31:28 2003 +++ llvm/include/llvm/CodeGen/SchedGraphCommon.h Tue Sep 30 13:37:44 2003 @@ -1,9 +1,9 @@ -//===-- SchedGraphCommon.h - Scheduling Base Graph ---------------*- C++ -*---=// +//===-- SchedGraphCommon.h - Scheduling Base Graph --------------*- C++ -*-===// // // A common graph class that is based on the SSA graph. It includes // extra dependencies that are caused by machine resources. // -//===-------------------------------------------------------------------------=// +//===----------------------------------------------------------------------===// #ifndef LLVM_CODEGEN_SCHEDGRAPHCOMMON_H #define LLVM_CODEGEN_SCHEDGRAPHCOMMON_H From lattner at cs.uiuc.edu Tue Sep 30 13:38:14 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:38:14 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/Format.h Primitives.h Reader.h WriteBytecodePass.h Writer.h Message-ID: <200309301837.NAA18197@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bytecode: Format.h updated: 1.3 -> 1.4 Primitives.h updated: 1.11 -> 1.12 Reader.h updated: 1.12 -> 1.13 WriteBytecodePass.h updated: 1.7 -> 1.8 Writer.h updated: 1.2 -> 1.3 --- Log message: Standardize header file comments --- Diffs of the changes: Index: llvm/include/llvm/Bytecode/Format.h diff -u llvm/include/llvm/Bytecode/Format.h:1.3 llvm/include/llvm/Bytecode/Format.h:1.4 --- llvm/include/llvm/Bytecode/Format.h:1.3 Wed Mar 19 14:48:27 2003 +++ llvm/include/llvm/Bytecode/Format.h Tue Sep 30 13:37:43 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Bytecode/Format.h - VM bytecode file format info ----*- C++ -*--=// +//===-- llvm/Bytecode/Format.h - VM bytecode file format info ---*- C++ -*-===// // // This header defines intrinsic constants that are useful to libraries that // need to hack on bytecode files directly, like the reader and writer. @@ -24,7 +24,7 @@ ModuleGlobalInfo, GlobalTypePlane, - // Method subtypes: + // Function subtypes: MethodInfo = 0x21, // Can also have ConstantPool block // Can also have SymbolTable block Index: llvm/include/llvm/Bytecode/Primitives.h diff -u llvm/include/llvm/Bytecode/Primitives.h:1.11 llvm/include/llvm/Bytecode/Primitives.h:1.12 --- llvm/include/llvm/Bytecode/Primitives.h:1.11 Mon Sep 22 18:35:54 2003 +++ llvm/include/llvm/Bytecode/Primitives.h Tue Sep 30 13:37:43 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Bytecode/Primitives.h - Bytecode file format prims --*- C++ -*--=// +//===-- llvm/Bytecode/Primitives.h - Bytecode file format prims -*- C++ -*-===// // // This header defines some basic functions for reading and writing basic // primitive types to a bytecode stream. Index: llvm/include/llvm/Bytecode/Reader.h diff -u llvm/include/llvm/Bytecode/Reader.h:1.12 llvm/include/llvm/Bytecode/Reader.h:1.13 --- llvm/include/llvm/Bytecode/Reader.h:1.12 Mon Sep 22 18:40:38 2003 +++ llvm/include/llvm/Bytecode/Reader.h Tue Sep 30 13:37:43 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=// +//===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ---*- C++ -*-===// // // This functionality is implemented by the lib/Bytecode/Reader library. // This library is used to read VM bytecode files from an iostream. Index: llvm/include/llvm/Bytecode/WriteBytecodePass.h diff -u llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.7 llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.8 --- llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.7 Tue Jul 23 14:56:03 2002 +++ llvm/include/llvm/Bytecode/WriteBytecodePass.h Tue Sep 30 13:37:43 2003 @@ -1,4 +1,4 @@ -//===- llvm/Bytecode/WriteBytecodePass.h - Bytecode Writer Pass --*- C++ -*--=// +//===- llvm/Bytecode/WriteBytecodePass.h - Bytecode Writer Pass -*- C++ -*-===// // // This file defines a simple pass to write the working module to a file after // pass processing is completed. Index: llvm/include/llvm/Bytecode/Writer.h diff -u llvm/include/llvm/Bytecode/Writer.h:1.2 llvm/include/llvm/Bytecode/Writer.h:1.3 --- llvm/include/llvm/Bytecode/Writer.h:1.2 Mon Apr 29 12:41:28 2002 +++ llvm/include/llvm/Bytecode/Writer.h Tue Sep 30 13:37:43 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Bytecode/Writer.h - Writer for VM bytecode files ----*- C++ -*--=// +//===-- llvm/Bytecode/Writer.h - Writer for VM bytecode files ---*- C++ -*-===// // // This functionality is implemented by the lib/BytecodeWriter library. // This library is used to write VM bytecode files to an iostream. First, you From lattner at cs.uiuc.edu Tue Sep 30 13:38:18 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:38:18 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Assembly/CWriter.h CachedWriter.h Parser.h PrintModulePass.h Writer.h Message-ID: <200309301837.NAA18182@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Assembly: CWriter.h updated: 1.2 -> 1.3 CachedWriter.h updated: 1.9 -> 1.10 Parser.h updated: 1.5 -> 1.6 PrintModulePass.h updated: 1.12 -> 1.13 Writer.h updated: 1.24 -> 1.25 --- Log message: Standardize header file comments --- Diffs of the changes: Index: llvm/include/llvm/Assembly/CWriter.h diff -u llvm/include/llvm/Assembly/CWriter.h:1.2 llvm/include/llvm/Assembly/CWriter.h:1.3 --- llvm/include/llvm/Assembly/CWriter.h:1.2 Fri Aug 30 19:28:25 2002 +++ llvm/include/llvm/Assembly/CWriter.h Tue Sep 30 13:37:41 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Assembly/CWriter.h - C Printer for LLVM programs --*- C++ -*--===// +//===-- llvm/Assembly/CWriter.h - C Printer for LLVM programs ---*- C++ -*-===// // // This functionality is implemented by the lib/CWriter library. This library // is used to print C language files to an iostream. Index: llvm/include/llvm/Assembly/CachedWriter.h diff -u llvm/include/llvm/Assembly/CachedWriter.h:1.9 llvm/include/llvm/Assembly/CachedWriter.h:1.10 --- llvm/include/llvm/Assembly/CachedWriter.h:1.9 Sat Apr 27 23:47:33 2002 +++ llvm/include/llvm/Assembly/CachedWriter.h Tue Sep 30 13:37:41 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Assembly/CachedWriter.h - Printer Accellerator ------*- C++ -*--=// +//===-- llvm/Assembly/CachedWriter.h - Printer Accellerator -----*- C++ -*-===// // // This file defines a 'CacheWriter' class that is used to accelerate printing // chunks of LLVM. This is used when a module is not being changed, but random Index: llvm/include/llvm/Assembly/Parser.h diff -u llvm/include/llvm/Assembly/Parser.h:1.5 llvm/include/llvm/Assembly/Parser.h:1.6 --- llvm/include/llvm/Assembly/Parser.h:1.5 Fri Aug 30 17:51:21 2002 +++ llvm/include/llvm/Assembly/Parser.h Tue Sep 30 13:37:41 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Assembly/Parser.h - Parser for VM assembly files ----*- C++ -*--=// +//===-- llvm/Assembly/Parser.h - Parser for VM assembly files ---*- C++ -*-===// // // These classes are implemented by the lib/AsmParser library. // @@ -27,8 +27,7 @@ // ParseException - For when an exceptional event is generated by the parser. // This class lets you print out the exception message // -class ParseException { -public: +struct ParseException { ParseException(const std::string &filename, const std::string &message, int LineNo = -1, int ColNo = -1); Index: llvm/include/llvm/Assembly/PrintModulePass.h diff -u llvm/include/llvm/Assembly/PrintModulePass.h:1.12 llvm/include/llvm/Assembly/PrintModulePass.h:1.13 --- llvm/include/llvm/Assembly/PrintModulePass.h:1.12 Thu Sep 19 15:49:25 2002 +++ llvm/include/llvm/Assembly/PrintModulePass.h Tue Sep 30 13:37:41 2003 @@ -1,4 +1,4 @@ -//===- llvm/Assembly/PrintModulePass.h - Printing Pass -----------*- C++ -*--=// +//===- llvm/Assembly/PrintModulePass.h - Printing Pass ----------*- C++ -*-===// // // This file defines two passes to print out a module. The PrintModulePass pass // simply prints out the entire module when it is executed. The Index: llvm/include/llvm/Assembly/Writer.h diff -u llvm/include/llvm/Assembly/Writer.h:1.24 llvm/include/llvm/Assembly/Writer.h:1.25 --- llvm/include/llvm/Assembly/Writer.h:1.24 Wed Jul 10 11:48:14 2002 +++ llvm/include/llvm/Assembly/Writer.h Tue Sep 30 13:37:41 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Assembly/Writer.h - Printer for VM assembly files ---*- C++ -*--=// +//===-- llvm/Assembly/Writer.h - Printer for VM assembly files --*- C++ -*-===// // // This functionality is implemented by the lib/Assembly/Writer library. // This library is used to print VM assembly language files to an iostream. It @@ -21,13 +21,11 @@ class Module; class Value; - // WriteTypeSymbolic - This attempts to write the specified type as a symbolic // type, iff there is an entry in the modules symbol table for the specified // type or one of it's component types. This is slower than a simple x << Type; // std::ostream &WriteTypeSymbolic(std::ostream &, const Type *, const Module *M); - // WriteAsOperand - Write the name of the specified value out to the specified // ostream. This can be useful when you just want to print int %reg126, not the From lattner at cs.uiuc.edu Tue Sep 30 13:39:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:39:01 2003 Subject: [llvm-commits] CVS: llvm/include/Support/BitSetVector.h Casting.h CommandLine.h DOTGraphTraits.h DataTypes.h DepthFirstIterator.h EquivalenceClasses.h GraphTraits.h GraphWriter.h HashExtras.h MathExtras.h PostOrderIterator.h STLExtras.h SetOperations.h Signals.h StringExtras.h SystemUtils.h Tree.h TypeInfo.h hash_map ilist Message-ID: <200309301838.NAA18683@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: BitSetVector.h updated: 1.8 -> 1.9 Casting.h updated: 1.8 -> 1.9 CommandLine.h updated: 1.25 -> 1.26 DOTGraphTraits.h updated: 1.5 -> 1.6 DataTypes.h updated: 1.13 -> 1.14 DepthFirstIterator.h updated: 1.6 -> 1.7 EquivalenceClasses.h updated: 1.3 -> 1.4 GraphTraits.h updated: 1.3 -> 1.4 GraphWriter.h updated: 1.13 -> 1.14 HashExtras.h updated: 1.7 -> 1.8 MathExtras.h updated: 1.6 -> 1.7 PostOrderIterator.h updated: 1.11 -> 1.12 STLExtras.h updated: 1.6 -> 1.7 SetOperations.h updated: 1.2 -> 1.3 Signals.h updated: 1.4 -> 1.5 StringExtras.h updated: 1.4 -> 1.5 SystemUtils.h updated: 1.6 -> 1.7 Tree.h updated: 1.6 -> 1.7 TypeInfo.h updated: 1.2 -> 1.3 hash_map updated: 1.11 -> 1.12 ilist updated: 1.10 -> 1.11 --- Log message: Standardize header file comments --- Diffs of the changes: Index: llvm/include/Support/BitSetVector.h diff -u llvm/include/Support/BitSetVector.h:1.8 llvm/include/Support/BitSetVector.h:1.9 --- llvm/include/Support/BitSetVector.h:1.8 Mon Jun 30 16:58:23 2003 +++ llvm/include/Support/BitSetVector.h Tue Sep 30 13:37:23 2003 @@ -1,13 +1,11 @@ -//===-- BitVectorSet.h - A bit-vector representation of sets -----*- C++ -*--=// +//===-- BitVectorSet.h - A bit-vector representation of sets ----*- C++ -*-===// // -// class BitVectorSet -- -// -// An implementation of the bit-vector representation of sets. -// Unlike vector, this allows much more efficient parallel set -// operations on bits, by using the bitset template . The bitset template -// unfortunately can only represent sets with a size chosen at compile-time. -// We therefore use a vector of bitsets. The maxmimum size of our sets -// (i.e., the size of the universal set) can be chosen at creation time. +// This is an implementation of the bit-vector representation of sets. Unlike +// vector, this allows much more efficient parallel set operations on +// bits, by using the bitset template. The bitset template unfortunately can +// only represent sets with a size chosen at compile-time. We therefore use a +// vector of bitsets. The maxmimum size of our sets (i.e., the size of the +// universal set) can be chosen at creation time. // // External functions: // Index: llvm/include/Support/Casting.h diff -u llvm/include/Support/Casting.h:1.8 llvm/include/Support/Casting.h:1.9 --- llvm/include/Support/Casting.h:1.8 Wed Sep 10 00:30:09 2003 +++ llvm/include/Support/Casting.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===-- Support/Casting.h - Allow flexible, checked, casts -------*- C++ -*--=// +//===-- Support/Casting.h - Allow flexible, checked, casts ------*- C++ -*-===// // // This file defines the isa(), cast(), dyn_cast(), cast_or_null(), // and dyn_cast_or_null() templates. Index: llvm/include/Support/CommandLine.h diff -u llvm/include/Support/CommandLine.h:1.25 llvm/include/Support/CommandLine.h:1.26 --- llvm/include/Support/CommandLine.h:1.25 Fri Aug 22 09:26:59 2003 +++ llvm/include/Support/CommandLine.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===- Support/CommandLine.h - Flexible Command line parser ------*- C++ -*--=// +//===- Support/CommandLine.h - Flexible Command line parser -----*- C++ -*-===// // // This class implements a command line argument processor that is useful when // creating a tool. It provides a simple, minimalistic interface that is easily Index: llvm/include/Support/DOTGraphTraits.h diff -u llvm/include/Support/DOTGraphTraits.h:1.5 llvm/include/Support/DOTGraphTraits.h:1.6 --- llvm/include/Support/DOTGraphTraits.h:1.5 Mon Aug 18 09:26:23 2003 +++ llvm/include/Support/DOTGraphTraits.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===-- Support/DotGraphTraits.h - Customize .dot output -------*- C++ -*--===// +//===-- Support/DotGraphTraits.h - Customize .dot output --------*- C++ -*-===// // // This file defines a template class that can be used to customize dot output // graphs generated by the GraphWriter.h file. The default implementation of Index: llvm/include/Support/DataTypes.h diff -u llvm/include/Support/DataTypes.h:1.13 llvm/include/Support/DataTypes.h:1.14 --- llvm/include/Support/DataTypes.h:1.13 Mon Aug 11 15:04:57 2003 +++ llvm/include/Support/DataTypes.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===-- include/Support/DataTypes.h - Define fixed size types ----*- C++ -*--=// +//===-- include/Support/DataTypes.h - Define fixed size types ---*- C++ -*-===// // // This file contains definitions to figure out the size of _HOST_ data types. // This file is important because different host OS's define different macros, Index: llvm/include/Support/DepthFirstIterator.h diff -u llvm/include/Support/DepthFirstIterator.h:1.6 llvm/include/Support/DepthFirstIterator.h:1.7 --- llvm/include/Support/DepthFirstIterator.h:1.6 Fri Jul 25 12:49:28 2003 +++ llvm/include/Support/DepthFirstIterator.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===- Support/DepthFirstIterator.h - Depth First iterator -------*- C++ -*--=// +//===- Support/DepthFirstIterator.h - Depth First iterator ------*- C++ -*-===// // // This file builds on the Support/GraphTraits.h file to build generic depth // first graph iterator. Index: llvm/include/Support/EquivalenceClasses.h diff -u llvm/include/Support/EquivalenceClasses.h:1.3 llvm/include/Support/EquivalenceClasses.h:1.4 --- llvm/include/Support/EquivalenceClasses.h:1.3 Mon Jun 16 19:35:55 2003 +++ llvm/include/Support/EquivalenceClasses.h Tue Sep 30 13:37:23 2003 @@ -1,12 +1,11 @@ -//===-- Support/EquivalenceClasses.h -------------------------*- C++ -*--=// +//===-- Support/EquivalenceClasses.h ----------------------------*- C++ -*-===// // -// Generic implementation of equivalence classes and implementation of -// union-find algorithms -// A not-so-fancy implementation: 2 level tree i.e root and one more level -// Overhead of a union = size of the equivalence class being attached -// Overhead of a find = 1. +// Generic implementation of equivalence classes and implementation of +// union-find algorithms A not-so-fancy implementation: 2 level tree i.e root +// and one more level Overhead of a union = size of the equivalence class being +// attached Overhead of a find = 1. // -//===------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #ifndef SUPPORT_EQUIVALENCECLASSES_H #define SUPPORT_EQUIVALENCECLASSES_H @@ -68,7 +67,6 @@ return EqClass; ElemTy classLeader = Elem2ECLeaderMap[Element1]; - for (typename std::map::iterator ElemI = Elem2ECLeaderMap.begin(), ElemE = Elem2ECLeaderMap.end(); ElemI != ElemE; ++ElemI) { @@ -77,13 +75,11 @@ } return EqClass; - } std::map& getLeaderMap() { return Elem2ECLeaderMap ; } - }; #endif Index: llvm/include/Support/GraphTraits.h diff -u llvm/include/Support/GraphTraits.h:1.3 llvm/include/Support/GraphTraits.h:1.4 --- llvm/include/Support/GraphTraits.h:1.3 Mon Jun 16 19:35:55 2003 +++ llvm/include/Support/GraphTraits.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===-- Support/GraphTraits.h - Graph traits template ------------*- C++ -*--=// +//===-- Support/GraphTraits.h - Graph traits template -----------*- C++ -*-===// // // This file defines the little GraphTraits template class that should be // specialized by classes that want to be iteratable by generic graph iterators. Index: llvm/include/Support/GraphWriter.h diff -u llvm/include/Support/GraphWriter.h:1.13 llvm/include/Support/GraphWriter.h:1.14 --- llvm/include/Support/GraphWriter.h:1.13 Wed Feb 5 13:40:59 2003 +++ llvm/include/Support/GraphWriter.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===-- Support/GraphWriter.h - Write a graph to a .dot file ---*- C++ -*--===// +//===-- Support/GraphWriter.h - Write a graph to a .dot file ----*- C++ -*-===// // // This file defines a simple interface that can be used to print out generic // LLVM graphs to ".dot" files. "dot" is a tool that is part of the AT&T Index: llvm/include/Support/HashExtras.h diff -u llvm/include/Support/HashExtras.h:1.7 llvm/include/Support/HashExtras.h:1.8 --- llvm/include/Support/HashExtras.h:1.7 Fri Aug 15 12:52:02 2003 +++ llvm/include/Support/HashExtras.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===-- HashExtras.h - Useful functions for STL hash containers --*- C++ -*--=// +//===-- HashExtras.h - Useful functions for STL hash containers -*- C++ -*-===// // // This file contains some templates that are useful if you are working with the // STL Hashed containers. Index: llvm/include/Support/MathExtras.h diff -u llvm/include/Support/MathExtras.h:1.6 llvm/include/Support/MathExtras.h:1.7 --- llvm/include/Support/MathExtras.h:1.6 Mon Jun 16 19:35:55 2003 +++ llvm/include/Support/MathExtras.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===-- Support/MathExtras.h - Useful math functions -------------*- C++ -*--=// +//===-- Support/MathExtras.h - Useful math functions ------------*- C++ -*-===// // // This file contains some functions that are useful for math stuff. // Index: llvm/include/Support/PostOrderIterator.h diff -u llvm/include/Support/PostOrderIterator.h:1.11 llvm/include/Support/PostOrderIterator.h:1.12 --- llvm/include/Support/PostOrderIterator.h:1.11 Mon Aug 18 09:26:23 2003 +++ llvm/include/Support/PostOrderIterator.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===-- Support/PostOrderIterator.h - Generic PostOrder iterator -*- C++ -*--=// +//===- Support/PostOrderIterator.h - Generic PostOrder iterator -*- C++ -*-===// // // This file builds on the Support/GraphTraits.h file to build a generic graph // post order iterator. This should work over any graph type that has a Index: llvm/include/Support/STLExtras.h diff -u llvm/include/Support/STLExtras.h:1.6 llvm/include/Support/STLExtras.h:1.7 --- llvm/include/Support/STLExtras.h:1.6 Mon Jun 16 19:35:55 2003 +++ llvm/include/Support/STLExtras.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===-- STLExtras.h - Useful functions when working with the STL -*- C++ -*--=// +//===- STLExtras.h - Useful functions when working with the STL -*- C++ -*-===// // // This file contains some templates that are useful if you are working with the // STL at all. Index: llvm/include/Support/SetOperations.h diff -u llvm/include/Support/SetOperations.h:1.2 llvm/include/Support/SetOperations.h:1.3 --- llvm/include/Support/SetOperations.h:1.2 Mon Jun 16 19:35:55 2003 +++ llvm/include/Support/SetOperations.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===-- Support/SetOperations.h - Generic Set Operations ---------*- C++ -*--=// +//===-- Support/SetOperations.h - Generic Set Operations --------*- C++ -*-===// // // This file defines generic set operations that may be used on set's of // different types, and different element types. Index: llvm/include/Support/Signals.h diff -u llvm/include/Support/Signals.h:1.4 llvm/include/Support/Signals.h:1.5 --- llvm/include/Support/Signals.h:1.4 Fri Aug 1 14:16:18 2003 +++ llvm/include/Support/Signals.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===- Support/Signals.h - Signal Handling support -------------*- C++ -*-===// +//===- Support/Signals.h - Signal Handling support --------------*- C++ -*-===// // // This file defines some helpful functions for dealing with the possibility of // unix signals occuring while your program is running. Index: llvm/include/Support/StringExtras.h diff -u llvm/include/Support/StringExtras.h:1.4 llvm/include/Support/StringExtras.h:1.5 --- llvm/include/Support/StringExtras.h:1.4 Mon Jun 16 19:35:55 2003 +++ llvm/include/Support/StringExtras.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===-- Support/StringExtras.h - Useful string functions ---------*- C++ -*--=// +//===-- Support/StringExtras.h - Useful string functions --------*- C++ -*-===// // // This file contains some functions that are useful when dealing with strings. // Index: llvm/include/Support/SystemUtils.h diff -u llvm/include/Support/SystemUtils.h:1.6 llvm/include/Support/SystemUtils.h:1.7 --- llvm/include/Support/SystemUtils.h:1.6 Mon Sep 29 17:37:57 2003 +++ llvm/include/Support/SystemUtils.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===- SystemUtils.h - Utilities to do low-level system stuff --*- C++ -*--===// +//===- SystemUtils.h - Utilities to do low-level system stuff ---*- C++ -*-===// // // This file contains functions used to do a variety of low-level, often // system-specific, tasks. Index: llvm/include/Support/Tree.h diff -u llvm/include/Support/Tree.h:1.6 llvm/include/Support/Tree.h:1.7 --- llvm/include/Support/Tree.h:1.6 Mon Jun 30 16:58:23 2003 +++ llvm/include/Support/Tree.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===- Support/Tree.h - Generic n-way tree structure -------------*- C++ -*--=// +//===- Support/Tree.h - Generic n-way tree structure ------------*- C++ -*-===// // // This class defines a generic N way tree node structure. The tree structure // is immutable after creation, but the payload contained within it is not. Index: llvm/include/Support/TypeInfo.h diff -u llvm/include/Support/TypeInfo.h:1.2 llvm/include/Support/TypeInfo.h:1.3 --- llvm/include/Support/TypeInfo.h:1.2 Mon Jun 16 19:35:55 2003 +++ llvm/include/Support/TypeInfo.h Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===- Support/TypeInfo.h - Support class for type_info objects --*- C++ -*--=// +//===- Support/TypeInfo.h - Support class for type_info objects -*- C++ -*-===// // // This class makes std::type_info objects behave like first class objects that // can be put in maps and hashtables. This code is based off of code in the Index: llvm/include/Support/hash_map diff -u llvm/include/Support/hash_map:1.11 llvm/include/Support/hash_map:1.12 --- llvm/include/Support/hash_map:1.11 Fri Aug 15 15:01:10 2003 +++ llvm/include/Support/hash_map Tue Sep 30 13:37:23 2003 @@ -1,5 +1,4 @@ //===-- Support/hash_map - "Portable" wrapper around hash_map ---*- C++ -*-===// -// vim:ft=cpp // // This file provides a wrapper around the mysterious header file // that seems to move around between GCC releases into and out of namespaces at Index: llvm/include/Support/ilist diff -u llvm/include/Support/ilist:1.10 llvm/include/Support/ilist:1.11 --- llvm/include/Support/ilist:1.10 Fri Aug 29 09:22:29 2003 +++ llvm/include/Support/ilist Tue Sep 30 13:37:23 2003 @@ -1,4 +1,4 @@ -//===-- - Intrusive Linked List Template ---------*- C++ -*--=// +//===-- Support/ilist - Intrusive Linked List Template ----------*- C++ -*-===// // // This file defines classes to implement an intrusive doubly linked list class // (ie each node of the list must contain a next and previous field for the From lattner at cs.uiuc.edu Tue Sep 30 13:39:06 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:39:06 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h Linker.h Local.h Message-ID: <200309301838.NAA18469@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms/Utils: BasicBlockUtils.h updated: 1.3 -> 1.4 Linker.h updated: 1.5 -> 1.6 Local.h updated: 1.9 -> 1.10 --- Log message: Standardize header file comments --- Diffs of the changes: Index: llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h diff -u llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h:1.3 llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h:1.4 --- llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h:1.3 Mon Jul 29 17:32:06 2002 +++ llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h Tue Sep 30 13:37:50 2003 @@ -1,4 +1,4 @@ -//===-- Transform/Utils/BasicBlockUtils.h - BasicBlock Utilities -*- C++ -*-==// +//===-- Transform/Utils/BasicBlockUtils.h - BasicBlock Utils ----*- C++ -*-===// // // This family of functions perform manipulations on basic blocks, and // instructions contained within basic blocks. Index: llvm/include/llvm/Transforms/Utils/Linker.h diff -u llvm/include/llvm/Transforms/Utils/Linker.h:1.5 llvm/include/llvm/Transforms/Utils/Linker.h:1.6 --- llvm/include/llvm/Transforms/Utils/Linker.h:1.5 Tue May 7 13:34:57 2002 +++ llvm/include/llvm/Transforms/Utils/Linker.h Tue Sep 30 13:37:50 2003 @@ -1,4 +1,4 @@ -//===- llvm/Transforms/Utils/Linker.h - Module Linker Interface --*- C++ -*--=// +//===- llvm/Transforms/Utils/Linker.h - Module Linker Interface -*- C++ -*-===// // // This file defines the interface to the module linker. // Index: llvm/include/llvm/Transforms/Utils/Local.h diff -u llvm/include/llvm/Transforms/Utils/Local.h:1.9 llvm/include/llvm/Transforms/Utils/Local.h:1.10 --- llvm/include/llvm/Transforms/Utils/Local.h:1.9 Tue May 20 16:01:12 2003 +++ llvm/include/llvm/Transforms/Utils/Local.h Tue Sep 30 13:37:50 2003 @@ -1,4 +1,4 @@ -//===-- Local.h - Functions to perform local transformations -----*- C++ -*--=// +//===-- Local.h - Functions to perform local transformations ----*- C++ -*-===// // // This family of functions perform various local transformations to the // program. From lattner at cs.uiuc.edu Tue Sep 30 13:39:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:39:10 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/MutateStructTypes.h Scalar.h Message-ID: <200309301837.NAA18349@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: MutateStructTypes.h updated: 1.9 -> 1.10 Scalar.h updated: 1.24 -> 1.25 --- Log message: Standardize header file comments --- Diffs of the changes: Index: llvm/include/llvm/Transforms/MutateStructTypes.h diff -u llvm/include/llvm/Transforms/MutateStructTypes.h:1.9 llvm/include/llvm/Transforms/MutateStructTypes.h:1.10 --- llvm/include/llvm/Transforms/MutateStructTypes.h:1.9 Tue Jun 25 11:11:20 2002 +++ llvm/include/llvm/Transforms/MutateStructTypes.h Tue Sep 30 13:37:49 2003 @@ -1,4 +1,4 @@ -//===- llvm/Transforms/MutateStructTypes.h - Change struct defns -*- C++ -*--=// +//===-- llvm/Transforms/MutateStructTypes.h - Rearrange structs -*- C++ -*-===// // // This pass is used to change structure accesses and type definitions in some // way. It can be used to arbitrarily permute structure fields, safely, without Index: llvm/include/llvm/Transforms/Scalar.h diff -u llvm/include/llvm/Transforms/Scalar.h:1.24 llvm/include/llvm/Transforms/Scalar.h:1.25 --- llvm/include/llvm/Transforms/Scalar.h:1.24 Sat Sep 20 00:14:01 2003 +++ llvm/include/llvm/Transforms/Scalar.h Tue Sep 30 13:37:49 2003 @@ -1,4 +1,4 @@ -//===-- Scalar.h - Scalar Transformations ------------------------*- C++ -*-==// +//===-- Scalar.h - Scalar Transformations -----------------------*- C++ -*-===// // // This header file defines prototypes for accessor functions that expose passes // in the Scalar transformations library. From lattner at cs.uiuc.edu Tue Sep 30 13:39:15 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:39:15 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/AbstractTypeUser.h BasicBlock.h Constant.h ConstantHandling.h Constants.h DerivedTypes.h GlobalValue.h GlobalVariable.h InstrTypes.h Instruction.def Module.h Pass.h PassAnalysisSupport.h PassManager.h SlotCalculator.h SymbolTable.h SymbolTableListTraits.h Type.def Type.h User.h Value.h iOther.h iPHINode.h Message-ID: <200309301838.NAA18949@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: AbstractTypeUser.h updated: 1.10 -> 1.11 BasicBlock.h updated: 1.30 -> 1.31 Constant.h updated: 1.9 -> 1.10 ConstantHandling.h updated: 1.28 -> 1.29 Constants.h updated: 1.29 -> 1.30 DerivedTypes.h updated: 1.38 -> 1.39 GlobalValue.h updated: 1.9 -> 1.10 GlobalVariable.h updated: 1.22 -> 1.23 InstrTypes.h updated: 1.31 -> 1.32 Instruction.def updated: 1.7 -> 1.8 Module.h updated: 1.34 -> 1.35 Pass.h updated: 1.38 -> 1.39 PassAnalysisSupport.h updated: 1.14 -> 1.15 PassManager.h updated: 1.6 -> 1.7 SlotCalculator.h updated: 1.9 -> 1.10 SymbolTable.h updated: 1.23 -> 1.24 SymbolTableListTraits.h updated: 1.1 -> 1.2 Type.def updated: 1.3 -> 1.4 Type.h updated: 1.28 -> 1.29 User.h updated: 1.20 -> 1.21 Value.h updated: 1.42 -> 1.43 iOther.h updated: 1.36 -> 1.37 iPHINode.h updated: 1.10 -> 1.11 --- Log message: Standardize header file comments --- Diffs of the changes: Index: llvm/include/llvm/AbstractTypeUser.h diff -u llvm/include/llvm/AbstractTypeUser.h:1.10 llvm/include/llvm/AbstractTypeUser.h:1.11 --- llvm/include/llvm/AbstractTypeUser.h:1.10 Fri Jul 25 12:39:33 2003 +++ llvm/include/llvm/AbstractTypeUser.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/AbstractTypeUser.h - AbstractTypeUser Interface -----*- C++ -*--=// +//===-- llvm/AbstractTypeUser.h - AbstractTypeUser Interface ----*- C++ -*-===// // // The AbstractTypeUser class is an interface to be implemented by classes who // could possible use an abstract type. Abstract types are denoted by the Index: llvm/include/llvm/BasicBlock.h diff -u llvm/include/llvm/BasicBlock.h:1.30 llvm/include/llvm/BasicBlock.h:1.31 --- llvm/include/llvm/BasicBlock.h:1.30 Sat Aug 30 21:50:07 2003 +++ llvm/include/llvm/BasicBlock.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/BasicBlock.h - Represent a basic block in the VM ----*- C++ -*--=// +//===-- llvm/BasicBlock.h - Represent a basic block in the VM ---*- C++ -*-===// /// /// \class BasicBlock /// Index: llvm/include/llvm/Constant.h diff -u llvm/include/llvm/Constant.h:1.9 llvm/include/llvm/Constant.h:1.10 --- llvm/include/llvm/Constant.h:1.9 Fri Aug 29 00:36:05 2003 +++ llvm/include/llvm/Constant.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Constant.h - Constant class definition --------------*- C++ -*--=// +//===-- llvm/Constant.h - Constant class definition -------------*- C++ -*-===// // // This file contains the declaration of the Constant class. // Index: llvm/include/llvm/ConstantHandling.h diff -u llvm/include/llvm/ConstantHandling.h:1.28 llvm/include/llvm/ConstantHandling.h:1.29 --- llvm/include/llvm/ConstantHandling.h:1.28 Wed Jul 23 12:21:17 2003 +++ llvm/include/llvm/ConstantHandling.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- ConstantHandling.h - Stuff for manipulating constants ----*- C++ -*--=// +//===-- ConstantHandling.h - Stuff for manipulating constants ---*- C++ -*-===// // // This file contains the declarations of some cool operators that allow you // to do natural things with constant pool values. Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.29 llvm/include/llvm/Constants.h:1.30 --- llvm/include/llvm/Constants.h:1.29 Fri Aug 29 00:36:05 2003 +++ llvm/include/llvm/Constants.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Constants.h - Constant class subclass definitions ---*- C++ -*--=// +//===-- llvm/Constants.h - Constant class subclass definitions --*- C++ -*-===// // // This file contains the declarations for the subclasses of Constant, which // represent the different type of constant pool values Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.38 llvm/include/llvm/DerivedTypes.h:1.39 --- llvm/include/llvm/DerivedTypes.h:1.38 Thu Sep 4 21:30:18 2003 +++ llvm/include/llvm/DerivedTypes.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/DerivedTypes.h - Classes for handling data types ----*- C++ -*--=// +//===-- llvm/DerivedTypes.h - Classes for handling data types ---*- C++ -*-===// // // This file contains the declarations of classes that represent "derived // types". These are things like "arrays of x" or "structure of x, y, z" or Index: llvm/include/llvm/GlobalValue.h diff -u llvm/include/llvm/GlobalValue.h:1.9 llvm/include/llvm/GlobalValue.h:1.10 --- llvm/include/llvm/GlobalValue.h:1.9 Wed Apr 16 15:28:30 2003 +++ llvm/include/llvm/GlobalValue.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/GlobalValue.h - Class to represent a global value ---*- C++ -*--=// +//===-- llvm/GlobalValue.h - Class to represent a global value --*- C++ -*-===// // // This file is a common base class of all globally definable objects. As such, // it is subclassed by GlobalVariable and by Function. This is used because you Index: llvm/include/llvm/GlobalVariable.h diff -u llvm/include/llvm/GlobalVariable.h:1.22 llvm/include/llvm/GlobalVariable.h:1.23 --- llvm/include/llvm/GlobalVariable.h:1.22 Mon Jun 30 16:58:26 2003 +++ llvm/include/llvm/GlobalVariable.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Global.h - Class to represent a global variable -----*- C++ -*--=// +//===-- llvm/Global.h - Class to represent a global variable ----*- C++ -*-===// // // This file contains the declaration of the GlobalVariable class, which // represents a single global variable (or constant) in the VM. Index: llvm/include/llvm/InstrTypes.h diff -u llvm/include/llvm/InstrTypes.h:1.31 llvm/include/llvm/InstrTypes.h:1.32 --- llvm/include/llvm/InstrTypes.h:1.31 Thu Aug 21 17:08:59 2003 +++ llvm/include/llvm/InstrTypes.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/InstrTypes.h - Important Instruction subclasses -----*- C++ -*--=// +//===-- llvm/InstrTypes.h - Important Instruction subclasses ----*- C++ -*-===// // // This file defines various meta classes of instructions that exist in the VM // representation. Specific concrete subclasses of these may be found in the Index: llvm/include/llvm/Instruction.def diff -u llvm/include/llvm/Instruction.def:1.7 llvm/include/llvm/Instruction.def:1.8 --- llvm/include/llvm/Instruction.def:1.7 Mon Sep 8 13:54:01 2003 +++ llvm/include/llvm/Instruction.def Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Instruction.def - File that describes Instructions --*- C++ -*--=// +//===-- llvm/Instruction.def - File that describes Instructions -*- C++ -*-===// // // This file contains descriptions of the various LLVM instructions. This is // used as a central place for enumerating the different instructions and Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.34 llvm/include/llvm/Module.h:1.35 --- llvm/include/llvm/Module.h:1.34 Sat Aug 30 19:19:18 2003 +++ llvm/include/llvm/Module.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Module.h - C++ class to represent a VM module -------*- C++ -*--=// +//===-- llvm/Module.h - C++ class to represent a VM module ------*- C++ -*-===// // // This file contains the declarations for the Module class that is used to // maintain all the information related to a VM module. Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.38 llvm/include/llvm/Pass.h:1.39 --- llvm/include/llvm/Pass.h:1.38 Fri Aug 29 09:26:51 2003 +++ llvm/include/llvm/Pass.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===- llvm/Pass.h - Base class for XForm Passes -----------------*- C++ -*--=// +//===- llvm/Pass.h - Base class for Passes ----------------------*- C++ -*-===// // // This file defines a base class that indicates that a specified class is a // transformation pass implementation. Index: llvm/include/llvm/PassAnalysisSupport.h diff -u llvm/include/llvm/PassAnalysisSupport.h:1.14 llvm/include/llvm/PassAnalysisSupport.h:1.15 --- llvm/include/llvm/PassAnalysisSupport.h:1.14 Fri Aug 29 09:26:51 2003 +++ llvm/include/llvm/PassAnalysisSupport.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===- llvm/PassAnalysisSupport.h - Analysis Pass Support code ---*- C++ -*-==// +//===- llvm/PassAnalysisSupport.h - Analysis Pass Support code --*- C++ -*-===// // // This file defines stuff that is used to define and "use" Analysis Passes. // This file is automatically #included by Pass.h, so: Index: llvm/include/llvm/PassManager.h diff -u llvm/include/llvm/PassManager.h:1.6 llvm/include/llvm/PassManager.h:1.7 --- llvm/include/llvm/PassManager.h:1.6 Thu Aug 14 01:07:57 2003 +++ llvm/include/llvm/PassManager.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===- llvm/PassManager.h - Container for Passes -----------------*- C++ -*--=// +//===- llvm/PassManager.h - Container for Passes ----------------*- C++ -*-===// // // This file defines the PassManager class. This class is used to hold, // maintain, and optimize execution of Passes. The PassManager class ensures Index: llvm/include/llvm/SlotCalculator.h diff -u llvm/include/llvm/SlotCalculator.h:1.9 llvm/include/llvm/SlotCalculator.h:1.10 --- llvm/include/llvm/SlotCalculator.h:1.9 Tue Apr 9 13:35:38 2002 +++ llvm/include/llvm/SlotCalculator.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/SlotCalculator.h - Calculate value slots ------------*- C++ -*-==// +//===-- llvm/SlotCalculator.h - Calculate value slots -----------*- C++ -*-===// // // This class calculates the slots that values will land in. This is useful for // when writing bytecode or assembly out, because you have to know these things. Index: llvm/include/llvm/SymbolTable.h diff -u llvm/include/llvm/SymbolTable.h:1.23 llvm/include/llvm/SymbolTable.h:1.24 --- llvm/include/llvm/SymbolTable.h:1.23 Sat Aug 23 18:15:10 2003 +++ llvm/include/llvm/SymbolTable.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/SymbolTable.h - Implement a type plane'd symtab ------*- C++ -*-=// +//===-- llvm/SymbolTable.h - Implement a type plane'd symtab ----*- C++ -*-===// // // This file implements a symbol table that has planed broken up by type. // Identical types may have overlapping symbol names as long as they are Index: llvm/include/llvm/SymbolTableListTraits.h diff -u llvm/include/llvm/SymbolTableListTraits.h:1.1 llvm/include/llvm/SymbolTableListTraits.h:1.2 --- llvm/include/llvm/SymbolTableListTraits.h:1.1 Tue Jun 25 11:10:41 2002 +++ llvm/include/llvm/SymbolTableListTraits.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/SymbolTableListTraits.h - Traits for iplist -------*- C++ -*--===// +//===-- llvm/SymbolTableListTraits.h - Traits for iplist --------*- C++ -*-===// // // This file defines a generic class that is used to implement the automatic // symbol table manipulation that occurs when you put (for example) a named Index: llvm/include/llvm/Type.def diff -u llvm/include/llvm/Type.def:1.3 llvm/include/llvm/Type.def:1.4 --- llvm/include/llvm/Type.def:1.3 Mon May 6 10:10:15 2002 +++ llvm/include/llvm/Type.def Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Type.def - File that describes various LLVM types ---*- C++ -*--=// +//===-- llvm/Type.def - File that describes various LLVM types --*- C++ -*-===// // // This file contains descriptions of the various LLVM types and derived types. // This file serves as a source of in source documentation and a can be Index: llvm/include/llvm/Type.h diff -u llvm/include/llvm/Type.h:1.28 llvm/include/llvm/Type.h:1.29 --- llvm/include/llvm/Type.h:1.28 Tue Sep 2 16:54:56 2003 +++ llvm/include/llvm/Type.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Type.h - Classes for handling data types ------------*- C++ -*--=// +//===-- llvm/Type.h - Classes for handling data types -----------*- C++ -*-===// // // This file contains the declaration of the Type class. For more "Type" type // stuff, look in DerivedTypes.h. @@ -37,8 +37,7 @@ class StructType; class OpaqueType; -class Type : public Value { -public: +struct Type : public Value { ///===-------------------------------------------------------------------===// /// Definitions of all of the base types for the Type system. Based on this /// value, you can cast to a "DerivedType" subclass (see DerivedTypes.h) Index: llvm/include/llvm/User.h diff -u llvm/include/llvm/User.h:1.20 llvm/include/llvm/User.h:1.21 --- llvm/include/llvm/User.h:1.20 Sat Jun 21 22:07:32 2003 +++ llvm/include/llvm/User.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/User.h - User class definition ----------------------*- C++ -*--=// +//===-- llvm/User.h - User class definition ---------------------*- C++ -*-===// // // This class defines the interface that one who 'use's a Value must implement. // Each instance of the Value class keeps track of what User's have handles Index: llvm/include/llvm/Value.h diff -u llvm/include/llvm/Value.h:1.42 llvm/include/llvm/Value.h:1.43 --- llvm/include/llvm/Value.h:1.42 Fri Aug 29 00:08:31 2003 +++ llvm/include/llvm/Value.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Value.h - Definition of the Value class -------------*- C++ -*--=// +//===-- llvm/Value.h - Definition of the Value class ------------*- C++ -*-===// // // This file defines the very important Value class. This is subclassed by a // bunch of other important classes, like Instruction, Function, Type, etc... Index: llvm/include/llvm/iOther.h diff -u llvm/include/llvm/iOther.h:1.36 llvm/include/llvm/iOther.h:1.37 --- llvm/include/llvm/iOther.h:1.36 Sat Jun 21 22:07:32 2003 +++ llvm/include/llvm/iOther.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/iOther.h - "Other" instruction node definitions -----*- C++ -*--=// +//===-- llvm/iOther.h - "Other" instruction node definitions ----*- C++ -*-===// // // This file contains the declarations for instructions that fall into the // grandiose 'other' catagory... Index: llvm/include/llvm/iPHINode.h diff -u llvm/include/llvm/iPHINode.h:1.10 llvm/include/llvm/iPHINode.h:1.11 --- llvm/include/llvm/iPHINode.h:1.10 Sat Jun 21 22:07:32 2003 +++ llvm/include/llvm/iPHINode.h Tue Sep 30 13:37:37 2003 @@ -1,4 +1,4 @@ -//===-- llvm/iPHINode.h - PHI instruction definition -------------*- C++ -*--=// +//===-- llvm/iPHINode.h - PHI instruction definition ------------*- C++ -*-===// // // This file defines the PHINode class. // From lattner at cs.uiuc.edu Tue Sep 30 13:39:20 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:39:20 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/CallGraph.h ConstantsScanner.h Expressions.h FindUnsafePointerTypes.h FindUsedTypes.h InstForest.h Interval.h IntervalIterator.h IntervalPartition.h LoopInfo.h PostDominators.h Verifier.h Message-ID: <200309301838.NAA18976@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: CallGraph.h updated: 1.29 -> 1.30 ConstantsScanner.h updated: 1.11 -> 1.12 Expressions.h updated: 1.6 -> 1.7 FindUnsafePointerTypes.h updated: 1.12 -> 1.13 FindUsedTypes.h updated: 1.16 -> 1.17 InstForest.h updated: 1.19 -> 1.20 Interval.h updated: 1.12 -> 1.13 IntervalIterator.h updated: 1.13 -> 1.14 IntervalPartition.h updated: 1.17 -> 1.18 LoopInfo.h updated: 1.26 -> 1.27 PostDominators.h updated: 1.3 -> 1.4 Verifier.h updated: 1.9 -> 1.10 --- Log message: Standardize header file comments --- Diffs of the changes: Index: llvm/include/llvm/Analysis/CallGraph.h diff -u llvm/include/llvm/Analysis/CallGraph.h:1.29 llvm/include/llvm/Analysis/CallGraph.h:1.30 --- llvm/include/llvm/Analysis/CallGraph.h:1.29 Sat Aug 30 20:38:00 2003 +++ llvm/include/llvm/Analysis/CallGraph.h Tue Sep 30 13:37:40 2003 @@ -1,4 +1,4 @@ -//===- CallGraph.h - Build a Module's call graph -----------------*- C++ -*--=// +//===- CallGraph.h - Build a Module's call graph ----------------*- C++ -*-===// // // This interface is used to build and manipulate a call graph, which is a very // useful tool for interprocedural optimization. Index: llvm/include/llvm/Analysis/ConstantsScanner.h diff -u llvm/include/llvm/Analysis/ConstantsScanner.h:1.11 llvm/include/llvm/Analysis/ConstantsScanner.h:1.12 --- llvm/include/llvm/Analysis/ConstantsScanner.h:1.11 Sat Jun 21 22:05:45 2003 +++ llvm/include/llvm/Analysis/ConstantsScanner.h Tue Sep 30 13:37:40 2003 @@ -1,4 +1,4 @@ -//==-- llvm/Analysis/ConstantsScanner.h - Iterate over constants -*- C++ -*-==// +//==- llvm/Analysis/ConstantsScanner.h - Iterate over constants -*- C++ -*-===// // // This class implements an iterator to walk through the constants referenced by // a method. This is used by the Bytecode & Assembly writers to build constant Index: llvm/include/llvm/Analysis/Expressions.h diff -u llvm/include/llvm/Analysis/Expressions.h:1.6 llvm/include/llvm/Analysis/Expressions.h:1.7 --- llvm/include/llvm/Analysis/Expressions.h:1.6 Tue Sep 17 12:18:12 2002 +++ llvm/include/llvm/Analysis/Expressions.h Tue Sep 30 13:37:40 2003 @@ -1,4 +1,4 @@ -//===- llvm/Analysis/Expressions.h - Expression Analysis Utils ---*- C++ -*--=// +//===- llvm/Analysis/Expressions.h - Expression Analysis Utils --*- C++ -*-===// // // This file defines a package of expression analysis utilties: // Index: llvm/include/llvm/Analysis/FindUnsafePointerTypes.h diff -u llvm/include/llvm/Analysis/FindUnsafePointerTypes.h:1.12 llvm/include/llvm/Analysis/FindUnsafePointerTypes.h:1.13 --- llvm/include/llvm/Analysis/FindUnsafePointerTypes.h:1.12 Wed Aug 21 12:09:18 2002 +++ llvm/include/llvm/Analysis/FindUnsafePointerTypes.h Tue Sep 30 13:37:40 2003 @@ -1,4 +1,4 @@ -//===- llvm/Analysis/FindUnsafePointerTypes.h - Unsafe pointers ---*- C++ -*-=// +//===- llvm/Analysis/FindUnsafePointerTypes.h - Unsafe pointers -*- C++ -*-===// // // This file defines a pass that can be used to determine, interprocedurally, // which pointer types are accessed unsafely in a program. If there is an Index: llvm/include/llvm/Analysis/FindUsedTypes.h diff -u llvm/include/llvm/Analysis/FindUsedTypes.h:1.16 llvm/include/llvm/Analysis/FindUsedTypes.h:1.17 --- llvm/include/llvm/Analysis/FindUsedTypes.h:1.16 Mon Sep 23 19:07:17 2002 +++ llvm/include/llvm/Analysis/FindUsedTypes.h Tue Sep 30 13:37:40 2003 @@ -1,4 +1,4 @@ -//===- llvm/Analysis/FindUsedTypes.h - Find all Types in use -----*- C++ -*--=// +//===- llvm/Analysis/FindUsedTypes.h - Find all Types in use ----*- C++ -*-===// // // This pass is used to seek out all of the types in use by the program. // Index: llvm/include/llvm/Analysis/InstForest.h diff -u llvm/include/llvm/Analysis/InstForest.h:1.19 llvm/include/llvm/Analysis/InstForest.h:1.20 --- llvm/include/llvm/Analysis/InstForest.h:1.19 Wed Jul 23 10:29:59 2003 +++ llvm/include/llvm/Analysis/InstForest.h Tue Sep 30 13:37:40 2003 @@ -1,4 +1,4 @@ -//===- llvm/Analysis/InstForest.h - Partition Func into forest ---*- C++ -*--=// +//===- llvm/Analysis/InstForest.h - Partition Func into forest --*- C++ -*-===// // // This interface is used to partition a method into a forest of instruction // trees, where the following invariants hold: Index: llvm/include/llvm/Analysis/Interval.h diff -u llvm/include/llvm/Analysis/Interval.h:1.12 llvm/include/llvm/Analysis/Interval.h:1.13 --- llvm/include/llvm/Analysis/Interval.h:1.12 Fri Jul 26 20:11:59 2002 +++ llvm/include/llvm/Analysis/Interval.h Tue Sep 30 13:37:40 2003 @@ -1,4 +1,4 @@ -//===- llvm/Analysis/Interval.h - Interval Class Declaration -----*- C++ -*--=// +//===- llvm/Analysis/Interval.h - Interval Class Declaration ----*- C++ -*-===// // // This file contains the declaration of the Interval class, which // represents a set of CFG nodes and is a portion of an interval partition. Index: llvm/include/llvm/Analysis/IntervalIterator.h diff -u llvm/include/llvm/Analysis/IntervalIterator.h:1.13 llvm/include/llvm/Analysis/IntervalIterator.h:1.14 --- llvm/include/llvm/Analysis/IntervalIterator.h:1.13 Mon Aug 18 09:27:29 2003 +++ llvm/include/llvm/Analysis/IntervalIterator.h Tue Sep 30 13:37:40 2003 @@ -1,4 +1,4 @@ -//===- IntervalIterator.h - Interval Iterator Declaration --------*- C++ -*--=// +//===- IntervalIterator.h - Interval Iterator Declaration -------*- C++ -*-===// // // This file defines an iterator that enumerates the intervals in a control flow // graph of some sort. This iterator is parametric, allowing iterator over the Index: llvm/include/llvm/Analysis/IntervalPartition.h diff -u llvm/include/llvm/Analysis/IntervalPartition.h:1.17 llvm/include/llvm/Analysis/IntervalPartition.h:1.18 --- llvm/include/llvm/Analysis/IntervalPartition.h:1.17 Tue Oct 29 16:55:11 2002 +++ llvm/include/llvm/Analysis/IntervalPartition.h Tue Sep 30 13:37:40 2003 @@ -1,4 +1,4 @@ -//===- IntervalPartition.h - Interval partition Calculation ------*- C++ -*--=// +//===- IntervalPartition.h - Interval partition Calculation -----*- C++ -*-===// // // This file contains the declaration of the IntervalPartition class, which // calculates and represents the interval partition of a function, or a Index: llvm/include/llvm/Analysis/LoopInfo.h diff -u llvm/include/llvm/Analysis/LoopInfo.h:1.26 llvm/include/llvm/Analysis/LoopInfo.h:1.27 --- llvm/include/llvm/Analysis/LoopInfo.h:1.26 Sat Aug 16 15:57:13 2003 +++ llvm/include/llvm/Analysis/LoopInfo.h Tue Sep 30 13:37:40 2003 @@ -1,4 +1,4 @@ -//===- llvm/Analysis/LoopInfo.h - Natural Loop Calculator --------*- C++ -*--=// +//===- llvm/Analysis/LoopInfo.h - Natural Loop Calculator -------*- C++ -*-===// // // This file defines the LoopInfo class that is used to identify natural loops // and determine the loop depth of various nodes of the CFG. Note that natural Index: llvm/include/llvm/Analysis/PostDominators.h diff -u llvm/include/llvm/Analysis/PostDominators.h:1.3 llvm/include/llvm/Analysis/PostDominators.h:1.4 --- llvm/include/llvm/Analysis/PostDominators.h:1.3 Mon Sep 15 10:47:40 2003 +++ llvm/include/llvm/Analysis/PostDominators.h Tue Sep 30 13:37:40 2003 @@ -1,4 +1,4 @@ -//=- llvm/Analysis/PostDominators.h - Post Dominator Calculation -*- C++ -*--=// +//=- llvm/Analysis/PostDominators.h - Post Dominator Calculation-*- C++ -*-===// // // This file exposes interfaces to post dominance information. // Index: llvm/include/llvm/Analysis/Verifier.h diff -u llvm/include/llvm/Analysis/Verifier.h:1.9 llvm/include/llvm/Analysis/Verifier.h:1.10 --- llvm/include/llvm/Analysis/Verifier.h:1.9 Wed Sep 10 14:37:03 2003 +++ llvm/include/llvm/Analysis/Verifier.h Tue Sep 30 13:37:40 2003 @@ -1,4 +1,4 @@ -//===-- llvm/Analysis/Verifier.h - Module Verifier ---------------*- C++ -*-==// +//===-- llvm/Analysis/Verifier.h - Module Verifier --------------*- C++ -*-===// // // This file defines the function verifier interface, that can be used for some // sanity checking of input to the system, and for checking that transformations From lattner at cs.uiuc.edu Tue Sep 30 13:45:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:45:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/AbstractTypeUser.h Message-ID: <200309301844.NAA21173@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: AbstractTypeUser.h updated: 1.11 -> 1.12 --- Log message: Update comment --- Diffs of the changes: Index: llvm/include/llvm/AbstractTypeUser.h diff -u llvm/include/llvm/AbstractTypeUser.h:1.11 llvm/include/llvm/AbstractTypeUser.h:1.12 --- llvm/include/llvm/AbstractTypeUser.h:1.11 Tue Sep 30 13:37:37 2003 +++ llvm/include/llvm/AbstractTypeUser.h Tue Sep 30 13:44:27 2003 @@ -61,10 +61,8 @@ }; -// PATypeHandle - Handle to a Type subclass. This class is parameterized so -// that users can have handles to FunctionType's that are still specialized, for -// example. This class is a simple class used to keep the use list of abstract -// types up-to-date. +// PATypeHandle - Handle to a Type subclass. This class is used to keep the use +// list of abstract types up-to-date. // class PATypeHandle { const Type *Ty; From lattner at cs.uiuc.edu Tue Sep 30 13:57:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:57:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C++/EH/Makefile Message-ID: <200309301856.NAA21900@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C++/EH: Makefile updated: 1.4 -> 1.5 --- Log message: Link in eh support! --- Diffs of the changes: Index: llvm/test/Programs/SingleSource/Regression/C++/EH/Makefile diff -u llvm/test/Programs/SingleSource/Regression/C++/EH/Makefile:1.4 llvm/test/Programs/SingleSource/Regression/C++/EH/Makefile:1.5 --- llvm/test/Programs/SingleSource/Regression/C++/EH/Makefile:1.4 Mon Sep 29 16:34:48 2003 +++ llvm/test/Programs/SingleSource/Regression/C++/EH/Makefile Tue Sep 30 13:56:44 2003 @@ -1,4 +1,5 @@ LEVEL = ../../../../../.. include $(LEVEL)/test/Programs/SingleSource/Makefile.singlesrc CFLAGS += -std=c99 +LIBS = -lsupc++ From lattner at cs.uiuc.edu Tue Sep 30 13:59:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 13:59:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/EH/dead_try_block.cpp function_try_block.cpp simple_throw.cpp ctor_dtor_count.cpp exception_spec_test.cpp simple_rethrow.cpp throw_rethrow_test.cpp Message-ID: <200309301858.NAA21919@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend/EH: dead_try_block.cpp (r1.2) removed function_try_block.cpp (r1.1) removed simple_throw.cpp (r1.1) removed ctor_dtor_count.cpp (r1.1) removed exception_spec_test.cpp (r1.1) removed simple_rethrow.cpp (r1.1) removed throw_rethrow_test.cpp (r1.1) removed --- Log message: These tests got moved to test/Programs/SingleSource/Regression/C++/EH --- Diffs of the changes: From lattner at cs.uiuc.edu Tue Sep 30 14:00:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 14:00:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/Makefile Message-ID: <200309301859.NAA21945@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: Makefile (r1.3) removed --- Log message: This makefile is completely wrong, don't even bother to keep it --- Diffs of the changes: From lattner at cs.uiuc.edu Tue Sep 30 14:03:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 14:03:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C++/CompileFail/2003-08-20-ExceptionFail.cpp 2003-08-21-EmptyClass.cpp 2003-08-24-Cleanup.cpp.tr 2003-08-27-TypeNamespaces.cpp 2003-08-28-ForwardType.cpp 2003-08-28-SaveExprBug.cpp 2003-08-29-ArgPassingBug.cpp.tr 2003-08-31-StructLayout.cpp 2003-09-22-CompositeExprValue.cpp 2003-09-29-ArgumentNumberMismatch.cpp 2003-09-30-NestedFunctionDecl.cpp Makefile Message-ID: <200309301902.OAA22749@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C++/CompileFail: 2003-08-20-ExceptionFail.cpp (r1.2) removed 2003-08-21-EmptyClass.cpp (r1.3) removed 2003-08-24-Cleanup.cpp.tr (r1.2) removed 2003-08-27-TypeNamespaces.cpp (r1.1) removed 2003-08-28-ForwardType.cpp (r1.1) removed 2003-08-28-SaveExprBug.cpp (r1.1) removed 2003-08-29-ArgPassingBug.cpp.tr (r1.1) removed 2003-08-31-StructLayout.cpp (r1.1) removed 2003-09-22-CompositeExprValue.cpp (r1.1) removed 2003-09-29-ArgumentNumberMismatch.cpp (r1.2) removed 2003-09-30-NestedFunctionDecl.cpp (r1.1) removed Makefile (r1.3) removed --- Log message: These files belong in test/Regression/C++Frontend, and they were actually already there! --- Diffs of the changes: From criswell at cs.uiuc.edu Tue Sep 30 14:04:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 14:04:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/QMTest/llvm.py Message-ID: <200309301903.OAA16809@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/QMTest: llvm.py updated: 1.8 -> 1.9 --- Log message: Added a test class that compiles C++ code into LLVM bytecode. --- Diffs of the changes: Index: llvm/test/QMTestDB/QMTest/llvm.py diff -u llvm/test/QMTestDB/QMTest/llvm.py:1.8 llvm/test/QMTestDB/QMTest/llvm.py:1.9 --- llvm/test/QMTestDB/QMTest/llvm.py:1.8 Thu Sep 25 19:52:59 2003 +++ llvm/test/QMTestDB/QMTest/llvm.py Tue Sep 30 14:03:44 2003 @@ -1083,6 +1083,94 @@ return +############################################################################## +# +# Class: CXXTest +# +# Description: +# This test verifies that the specified C++ program can be compiled +# into LLVM assembly code which can then be assembled into LLVM byte +# code. +# +############################################################################## +class CXXTest(qm.test.test.Test): + + description="Verifies that LLVM can compile C++ code into LLVM bytecode" + + # + # List of arguments that the objects accepts for test configuration. + # + arguments = [ + qm.fields.TextField(name='srcfile', + title='C Source Code File', + description='C Source Code File to Convert to LLVM Bytecode'), + ] + + + #devnull = ' > /dev/null 2>&1' + devnull = '' + + def Run (self, context, result): + + # + # Set the core dump size + # + coresize=int(context['coresize']) + resource.setrlimit (resource.RLIMIT_CORE, (coresize,coresize)) + + # + # Fetch the source and build root directories from the context. + # + srcroot=context['srcroot'] + buildroot=context['buildroot'] + tmpdir=context['tmpdir'] + + # + # Construct the pathname of the source file and object file. + # + srcfile=srcroot + '/' + self.srcfile + llvmsrc=tmpdir + '/' + os.path.basename (self.srcfile) + '.ll' + llvmobj=tmpdir + '/' + os.path.basename (self.srcfile) + '.bc' + + # + # Construct the pathnames to the various utilities. + # + cc = context['llvmgxx'] + as = buildroot + '/tools/' + context['buildtype'] + '/llvm-as' + + # + # Construct the command to generate the LLVM assembly and byte + # code. + # + ccmd = cc + ' -S ' + srcfile + ' -o ' + llvmsrc + self.devnull + acmd = as + ' -f ' + llvmsrc + ' -o /dev/null 2>&1 /dev/null' + + # + # Assemble the program into C code and then compile it. + # + estatus=os.system (ccmd) + if ((os.WIFEXITED(estatus)) and (os.WEXITSTATUS(estatus) != 0)): + fail = 1 + result.Fail('Compiling C++ code failed') + else: + estatus=os.system (acmd) + if ((os.WIFEXITED(estatus)) and (os.WEXITSTATUS(estatus) != 0)): + fail = 1 + result.Fail('Compiling code failed') + else: + fail = 0 + + # + # Cleanup the files. + # + if ((os.access(llvmsrc,os.F_OK)) == 1): + os.remove (llvmsrc) + else: + if (fail == 0): + result.Fail ('Object file not generated') + + return + ############################################################################## # RESOURCES From criswell at cs.uiuc.edu Tue Sep 30 14:05:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 14:05:01 2003 Subject: [llvm-commits] CVS: llvm/test/Makefile Message-ID: <200309301904.OAA16822@choi.cs.uiuc.edu> Changes in directory llvm/test: Makefile updated: 1.40 -> 1.41 --- Log message: Added the CXXTest test class. --- Diffs of the changes: Index: llvm/test/Makefile diff -u llvm/test/Makefile:1.40 llvm/test/Makefile:1.41 --- llvm/test/Makefile:1.40 Mon Sep 15 21:59:26 2003 +++ llvm/test/Makefile Tue Sep 30 14:04:08 2003 @@ -29,6 +29,7 @@ -c cc=$(CC) \ -c cxx=$(CXX) \ -c "llvmgcc=$(LLVMGCC)" \ + -c "llvmgxx=$(LLVMGXX)" \ -c make=$(MAKE) # @@ -72,6 +73,7 @@ $(QMTEST) register test llvm.VerifierTest $(QMTEST) register test llvm.AnalyzeTest $(QMTEST) register test llvm.CTest + $(QMTEST) register test llvm.CXXTest $(QMTEST) register resource llvm.BytecodeResource # From criswell at cs.uiuc.edu Tue Sep 30 14:09:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 14:09:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/ Message-ID: <200309301908.OAA16902@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/cxxfrontend.qms: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/QMTestDB/regression.qms/cxxfrontend.qms added to the repository --- Diffs of the changes: From criswell at cs.uiuc.edu Tue Sep 30 14:09:07 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 14:09:07 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-20-exceptionfail.qmt 2003-08-21-emptyclass.qmt 2003-08-27-typenamespaces.qmt 2003-08-28-forwardtype.qmt 2003-08-28-saveexprbug.qmt 2003-08-31-structlayout.qmt 2003-09-22-compositeexprvalue.qmt 2003-09-29-argumentnumbermismatch.qmt 2003-09-30-nestedfunctiondecl.qmt Message-ID: <200309301908.OAA16929@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/cxxfrontend.qms: 2003-08-20-exceptionfail.qmt added (r1.1) 2003-08-21-emptyclass.qmt added (r1.1) 2003-08-27-typenamespaces.qmt added (r1.1) 2003-08-28-forwardtype.qmt added (r1.1) 2003-08-28-saveexprbug.qmt added (r1.1) 2003-08-31-structlayout.qmt added (r1.1) 2003-09-22-compositeexprvalue.qmt added (r1.1) 2003-09-29-argumentnumbermismatch.qmt added (r1.1) 2003-09-30-nestedfunctiondecl.qmt added (r1.1) --- Log message: Adding C++ Regression tests. These tests are not actually compiled to native code and execute; they are simply tested to see if they compile. --- Diffs of the changes: Index: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-20-exceptionfail.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-20-exceptionfail.qmt:1.1 *** /dev/null Tue Sep 30 14:08:44 2003 --- llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-20-exceptionfail.qmt Tue Sep 30 14:08:34 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/C++Frontend/2003-08-20-ExceptionFail.cpp Index: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-21-emptyclass.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-21-emptyclass.qmt:1.1 *** /dev/null Tue Sep 30 14:08:44 2003 --- llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-21-emptyclass.qmt Tue Sep 30 14:08:34 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/C++Frontend/2003-08-21-EmptyClass.cpp Index: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-27-typenamespaces.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-27-typenamespaces.qmt:1.1 *** /dev/null Tue Sep 30 14:08:44 2003 --- llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-27-typenamespaces.qmt Tue Sep 30 14:08:34 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/C++Frontend/2003-08-27-TypeNamespaces.cpp Index: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-28-forwardtype.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-28-forwardtype.qmt:1.1 *** /dev/null Tue Sep 30 14:08:44 2003 --- llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-28-forwardtype.qmt Tue Sep 30 14:08:34 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/C++Frontend/2003-08-28-ForwardType.cpp Index: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-28-saveexprbug.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-28-saveexprbug.qmt:1.1 *** /dev/null Tue Sep 30 14:08:44 2003 --- llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-28-saveexprbug.qmt Tue Sep 30 14:08:34 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/C++Frontend/2003-08-28-SaveExprBug.cpp Index: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-31-structlayout.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-31-structlayout.qmt:1.1 *** /dev/null Tue Sep 30 14:08:44 2003 --- llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-31-structlayout.qmt Tue Sep 30 14:08:34 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/C++Frontend/2003-08-31-StructLayout.cpp Index: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-09-22-compositeexprvalue.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-09-22-compositeexprvalue.qmt:1.1 *** /dev/null Tue Sep 30 14:08:44 2003 --- llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-09-22-compositeexprvalue.qmt Tue Sep 30 14:08:34 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/C++Frontend/2003-09-22-CompositeExprValue.cpp Index: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-09-29-argumentnumbermismatch.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-09-29-argumentnumbermismatch.qmt:1.1 *** /dev/null Tue Sep 30 14:08:44 2003 --- llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-09-29-argumentnumbermismatch.qmt Tue Sep 30 14:08:34 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/C++Frontend/2003-09-29-ArgumentNumberMismatch.cpp Index: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-09-30-nestedfunctiondecl.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-09-30-nestedfunctiondecl.qmt:1.1 *** /dev/null Tue Sep 30 14:08:44 2003 --- llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-09-30-nestedfunctiondecl.qmt Tue Sep 30 14:08:34 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/C++Frontend/2003-09-30-NestedFunctionDecl.cpp From criswell at cs.uiuc.edu Tue Sep 30 14:28:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 14:28:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-24-cleanup.qmt 2003-08-29-argpassingbug.qmt Message-ID: <200309301927.OAA21569@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/regression.qms/cxxfrontend.qms: 2003-08-24-cleanup.qmt added (r1.1) 2003-08-29-argpassingbug.qmt added (r1.1) --- Log message: Added new TestRunner tests for the C++ front end. Adjusted the TestRunner class to configure the names of the LLVM C and C++ frontends. --- Diffs of the changes: Index: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-24-cleanup.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-24-cleanup.qmt:1.1 *** /dev/null Tue Sep 30 14:27:57 2003 --- llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-24-cleanup.qmt Tue Sep 30 14:27:47 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/C++Frontend/2003-08-24-Cleanup.cpp.tr Index: llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-29-argpassingbug.qmt diff -c /dev/null llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-29-argpassingbug.qmt:1.1 *** /dev/null Tue Sep 30 14:27:57 2003 --- llvm/test/QMTestDB/regression.qms/cxxfrontend.qms/2003-08-29-argpassingbug.qmt Tue Sep 30 14:27:47 2003 *************** *** 0 **** --- 1,2 ---- + + .*test/Regression/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr From criswell at cs.uiuc.edu Tue Sep 30 14:28:07 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 14:28:07 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/QMTest/llvm.py Message-ID: <200309301927.OAA21560@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/QMTest: llvm.py updated: 1.9 -> 1.10 --- Log message: Added new TestRunner tests for the C++ front end. Adjusted the TestRunner class to configure the names of the LLVM C and C++ frontends. --- Diffs of the changes: Index: llvm/test/QMTestDB/QMTest/llvm.py diff -u llvm/test/QMTestDB/QMTest/llvm.py:1.9 llvm/test/QMTestDB/QMTest/llvm.py:1.10 --- llvm/test/QMTestDB/QMTest/llvm.py:1.9 Tue Sep 30 14:03:44 2003 +++ llvm/test/QMTestDB/QMTest/llvm.py Tue Sep 30 14:27:46 2003 @@ -968,6 +968,10 @@ '-e', 's|%t|' + scriptfile + '.tmp|g;', '-e', + 's|%gcc|' + context['llvmgcc'] + '|g;', + '-e', + 's|%gxx|' + context['llvmgxx'] + '|g;', + '-e', 'w ' + scriptfile, srcfile) From criswell at cs.uiuc.edu Tue Sep 30 14:29:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 14:29:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-08-24-Cleanup.cpp.tr 2003-08-29-ArgPassingBug.cpp.tr Message-ID: <200309301928.OAA21582@choi.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2003-08-24-Cleanup.cpp.tr updated: 1.2 -> 1.3 2003-08-29-ArgPassingBug.cpp.tr updated: 1.1 -> 1.2 --- Log message: Adjusted for the new TestRunner test class. This replaces %gcc and %g++ with the names of the LLVM C and C++ frontends, respectively. --- Diffs of the changes: Index: llvm/test/Regression/C++Frontend/2003-08-24-Cleanup.cpp.tr diff -u llvm/test/Regression/C++Frontend/2003-08-24-Cleanup.cpp.tr:1.2 llvm/test/Regression/C++Frontend/2003-08-24-Cleanup.cpp.tr:1.3 --- llvm/test/Regression/C++Frontend/2003-08-24-Cleanup.cpp.tr:1.2 Mon Sep 29 17:17:12 2003 +++ llvm/test/Regression/C++Frontend/2003-08-24-Cleanup.cpp.tr Tue Sep 30 14:28:26 2003 @@ -1,4 +1,4 @@ -// RUN: llvmg++ -xc++ %s -c -o - | llvm-dis | grep unwind +// RUN: %gxx -xc++ %s -c -o - | llvm-dis | grep unwind struct S { ~S(); }; Index: llvm/test/Regression/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr diff -u llvm/test/Regression/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr:1.1 llvm/test/Regression/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr:1.2 --- llvm/test/Regression/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr:1.1 Fri Aug 29 11:00:19 2003 +++ llvm/test/Regression/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr Tue Sep 30 14:28:26 2003 @@ -1,5 +1,5 @@ -// RUN: llvmgcc -xc++ -c -o /dev/null %s 2>&1 | not grep WARNING +// RUN: %gcc -xc++ -c -o /dev/null %s 2>&1 | not grep WARNING struct iterator { iterator(); From criswell at cs.uiuc.edu Tue Sep 30 14:40:00 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 14:40:00 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C++/Makefile Message-ID: <200309301939.OAA14476@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C++: Makefile updated: 1.6 -> 1.7 --- Log message: Added the EH directory to the list of tests to run. --- Diffs of the changes: Index: llvm/test/Programs/SingleSource/Regression/C++/Makefile diff -u llvm/test/Programs/SingleSource/Regression/C++/Makefile:1.6 llvm/test/Programs/SingleSource/Regression/C++/Makefile:1.7 --- llvm/test/Programs/SingleSource/Regression/C++/Makefile:1.6 Fri Sep 26 14:50:50 2003 +++ llvm/test/Programs/SingleSource/Regression/C++/Makefile Tue Sep 30 14:39:02 2003 @@ -1,10 +1,11 @@ -# test/Regression/C++Frontend/Makefile +# test/Programs/SingleSource/Regression/C++ # # This directory contains regression tests for the GCC C++ front-end for LLVM. # These tests are C++ source files that are input to GCC and compiled to .ll # files. After that, the files are assembled and executed by the LLVM backends. # LEVEL = ../../../../.. +DIRS=EH include $(LEVEL)/test/Programs/SingleSource/Makefile.singlesrc CFLAGS += -std=c99 From criswell at cs.uiuc.edu Tue Sep 30 14:42:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 14:42:01 2003 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200309301941.OAA14513@choi.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.29 -> 1.30 --- Log message: Removed Makefile for CompileFail tests. They are now run by QMTest and are located under llvm/test/Regression/C++Frontend. --- Diffs of the changes: Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.29 llvm/autoconf/configure.ac:1.30 --- llvm/autoconf/configure.ac:1.29 Tue Sep 30 11:31:48 2003 +++ llvm/autoconf/configure.ac Tue Sep 30 14:41:15 2003 @@ -188,7 +188,6 @@ AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Regression/C/Makefile) AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Regression/C++/Makefile) AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Regression/C++/EH/Makefile) -AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Regression/C++/CompileFail/Makefile) AC_CONFIG_MAKEFILE(tools/Makefile) AC_CONFIG_MAKEFILE(tools/analyze/Makefile) AC_CONFIG_MAKEFILE(tools/bugpoint/Makefile) From criswell at cs.uiuc.edu Tue Sep 30 14:42:06 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 14:42:06 2003 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200309301941.OAA14506@choi.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.37 -> 1.38 --- Log message: Removed Makefile for CompileFail tests. They are now run by QMTest and are located under llvm/test/Regression/C++Frontend. --- Diffs of the changes: Index: llvm/configure diff -u llvm/configure:1.37 llvm/configure:1.38 --- llvm/configure:1.37 Tue Sep 30 11:31:47 2003 +++ llvm/configure Tue Sep 30 14:41:13 2003 @@ -1977,9 +1977,6 @@ ac_config_commands="$ac_config_commands test/Programs/SingleSource/Regression/C++/EH/Makefile" - ac_config_commands="$ac_config_commands test/Programs/SingleSource/Regression/C++/CompileFail/Makefile" - - ac_config_commands="$ac_config_commands tools/Makefile" @@ -4429,7 +4426,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4432 "configure"' > conftest.$ac_ext + echo '#line 4429 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5270,7 +5267,7 @@ # Provide some information about the compiler. -echo "$as_me:5273:" \ +echo "$as_me:5270:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -6279,11 +6276,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6282: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6279: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6286: \$? = $ac_status" >&5 + echo "$as_me:6283: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6511,11 +6508,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6514: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6511: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6518: \$? = $ac_status" >&5 + echo "$as_me:6515: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6578,11 +6575,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6581: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6578: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6585: \$? = $ac_status" >&5 + echo "$as_me:6582: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8590,7 +8587,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:10824: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10831: \$? = $ac_status" >&5 + echo "$as_me:10828: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10891,11 +10888,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10894: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10891: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10898: \$? = $ac_status" >&5 + echo "$as_me:10895: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12134,7 +12131,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13054: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13061: \$? = $ac_status" >&5 + echo "$as_me:13058: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13121,11 +13118,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13124: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13121: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13128: \$? = $ac_status" >&5 + echo "$as_me:13125: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15065,11 +15062,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15068: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15065: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15072: \$? = $ac_status" >&5 + echo "$as_me:15069: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15297,11 +15294,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15300: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15297: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15304: \$? = $ac_status" >&5 + echo "$as_me:15301: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15364,11 +15361,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15367: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15364: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15371: \$? = $ac_status" >&5 + echo "$as_me:15368: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17376,7 +17373,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < Changes in directory llvm/lib/CodeGen: RegAllocLinearScan.cpp added (r1.1.2.1) --- Log message: Initial commit of linear scan allocator. This is just a sceleton file; it does not really work --- Diffs of the changes: Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp diff -c /dev/null llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.1.2.1 *** /dev/null Tue Sep 30 14:55:13 2003 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp Tue Sep 30 14:55:02 2003 *************** *** 0 **** --- 1,70 ---- + //===-- RegAllocLinearScan.cpp - Linear Scan register allocator ---------===// + // + // This file implements a linear scan register allocator.. + // + //===--------------------------------------------------------------------===// + + #define DEBUG_TYPE "regalloc" + + #include "llvm/Target/MRegisterInfo.h" + #include "llvm/Target/TargetMachine.h" + + namespace { + Statistic<> NumSpilled ("ra-linearscan", "Number of registers spilled"); + Statistic<> NumReloaded("ra-linearscan", "Number of registers reloaded"); + + class RA : public MachineFunctionPass { + private: + MachineFunction *MF; + const TargetMachine *TM; + const MRegisterInfo *RegInfo; + LiveVariables* LV; + + // StackSlotForVirtReg - Maps virtual regs to the frame index where these + // values are spilled. + std::map StackSlotForVirtReg; + + // Virt2PhysRegMap - This map contains entries for each virtual register + // that is currently available in a physical register. + // + std::map Virt2PhysRegMap; + + // Phys2VirtRegMap - This map contains entries for each physical register + // that currently maps a virtual register.. + // + std::map Phys2VirtRegMap; + + public: + virtual const char* getPassName() const { + return "Linear Scan Register Allocator"; + } + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); + AU.addRequiredID(PHIEliminationID); + MachineFunctionPass::getAnalysisUsage(AU); + } + + private: + /// runOnMachineFunction - Register allocate the whole function + bool runOnMachineFunction(MachineFunction &Fn); + }; + } + + /// runOnMachineFunction - Register allocate the whole function + /// + bool RA::runOnMachineFunction(MachineFunction &Fn) { + DEBUG(std::cerr << "Machine Function " << "\n"); + MF = &Fn; + TM = &Fn.getTarget(); + RegInfo = TM->getRegisterInfo(); + + LV = &getAnalysis(); + // compute live intervals + // liner scan algorithm + + return true; + } + + FunctionPass *createLinearScanRegisterAllocator() { + return new RA(); + } From alkis at cs.uiuc.edu Tue Sep 30 14:56:07 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Tue Sep 30 14:56:07 2003 Subject: [llvm-commits] [regalloc_linearscan] CVS: llvm/include/llvm/CodeGen/Passes.h Message-ID: <200309301955.OAA07477@morpheus.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: Passes.h updated: 1.3 -> 1.3.2.1 --- Log message: Add createLinearScanRegisterAllocator() --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/Passes.h diff -u llvm/include/llvm/CodeGen/Passes.h:1.3 llvm/include/llvm/CodeGen/Passes.h:1.3.2.1 --- llvm/include/llvm/CodeGen/Passes.h:1.3 Thu Aug 21 17:09:31 2003 +++ llvm/include/llvm/CodeGen/Passes.h Tue Sep 30 14:54:49 2003 @@ -30,6 +30,12 @@ /// FunctionPass *createLocalRegisterAllocator(); +/// LinearScanRegisterAllocation Pass - This pass implements the +/// linear scan register allocation algorithm, a global register +/// allocator. +/// +FunctionPass *createLinearScanRegisterAllocator(); + /// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code, /// and eliminates abstract frame references. /// From criswell at cs.uiuc.edu Tue Sep 30 14:57:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 14:57:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-08-24-Cleanup.cpp.tr 2003-08-29-ArgPassingBug.cpp.tr Message-ID: <200309301956.OAA20049@choi.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2003-08-24-Cleanup.cpp.tr updated: 1.3 -> 1.4 2003-08-29-ArgPassingBug.cpp.tr updated: 1.2 -> 1.3 --- Log message: Changed TestRunner test class so that it replaces %llvmgcc and %llvmgxx instead of %gcc and %gxx. --- Diffs of the changes: Index: llvm/test/Regression/C++Frontend/2003-08-24-Cleanup.cpp.tr diff -u llvm/test/Regression/C++Frontend/2003-08-24-Cleanup.cpp.tr:1.3 llvm/test/Regression/C++Frontend/2003-08-24-Cleanup.cpp.tr:1.4 --- llvm/test/Regression/C++Frontend/2003-08-24-Cleanup.cpp.tr:1.3 Tue Sep 30 14:28:26 2003 +++ llvm/test/Regression/C++Frontend/2003-08-24-Cleanup.cpp.tr Tue Sep 30 14:56:36 2003 @@ -1,4 +1,4 @@ -// RUN: %gxx -xc++ %s -c -o - | llvm-dis | grep unwind +// RUN: %llvmgxx -xc++ %s -c -o - | llvm-dis | grep unwind struct S { ~S(); }; Index: llvm/test/Regression/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr diff -u llvm/test/Regression/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr:1.2 llvm/test/Regression/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr:1.3 --- llvm/test/Regression/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr:1.2 Tue Sep 30 14:28:26 2003 +++ llvm/test/Regression/C++Frontend/2003-08-29-ArgPassingBug.cpp.tr Tue Sep 30 14:56:36 2003 @@ -1,5 +1,5 @@ -// RUN: %gcc -xc++ -c -o /dev/null %s 2>&1 | not grep WARNING +// RUN: %llvmgcc -xc++ -c -o /dev/null %s 2>&1 | not grep WARNING struct iterator { iterator(); From criswell at cs.uiuc.edu Tue Sep 30 14:57:06 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 14:57:06 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/QMTest/llvm.py Message-ID: <200309301956.OAA20040@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/QMTest: llvm.py updated: 1.10 -> 1.11 --- Log message: Changed TestRunner test class so that it replaces %llvmgcc and %llvmgxx instead of %gcc and %gxx. --- Diffs of the changes: Index: llvm/test/QMTestDB/QMTest/llvm.py diff -u llvm/test/QMTestDB/QMTest/llvm.py:1.10 llvm/test/QMTestDB/QMTest/llvm.py:1.11 --- llvm/test/QMTestDB/QMTest/llvm.py:1.10 Tue Sep 30 14:27:46 2003 +++ llvm/test/QMTestDB/QMTest/llvm.py Tue Sep 30 14:56:35 2003 @@ -968,9 +968,9 @@ '-e', 's|%t|' + scriptfile + '.tmp|g;', '-e', - 's|%gcc|' + context['llvmgcc'] + '|g;', + 's|%llvmgcc|' + context['llvmgcc'] + '|g;', '-e', - 's|%gxx|' + context['llvmgxx'] + '|g;', + 's|%llvmgxx|' + context['llvmgxx'] + '|g;', '-e', 'w ' + scriptfile, srcfile) From lattner at cs.uiuc.edu Tue Sep 30 15:15:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 15:15:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/Passes.h Message-ID: <200309302014.PAA32722@neo.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: Passes.h updated: 1.3 -> 1.4 --- Log message: Include the sparc register in this file --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/Passes.h diff -u llvm/include/llvm/CodeGen/Passes.h:1.3 llvm/include/llvm/CodeGen/Passes.h:1.4 --- llvm/include/llvm/CodeGen/Passes.h:1.3 Thu Aug 21 17:09:31 2003 +++ llvm/include/llvm/CodeGen/Passes.h Tue Sep 30 15:14:43 2003 @@ -35,4 +35,9 @@ /// FunctionPass *createPrologEpilogCodeInserter(); + +/// getRegisterAllocator - This creates an instance of the register allocator +/// for the Sparc. +FunctionPass *getRegisterAllocator(TargetMachine &T); + #endif From lattner at cs.uiuc.edu Tue Sep 30 15:15:07 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 15:15:07 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp Message-ID: <200309302014.PAA32709@neo.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/RegAlloc: PhyRegAlloc.cpp updated: 1.117 -> 1.118 --- Log message: include passes.h which defines the interface this file exposes --- Diffs of the changes: Index: llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp diff -u llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp:1.117 llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp:1.118 --- llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp:1.117 Wed Sep 24 13:16:23 2003 +++ llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp Tue Sep 30 15:13:59 2003 @@ -17,22 +17,22 @@ #include "RegAllocCommon.h" #include "RegClass.h" #include "IGNode.h" +#include "llvm/CodeGen/FunctionLiveVarInfo.h" +#include "llvm/CodeGen/InstrSelection.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineInstrAnnot.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunctionInfo.h" -#include "llvm/CodeGen/FunctionLiveVarInfo.h" -#include "llvm/CodeGen/InstrSelection.h" +#include "llvm/CodeGen/Passes.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Target/TargetInstrInfo.h" -#include "llvm/Function.h" #include "llvm/Type.h" #include "llvm/iOther.h" #include "llvm/DerivedTypes.h" #include "llvm/Constants.h" -#include "llvm/Support/InstIterator.h" #include "llvm/Module.h" +#include "llvm/Support/InstIterator.h" #include "Support/STLExtras.h" #include "Support/SetOperations.h" #include "Support/CommandLine.h" From lattner at cs.uiuc.edu Tue Sep 30 15:16:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 15:16:02 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/Passes.h Message-ID: <200309302015.PAA32757@neo.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: Passes.h updated: 1.4 -> 1.5 --- Log message: Forward declare a class --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/Passes.h diff -u llvm/include/llvm/CodeGen/Passes.h:1.4 llvm/include/llvm/CodeGen/Passes.h:1.5 --- llvm/include/llvm/CodeGen/Passes.h:1.4 Tue Sep 30 15:14:43 2003 +++ llvm/include/llvm/CodeGen/Passes.h Tue Sep 30 15:15:40 2003 @@ -10,6 +10,7 @@ class FunctionPass; class PassInfo; +class TargetMachine; // PHIElimination pass - This pass eliminates machine instruction PHI nodes by // inserting copy instructions. This destroys SSA information, but is the From lattner at cs.uiuc.edu Tue Sep 30 15:16:07 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 15:16:07 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/RegisterAllocation.h Message-ID: <200309302015.PAA32750@neo.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: RegisterAllocation.h (r1.6) removed --- Log message: This got merged into Passes.h --- Diffs of the changes: From lattner at cs.uiuc.edu Tue Sep 30 15:16:12 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 15:16:12 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/Sparc.cpp Message-ID: <200309302015.PAA32739@neo.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: Sparc.cpp updated: 1.81 -> 1.82 --- Log message: RegisterAllocation.h is going away --- Diffs of the changes: Index: llvm/lib/Target/Sparc/Sparc.cpp diff -u llvm/lib/Target/Sparc/Sparc.cpp:1.81 llvm/lib/Target/Sparc/Sparc.cpp:1.82 --- llvm/lib/Target/Sparc/Sparc.cpp:1.81 Thu Sep 18 12:37:46 2003 +++ llvm/lib/Target/Sparc/Sparc.cpp Tue Sep 30 15:15:04 2003 @@ -15,7 +15,6 @@ #include "llvm/CodeGen/MachineFunctionInfo.h" #include "llvm/CodeGen/InstrSelection.h" #include "llvm/CodeGen/InstrScheduling.h" -#include "llvm/CodeGen/RegisterAllocation.h" #include "llvm/CodeGen/MachineCodeForInstruction.h" #include "llvm/Target/TargetMachineImpls.h" #include "Support/CommandLine.h" From criswell at cs.uiuc.edu Tue Sep 30 15:51:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 15:51:01 2003 Subject: [llvm-commits] CVS: reopt/test/Makefile Message-ID: <200309302050.PAA20166@choi.cs.uiuc.edu> Changes in directory reopt/test: Makefile updated: 1.4 -> 1.5 --- Log message: Go into the object directory to run tests. --- Diffs of the changes: Index: reopt/test/Makefile diff -u reopt/test/Makefile:1.4 reopt/test/Makefile:1.5 --- reopt/test/Makefile:1.4 Thu Aug 21 14:41:00 2003 +++ reopt/test/Makefile Tue Sep 30 15:50:40 2003 @@ -14,6 +14,6 @@ # test target - Descend into test/Programs and run the TEST.reopt.Makefile # tests... test:: - (cd $(LLVM_SRC_ROOT)/test/Programs/$(SUBDIR); \ + (cd $(LLVM_OBJ_ROOT)/test/Programs/$(SUBDIR); \ PROJECT_DIR=$(BUILD_OBJ_ROOT) $(MAKE) TEST=reopt \ test ) From lattner at cs.uiuc.edu Tue Sep 30 16:30:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 16:30:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-09-30-ForIncrementExprBug.cpp Message-ID: <200309302129.QAA25652@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2003-09-30-ForIncrementExprBug.cpp added (r1.1) --- Log message: new testcase --- Diffs of the changes: Index: llvm/test/Regression/C++Frontend/2003-09-30-ForIncrementExprBug.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2003-09-30-ForIncrementExprBug.cpp:1.1 *** /dev/null Tue Sep 30 16:29:38 2003 --- llvm/test/Regression/C++Frontend/2003-09-30-ForIncrementExprBug.cpp Tue Sep 30 16:29:27 2003 *************** *** 0 **** --- 1,8 ---- + struct C {}; + + C &foo(); + + void foox() { + for (; ; foo()); + } + From lattner at cs.uiuc.edu Tue Sep 30 16:32:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 16:32:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-09-30-ForIncrementExprBug2.cpp Message-ID: <200309302131.QAA25702@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2003-09-30-ForIncrementExprBug2.cpp added (r1.1) --- Log message: This bug is not fixed, but will be in the future eventually --- Diffs of the changes: Index: llvm/test/Regression/C++Frontend/2003-09-30-ForIncrementExprBug2.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2003-09-30-ForIncrementExprBug2.cpp:1.1 *** /dev/null Tue Sep 30 16:31:35 2003 --- llvm/test/Regression/C++Frontend/2003-09-30-ForIncrementExprBug2.cpp Tue Sep 30 16:31:25 2003 *************** *** 0 **** --- 1,10 ---- + // Test with an opaque type + + struct C; + + C &foo(); + + void foox() { + for (; ; foo()); + } + From lattner at cs.uiuc.edu Tue Sep 30 16:47:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 16:47:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2003-09-30-CommaExprBug.cpp Message-ID: <200309302146.QAA28013@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2003-09-30-CommaExprBug.cpp added (r1.1) --- Log message: New testcase that was not correctly handled --- Diffs of the changes: Index: llvm/test/Regression/C++Frontend/2003-09-30-CommaExprBug.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2003-09-30-CommaExprBug.cpp:1.1 *** /dev/null Tue Sep 30 16:46:33 2003 --- llvm/test/Regression/C++Frontend/2003-09-30-CommaExprBug.cpp Tue Sep 30 16:46:23 2003 *************** *** 0 **** --- 1,8 ---- + class Empty {}; + + void foo(Empty E); + + void bar() { + foo(Empty()); + } + From lattner at cs.uiuc.edu Tue Sep 30 17:25:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Sep 30 17:25:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/Sparc.cpp Message-ID: <200309302224.RAA14664@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: Sparc.cpp updated: 1.82 -> 1.83 --- Log message: Make sure to get the definition of getRegisterAllocator --- Diffs of the changes: Index: llvm/lib/Target/Sparc/Sparc.cpp diff -u llvm/lib/Target/Sparc/Sparc.cpp:1.82 llvm/lib/Target/Sparc/Sparc.cpp:1.83 --- llvm/lib/Target/Sparc/Sparc.cpp:1.82 Tue Sep 30 15:15:04 2003 +++ llvm/lib/Target/Sparc/Sparc.cpp Tue Sep 30 17:24:00 2003 @@ -16,6 +16,7 @@ #include "llvm/CodeGen/InstrSelection.h" #include "llvm/CodeGen/InstrScheduling.h" #include "llvm/CodeGen/MachineCodeForInstruction.h" +#include "llvm/CodeGen/Passes.h" #include "llvm/Target/TargetMachineImpls.h" #include "Support/CommandLine.h" From criswell at cs.uiuc.edu Tue Sep 30 17:56:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Sep 30 17:56:01 2003 Subject: [llvm-commits] CVS: llvm/www/docs/CommandGuide/extract.html Message-ID: <200309302255.RAA22276@choi.cs.uiuc.edu> Changes in directory llvm/www/docs/CommandGuide: extract.html updated: 1.2 -> 1.3 --- Log message: Corrected usage synopsis. Added information regarding additional LLVM passes used, input defaults, and output defaults. --- Diffs of the changes: Index: llvm/www/docs/CommandGuide/extract.html diff -u llvm/www/docs/CommandGuide/extract.html:1.2 llvm/www/docs/CommandGuide/extract.html:1.3 --- llvm/www/docs/CommandGuide/extract.html:1.2 Thu Sep 25 14:50:04 2003 +++ llvm/www/docs/CommandGuide/extract.html Tue Sep 30 17:55:44 2003 @@ -20,7 +20,7 @@ SYNOPSIS

-extract [options] <filename> [filename ...] +extract [options] [filename]

DESCRIPTION

@@ -28,6 +28,14 @@ The extract command takes the name of a function and extracts it from the specified LLVM bytecode file. It is primarily used as a debugging tool to reduce test cases from larger programs that are triggering a bug. +

+ +In addition to extracting the bytecode of the specified function, extract will +also remove unreachable global variables, prototypes, and unused types. +

+ +The extract command will read its input from standard input if filename is +omitted or if filename is -. The output is always written to standard output.

OPTIONS From brukman at cs.uiuc.edu Wed Oct 1 00:26:01 2003 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Wed Oct 1 00:26:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/PreSelection.cpp Message-ID: <200310010525.AAA20183@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: PreSelection.cpp updated: 1.16 -> 1.17 --- Log message: The comment seems irrelevant as the pass has become a BasicBlock pass. --- Diffs of the changes: Index: llvm/lib/Target/Sparc/PreSelection.cpp diff -u llvm/lib/Target/Sparc/PreSelection.cpp:1.16 llvm/lib/Target/Sparc/PreSelection.cpp:1.17 --- llvm/lib/Target/Sparc/PreSelection.cpp:1.16 Mon Sep 1 15:33:07 2003 +++ llvm/lib/Target/Sparc/PreSelection.cpp Wed Oct 1 00:24:50 2003 @@ -109,8 +109,6 @@ //===--------------------------------------------------------------------===// // PreSelection Pass - Specialize LLVM code for the current target machine. - // This was and will be a basicblock pass, but make it a FunctionPass until - // BasicBlockPass ::doFinalization(Function&) is available. // class PreSelection : public BasicBlockPass, public InstVisitor { From alkis at cs.uiuc.edu Wed Oct 1 14:39:01 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed Oct 1 14:39:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp Message-ID: <200310011938.OAA18339@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.25 -> 1.26 --- Log message: Added command line option for linear scan allocator --- Diffs of the changes: Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.25 llvm/lib/Target/X86/X86TargetMachine.cpp:1.26 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.25 Sun Aug 24 14:49:48 2003 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Wed Oct 1 14:38:10 2003 @@ -16,6 +16,14 @@ #include "Support/Statistic.h" namespace { + cl::opt + RegAlloc("regalloc", + cl::desc("Register allocator to use:"), cl::Prefix, + cl::values(clEnumVal(simple, "simple register allocator)"), + clEnumVal(local, "local register allocator"), + clEnumVal(linearscan, "linear scan global register allocator")), + cl::init(local)); + cl::opt NoLocalRA("disable-local-ra", cl::desc("Use Simple RA instead of Local RegAlloc")); cl::opt PrintCode("print-machineinstrs", @@ -113,10 +121,19 @@ PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - if (NoLocalRA) + switch (RegAlloc) { + case simple: PM.add(createSimpleRegisterAllocator()); - else + break; + case local: PM.add(createLocalRegisterAllocator()); + break; + case linearscan: + PM.add(createLinearScanRegisterAllocator()); + break; + default: + assert(0 && "no register allocator selected"); + } if (PrintCode) PM.add(createMachineFunctionPrinterPass()); From alkis at cs.uiuc.edu Wed Oct 1 14:39:07 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed Oct 1 14:39:07 2003 Subject: [llvm-commits] [regalloc_linearscan] CVS: llvm/include/llvm/CodeGen/Passes.h Message-ID: <200310011938.OAA18338@morpheus.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: Passes.h updated: 1.3.2.1 -> 1.3.2.2 --- Log message: Added command line option for linear scan allocator --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/Passes.h diff -u llvm/include/llvm/CodeGen/Passes.h:1.3.2.1 llvm/include/llvm/CodeGen/Passes.h:1.3.2.2 --- llvm/include/llvm/CodeGen/Passes.h:1.3.2.1 Tue Sep 30 14:54:49 2003 +++ llvm/include/llvm/CodeGen/Passes.h Wed Oct 1 14:38:11 2003 @@ -18,6 +18,8 @@ // extern const PassInfo *PHIEliminationID; +enum RegAllocName { simple, local, linearscan }; + /// SimpleRegisterAllocation Pass - This pass converts the input machine code /// from SSA form to use explicit registers by spilling every register. Wow, /// great policy huh? From alkis at cs.uiuc.edu Wed Oct 1 14:41:03 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed Oct 1 14:41:03 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp Message-ID: <200310011940.OAA23003@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.26 -> 1.27 --- Log message: Revert previous change. For some reason this went into the main branch --- Diffs of the changes: Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.26 llvm/lib/Target/X86/X86TargetMachine.cpp:1.27 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.26 Wed Oct 1 14:38:10 2003 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Wed Oct 1 14:40:13 2003 @@ -16,14 +16,6 @@ #include "Support/Statistic.h" namespace { - cl::opt - RegAlloc("regalloc", - cl::desc("Register allocator to use:"), cl::Prefix, - cl::values(clEnumVal(simple, "simple register allocator)"), - clEnumVal(local, "local register allocator"), - clEnumVal(linearscan, "linear scan global register allocator")), - cl::init(local)); - cl::opt NoLocalRA("disable-local-ra", cl::desc("Use Simple RA instead of Local RegAlloc")); cl::opt PrintCode("print-machineinstrs", @@ -121,19 +113,10 @@ PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - switch (RegAlloc) { - case simple: + if (NoLocalRA) PM.add(createSimpleRegisterAllocator()); - break; - case local: + else PM.add(createLocalRegisterAllocator()); - break; - case linearscan: - PM.add(createLinearScanRegisterAllocator()); - break; - default: - assert(0 && "no register allocator selected"); - } if (PrintCode) PM.add(createMachineFunctionPrinterPass()); From alkis at cs.uiuc.edu Wed Oct 1 14:42:00 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed Oct 1 14:42:00 2003 Subject: [llvm-commits] [regalloc_linearscan] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp Message-ID: <200310011941.OAA23020@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.25 -> 1.25.2.1 --- Log message: Added command line option for linear scan allocator --- Diffs of the changes: Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.25 llvm/lib/Target/X86/X86TargetMachine.cpp:1.25.2.1 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.25 Sun Aug 24 14:49:48 2003 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Wed Oct 1 14:41:38 2003 @@ -16,6 +16,14 @@ #include "Support/Statistic.h" namespace { + cl::opt + RegAlloc("regalloc", + cl::desc("Register allocator to use:"), cl::Prefix, + cl::values(clEnumVal(simple, "simple register allocator)"), + clEnumVal(local, "local register allocator"), + clEnumVal(linearscan, "linear scan global register allocator")), + cl::init(local)); + cl::opt NoLocalRA("disable-local-ra", cl::desc("Use Simple RA instead of Local RegAlloc")); cl::opt PrintCode("print-machineinstrs", @@ -113,10 +121,19 @@ PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - if (NoLocalRA) + switch (RegAlloc) { + case simple: PM.add(createSimpleRegisterAllocator()); - else + break; + case local: PM.add(createLocalRegisterAllocator()); + break; + case linearscan: + PM.add(createLinearScanRegisterAllocator()); + break; + default: + assert(0 && "no register allocator selected"); + } if (PrintCode) PM.add(createMachineFunctionPrinterPass()); From lattner at cs.uiuc.edu Wed Oct 1 15:23:13 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 15:23:13 2003 Subject: [llvm-commits] CVS: llvm/www/pubs/2003-10-01-LLVMLifelongOpt.html Message-ID: <200310012022.PAA29407@tank.cs.uiuc.edu> Changes in directory llvm/www/pubs: 2003-10-01-LLVMLifelongOpt.html added (r1.1) --- Log message: Initial checkin of page for the micro paper --- Diffs of the changes: Index: llvm/www/pubs/2003-10-01-LLVMLifelongOpt.html diff -c /dev/null llvm/www/pubs/2003-10-01-LLVMLifelongOpt.html:1.1 *** /dev/null Wed Oct 1 15:22:40 2003 --- llvm/www/pubs/2003-10-01-LLVMLifelongOpt.html Wed Oct 1 15:22:30 2003 *************** *** 0 **** --- 1,71 ---- + + + + LLVA: A Low-level Virtual Instruction Set Architecture + + + +


+ + + LLVA: A Low-level Virtual Instruction Set Architecture +
+ + + Vikram Adve, + Chris Lattner, + Michael Brukman, + Anand Shukla, and + Brian Gaeke +

+ + +

Abstract:

+
+ A virtual instruction set architecture (V-ISA) implemented via a + processor-specific software translation layer can provide great flexibility to + processor designers. Recent examples such as Crusoe and DAISY, however, have + used existing hardware instruction sets as virtual ISAs, which complicates + translation and optimization. In fact, there has been little research on + specific designs for a virtual ISA for processors. This paper proposes a novel + virtual ISA (LLVA) and a translation strategy for implementing it on arbitrary + hardware. The instruction set is typed, uses an infinite virtual register set + in Static Single Assignment form, and provides explicit control-flow and + dataflow information, and yet uses low-level operations closely matched to + traditional hardware. It includes novel mechanisms to allow more flexible + optimization of native code, including a flexible exception model and minor + constraints on self-modifying code. We propose a translation strategy that + enables offline translation and transparent offline caching of native code and + profile information, while remaining completely OS-independent. It also + supports optimizations directly on the representation at install-time, runtime, + and offline between executions. We show experimentally that the virtual ISA is + compact, it is closely matched to ordinary hardware instruction sets, and + permits very fast code generation, yet has enough high-level information to + permit sophisticated program analyses and optimizations. +
+ +

Published:

+
    + "LLVA: A Low-level Virtual Instruction Set Architecture", Vikram Adve, Chris Lattner, Michael Brukman, Anand Shukla, and Brian Gaeke.
    + Proceedings of the 36th annual ACM/IEEE international symposium on Microarchitecture (MICRO-36), San Diego, California, Dec. 2003. +
+ +

Download:

+ + +

Bibtex Entry:

+
+   @InProceedings{ALBSG:MICRO36,
+     author    = {Vikram Adve and Chris Lattner and Michael Brukman and Anand Shukla and Brian Gaeke},
+     title     = {{LLVA: A Low-level Virtual Instruction Set Architecture}},
+     booktitle = {Proceedings of the 36th annual ACM/IEEE international symposium on Microarchitecture (MICRO-36)},
+     address = {San Diego, California},
+     month   = {Dec},
+     year    = {2003}
+   }
+ 
+ + From lattner at cs.uiuc.edu Wed Oct 1 15:26:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 15:26:02 2003 Subject: [llvm-commits] CVS: llvm/www/www-index.html Message-ID: <200310012025.PAA29459@tank.cs.uiuc.edu> Changes in directory llvm/www: www-index.html updated: 1.52 -> 1.53 --- Log message: Add link to new paper --- Diffs of the changes: Index: llvm/www/www-index.html diff -u llvm/www/www-index.html:1.52 llvm/www/www-index.html:1.53 --- llvm/www/www-index.html:1.52 Tue Sep 23 23:59:15 2003 +++ llvm/www/www-index.html Wed Oct 1 15:25:37 2003 @@ -79,6 +79,11 @@
    +
  1. " + LLVA: A Low-level Virtual Instruction Set + Architecture"
    Vikram Adve, Chris Lattner, Michael Brukman, Anand Shukla, and Brian Gaeke. Proc. of the 36th annual ACM/IEEE international symposium on Microarchitecture (MICRO-36), San Diego, CA, December 2003. + +
  2. " Memory Safety Without Runtime Checks or Garbage Collection"
    From lattner at cs.uiuc.edu Wed Oct 1 15:31:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 15:31:03 2003 Subject: [llvm-commits] CVS: llvm/www/www-index.html Message-ID: <200310012030.PAA29588@tank.cs.uiuc.edu> Changes in directory llvm/www: www-index.html updated: 1.53 -> 1.54 --- Log message: unbreak link. --- Diffs of the changes: Index: llvm/www/www-index.html diff -u llvm/www/www-index.html:1.53 llvm/www/www-index.html:1.54 --- llvm/www/www-index.html:1.53 Wed Oct 1 15:25:37 2003 +++ llvm/www/www-index.html Wed Oct 1 15:29:57 2003 @@ -79,10 +79,9 @@
      -
    1. " +
    2. " LLVA: A Low-level Virtual Instruction Set Architecture"
      Vikram Adve, Chris Lattner, Michael Brukman, Anand Shukla, and Brian Gaeke. Proc. of the 36th annual ACM/IEEE international symposium on Microarchitecture (MICRO-36), San Diego, CA, December 2003. -
    3. " Memory Safety Without Runtime Checks or Garbage From lattner at cs.uiuc.edu Wed Oct 1 15:47:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 15:47:01 2003 Subject: [llvm-commits] CVS: llvm/www/pubs/2003-09-30-LifelongOptimizationTR.html Message-ID: <200310012046.PAA29699@tank.cs.uiuc.edu> Changes in directory llvm/www/pubs: 2003-09-30-LifelongOptimizationTR.html added (r1.1) --- Log message: Add page for TR --- Diffs of the changes: Index: llvm/www/pubs/2003-09-30-LifelongOptimizationTR.html diff -c /dev/null llvm/www/pubs/2003-09-30-LifelongOptimizationTR.html:1.1 *** /dev/null Wed Oct 1 15:46:46 2003 --- llvm/www/pubs/2003-09-30-LifelongOptimizationTR.html Wed Oct 1 15:46:36 2003 *************** *** 0 **** --- 1,71 ---- + + + + LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation + + + +


      + + + LLVM: A Compilation Framework for
      + Lifelong Program Analysis & Transformation +

      + + +
      Chris Lattner and + Vikram Adve +

      + + +

      Abstract:

      +
      + This paper describes LLVM (Low Level Virtual Machine), a compiler framework + designed to support transparent, lifelong program analysis and + transformation for arbitrary programs, by providing high-level information to + compiler transformations at compile-time, link-time, run-time, and offline. + LLVM defines a common, low-level code representation in Static Single Assignment + (SSA) form, with several novel features: a simple, language-independent + type-system that exposes the primitives commonly used to implement high-level + language features; an instruction for typed address arithmetic; and a simple + mechanism that can be used to implement the exception handling features of + high-level languages (and setjmp/longjmp in C) uniformly and + efficiently. The LLVM compiler framework and code representation together + provide a combination of key capabilities that are important for practical, + lifelong analysis and transformation of programs. To our knowledge, no existing + compilation approach provides all these capabilities. We describe the design of + the LLVM representation and compiler framework, and evaluate the design in three + ways: (a) the size and effectiveness of the representation, including the type + information it provides; (b) compiler performance for several interprocedural + problems; and (c) illustrative examples of the benefits LLVM provides for + several challenging compiler problems. +
      + +

      Published:

      +
        + "LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation", + Chris Lattner & Vikram Adve
        + Technical Report #UIUCDCS-R-2003-2380, Computer Science Dept., Univ. of Illinois, Sep. 2003. +
      + +

      Download:

      + + +

      Bibtex Entry:

      +
      +   @TechReport{LattnerAdve:LifeLong,
      +     Author      = {Chris Lattner and Vikram Adve},
      +     Title       = {LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation},
      +     Institution = {Computer Science Dept.,
      +                    Univ. of Illinois at Urbana-Champaign},
      +     Number      = {UIUCDCS-R-2003-2380},
      +     Type        = {Tech. Report},
      +     Month       = {Sep},
      +     Year        = {2003}
      +   }
      + 
      + + From lattner at cs.uiuc.edu Wed Oct 1 15:56:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 15:56:02 2003 Subject: [llvm-commits] CVS: llvm/www/www-index.html Message-ID: <200310012055.PAA29809@tank.cs.uiuc.edu> Changes in directory llvm/www: www-index.html updated: 1.54 -> 1.55 --- Log message: Fix link, wrap at 80 cols --- Diffs of the changes: Index: llvm/www/www-index.html diff -u llvm/www/www-index.html:1.54 llvm/www/www-index.html:1.55 --- llvm/www/www-index.html:1.54 Wed Oct 1 15:29:57 2003 +++ llvm/www/www-index.html Wed Oct 1 15:55:23 2003 @@ -79,10 +79,14 @@
        -
      1. " +
      2. " LLVA: A Low-level Virtual Instruction Set - Architecture"
        Vikram Adve, Chris Lattner, Michael Brukman, Anand Shukla, and Brian Gaeke. Proc. of the 36th annual ACM/IEEE international symposium on Microarchitecture (MICRO-36), San Diego, CA, December 2003. - + Architecture"
        Vikram Adve, Chris Lattner, + Michael Brukman, Anand Shukla, and Brian Gaeke. + Proc. + of the 36th annual ACM/IEEE international symposium on + Microarchitecture (MICRO-36), San Diego, CA, + December 2003.
      3. " Memory Safety Without Runtime Checks or Garbage Collection"
        From lattner at cs.uiuc.edu Wed Oct 1 15:58:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 15:58:01 2003 Subject: [llvm-commits] CVS: llvm/www/pubs/2003-10-01-LLVA.html Message-ID: <200310012057.PAA29862@tank.cs.uiuc.edu> Changes in directory llvm/www/pubs: 2003-10-01-LLVA.html updated: 1.1 -> 1.2 --- Log message: Rename files --- Diffs of the changes: Index: llvm/www/pubs/2003-10-01-LLVA.html diff -u llvm/www/pubs/2003-10-01-LLVA.html:1.1 llvm/www/pubs/2003-10-01-LLVA.html:1.2 --- llvm/www/pubs/2003-10-01-LLVA.html:1.1 Wed Oct 1 15:22:30 2003 +++ llvm/www/pubs/2003-10-01-LLVA.html Wed Oct 1 15:57:28 2003 @@ -52,8 +52,8 @@

        Download:

        Bibtex Entry:

        From lattner at cs.uiuc.edu Wed Oct 1 16:13:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 16:13:02 2003 Subject: [llvm-commits] CVS: llvm/utils/getsrcs.sh Message-ID: <200310012113.QAA26006@apoc.cs.uiuc.edu> Changes in directory llvm/utils: getsrcs.sh updated: 1.9 -> 1.10 --- Log message: Make sure to include the "support" directory --- Diffs of the changes: Index: llvm/utils/getsrcs.sh diff -u llvm/utils/getsrcs.sh:1.9 llvm/utils/getsrcs.sh:1.10 --- llvm/utils/getsrcs.sh:1.9 Tue Aug 12 00:11:12 2003 +++ llvm/utils/getsrcs.sh Wed Oct 1 16:12:46 2003 @@ -1,7 +1,7 @@ #!/bin/sh # This is useful because it prints out all of the source files. Useful for # greps. -find www include lib tools utils -name \*.\[cdhyl\]\* | grep -v Lexer.cpp | \ +find support www include lib tools utils -name \*.\[cdhyl\]\* | grep -v Lexer.cpp | \ grep -v llvmAsmParser.cpp | grep -v llvmAsmParser.h | grep -v '~$' | \ grep -v '\.ll$' | grep -v .flc | grep -v Sparc.burm.c | grep -v '\.d$' |\ grep -v '\.dir$' | grep -v www/docs/doxygen | grep -v include/boost | \ From lattner at cs.uiuc.edu Wed Oct 1 16:42:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 16:42:02 2003 Subject: [llvm-commits] CVS: llvm/www/www-index.html Message-ID: <200310012141.QAA00313@tank.cs.uiuc.edu> Changes in directory llvm/www: www-index.html updated: 1.55 -> 1.56 --- Log message: Add a link to the CGO paper tech report --- Diffs of the changes: Index: llvm/www/www-index.html diff -u llvm/www/www-index.html:1.55 llvm/www/www-index.html:1.56 --- llvm/www/www-index.html:1.55 Wed Oct 1 15:55:23 2003 +++ llvm/www/www-index.html Wed Oct 1 16:41:31 2003 @@ -87,6 +87,13 @@ of the 36th annual ACM/IEEE international symposium on Microarchitecture (MICRO-36), San Diego, CA, December 2003. + +
      4. " + LLVM: A Compilation Framework for Lifelong Program + Analysis & Transformation", + Chris Lattner & Vikram Adve.
        + Technical Report #UIUCDCS-R-2003-2380, Computer Science + Dept., Univ. of Illinois, Sep. 2003.
      5. " Memory Safety Without Runtime Checks or Garbage Collection"
        From lattner at cs.uiuc.edu Wed Oct 1 16:51:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 16:51:02 2003 Subject: [llvm-commits] CVS: llvm/www/docs/OpenProjects.html Message-ID: <200310012150.QAA00411@tank.cs.uiuc.edu> Changes in directory llvm/www/docs: OpenProjects.html updated: 1.10 -> 1.11 --- Log message: Amazingly enough, we actually do some stuff around here. Now if we could just remember to update the open projects list... :) --- Diffs of the changes: Index: llvm/www/docs/OpenProjects.html diff -u llvm/www/docs/OpenProjects.html:1.10 llvm/www/docs/OpenProjects.html:1.11 --- llvm/www/docs/OpenProjects.html:1.10 Mon Aug 18 09:41:19 2003 +++ llvm/www/docs/OpenProjects.html Wed Oct 1 16:49:55 2003 @@ -127,9 +127,6 @@
            -
          1. Transform setjmp and longjmp calls to use the LLVM - invoke mechanism. -
          2. Add support for a volatile attribute on loads and stores
          3. Add a new conditional move instruction: X = select bool Cond, Y, Z
          4. Add support for platform independent prefetch support. The GCC prefetch project page @@ -151,8 +148,9 @@ would also then have to implement the reader for this index in gccld.
            -
          5. Improve the efficiency of the bytecode loader/writer, allow streaming lazy - loading of functions from the bytecode (for use by the JIT, for example)
            +
          6. Improve the efficiency of the bytecode loader/writer
            +
          7. Extend the FunctionPassManager to use a ModuleProvider to stream functions + in on demand. This would improve the efficiency of the JIT.
          8. Rework the PassManager to be more flexible
          9. Some transformations and analyses only work on reducible flow graphs. It would be nice to have a transformation which could be "required" by these passes @@ -240,7 +238,6 @@ - A linear time or nearly so algorithm
          10. Implement a strength reduction pass
          11. Value range propagation pass -
          12. Implement a tail recursion elimination pass
          13. Implement an unswitching pass
          14. Write a loop unroller, with a simple heuristic for when to unroll
          @@ -280,6 +277,6 @@
          Chris Lattner
          -Last modified: Wed Aug 6 10:40:05 CDT 2003 +Last modified: Wed Oct 1 16:48:54 CDT 2003 From lattner at cs.uiuc.edu Wed Oct 1 17:29:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 17:29:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/IntervalIterator.h Message-ID: <200310012228.RAA02385@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: IntervalIterator.h updated: 1.14 -> 1.15 --- Log message: Use graph traits to perform generic interval construction --- Diffs of the changes: Index: llvm/include/llvm/Analysis/IntervalIterator.h diff -u llvm/include/llvm/Analysis/IntervalIterator.h:1.14 llvm/include/llvm/Analysis/IntervalIterator.h:1.15 --- llvm/include/llvm/Analysis/IntervalIterator.h:1.14 Tue Sep 30 13:37:40 2003 +++ llvm/include/llvm/Analysis/IntervalIterator.h Wed Oct 1 17:28:00 2003 @@ -76,7 +76,8 @@ -template +template, + class IGT = GraphTraits > > class IntervalIterator { std::stack > IntStack; std::set Visited; @@ -163,8 +164,8 @@ Visited.insert(Header); // The header has now been visited! // Check all of our successors to see if they are in the interval... - for (typename NodeTy::succ_iterator I = succ_begin(Node), - E = succ_end(Node); I != E; ++I) + for (typename GT::ChildIteratorType I = GT::child_begin(Node), + E = GT::child_end(Node); I != E; ++I) ProcessNode(Int, getSourceGraphNode(OrigContainer, *I)); IntStack.push(make_pair(Int, succ_begin(Int))); @@ -194,8 +195,8 @@ Int->Successors.push_back(NodeHeader); } } else { // Otherwise, not in interval yet - for (typename NodeTy::pred_iterator I = pred_begin(Node), - E = pred_end(Node); I != E; ++I) { + for (typename IGT::ChildIteratorType I = IGT::child_begin(Node), + E = IGT::child_end(Node); I != E; ++I) { if (!Int->contains(*I)) { // If pred not in interval, we can't be if (!Int->isSuccessor(NodeHeader)) // Add only if not already in set Int->Successors.push_back(NodeHeader); @@ -217,8 +218,8 @@ // Now that we have discovered that Node is in the interval, perhaps some // of its successors are as well? - for (typename NodeTy::succ_iterator It = succ_begin(Node), - End = succ_end(Node); It != End; ++It) + for (typename GT::ChildIteratorType It = GT::child_begin(Node), + End = GT::child_end(Node); It != End; ++It) ProcessNode(Int, getSourceGraphNode(OrigContainer, *It)); } } From lattner at cs.uiuc.edu Wed Oct 1 17:29:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 17:29:08 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/Interval.h Message-ID: <200310012228.RAA02465@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: Interval.h updated: 1.13 -> 1.14 --- Log message: Add graph traits specializations for intervals --- Diffs of the changes: Index: llvm/include/llvm/Analysis/Interval.h diff -u llvm/include/llvm/Analysis/Interval.h:1.13 llvm/include/llvm/Analysis/Interval.h:1.14 --- llvm/include/llvm/Analysis/Interval.h:1.13 Tue Sep 30 13:37:40 2003 +++ llvm/include/llvm/Analysis/Interval.h Wed Oct 1 17:27:36 2003 @@ -13,6 +13,7 @@ #ifndef LLVM_INTERVAL_H #define LLVM_INTERVAL_H +#include "Support/GraphTraits.h" #include #include @@ -110,5 +111,32 @@ inline Interval::pred_iterator pred_end(Interval *I) { return I->Predecessors.end(); } + +template <> struct GraphTraits { + typedef Interval NodeType; + typedef Interval::succ_iterator ChildIteratorType; + + static NodeType *getEntryNode(Interval *I) { return I; } + + // nodes_iterator/begin/end - Allow iteration over all nodes in the graph + static inline ChildIteratorType child_begin(NodeType *N) { + return succ_begin(N); + } + static inline ChildIteratorType child_end(NodeType *N) { + return succ_end(N); + } +}; + +template <> struct GraphTraits > { + typedef Interval NodeType; + typedef Interval::pred_iterator ChildIteratorType; + static NodeType *getEntryNode(Inverse G) { return G.Graph; } + static inline ChildIteratorType child_begin(NodeType *N) { + return pred_begin(N); + } + static inline ChildIteratorType child_end(NodeType *N) { + return pred_end(N); + } +}; #endif From lattner at cs.uiuc.edu Wed Oct 1 17:29:14 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 17:29:14 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/BasicBlock.h Message-ID: <200310012228.RAA04199@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: BasicBlock.h updated: 1.31 -> 1.32 --- Log message: Remove obsolete scoped pred and succ iterator typedefs --- Diffs of the changes: Index: llvm/include/llvm/BasicBlock.h diff -u llvm/include/llvm/BasicBlock.h:1.31 llvm/include/llvm/BasicBlock.h:1.32 --- llvm/include/llvm/BasicBlock.h:1.31 Tue Sep 30 13:37:37 2003 +++ llvm/include/llvm/BasicBlock.h Wed Oct 1 17:28:39 2003 @@ -89,16 +89,6 @@ TerminatorInst *getTerminator(); const TerminatorInst *const getTerminator() const; - // Provide a scoped predecessor and successor iterator - typedef PredIterator pred_iterator; - typedef PredIterator pred_const_iterator; - - typedef SuccIterator succ_iterator; - typedef SuccIterator succ_const_iterator; - - //===--------------------------------------------------------------------===// /// Instruction iterator methods /// From lattner at cs.uiuc.edu Wed Oct 1 17:35:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 17:35:03 2003 Subject: [llvm-commits] CVS: llvm/www/releases/ Message-ID: <200310012234.RAA13586@apoc.cs.uiuc.edu> Changes in directory llvm/www/releases: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/www/releases added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Wed Oct 1 17:35:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 17:35:10 2003 Subject: [llvm-commits] CVS: llvm/www/releases/1.0/ Message-ID: <200310012234.RAA14002@apoc.cs.uiuc.edu> Changes in directory llvm/www/releases/1.0: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/www/releases/1.0 added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Wed Oct 1 17:37:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 17:37:01 2003 Subject: [llvm-commits] CVS: llvm/www/releases/1.0/index.html Message-ID: <200310012236.RAA00770@tank.cs.uiuc.edu> Changes in directory llvm/www/releases/1.0: index.html added (r1.1) --- Log message: Until we're ready to go public, index.html is empty --- Diffs of the changes: Index: llvm/www/releases/1.0/index.html diff -c /dev/null llvm/www/releases/1.0/index.html:1.1 *** /dev/null Wed Oct 1 17:36:27 2003 --- llvm/www/releases/1.0/index.html Wed Oct 1 17:36:17 2003 *************** *** 0 **** --- 1 ---- + nothing to see here From lattner at cs.uiuc.edu Wed Oct 1 17:38:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 17:38:01 2003 Subject: [llvm-commits] CVS: llvm/www/releases/index.html Message-ID: <200310012237.RAA00806@tank.cs.uiuc.edu> Changes in directory llvm/www/releases: index.html added (r1.1) --- Log message: New file --- Diffs of the changes: Index: llvm/www/releases/index.html diff -c /dev/null llvm/www/releases/index.html:1.1 *** /dev/null Wed Oct 1 17:37:42 2003 --- llvm/www/releases/index.html Wed Oct 1 17:37:32 2003 *************** *** 0 **** --- 1,2 ---- + + LLVM 1.0 Release (date) From alkis at cs.uiuc.edu Wed Oct 1 17:50:01 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed Oct 1 17:50:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/GraphChecker.cpp Message-ID: <200310012249.RAA03967@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: GraphChecker.cpp updated: 1.6 -> 1.7 --- Log message: Use std::string::size_type for for ColonPos to stop gcc from giving a warning --- Diffs of the changes: Index: llvm/lib/Analysis/DataStructure/GraphChecker.cpp diff -u llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.6 llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.7 --- llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.6 Sat Jul 26 18:00:05 2003 +++ llvm/lib/Analysis/DataStructure/GraphChecker.cpp Wed Oct 1 17:49:22 2003 @@ -125,7 +125,7 @@ for (cl::list::iterator I = CheckFlags.begin(), E = CheckFlags.end(); I != E; ++I) { - unsigned ColonPos = I->rfind(':'); + std::string::size_type ColonPos = I->rfind(':'); if (ColonPos == std::string::npos) { std::cerr << "Error: '" << *I << "' is an invalid value for the --dsgc-check-flags option!\n"; From lattner at cs.uiuc.edu Wed Oct 1 22:28:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Oct 1 22:28:01 2003 Subject: [llvm-commits] CVS: llvm/www/www-index.html Message-ID: <200310020327.WAA02236@tank.cs.uiuc.edu> Changes in directory llvm/www: www-index.html updated: 1.56 -> 1.57 --- Log message: Update target date to reflect the slip --- Diffs of the changes: Index: llvm/www/www-index.html diff -u llvm/www/www-index.html:1.56 llvm/www/www-index.html:1.57 --- llvm/www/www-index.html:1.56 Wed Oct 1 16:41:31 2003 +++ llvm/www/www-index.html Wed Oct 1 22:27:20 2003 @@ -163,8 +163,8 @@ We are working towards a public release of the LLVM - infrastructure, and hope to have a distribution available by the - end of September 2003. We expect to include a C front-end, beta + infrastructure, and hope to have a distribution available the + first week of October 2003. We expect to include a C front-end, beta C++ front-end, Sparc and X86 code generators (in both Static and JIT forms), and a mid-level optimizer in this release. This release will be covered under the Changes in directory llvm/www/releases/1.0: ReleaseNotes.html added (r1.1) --- Log message: Initial checkin of the LLVM 1.0 release notes --- Diffs of the changes: Index: llvm/www/releases/1.0/ReleaseNotes.html diff -c /dev/null llvm/www/releases/1.0/ReleaseNotes.html:1.1 *** /dev/null Wed Oct 1 23:57:38 2003 --- llvm/www/releases/1.0/ReleaseNotes.html Wed Oct 1 23:57:28 2003 *************** *** 0 **** --- 1,326 ---- + + LLVM 1.0 Release Notes + + + + +
            LLVM 1.0 Release Notes
          + +
            +
          1. Instroduction +
          2. What's New? +
          3. Installation Instructions +
          4. Known Problems + +
          5. Additional Information +
        + +

        Written by Chris Lattner

        +

      + + + + +
      + Introduction +
        + + + This document contains the release notes for the LLVM compiler infrastructure, + release 1.0. The most up-to-date version of this document can be found on the + LLVM web + site. Since this document may be updated after the release, it is best to + read the copy hosted there. + + + +
      +
      + What's New? +
        + + + This is the first public release of the LLVM compiler infrastructure. As such, + it is all new! In particular, we are providing a stable C compiler, beta C++ + compiler, a C back-end, stable X86 and Sparc V9 static and JIT code generators, + as well as a large suite of scalar and interprocedural optimizations.

        + + TODO: Works on: SPEC CPU 2000

        + TODO: Works on: Olden/Ptrdist benchmarks + + + +

      +
      + Installation Instructions +
        + + + FIXME + + + +
      +
      + Known Problems +
        + + + This section contains all known problems with the LLVM system, listed by + component. As new problems are discovered, they will be added to these + sections, so it is important to check the web version of + this document for up-to-date information. + + + +


      Portability Problems


      Known problems with the LLVM Core


      Known problems with the C front-end


      Known problems with the C++ front-end


      Known problems with the X86 back-end


      Known problems with the Sparc back-end


      Known problems with the C back-end

      +
      + Additional Information +
      + + +
      + +
      By: Chris Lattner
      + + + Last modified: Wed Oct 1 23:56:16 CDT 2003 + + From lattner at cs.uiuc.edu Thu Oct 2 00:08:05 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 00:08:05 2003 Subject: [llvm-commits] CVS: llvm/www/releases/1.0/ReleaseNotes.html Message-ID: <200310020507.AAA02492@tank.cs.uiuc.edu> Changes in directory llvm/www/releases/1.0: ReleaseNotes.html updated: 1.1 -> 1.2 --- Log message: add note about .a files --- Diffs of the changes: Index: llvm/www/releases/1.0/ReleaseNotes.html diff -u llvm/www/releases/1.0/ReleaseNotes.html:1.1 llvm/www/releases/1.0/ReleaseNotes.html:1.2 --- llvm/www/releases/1.0/ReleaseNotes.html:1.1 Wed Oct 1 23:57:28 2003 +++ llvm/www/releases/1.0/ReleaseNotes.html Thu Oct 2 00:07:23 2003 @@ -101,6 +101,8 @@
    4. It is not possible to dlopen an LLVM bytecode file in the JIT.

      +

    5. Linking in static archive files (.a files) is very slow. +


      Known problems with the C front-end

        @@ -321,6 +323,6 @@
        By: Chris Lattner
        -Last modified: Wed Oct 1 23:56:16 CDT 2003 +Last modified: Thu Oct 2 00:06:58 CDT 2003 From lattner at cs.uiuc.edu Thu Oct 2 00:11:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 00:11:04 2003 Subject: [llvm-commits] CVS: llvm/www/releases/1.0/ReleaseNotes.html Message-ID: <200310020509.AAA02543@tank.cs.uiuc.edu> Changes in directory llvm/www/releases/1.0: ReleaseNotes.html updated: 1.2 -> 1.3 --- Log message: fix spleling --- Diffs of the changes: Index: llvm/www/releases/1.0/ReleaseNotes.html diff -u llvm/www/releases/1.0/ReleaseNotes.html:1.2 llvm/www/releases/1.0/ReleaseNotes.html:1.3 --- llvm/www/releases/1.0/ReleaseNotes.html:1.2 Thu Oct 2 00:07:23 2003 +++ llvm/www/releases/1.0/ReleaseNotes.html Thu Oct 2 00:09:46 2003 @@ -7,7 +7,7 @@
          -
        1. Instroduction +
        2. Introduction
        3. What's New?
        4. Installation Instructions
        5. Known Problems @@ -120,7 +120,7 @@ }

          -

        6. The following unix system functionality has not been tested and may not work: +
        7. The following Unix system functionality has not been tested and may not work:
          1. sigsetjmp, siglongjmp - These are not turned into the appropriate invoke/unwind instructions. @@ -288,7 +288,7 @@
          2. Initializers for global variables that include floating point numbers may not be initialized with exactly the right floating point number, if the number is not accurately representable in decimal. This prevents the Olden "power" -benchmark from producing exactly the right results with the C backend.

            +benchmark from producing exactly the right results with the C back-end.

          3. The code produces by the C back-end has only been tested with the Sun CC and GCC compilers. It is possible that it will have to be adjusted to support other From alkis at cs.uiuc.edu Thu Oct 2 01:14:01 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 01:14:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp Message-ID: <200310020613.BAA07059@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.27 -> 1.28 --- Log message: Change llc command line for register allocators --- Diffs of the changes: Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.27 llvm/lib/Target/X86/X86TargetMachine.cpp:1.28 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.27 Wed Oct 1 14:40:13 2003 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Thu Oct 2 01:13:19 2003 @@ -16,8 +16,15 @@ #include "Support/Statistic.h" namespace { - cl::opt NoLocalRA("disable-local-ra", - cl::desc("Use Simple RA instead of Local RegAlloc")); + cl::opt + RegAlloc("regalloc", + cl::desc("Register allocator to use: (default = simple)"), + cl::Prefix, + cl::values(clEnumVal(simple, " simple register allocator"), + clEnumVal(local, " local register allocator"), + 0), + cl::init(local)); + cl::opt PrintCode("print-machineinstrs", cl::desc("Print generated machine code")); cl::opt NoPatternISel("disable-pattern-isel", cl::init(true), @@ -66,10 +73,16 @@ PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - if (NoLocalRA) + switch (RegAlloc) { + case simple: PM.add(createSimpleRegisterAllocator()); - else + break; + case local: PM.add(createLocalRegisterAllocator()); + break; + default: + assert(0 && "no register allocator selected"); + } if (PrintCode) PM.add(createMachineFunctionPrinterPass()); @@ -113,10 +126,16 @@ PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - if (NoLocalRA) + switch (RegAlloc) { + case simple: PM.add(createSimpleRegisterAllocator()); - else + break; + case local: PM.add(createLocalRegisterAllocator()); + break; + default: + assert(0 && "no register allocator selected"); + } if (PrintCode) PM.add(createMachineFunctionPrinterPass()); From alkis at cs.uiuc.edu Thu Oct 2 01:14:10 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 01:14:10 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Jello/2002-12-23-LocalRAProblem.llx 2002-12-23-SubProblem.llx Message-ID: <200310020613.BAA07066@morpheus.cs.uiuc.edu> Changes in directory llvm/test/Regression/Jello: 2002-12-23-LocalRAProblem.llx updated: 1.3 -> 1.4 2002-12-23-SubProblem.llx updated: 1.3 -> 1.4 --- Log message: Change llc command line for register allocators --- Diffs of the changes: Index: llvm/test/Regression/Jello/2002-12-23-LocalRAProblem.llx diff -u llvm/test/Regression/Jello/2002-12-23-LocalRAProblem.llx:1.3 llvm/test/Regression/Jello/2002-12-23-LocalRAProblem.llx:1.4 --- llvm/test/Regression/Jello/2002-12-23-LocalRAProblem.llx:1.3 Mon Sep 15 15:02:53 2003 +++ llvm/test/Regression/Jello/2002-12-23-LocalRAProblem.llx Thu Oct 2 01:13:19 2003 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | lli -force-interpreter=false -disable-local-ra=false +; RUN: llvm-as < %s | lli -force-interpreter=false -regalloc=simple ;-print-machineinstrs int %main() { Index: llvm/test/Regression/Jello/2002-12-23-SubProblem.llx diff -u llvm/test/Regression/Jello/2002-12-23-SubProblem.llx:1.3 llvm/test/Regression/Jello/2002-12-23-SubProblem.llx:1.4 --- llvm/test/Regression/Jello/2002-12-23-SubProblem.llx:1.3 Mon Sep 15 15:02:53 2003 +++ llvm/test/Regression/Jello/2002-12-23-SubProblem.llx Thu Oct 2 01:13:19 2003 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | lli -force-interpreter=false -disable-local-ra +; RUN: llvm-as < %s | lli -force-interpreter=false -regalloc=simple int %main(int %B) { ;%B = add int 0, 1 From alkis at cs.uiuc.edu Thu Oct 2 01:14:16 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 01:14:16 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/Passes.h Message-ID: <200310020613.BAA07058@morpheus.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: Passes.h updated: 1.5 -> 1.6 --- Log message: Change llc command line for register allocators --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/Passes.h diff -u llvm/include/llvm/CodeGen/Passes.h:1.5 llvm/include/llvm/CodeGen/Passes.h:1.6 --- llvm/include/llvm/CodeGen/Passes.h:1.5 Tue Sep 30 15:15:40 2003 +++ llvm/include/llvm/CodeGen/Passes.h Thu Oct 2 01:13:18 2003 @@ -19,6 +19,8 @@ // extern const PassInfo *PHIEliminationID; +enum RegAllocName { simple, local }; + /// SimpleRegisterAllocation Pass - This pass converts the input machine code /// from SSA form to use explicit registers by spilling every register. Wow, /// great policy huh? From alkis at cs.uiuc.edu Thu Oct 2 01:14:22 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 01:14:22 2003 Subject: [llvm-commits] CVS: llvm/www/docs/CommandGuide/llc.html Message-ID: <200310020613.BAA07073@morpheus.cs.uiuc.edu> Changes in directory llvm/www/docs/CommandGuide: llc.html updated: 1.3 -> 1.4 --- Log message: Change llc command line for register allocators --- Diffs of the changes: Index: llvm/www/docs/CommandGuide/llc.html diff -u llvm/www/docs/CommandGuide/llc.html:1.3 llvm/www/docs/CommandGuide/llc.html:1.4 --- llvm/www/docs/CommandGuide/llc.html:1.3 Mon Sep 29 15:10:08 2003 +++ llvm/www/docs/CommandGuide/llc.html Thu Oct 2 01:13:19 2003 @@ -95,11 +95,6 @@ Disable frame pointer elimination optimization.

            -

          4. -disable-local-ra -
            - Use Simple RA instead of Local RegAlloc. -

            -

          5. -disable-pattern-isel
            Use the 'simple' X86 instruction selector. @@ -146,13 +141,11 @@ architectures are:
            - x86 -
            - IA-32 (Pentium and above) -

            + x86 +

            IA-32 (Pentium and above)
            - sparc -
            SPARC V9 + sparc +
            SPARC V9

            @@ -164,6 +157,19 @@

          6. -print-machineinstrs
            Print generated machine code. +

            + +

          7. -regalloc=<ra> +
            + Specify the register allocator to use. The default is simple. + Valid register allocators are: +
            + simple +
            Very simple register allocator
            + + local +
            Local register allocator
            +

          8. -help From alkis at cs.uiuc.edu Thu Oct 2 02:27:01 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 02:27:01 2003 Subject: [llvm-commits] [regalloc_linearscan] CVS: llvm/lib/CodeGen/RegAllocLinearScan.cpp Message-ID: <200310020726.CAA07405@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: RegAllocLinearScan.cpp updated: 1.1.2.1 -> 1.1.2.2 --- Log message: Merge-in from main --- Diffs of the changes: Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.1.2.1 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.1.2.2 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.1.2.1 Tue Sep 30 14:55:02 2003 +++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Thu Oct 2 02:26:01 2003 @@ -5,9 +5,13 @@ //===--------------------------------------------------------------------===// #define DEBUG_TYPE "regalloc" - +#include "llvm/CodeGen/Passes.h" +#include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetMachine.h" +#include "Support/Debug.h" +#include "Support/Statistic.h" +#include namespace { Statistic<> NumSpilled ("ra-linearscan", "Number of registers spilled"); @@ -18,7 +22,6 @@ MachineFunction *MF; const TargetMachine *TM; const MRegisterInfo *RegInfo; - LiveVariables* LV; // StackSlotForVirtReg - Maps virtual regs to the frame index where these // values are spilled. @@ -39,7 +42,6 @@ return "Linear Scan Register Allocator"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); AU.addRequiredID(PHIEliminationID); MachineFunctionPass::getAnalysisUsage(AU); } @@ -58,7 +60,6 @@ TM = &Fn.getTarget(); RegInfo = TM->getRegisterInfo(); - LV = &getAnalysis(); // compute live intervals // liner scan algorithm From alkis at cs.uiuc.edu Thu Oct 2 02:27:09 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 02:27:09 2003 Subject: [llvm-commits] [regalloc_linearscan] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp Message-ID: <200310020726.CAA07413@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.25.2.1 -> 1.25.2.3 --- Log message: Merge-in from main --- Diffs of the changes: Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.25.2.1 llvm/lib/Target/X86/X86TargetMachine.cpp:1.25.2.3 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.25.2.1 Wed Oct 1 14:41:38 2003 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Thu Oct 2 02:26:01 2003 @@ -18,14 +18,14 @@ namespace { cl::opt RegAlloc("regalloc", - cl::desc("Register allocator to use:"), cl::Prefix, - cl::values(clEnumVal(simple, "simple register allocator)"), - clEnumVal(local, "local register allocator"), - clEnumVal(linearscan, "linear scan global register allocator")), + cl::desc("Register allocator to use: (default = simple)"), + cl::Prefix, + cl::values(clEnumVal(simple, " simple register allocator"), + clEnumVal(local, " local register allocator"), + clEnumVal(linearscan, " linear scan global register allocator"), + 0), cl::init(local)); - cl::opt NoLocalRA("disable-local-ra", - cl::desc("Use Simple RA instead of Local RegAlloc")); cl::opt PrintCode("print-machineinstrs", cl::desc("Print generated machine code")); cl::opt NoPatternISel("disable-pattern-isel", cl::init(true), @@ -74,10 +74,18 @@ PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - if (NoLocalRA) + switch (RegAlloc) { + case simple: PM.add(createSimpleRegisterAllocator()); - else + break; + case local: + PM.add(createLocalRegisterAllocator()); + break; + case linearscan: PM.add(createLocalRegisterAllocator()); + default: + assert(0 && "no register allocator selected"); + } if (PrintCode) PM.add(createMachineFunctionPrinterPass()); From alkis at cs.uiuc.edu Thu Oct 2 02:27:15 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 02:27:15 2003 Subject: [llvm-commits] [regalloc_linearscan] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp Message-ID: <200310020726.CAA07396@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.25.2.1 -> 1.25.2.2 --- Log message: Merge-in from main --- Diffs of the changes: Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.25.2.1 llvm/lib/Target/X86/X86TargetMachine.cpp:1.25.2.2 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.25.2.1 Wed Oct 1 14:41:38 2003 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Thu Oct 2 02:26:00 2003 @@ -18,14 +18,14 @@ namespace { cl::opt RegAlloc("regalloc", - cl::desc("Register allocator to use:"), cl::Prefix, - cl::values(clEnumVal(simple, "simple register allocator)"), - clEnumVal(local, "local register allocator"), - clEnumVal(linearscan, "linear scan global register allocator")), + cl::desc("Register allocator to use: (default = simple)"), + cl::Prefix, + cl::values(clEnumVal(simple, " simple register allocator"), + clEnumVal(local, " local register allocator"), + clEnumVal(linearscan, " linear scan global register allocator"), + 0), cl::init(local)); - cl::opt NoLocalRA("disable-local-ra", - cl::desc("Use Simple RA instead of Local RegAlloc")); cl::opt PrintCode("print-machineinstrs", cl::desc("Print generated machine code")); cl::opt NoPatternISel("disable-pattern-isel", cl::init(true), @@ -74,10 +74,18 @@ PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - if (NoLocalRA) + switch (RegAlloc) { + case simple: PM.add(createSimpleRegisterAllocator()); - else + break; + case local: + PM.add(createLocalRegisterAllocator()); + break; + case linearscan: PM.add(createLocalRegisterAllocator()); + default: + assert(0 && "no register allocator selected"); + } if (PrintCode) PM.add(createMachineFunctionPrinterPass()); From alkis at cs.uiuc.edu Thu Oct 2 02:27:22 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 02:27:22 2003 Subject: [llvm-commits] [regalloc_linearscan] CVS: llvm/include/llvm/CodeGen/Passes.h Message-ID: <200310020726.CAA07410@morpheus.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: Passes.h updated: 1.3.2.2 -> 1.3.2.3 --- Log message: Merge-in from main --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/Passes.h diff -u llvm/include/llvm/CodeGen/Passes.h:1.3.2.2 llvm/include/llvm/CodeGen/Passes.h:1.3.2.3 --- llvm/include/llvm/CodeGen/Passes.h:1.3.2.2 Wed Oct 1 14:38:11 2003 +++ llvm/include/llvm/CodeGen/Passes.h Thu Oct 2 02:26:01 2003 @@ -10,6 +10,7 @@ class FunctionPass; class PassInfo; +class TargetMachine; // PHIElimination pass - This pass eliminates machine instruction PHI nodes by // inserting copy instructions. This destroys SSA information, but is the @@ -42,5 +43,10 @@ /// and eliminates abstract frame references. /// FunctionPass *createPrologEpilogCodeInserter(); + + +/// getRegisterAllocator - This creates an instance of the register allocator +/// for the Sparc. +FunctionPass *getRegisterAllocator(TargetMachine &T); #endif From alkis at cs.uiuc.edu Thu Oct 2 02:27:29 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 02:27:29 2003 Subject: [llvm-commits] [regalloc_linearscan] CVS: llvm/include/llvm/CodeGen/Passes.h Message-ID: <200310020726.CAA07426@morpheus.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: Passes.h updated: 1.3.2.2 -> 1.3.2.4 --- Log message: Merge-in from main --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/Passes.h diff -u llvm/include/llvm/CodeGen/Passes.h:1.3.2.2 llvm/include/llvm/CodeGen/Passes.h:1.3.2.4 --- llvm/include/llvm/CodeGen/Passes.h:1.3.2.2 Wed Oct 1 14:38:11 2003 +++ llvm/include/llvm/CodeGen/Passes.h Thu Oct 2 02:26:01 2003 @@ -10,6 +10,7 @@ class FunctionPass; class PassInfo; +class TargetMachine; // PHIElimination pass - This pass eliminates machine instruction PHI nodes by // inserting copy instructions. This destroys SSA information, but is the @@ -42,5 +43,10 @@ /// and eliminates abstract frame references. /// FunctionPass *createPrologEpilogCodeInserter(); + + +/// getRegisterAllocator - This creates an instance of the register allocator +/// for the Sparc. +FunctionPass *getRegisterAllocator(TargetMachine &T); #endif From alkis at cs.uiuc.edu Thu Oct 2 02:27:35 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 02:27:35 2003 Subject: [llvm-commits] [regalloc_linearscan] CVS: llvm/lib/CodeGen/RegAllocLinearScan.cpp Message-ID: <200310020726.CAA07431@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: RegAllocLinearScan.cpp updated: 1.1.2.1 -> 1.1.2.3 --- Log message: Merge-in from main --- Diffs of the changes: Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.1.2.1 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.1.2.3 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.1.2.1 Tue Sep 30 14:55:02 2003 +++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Thu Oct 2 02:26:01 2003 @@ -5,9 +5,13 @@ //===--------------------------------------------------------------------===// #define DEBUG_TYPE "regalloc" - +#include "llvm/CodeGen/Passes.h" +#include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetMachine.h" +#include "Support/Debug.h" +#include "Support/Statistic.h" +#include namespace { Statistic<> NumSpilled ("ra-linearscan", "Number of registers spilled"); @@ -18,7 +22,6 @@ MachineFunction *MF; const TargetMachine *TM; const MRegisterInfo *RegInfo; - LiveVariables* LV; // StackSlotForVirtReg - Maps virtual regs to the frame index where these // values are spilled. @@ -39,7 +42,6 @@ return "Linear Scan Register Allocator"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); AU.addRequiredID(PHIEliminationID); MachineFunctionPass::getAnalysisUsage(AU); } @@ -58,7 +60,6 @@ TM = &Fn.getTarget(); RegInfo = TM->getRegisterInfo(); - LV = &getAnalysis(); // compute live intervals // liner scan algorithm From lattner at cs.uiuc.edu Thu Oct 2 10:12:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 10:12:02 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/add.ll Message-ID: <200310021511.KAA19752@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: add.ll updated: 1.15 -> 1.16 --- Log message: Add new testcases --- Diffs of the changes: Index: llvm/test/Regression/Transforms/InstCombine/add.ll diff -u llvm/test/Regression/Transforms/InstCombine/add.ll:1.15 llvm/test/Regression/Transforms/InstCombine/add.ll:1.16 --- llvm/test/Regression/Transforms/InstCombine/add.ll:1.15 Fri Sep 19 10:33:46 2003 +++ llvm/test/Regression/Transforms/InstCombine/add.ll Thu Oct 2 10:11:09 2003 @@ -105,3 +105,14 @@ ret ubyte %C } +int %test17(int %A) { + %B = xor int %A, -1 + %C = add int %B, 1 ; == sub int 0, %A + ret int %C +} + +ubyte %test18(ubyte %A) { + %B = xor ubyte %A, 255 + %C = add ubyte %B, 17 ; == sub ubyte 16, %A + ret ubyte %C +} From lattner at cs.uiuc.edu Thu Oct 2 10:12:14 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 10:12:14 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200310021511.KAA19761@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.123 -> 1.124 --- Log message: Implement InstCombine/add.ll:test17 & 18 --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.123 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.124 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.123 Mon Sep 22 15:33:21 2003 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Oct 2 10:11:26 2003 @@ -437,6 +437,22 @@ if (Constant *C2 = dyn_castMaskingAnd(RHS)) if (Instruction *R = AssociativeOpt(I, AddMaskingAnd(C2))) return R; + if (ConstantInt *CRHS = dyn_cast(RHS)) { + if (Instruction *ILHS = dyn_cast(LHS)) { + switch (ILHS->getOpcode()) { + case Instruction::Xor: + // ~X + C --> (C-1) - X + if (ConstantInt *XorRHS = dyn_cast(ILHS->getOperand(1))) + if (XorRHS->isAllOnesValue()) + return BinaryOperator::create(Instruction::Sub, + *CRHS - *ConstantInt::get(I.getType(), 1), + ILHS->getOperand(0)); + break; + default: break; + } + } + } + return Changed ? &I : 0; } From lattner at cs.uiuc.edu Thu Oct 2 11:39:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 11:39:02 2003 Subject: [llvm-commits] CVS: llvm/www/releases/1.0/ReleaseNotes.html Message-ID: <200310021638.LAA06860@tank.cs.uiuc.edu> Changes in directory llvm/www/releases/1.0: ReleaseNotes.html updated: 1.3 -> 1.4 --- Log message: Add ideas and small revisions from Vikram --- Diffs of the changes: Index: llvm/www/releases/1.0/ReleaseNotes.html diff -u llvm/www/releases/1.0/ReleaseNotes.html:1.3 llvm/www/releases/1.0/ReleaseNotes.html:1.4 --- llvm/www/releases/1.0/ReleaseNotes.html:1.3 Thu Oct 2 00:09:46 2003 +++ llvm/www/releases/1.0/ReleaseNotes.html Thu Oct 2 11:38:05 2003 @@ -9,10 +9,11 @@
            1. Introduction
            2. What's New? +
            3. Portability and Supported Platforms
            4. Installation Instructions
            5. Known Problems
                -
              • Portability Problems +
              • Known problems with the LLVM Core
              • Known problems with the C Front-end
              • Known problems with the C++ Front-end @@ -37,8 +38,10 @@ This document contains the release notes for the LLVM compiler infrastructure, release 1.0. The most up-to-date version of this document can be found on the LLVM web -site. Since this document may be updated after the release, it is best to -read the copy hosted there. +site. If you are not reading this on the LLVM web pages, you should +probably go there, because this document may be updated after the release.

                + +FIXME: What is this document? Where do I find other documents?

                @@ -54,7 +57,26 @@ as well as a large suite of scalar and interprocedural optimizations.

                TODO: Works on: SPEC CPU 2000

                -TODO: Works on: Olden/Ptrdist benchmarks +TODO: Works on: Olden/Ptrdist benchmarks

                + +The What's New section should give a bulletted list of what is +included, perhaps a couple of lists (Stable, Beta).

                + +It would be useful to give a pointer to a list of the available passes (at least +for the standard compiler techniques).

                + + + +

              +
              +Portability and Supported Platforms +
                + + +LLVM has only been extensively tested on ia32-linux and sparc-solaris machines. +The core LLVM infrastructure uses "autoconf" for portability, so hopefully we +work on more platforms than that. However, it is extremely likely that we +missed something. We welcome portability patches and error messages.

                @@ -76,18 +98,13 @@ This section contains all known problems with the LLVM system, listed by component. As new problems are discovered, they will be added to these -sections, so it is important to check the web version of -this document for up-to-date information. +sections. + @@ -109,8 +126,8 @@

              • Inline assembly is not yet supported.

              • "long double" is transformed by the front-end into "double". There is no - support for floating point data types of any size other than 32 and 64 bits. -

                + support for floating point data types of any size other than 32 and 64 bits. +

              • C99 Variable sized arrays do not release stack memory when they go out of scope. Thus, the following program may run out of stack space:
                @@ -194,7 +211,7 @@
                   
                1. Statement Exprs: Putting statements and declarations inside expressions.
                2. Typeof: typeof: referring to the type of an expression. -
                3. Lvalues: Using ?:, , and casts in lvalues. +
                4. Lvalues: Using ?:, "," and casts in lvalues.
                5. Conditionals: Omitting the middle operand of a ?: expression.
                6. Long Long: Double-word integers.
                7. Complex: Data types for complex numbers. @@ -246,16 +263,21 @@ href="http://gcc.gnu.org/gcc-3.4/changes.html">GCC 3.4 release notes.

                8. Destructors for local objects are not always run when a longjmp is - performed. In particular, destructors for objects in the longjmping + performed. In particular, destructors for objects in the longjmping function and in the setjmp receiver function may not be run. Objects in intervening stack frames will be destroyed however (which is better than most compilers).

                  -

                9. The calling conventions and name mangling used by the LLVM C++ front-end do - follow the Itanium C++ - ABI, and thus we should be binary compatible with native C++ code - compiled with a recent GCC compiler. However, the exception handling - mechanisms are very different, so they will not interact correctly. +
                10. The LLVM C++ front-end follows the Itanium C++ ABI. + This document, which is not Itanium specific, specifies a standard for name + mangling, class layout, v-table layout, RTTI formats, and other C++ + representation issues. Because we use this API, code generated by the LLVM + compilers should be binary compatible with machine code generated by other + Itanium ABI C++ compilers (such as G++, the Intel and HP compilers, etc). + However, the exception handling mechanism used by LLVM is very + different from the model used in the Itanium ABI, so exceptions will not + interact correctly .


              Known problems with the X86 back-end

                @@ -323,6 +345,6 @@
                By: Chris Lattner
                -Last modified: Thu Oct 2 00:06:58 CDT 2003 +Last modified: Thu Oct 2 11:37:25 CDT 2003 From alkis at cs.uiuc.edu Thu Oct 2 11:58:02 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 11:58:02 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/Passes.h Message-ID: <200310021658.LAA10116@morpheus.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: Passes.h updated: 1.6 -> 1.7 --- Log message: Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller. --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/Passes.h diff -u llvm/include/llvm/CodeGen/Passes.h:1.6 llvm/include/llvm/CodeGen/Passes.h:1.7 --- llvm/include/llvm/CodeGen/Passes.h:1.6 Thu Oct 2 01:13:18 2003 +++ llvm/include/llvm/CodeGen/Passes.h Thu Oct 2 11:57:49 2003 @@ -19,7 +19,9 @@ // extern const PassInfo *PHIEliminationID; -enum RegAllocName { simple, local }; +/// Creates a register allocator as the user specified on the command +/// line. +FunctionPass *createRegisterAllocator(); /// SimpleRegisterAllocation Pass - This pass converts the input machine code /// from SSA form to use explicit registers by spilling every register. Wow, From alkis at cs.uiuc.edu Thu Oct 2 11:59:01 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 11:59:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/Passes.cpp Message-ID: <200310021658.LAA10106@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: Passes.cpp added (r1.1) --- Log message: Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller. --- Diffs of the changes: Index: llvm/lib/CodeGen/Passes.cpp diff -c /dev/null llvm/lib/CodeGen/Passes.cpp:1.1 *** /dev/null Thu Oct 2 11:58:00 2003 --- llvm/lib/CodeGen/Passes.cpp Thu Oct 2 11:57:49 2003 *************** *** 0 **** --- 1,35 ---- + //===-- Passes.cpp - Target independent code generation passes -*- C++ -*-===// + // + // This file defines interfaces to access the target independent code + // generation passes provided by the LLVM backend. + // + //===---------------------------------------------------------------------===// + + #include "llvm/CodeGen/Passes.h" + #include "Support/CommandLine.h" + + namespace { + enum RegAllocName { simple, local }; + + cl::opt + RegAlloc("regalloc", + cl::desc("Register allocator to use: (default = simple)"), + cl::Prefix, + cl::values(clEnumVal(simple, " simple register allocator"), + clEnumVal(local, " local register allocator"), + 0), + cl::init(local)); + } + + FunctionPass *createRegisterAllocator() + { + switch (RegAlloc) { + case simple: + return createSimpleRegisterAllocator(); + case local: + return createLocalRegisterAllocator(); + default: + assert(0 && "no register allocator selected"); + return 0; // not reached + } + } From alkis at cs.uiuc.edu Thu Oct 2 11:59:07 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 11:59:07 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp Message-ID: <200310021658.LAA10104@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.28 -> 1.29 --- Log message: Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller. --- Diffs of the changes: Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.28 llvm/lib/Target/X86/X86TargetMachine.cpp:1.29 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.28 Thu Oct 2 01:13:19 2003 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Thu Oct 2 11:57:49 2003 @@ -16,15 +16,6 @@ #include "Support/Statistic.h" namespace { - cl::opt - RegAlloc("regalloc", - cl::desc("Register allocator to use: (default = simple)"), - cl::Prefix, - cl::values(clEnumVal(simple, " simple register allocator"), - clEnumVal(local, " local register allocator"), - 0), - cl::init(local)); - cl::opt PrintCode("print-machineinstrs", cl::desc("Print generated machine code")); cl::opt NoPatternISel("disable-pattern-isel", cl::init(true), @@ -73,16 +64,7 @@ PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - switch (RegAlloc) { - case simple: - PM.add(createSimpleRegisterAllocator()); - break; - case local: - PM.add(createLocalRegisterAllocator()); - break; - default: - assert(0 && "no register allocator selected"); - } + PM.add(createRegisterAllocator()); if (PrintCode) PM.add(createMachineFunctionPrinterPass()); @@ -126,16 +108,7 @@ PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - switch (RegAlloc) { - case simple: - PM.add(createSimpleRegisterAllocator()); - break; - case local: - PM.add(createLocalRegisterAllocator()); - break; - default: - assert(0 && "no register allocator selected"); - } + PM.add(createRegisterAllocator()); if (PrintCode) PM.add(createMachineFunctionPrinterPass()); From alkis at cs.uiuc.edu Thu Oct 2 12:18:02 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 12:18:02 2003 Subject: [llvm-commits] [regalloc_linearscan] CVS: llvm/include/llvm/CodeGen/Passes.h Message-ID: <200310021717.MAA10995@morpheus.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: Passes.h updated: 1.3.2.4 -> 1.3.2.5 --- Log message: Merge-in from main --- Diffs of the changes: Index: llvm/include/llvm/CodeGen/Passes.h diff -u llvm/include/llvm/CodeGen/Passes.h:1.3.2.4 llvm/include/llvm/CodeGen/Passes.h:1.3.2.5 --- llvm/include/llvm/CodeGen/Passes.h:1.3.2.4 Thu Oct 2 02:26:01 2003 +++ llvm/include/llvm/CodeGen/Passes.h Thu Oct 2 12:17:03 2003 @@ -19,7 +19,9 @@ // extern const PassInfo *PHIEliminationID; -enum RegAllocName { simple, local, linearscan }; +/// Creates a register allocator as the user specified on the command +/// line. +FunctionPass *createRegisterAllocator(); /// SimpleRegisterAllocation Pass - This pass converts the input machine code /// from SSA form to use explicit registers by spilling every register. Wow, From alkis at cs.uiuc.edu Thu Oct 2 12:18:09 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 12:18:09 2003 Subject: [llvm-commits] [regalloc_linearscan] CVS: llvm/lib/CodeGen/Passes.cpp Message-ID: <200310021717.MAA10992@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: Passes.cpp updated: 1.1 -> 1.1.2.1 --- Log message: Merge-in from main --- Diffs of the changes: Index: llvm/lib/CodeGen/Passes.cpp diff -u llvm/lib/CodeGen/Passes.cpp:1.1 llvm/lib/CodeGen/Passes.cpp:1.1.2.1 --- llvm/lib/CodeGen/Passes.cpp:1.1 Thu Oct 2 11:57:49 2003 +++ llvm/lib/CodeGen/Passes.cpp Thu Oct 2 12:17:02 2003 @@ -9,7 +9,7 @@ #include "Support/CommandLine.h" namespace { - enum RegAllocName { simple, local }; + enum RegAllocName { simple, local, linearscan }; cl::opt RegAlloc("regalloc", @@ -17,6 +17,7 @@ cl::Prefix, cl::values(clEnumVal(simple, " simple register allocator"), clEnumVal(local, " local register allocator"), + clEnumVal(local, " linear-scan global register allocator"), 0), cl::init(local)); } @@ -28,6 +29,8 @@ return createSimpleRegisterAllocator(); case local: return createLocalRegisterAllocator(); + case linearscan: + return createLinearScanRegisterAllocator(); default: assert(0 && "no register allocator selected"); return 0; // not reached From alkis at cs.uiuc.edu Thu Oct 2 12:20:01 2003 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu Oct 2 12:20:01 2003 Subject: [llvm-commits] [regalloc_linearscan] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp Message-ID: <200310021719.MAA11083@morpheus.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.25.2.3 -> 1.25.2.4 --- Log message: Merge-in from main --- Diffs of the changes: Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.25.2.3 llvm/lib/Target/X86/X86TargetMachine.cpp:1.25.2.4 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.25.2.3 Thu Oct 2 02:26:01 2003 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Thu Oct 2 12:19:46 2003 @@ -16,16 +16,6 @@ #include "Support/Statistic.h" namespace { - cl::opt - RegAlloc("regalloc", - cl::desc("Register allocator to use: (default = simple)"), - cl::Prefix, - cl::values(clEnumVal(simple, " simple register allocator"), - clEnumVal(local, " local register allocator"), - clEnumVal(linearscan, " linear scan global register allocator"), - 0), - cl::init(local)); - cl::opt PrintCode("print-machineinstrs", cl::desc("Print generated machine code")); cl::opt NoPatternISel("disable-pattern-isel", cl::init(true), @@ -74,18 +64,7 @@ PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - switch (RegAlloc) { - case simple: - PM.add(createSimpleRegisterAllocator()); - break; - case local: - PM.add(createLocalRegisterAllocator()); - break; - case linearscan: - PM.add(createLocalRegisterAllocator()); - default: - assert(0 && "no register allocator selected"); - } + PM.add(createRegisterAllocator()); if (PrintCode) PM.add(createMachineFunctionPrinterPass()); @@ -129,19 +108,7 @@ PM.add(createMachineFunctionPrinterPass()); // Perform register allocation to convert to a concrete x86 representation - switch (RegAlloc) { - case simple: - PM.add(createSimpleRegisterAllocator()); - break; - case local: - PM.add(createLocalRegisterAllocator()); - break; - case linearscan: - PM.add(createLinearScanRegisterAllocator()); - break; - default: - assert(0 && "no register allocator selected"); - } + PM.add(createRegisterAllocator()); if (PrintCode) PM.add(createMachineFunctionPrinterPass()); From criswell at cs.uiuc.edu Thu Oct 2 13:19:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Oct 2 13:19:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTestDB/QMTest/llvm.py Message-ID: <200310021818.NAA05440@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTestDB/QMTest: llvm.py updated: 1.11 -> 1.12 --- Log message: TestRunner tests now run in their temporary directory as opposed to running in the source tree. This will hopefully prevent core files and bugpoint output from being dumped into the source tree. --- Diffs of the changes: Index: llvm/test/QMTestDB/QMTest/llvm.py diff -u llvm/test/QMTestDB/QMTest/llvm.py:1.11 llvm/test/QMTestDB/QMTest/llvm.py:1.12 --- llvm/test/QMTestDB/QMTest/llvm.py:1.11 Tue Sep 30 14:56:35 2003 +++ llvm/test/QMTestDB/QMTest/llvm.py Thu Oct 2 13:18:36 2003 @@ -983,7 +983,7 @@ # # Execute the script using TestRunner. # - command = '/bin/sh ' + scriptfile + ' > ' + outputfile + ' 2>&1' + command = 'cd ' + tmpdir + ';/bin/sh ' + scriptfile + ' > ' + outputfile + ' 2>&1' estatus=os.system (command) if ((os.WIFEXITED(estatus)) and (os.WEXITSTATUS(estatus) != 0)): result.Fail('Script: ' + scriptfile + '\n Output: ' + outputfile) From lattner at cs.uiuc.edu Thu Oct 2 13:27:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 13:27:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2003-10-02-UnionLValueError.c Message-ID: <200310021826.NAA20580@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2003-10-02-UnionLValueError.c added (r1.1) --- Log message: Checkin new file, reduced by Brian --- Diffs of the changes: Index: llvm/test/Regression/CFrontend/2003-10-02-UnionLValueError.c diff -c /dev/null llvm/test/Regression/CFrontend/2003-10-02-UnionLValueError.c:1.1 *** /dev/null Thu Oct 2 13:26:21 2003 --- llvm/test/Regression/CFrontend/2003-10-02-UnionLValueError.c Thu Oct 2 13:26:11 2003 *************** *** 0 **** --- 1,9 ---- + union U{ + int i[8]; + char s[80]; + }; + + void format_message(char *buffer, union U *u) { + sprintf(buffer, u->s); + } + From lattner at cs.uiuc.edu Thu Oct 2 13:49:09 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 13:49:09 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/LLC/badfuncptr.c badidx.c bigstack.c callargs.c casts.c globalrefs.c poisson.c testtrace.c varargs.c Message-ID: <200310021848.NAA21862@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/LLC: badfuncptr.c (r1.2) removed badidx.c (r1.1) removed bigstack.c (r1.1) removed callargs.c (r1.1) removed casts.c (r1.3) removed globalrefs.c (r1.2) removed poisson.c (r1.1) removed testtrace.c (r1.1) removed varargs.c (r1.1) removed --- Log message: Remove obsolete tests which: A. do not just test LLC, or even the sparc backend B. are cut down versions of tests that exist in other places --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Oct 2 14:01:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 14:01:01 2003 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200310021900.OAA01844@apoc.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.124 -> 1.125 --- Log message: The objects mapped are really PATypeHolders, not PATypeHandles --- Diffs of the changes: Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.124 llvm/lib/AsmParser/llvmAsmParser.y:1.125 --- llvm/lib/AsmParser/llvmAsmParser.y:1.124 Mon Sep 8 15:29:46 2003 +++ llvm/lib/AsmParser/llvmAsmParser.y Thu Oct 2 14:00:34 2003 @@ -809,7 +809,7 @@ | UpRTypesV '(' ArgTypeListI ')' { // Function derived type? std::vector Params; mapto($3->begin(), $3->end(), std::back_inserter(Params), - std::mem_fun_ref(&PATypeHandle::get)); + std::mem_fun_ref(&PATypeHolder::get)); bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); @@ -824,7 +824,7 @@ | '{' TypeListI '}' { // Structure type? std::vector Elements; mapto($2->begin(), $2->end(), std::back_inserter(Elements), - std::mem_fun_ref(&PATypeHandle::get)); + std::mem_fun_ref(&PATypeHolder::get)); $$ = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); delete $2; From criswell at cs.uiuc.edu Thu Oct 2 14:03:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Oct 2 14:03:01 2003 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200310021902.OAA21994@choi.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.38 -> 1.39 --- Log message: Removed the check for purify as we don't support its use at present. --- Diffs of the changes: Index: llvm/configure diff -u llvm/configure:1.38 llvm/configure:1.39 --- llvm/configure:1.38 Tue Sep 30 14:41:13 2003 +++ llvm/configure Thu Oct 2 14:02:28 2003 @@ -466,7 +466,7 @@ #endif" ac_unique_file=""Makefile.config.in"" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS subdirs INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVMGCCDIR ARCH CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT YACC EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL RPWD SED RM MKDIR DATE MV DOT ETAGS PURIFY PYTHON QMTEST ALLOCA LIBOBJS MMAP_FILE ENABLE_PURIFY ENABLE_OPTIMIZED USE_SPEC UPB DISABLE_LLC_DIFFS JIT SPEC_ROOT BCR PAPIDIR LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS subdirs INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVMGCCDIR ARCH CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT YACC EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL RPWD SED RM MKDIR DATE MV DOT ETAGS PYTHON QMTEST ALLOCA LIBOBJS MMAP_FILE ENABLE_PURIFY ENABLE_OPTIMIZED USE_SPEC UPB DISABLE_LLC_DIFFS JIT SPEC_ROOT BCR PAPIDIR PURIFY LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -18936,47 +18936,6 @@ fi -# Extract the first word of "purify", so it can be a program name with args. -set dummy purify; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PURIFY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PURIFY in - [\\/]* | ?:[\\/]*) - ac_cv_path_PURIFY="$PURIFY" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PURIFY="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_PURIFY" && ac_cv_path_PURIFY="false" - ;; -esac -fi -PURIFY=$ac_cv_path_PURIFY - -if test -n "$PURIFY"; then - echo "$as_me:$LINENO: result: $PURIFY" >&5 -echo "${ECHO_T}$PURIFY" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - # Extract the first word of "python", so it can be a program name with args. set dummy python; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -23913,7 +23872,6 @@ s, at MV@,$MV,;t t s, at DOT@,$DOT,;t t s, at ETAGS@,$ETAGS,;t t -s, at PURIFY@,$PURIFY,;t t s, at PYTHON@,$PYTHON,;t t s, at QMTEST@,$QMTEST,;t t s, at ALLOCA@,$ALLOCA,;t t @@ -23928,6 +23886,7 @@ s, at SPEC_ROOT@,$SPEC_ROOT,;t t s, at BCR@,$BCR,;t t s, at PAPIDIR@,$PAPIDIR,;t t +s, at PURIFY@,$PURIFY,;t t s, at LTLIBOBJS@,$LTLIBOBJS,;t t CEOF From criswell at cs.uiuc.edu Thu Oct 2 14:03:08 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Oct 2 14:03:08 2003 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200310021902.OAA22001@choi.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.30 -> 1.31 --- Log message: Removed the check for purify as we don't support its use at present. --- Diffs of the changes: Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.30 llvm/autoconf/configure.ac:1.31 --- llvm/autoconf/configure.ac:1.30 Tue Sep 30 14:41:15 2003 +++ llvm/autoconf/configure.ac Thu Oct 2 14:02:30 2003 @@ -367,8 +367,6 @@ AC_PATH_PROG(ETAGS,[etags],[false]) -AC_PATH_PROG(PURIFY,[purify],[false]) - AC_PATH_PROG(PYTHON,[python],[false]) if test ${PYTHON} = "false" then From criswell at cs.uiuc.edu Thu Oct 2 14:03:15 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Oct 2 14:03:15 2003 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200310021902.OAA22006@choi.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.141 -> 1.142 --- Log message: Fixed the conditional targets for postscript files and tags. --- Diffs of the changes: Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.141 llvm/Makefile.rules:1.142 --- llvm/Makefile.rules:1.141 Thu Sep 18 13:37:08 2003 +++ llvm/Makefile.rules Thu Oct 2 14:02:02 2003 @@ -550,7 +550,7 @@ # Create a TAGS database for emacs #------------------------------------------------------------------------ -ifdef ETAGS +ifneq ($(ETAGS),false) ifeq ($(LEVEL), .) SRCDIRS := $(wildcard $(SourceDir)/include $(SourceDir)/lib $(SourceDir)/tools) @@ -729,7 +729,7 @@ @$(DATE) > $@ # To create postscript files from dot files... -ifdef DOT +ifneq ($(DOT),false) %.ps: %.dot ${DOT} -Tps < $< > $@ else From lattner at cs.uiuc.edu Thu Oct 2 14:09:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 14:09:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/AbstractTypeUser.h Message-ID: <200310021908.OAA21595@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: AbstractTypeUser.h updated: 1.12 -> 1.13 --- Log message: There is no reason for the PATypeHolder class to derive from the PATypeHandle class --- Diffs of the changes: Index: llvm/include/llvm/AbstractTypeUser.h diff -u llvm/include/llvm/AbstractTypeUser.h:1.12 llvm/include/llvm/AbstractTypeUser.h:1.13 --- llvm/include/llvm/AbstractTypeUser.h:1.12 Tue Sep 30 13:44:27 2003 +++ llvm/include/llvm/AbstractTypeUser.h Thu Oct 2 14:08:18 2003 @@ -127,10 +127,17 @@ // as both a handle (as above) and an AbstractTypeUser. It uses the callback to // keep its pointer member updated to the current version of the type. // -struct PATypeHolder : public AbstractTypeUser, public PATypeHandle { - inline PATypeHolder(const Type *ty) : PATypeHandle(ty, this) {} - inline PATypeHolder(const PATypeHolder &T) - : AbstractTypeUser(T), PATypeHandle(T, this) {} +class PATypeHolder : public AbstractTypeUser { + PATypeHandle Handle; +public: + PATypeHolder(const Type *ty) : Handle(ty, this) {} + PATypeHolder(const PATypeHolder &T) : AbstractTypeUser(), Handle(T, this) {} + + operator const Type *() const { return Handle; } + const Type *get() const { return Handle; } + + // operator-> - Allow user to dereference handle naturally... + inline const Type *operator->() const { return Handle; } // refineAbstractType - All we do is update our PATypeHandle member to point // to the new type. @@ -140,23 +147,23 @@ // Check to see if the type just became concrete. If so, we have to // removeUser to get off its AbstractTypeUser list - removeUserFromConcrete(); + Handle.removeUserFromConcrete(); if ((const Type*)OldTy != NewTy) - PATypeHandle::operator=(NewTy); + Handle.operator=(NewTy); } // operator= - Allow assignment to handle - inline const Type *operator=(const Type *ty) { - return PATypeHandle::operator=(ty); + const Type *operator=(const Type *ty) { + return Handle = ty; } // operator= - Allow assignment to handle - inline const Type *operator=(const PATypeHandle &T) { - return PATypeHandle::operator=(T); + const Type *operator=(const PATypeHandle &T) { + return Handle = T; } - inline const Type *operator=(const PATypeHolder &H) { - return PATypeHandle::operator=(H); + const Type *operator=(const PATypeHolder &H) { + return Handle = H; } void dump() const; From lattner at cs.uiuc.edu Thu Oct 2 14:44:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 14:44:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C/globalrefs.c Message-ID: <200310021943.OAA19789@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C: globalrefs.c updated: 1.2 -> 1.3 --- Log message: Make the test more portable --- Diffs of the changes: Index: llvm/test/Programs/SingleSource/Regression/C/globalrefs.c diff -u llvm/test/Programs/SingleSource/Regression/C/globalrefs.c:1.2 llvm/test/Programs/SingleSource/Regression/C/globalrefs.c:1.3 --- llvm/test/Programs/SingleSource/Regression/C/globalrefs.c:1.2 Sat Oct 12 18:47:36 2002 +++ llvm/test/Programs/SingleSource/Regression/C/globalrefs.c Thu Oct 2 14:43:08 2003 @@ -29,7 +29,7 @@ void printdiff(void* p1, void* p2) { - printf(" 0x%lx", (unsigned long) p1 - (unsigned long) p2); + printf(" %d", (int)((unsigned long) p1 - (unsigned long) p2)); } int @@ -37,7 +37,7 @@ { unsigned long diff1, diff2, diff3, diff4; - printf("sizeof(struct Test) = %llu\n\n", sizeof(struct test)); + printf("sizeof(struct Test) = %d\n\n", (int)sizeof(struct test)); printdiff(&TestArray[3], TestArray); printdiff(&Test1.A, &TestArray[3]); From lattner at cs.uiuc.edu Thu Oct 2 14:45:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 14:45:00 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h Value.h Message-ID: <200310021944.OAA19806@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: DerivedTypes.h updated: 1.39 -> 1.40 Value.h updated: 1.43 -> 1.44 --- Log message: There is no reason for Value to be an AbstractTypeUser. This just makes things significantly more complete. Instead, just make DerivedType's AbstractTypeUser's, and make Value contain a PATypeHolder. This will also be more efficient in the future. --- Diffs of the changes: Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.39 llvm/include/llvm/DerivedTypes.h:1.40 --- llvm/include/llvm/DerivedTypes.h:1.39 Tue Sep 30 13:37:37 2003 +++ llvm/include/llvm/DerivedTypes.h Thu Oct 2 14:44:23 2003 @@ -19,7 +19,7 @@ class StructValType; class PointerValType; -class DerivedType : public Type { +class DerivedType : public Type, public AbstractTypeUser { char isRefining; // Used for recursive types // AbstractTypeUsers - Implement a list of the users that need to be notified @@ -80,6 +80,8 @@ refineAbstractTypeToInternal(NewType, true); } + void dump() const { Value::dump(); } + // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const DerivedType *T) { return true; } static inline bool classof(const Type *T) { @@ -149,7 +151,6 @@ const std::vector &Params, bool isVarArg); - // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const FunctionType *T) { return true; } static inline bool classof(const Type *T) { @@ -409,6 +410,16 @@ static OpaqueType *get() { return new OpaqueType(); // All opaque types are distinct } + + // refineAbstractType - Called when a contained type is found to be more + // concrete - this could potentially change us from an abstract type to a + // concrete type. + // + virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { + // This class never uses other types! + abort(); + } + // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const OpaqueType *T) { return true; } Index: llvm/include/llvm/Value.h diff -u llvm/include/llvm/Value.h:1.43 llvm/include/llvm/Value.h:1.44 --- llvm/include/llvm/Value.h:1.43 Tue Sep 30 13:37:37 2003 +++ llvm/include/llvm/Value.h Thu Oct 2 14:44:23 2003 @@ -34,9 +34,7 @@ /// Value - The base class of all values computed by a program that may be used /// as operands to other values. /// -class Value : public Annotable, // Values are annotable - public AbstractTypeUser { // Values use potentially abstract types -public: +struct Value : public Annotable { // Values are annotable enum ValueTy { TypeVal, // This is an instance of Type ConstantVal, // This is an instance of Constant @@ -50,7 +48,7 @@ private: std::vector Uses; std::string Name; - PATypeHandle Ty; + PATypeHolder Ty; ValueTy VTy; void operator=(const Value &); // Do not implement @@ -61,7 +59,7 @@ /// dump - Support for debugging, callable in GDB: V->dump() // - void dump() const; + virtual void dump() const; /// print - Implement operator<< on Value... /// @@ -93,12 +91,6 @@ // Only use when in type resolution situations! void uncheckedReplaceAllUsesWith(Value *V); - /// refineAbstractType - This function is implemented because we use - /// potentially abstract types, and these types may be resolved to more - /// concrete types after we are constructed. - /// - virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); - //---------------------------------------------------------------------- // Methods for handling the vector of uses of this Value. // From lattner at cs.uiuc.edu Thu Oct 2 14:45:08 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 14:45:08 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Value.cpp Message-ID: <200310021944.OAA19830@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.52 -> 1.53 Value.cpp updated: 1.34 -> 1.35 --- Log message: There is no reason for Value to be an AbstractTypeUser. This just makes things significantly more complete. Instead, just make DerivedType's AbstractTypeUser's, and make Value contain a PATypeHolder. --- Diffs of the changes: Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.52 llvm/lib/VMCore/Constants.cpp:1.53 --- llvm/lib/VMCore/Constants.cpp:1.52 Fri Aug 29 00:36:46 2003 +++ llvm/lib/VMCore/Constants.cpp Thu Oct 2 14:44:40 2003 @@ -581,7 +581,6 @@ /// void ConstantArray::refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { - Value::refineAbstractType(OldTy, NewTy); if (OldTy == NewTy) return; // Make everyone now use a constant of the new type... @@ -650,7 +649,6 @@ /// void ConstantStruct::refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { - Value::refineAbstractType(OldTy, NewTy); if (OldTy == NewTy) return; // Make everyone now use a constant of the new type... @@ -694,7 +692,6 @@ /// void ConstantPointerNull::refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { - Value::refineAbstractType(OldTy, NewTy); if (OldTy == NewTy) return; // Make everyone now use a constant of the new type... @@ -828,7 +825,6 @@ /// void ConstantExpr::refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { - Value::refineAbstractType(OldTy, NewTy); if (OldTy == NewTy) return; // FIXME: These need to use a lower-level implementation method, because the Index: llvm/lib/VMCore/Value.cpp diff -u llvm/lib/VMCore/Value.cpp:1.34 llvm/lib/VMCore/Value.cpp:1.35 --- llvm/lib/VMCore/Value.cpp:1.34 Fri Aug 29 00:37:22 2003 +++ llvm/lib/VMCore/Value.cpp Thu Oct 2 14:44:40 2003 @@ -21,7 +21,7 @@ } Value::Value(const Type *ty, ValueTy vty, const std::string &name) - : Name(name), Ty(checkType(ty), this) { + : Name(name), Ty(checkType(ty)) { VTy = vty; } @@ -34,7 +34,7 @@ // a // if (Uses.begin() != Uses.end()) { - std::cerr << "While deleting: " << Ty << "%" << Name << "\n"; + std::cerr << "While deleting: " << *Ty << "%" << Name << "\n"; for (use_const_iterator I = Uses.begin(); I != Uses.end(); ++I) std::cerr << "Use still stuck around after Def is destroyed:" << **I << "\n"; @@ -85,18 +85,6 @@ } } - -// refineAbstractType - This function is implemented because we use -// potentially abstract types, and these types may be resolved to more -// concrete types after we are constructed. For the value class, we simply -// change Ty to point to the right type. :) -// -void Value::refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { - assert(Ty.get() == OldTy && "Can't refine anything but my type!"); - if (OldTy == NewTy && !OldTy->isAbstract()) - Ty.removeUserFromConcrete(); - Ty = NewTy; -} void Value::killUse(User *U) { if (U == 0) return; From lattner at cs.uiuc.edu Thu Oct 2 14:46:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 14:46:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/TEST.micro.report Message-ID: <200310021945.OAA19847@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs: TEST.micro.report updated: 1.3 -> 1.4 --- Log message: Add benchmarks to latex output --- Diffs of the changes: Index: llvm/test/Programs/TEST.micro.report diff -u llvm/test/Programs/TEST.micro.report:1.3 llvm/test/Programs/TEST.micro.report:1.4 --- llvm/test/Programs/TEST.micro.report:1.3 Mon Sep 29 11:42:26 2003 +++ llvm/test/Programs/TEST.micro.report Thu Oct 2 14:45:06 2003 @@ -110,13 +110,18 @@ 'yacr2' => 'ptrdist-yacr2', 'bc' => 'ptrdist-bc', '-' => '-', + '179.art' => '179.art', + '183.equake' => '183.equake', '181.mcf' => '181.mcf', '256.bzip2' => '256.bzip2', '164.gzip' => '164.gzip', '197.parser' => '197.parser', + '188.ammp' => '188.ammp', '175.vpr' => '175.vpr', + '300.twolf' => '300.twolf', '186.crafty' => '186.crafty', - '255.vortex' => '255.vortex', + '255.vortex' => '255.vortex', + '254.gap' => '254.gap', # '-' => '-', # 'sgefa' => 'sgefa', # 'sim' => 'sim', From lattner at cs.uiuc.edu Thu Oct 2 14:46:09 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 14:46:09 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CINT2000/252.eon/Makefile Message-ID: <200310021945.OAA19859@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CINT2000/252.eon: Makefile updated: 1.2 -> 1.3 --- Log message: Update makefile for eon --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/CINT2000/252.eon/Makefile diff -u llvm/test/Programs/External/SPEC/CINT2000/252.eon/Makefile:1.2 llvm/test/Programs/External/SPEC/CINT2000/252.eon/Makefile:1.3 --- llvm/test/Programs/External/SPEC/CINT2000/252.eon/Makefile:1.2 Mon Sep 22 14:50:18 2003 +++ llvm/test/Programs/External/SPEC/CINT2000/252.eon/Makefile Thu Oct 2 14:45:24 2003 @@ -1,9 +1,13 @@ LEVEL = ../../../../../.. -#RUN_OPTIONS = cccp.i -o cccp.s -#STDOUT_FILENAME = cccp.out +RUN_OPTIONS = chair.control.cook chair.camera chair.surfaces chair.cook.ppm ppm pixels_out.cook +STDOUT_FILENAME = cook_log.out +STDERR_FILENAME = cook_log.err # Yes, we know this is an old crufty C++ benchmark. Don't tell us about it GCC! -CPPFLAGS = -Wno-deprecated -Wno-non-template-friend +CPPFLAGS = -Wno-deprecated -Wno-non-template-friend -DHAS_ERRLIST -DSPEC_STDCPP -DNDEBUG +LDFLAGS = -lstdc++ +LIBS = -lsupc++ + Source = $(addprefix $(SPEC_BENCH_DIR)/src/, \ ggCoverageSolidTexture.cc ggPathDielectricMaterial.cc ggBox2.cc \ @@ -49,4 +53,3 @@ mrSolidTexture.cc mrSphere.cc mrSurface.cc mrSurfaceTexture.cc \ mrXYRectangle.cc mrXZRectangle.cc mrYZRectangle.cc myrand.cc) include ../../Makefile.spec - From criswell at cs.uiuc.edu Thu Oct 2 15:25:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Oct 2 15:25:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C/badfuncptr.c poisson.c Message-ID: <200310022024.PAA30500@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C: badfuncptr.c (r1.2) removed poisson.c (r1.1) removed --- Log message: These files are part of the Olden benchmark and are not needed here anymore. --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Oct 2 15:27:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 15:27:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReadConst.cpp ReaderInternals.h Message-ID: <200310022026.PAA26659@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReadConst.cpp updated: 1.53 -> 1.54 ReaderInternals.h updated: 1.44 -> 1.45 --- Log message: There is no need for BytecodeParser to be an AbstractTypeUser. Instead, it can just use PATypeHolders --- Diffs of the changes: Index: llvm/lib/Bytecode/Reader/ReadConst.cpp diff -u llvm/lib/Bytecode/Reader/ReadConst.cpp:1.53 llvm/lib/Bytecode/Reader/ReadConst.cpp:1.54 --- llvm/lib/Bytecode/Reader/ReadConst.cpp:1.53 Mon Sep 22 18:38:23 2003 +++ llvm/lib/Bytecode/Reader/ReadConst.cpp Thu Oct 2 15:26:18 2003 @@ -94,25 +94,6 @@ } } -// refineAbstractType - The callback method is invoked when one of the -// elements of TypeValues becomes more concrete... -// -void BytecodeParser::refineAbstractType(const DerivedType *OldType, - const Type *NewType) { - TypeValuesListTy::iterator I = find(FunctionTypeValues.begin(), - FunctionTypeValues.end(), OldType); - if (I == FunctionTypeValues.end()) { - I = find(ModuleTypeValues.begin(), ModuleTypeValues.end(), OldType); - assert(I != ModuleTypeValues.end() && - "Can't refine a type I don't know about!"); - } - - I->removeUserFromConcrete(); - *I = NewType; // Update to point to new, more refined type. -} - - - // parseTypeConstants - We have to use this weird code to handle recursive // types. We know that recursive types will only reference the current slab of // values in the type plane, but they can forward reference types before they @@ -132,7 +113,7 @@ // Insert a bunch of opaque types to be resolved later... for (unsigned i = 0; i < NumEntries; ++i) - Tab.push_back(PATypeHandle(OpaqueType::get(), this)); + Tab.push_back(OpaqueType::get()); // Loop through reading all of the types. Forward types will make use of the // opaque types just inserted. Index: llvm/lib/Bytecode/Reader/ReaderInternals.h diff -u llvm/lib/Bytecode/Reader/ReaderInternals.h:1.44 llvm/lib/Bytecode/Reader/ReaderInternals.h:1.45 --- llvm/lib/Bytecode/Reader/ReaderInternals.h:1.44 Tue Sep 23 11:17:50 2003 +++ llvm/lib/Bytecode/Reader/ReaderInternals.h Thu Oct 2 15:26:18 2003 @@ -43,7 +43,7 @@ unsigned FunctionSlot; }; -class BytecodeParser : public AbstractTypeUser, public AbstractModuleProvider { +class BytecodeParser : public AbstractModuleProvider { BytecodeParser(const BytecodeParser &); // DO NOT IMPLEMENT void operator=(const BytecodeParser &); // DO NOT IMPLEMENT public: @@ -116,7 +116,7 @@ // TypesLoaded - This vector mirrors the Values[TypeTyID] plane. It is used // to deal with forward references to types. // - typedef std::vector TypeValuesListTy; + typedef std::vector TypeValuesListTy; TypeValuesListTy ModuleTypeValues; TypeValuesListTy FunctionTypeValues; @@ -189,12 +189,6 @@ // resolve all references to the placeholder (if any) for the given value void ResolveReferencesToValue(Value *Val, unsigned Slot); - - - // refineAbstractType - The callback method is invoked when one of the - // elements of TypeValues becomes more concrete... - // - virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); }; template From criswell at cs.uiuc.edu Thu Oct 2 18:35:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Oct 2 18:35:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTest/ Message-ID: <200310022334.SAA32693@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTest: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/QMTest added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Thu Oct 2 18:36:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 18:36:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/AbstractTypeUser.h DerivedTypes.h Type.h Message-ID: <200310022335.SAA26555@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: AbstractTypeUser.h updated: 1.13 -> 1.14 DerivedTypes.h updated: 1.40 -> 1.41 Type.h updated: 1.29 -> 1.30 --- Log message: Make the PATypeHolder use a simple union-find implementation to handle merging of types. This makes it MUCH more efficient than before, also making things simpler. --- Diffs of the changes: Index: llvm/include/llvm/AbstractTypeUser.h diff -u llvm/include/llvm/AbstractTypeUser.h:1.13 llvm/include/llvm/AbstractTypeUser.h:1.14 --- llvm/include/llvm/AbstractTypeUser.h:1.13 Thu Oct 2 14:08:18 2003 +++ llvm/include/llvm/AbstractTypeUser.h Thu Oct 2 18:35:45 2003 @@ -61,9 +61,9 @@ }; -// PATypeHandle - Handle to a Type subclass. This class is used to keep the use -// list of abstract types up-to-date. -// +/// PATypeHandle - Handle to a Type subclass. This class is used to keep the +/// use list of abstract types up-to-date. +/// class PATypeHandle { const Type *Ty; AbstractTypeUser * const User; @@ -123,50 +123,43 @@ }; -// PATypeHolder - Holder class for a potentially abstract type. This functions -// as both a handle (as above) and an AbstractTypeUser. It uses the callback to -// keep its pointer member updated to the current version of the type. -// -class PATypeHolder : public AbstractTypeUser { - PATypeHandle Handle; +/// PATypeHolder - Holder class for a potentially abstract type. This uses +/// efficient union-find techniques to handle dynamic type resolution. Unless +/// you need to do custom processing when types are resolved, you should always +/// use PATypeHolders in preference to PATypeHandles. +/// +class PATypeHolder { + mutable const Type *Ty; public: - PATypeHolder(const Type *ty) : Handle(ty, this) {} - PATypeHolder(const PATypeHolder &T) : AbstractTypeUser(), Handle(T, this) {} + PATypeHolder(const Type *ty) : Ty(ty) { + addRef(); + } + PATypeHolder(const PATypeHolder &T) : Ty(T.Ty) { + addRef(); + } - operator const Type *() const { return Handle; } - const Type *get() const { return Handle; } + operator const Type *() const { return get(); } + const Type *get() const; // operator-> - Allow user to dereference handle naturally... - inline const Type *operator->() const { return Handle; } - - // refineAbstractType - All we do is update our PATypeHandle member to point - // to the new type. - // - virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { - assert(get() == (const Type*)OldTy && "Can't refine to unknown value!"); - - // Check to see if the type just became concrete. If so, we have to - // removeUser to get off its AbstractTypeUser list - Handle.removeUserFromConcrete(); - - if ((const Type*)OldTy != NewTy) - Handle.operator=(NewTy); - } + const Type *operator->() const { return get(); } // operator= - Allow assignment to handle const Type *operator=(const Type *ty) { - return Handle = ty; - } - - // operator= - Allow assignment to handle - const Type *operator=(const PATypeHandle &T) { - return Handle = T; + if (Ty != ty) { // Don't accidentally drop last ref to Ty. + dropRef(); + Ty = ty; + addRef(); + } + return get(); } const Type *operator=(const PATypeHolder &H) { - return Handle = H; + return operator=(H.Ty); } - void dump() const; +private: + void addRef(); + void dropRef(); }; #endif Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.40 llvm/include/llvm/DerivedTypes.h:1.41 --- llvm/include/llvm/DerivedTypes.h:1.40 Thu Oct 2 14:44:23 2003 +++ llvm/include/llvm/DerivedTypes.h Thu Oct 2 18:35:45 2003 @@ -20,7 +20,14 @@ class PointerValType; class DerivedType : public Type, public AbstractTypeUser { - char isRefining; // Used for recursive types + /// RefCount - This counts the number of PATypeHolders that are pointing to + /// this type. When this number falls to zero, if the type is abstract and + /// has no AbstractTypeUsers, the type is deleted. + /// + mutable unsigned RefCount; + + // isRefining - Used for recursive types + char isRefining; // AbstractTypeUsers - Implement a list of the users that need to be notified // if I am a type, and I get resolved into a more concrete type. @@ -29,8 +36,7 @@ mutable std::vector AbstractTypeUsers; protected: - inline DerivedType(PrimitiveID id) : Type("", id) { - isRefining = 0; + DerivedType(PrimitiveID id) : Type("", id), RefCount(0), isRefining(0) { } ~DerivedType() { assert(AbstractTypeUsers.empty()); @@ -61,7 +67,10 @@ // addAbstractTypeUser - Notify an abstract type that there is a new user of // it. This function is called primarily by the PATypeHandle class. // - void addAbstractTypeUser(AbstractTypeUser *U) const; + void addAbstractTypeUser(AbstractTypeUser *U) const { + assert(isAbstract() && "addAbstractTypeUser: Current type not abstract!"); + AbstractTypeUsers.push_back(U); + } // removeAbstractTypeUser - Notify an abstract type that a user of the class // no longer has a handle to the type. This function is called primarily by @@ -80,6 +89,22 @@ refineAbstractTypeToInternal(NewType, true); } + void addRef() const { + assert(isAbstract() && "Cannot add a reference to a non-abstract type!"); + ++RefCount; + } + + void dropRef() const { + assert(isAbstract() && "Cannot drop a refernce to a non-abstract type!"); + assert(RefCount && "No objects are currently referencing this object!"); + + // If this is the last PATypeHolder using this object, and there are no + // PATypeHandles using it, the type is dead, delete it now. + if (--RefCount == 0 && AbstractTypeUsers.empty()) + delete this; + } + + void dump() const { Value::dump(); } // Methods for support type inquiry through isa, cast, and dyn_cast: @@ -451,6 +476,28 @@ inline void PATypeHandle::removeUserFromConcrete() { if (!Ty->isAbstract()) cast(Ty)->removeAbstractTypeUser(User); +} + +// Define inline methods for PATypeHolder... + +inline void PATypeHolder::addRef() { + if (Ty->isAbstract()) + cast(Ty)->addRef(); +} + +inline void PATypeHolder::dropRef() { + if (Ty->isAbstract()) + cast(Ty)->dropRef(); +} + +/// get - This implements the forwarding part of the union-find algorithm for +/// abstract types. Before every access to the Type*, we check to see if the +/// type we are pointing to is forwarding to a new type. If so, we drop our +/// reference to the type. +inline const Type* PATypeHolder::get() const { + const Type *NewTy = Ty->getForwardedType(); + if (!NewTy) return Ty; + return *const_cast(this) = NewTy; } #endif Index: llvm/include/llvm/Type.h diff -u llvm/include/llvm/Type.h:1.29 llvm/include/llvm/Type.h:1.30 --- llvm/include/llvm/Type.h:1.29 Tue Sep 30 13:37:37 2003 +++ llvm/include/llvm/Type.h Thu Oct 2 18:35:45 2003 @@ -73,6 +73,7 @@ unsigned UID; // The unique ID number for this class bool Abstract; // True if type contains an OpaqueType + const Type *getForwardedTypeInternal() const; protected: /// ctor is protected, so only subclasses can create Type objects... Type(const std::string &Name, PrimitiveID id); @@ -90,6 +91,12 @@ /// isTypeAbstract - This method is used to calculate the Abstract bit. /// bool isTypeAbstract(); + + /// ForwardType - This field is used to implement the union find scheme for + /// abstract types. When types are refined to other types, this field is set + /// to the more refined type. Only abstract types can be forwarded. + mutable const Type *ForwardType; + public: virtual void print(std::ostream &O) const; @@ -177,6 +184,13 @@ /// unsigned getPrimitiveSize() const; + /// getForwaredType - Return the type that this type has been resolved to if + /// it has been resolved to anything. This is used to implement the + /// union-find algorithm for type resolution. + const Type *getForwardedType() const { + if (!ForwardType) return 0; + return getForwardedTypeInternal(); + } //===--------------------------------------------------------------------===// // Type Iteration support From lattner at cs.uiuc.edu Thu Oct 2 18:37:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 18:37:02 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp Message-ID: <200310022336.SAA26566@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Type.cpp updated: 1.69 -> 1.70 --- Log message: Make the PATypeHolder use a simple union-find implementation to handle merging of types. This makes it MUCH more efficient than before, also making things simpler. --- Diffs of the changes: Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.69 llvm/lib/VMCore/Type.cpp:1.70 --- llvm/lib/VMCore/Type.cpp:1.69 Wed Sep 10 00:29:06 2003 +++ llvm/lib/VMCore/Type.cpp Thu Oct 2 18:35:57 2003 @@ -32,13 +32,8 @@ static std::map ConcreteTypeDescriptions; static std::map AbstractTypeDescriptions; -void PATypeHolder::dump() const { - std::cerr << "PATypeHolder(" << (void*)this << ")\n"; -} - - Type::Type(const std::string &name, PrimitiveID id) - : Value(Type::TypeTy, Value::TypeVal) { + : Value(Type::TypeTy, Value::TypeVal), ForwardType(0) { if (!name.empty()) ConcreteTypeDescriptions[this] = name; ID = id; @@ -122,6 +117,30 @@ } +/// getForwardedTypeInternal - This method is used to implement the union-find +/// algorithm for when a type is being forwarded to another type. +const Type *Type::getForwardedTypeInternal() const { + assert(ForwardType && "This type is not being forwarded to another type!"); + + // Check to see if the forwarded type has been forwarded on. If so, collapse + // the forwarding links. + const Type *RealForwardedType = ForwardType->getForwardedType(); + if (!RealForwardedType) + return ForwardType; // No it's not forwarded again + + // Yes, it is forwarded again. First thing, add the reference to the new + // forward type. + if (RealForwardedType->isAbstract()) + cast(RealForwardedType)->addRef(); + + // Now drop the old reference. This could cause ForwardType to get deleted. + cast(ForwardType)->dropRef(); + + // Return the updated type. + ForwardType = RealForwardedType; + return ForwardType; +} + // getTypeDescription - This is a recursive function that walks a type hierarchy // calculating the description for a type. // @@ -950,21 +969,6 @@ // Derived Type Refinement Functions //===----------------------------------------------------------------------===// -// addAbstractTypeUser - Notify an abstract type that there is a new user of -// it. This function is called primarily by the PATypeHandle class. -// -void DerivedType::addAbstractTypeUser(AbstractTypeUser *U) const { - assert(isAbstract() && "addAbstractTypeUser: Current type not abstract!"); - -#if DEBUG_MERGE_TYPES - std::cerr << " addAbstractTypeUser[" << (void*)this << ", " - << *this << "][" << AbstractTypeUsers.size() - << "] User = " << U << "\n"; -#endif - AbstractTypeUsers.push_back(U); -} - - // removeAbstractTypeUser - Notify an abstract type that a user of the class // no longer has a handle to the type. This function is called primarily by // the PATypeHandle class. When there are no users of the abstract type, it @@ -989,7 +993,7 @@ << *this << "][" << i << "] User = " << U << "\n"; #endif - if (AbstractTypeUsers.empty() && isAbstract()) { + if (AbstractTypeUsers.empty() && RefCount == 0 && isAbstract()) { #ifdef DEBUG_MERGE_TYPES std::cerr << "DELETEing unused abstract type: <" << *this << ">[" << (void*)this << "]" << "\n"; @@ -1022,6 +1026,10 @@ // refined, that we will not continue using a dead reference... // PATypeHolder NewTy(NewType); + + ForwardType = NewType; + if (NewType->isAbstract()) + cast(NewType)->addRef(); // Add a self use of the current type so that we don't delete ourself until // after this while loop. We are careful to never invoke refine on ourself, From lattner at cs.uiuc.edu Thu Oct 2 23:49:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Oct 2 23:49:01 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp Message-ID: <200310030448.XAA32379@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Type.cpp updated: 1.70 -> 1.71 --- Log message: Dramatically simplify DerivedType::refineAbstractTypeToInternal This makes use of the new PATypeHolder's to keep types from being deleted prematurely, instead of the wierd "self reference" garbage. This is easier to understand and more efficient as well. --- Diffs of the changes: Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.70 llvm/lib/VMCore/Type.cpp:1.71 --- llvm/lib/VMCore/Type.cpp:1.70 Thu Oct 2 18:35:57 2003 +++ llvm/lib/VMCore/Type.cpp Thu Oct 2 23:48:21 2003 @@ -1032,13 +1032,9 @@ cast(NewType)->addRef(); // Add a self use of the current type so that we don't delete ourself until - // after this while loop. We are careful to never invoke refine on ourself, - // so this extra reference shouldn't be a problem. Note that we must only - // remove a single reference at the end, but we must tolerate multiple self - // references because we could be refineAbstractTypeTo'ing recursively on the - // same type. + // after the function exits. // - addAbstractTypeUser(this); + PATypeHolder CurrentTy(this); // To make the situation simpler, we ask the subclass to remove this type from // the type map, and to replace any type uses with uses of non-abstract types. @@ -1046,59 +1042,44 @@ // ourselves in. dropAllTypeUses(inMap); - // Count the number of self uses. Stop looping when sizeof(list) == NSU. - unsigned NumSelfUses = 0; - // Iterate over all of the uses of this type, invoking callback. Each user // should remove itself from our use list automatically. We have to check to // make sure that NewTy doesn't _become_ 'this'. If it does, resolving types // will not cause users to drop off of the use list. If we resolve to ourself // we succeed! // - while (AbstractTypeUsers.size() > NumSelfUses && NewTy != this) { + while (!AbstractTypeUsers.empty() && NewTy != this) { AbstractTypeUser *User = AbstractTypeUsers.back(); - if (User == this) { - // Move self use to the start of the list. Increment NSU. - std::swap(AbstractTypeUsers.back(), AbstractTypeUsers[NumSelfUses++]); - } else { - unsigned OldSize = AbstractTypeUsers.size(); + unsigned OldSize = AbstractTypeUsers.size(); #ifdef DEBUG_MERGE_TYPES - std::cerr << " REFINING user " << OldSize-1 << "[" << (void*)User - << "] of abstract type [" << (void*)this << " " - << *this << "] to [" << (void*)NewTy.get() << " " - << *NewTy << "]!\n"; + std::cerr << " REFINING user " << OldSize-1 << "[" << (void*)User + << "] of abstract type [" << (void*)this << " " + << *this << "] to [" << (void*)NewTy.get() << " " + << *NewTy << "]!\n"; #endif - User->refineAbstractType(this, NewTy); + User->refineAbstractType(this, NewTy); #ifdef DEBUG_MERGE_TYPES - if (AbstractTypeUsers.size() == OldSize) { - User->refineAbstractType(this, NewTy); - if (AbstractTypeUsers.back() != User) - std::cerr << "User changed!\n"; - std::cerr << "Top of user list is:\n"; - AbstractTypeUsers.back()->dump(); - - std::cerr <<"\nOld User=\n"; - User->dump(); - } -#endif - assert(AbstractTypeUsers.size() != OldSize && - "AbsTyUser did not remove self from user list!"); + if (AbstractTypeUsers.size() == OldSize) { + User->refineAbstractType(this, NewTy); + if (AbstractTypeUsers.back() != User) + std::cerr << "User changed!\n"; + std::cerr << "Top of user list is:\n"; + AbstractTypeUsers.back()->dump(); + + std::cerr <<"\nOld User=\n"; + User->dump(); } +#endif + assert(AbstractTypeUsers.size() != OldSize && + "AbsTyUser did not remove self from user list!"); } - // Remove a single self use, even though there may be several here. This will - // probably 'delete this', so no instance variables may be used after this - // occurs... - // - assert((NewTy == this || AbstractTypeUsers.back() == this) && - "Only self uses should be left!"); - -#if 0 - assert(AbstractTypeUsers.size() == 1 && "This type should get deleted!"); -#endif - removeAbstractTypeUser(this); + // If we were successful removing all users from the type, 'this' will be + // deleted when the last PATypeHolder is destroyed or updated from this type. + // This may occur on exit of this function, as the CurrentTy object is + // destroyed. } // typeIsRefined - Notify AbstractTypeUsers of this type that the current type From criswell at cs.uiuc.edu Fri Oct 3 08:47:03 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Oct 3 08:47:03 2003 Subject: [llvm-commits] CVS: llvm/www/docs/CommandGuide/llvmgcc.html llvmgxx.html Message-ID: <200310031346.IAA14574@tank.cs.uiuc.edu> Changes in directory llvm/www/docs/CommandGuide: llvmgcc.html added (r1.1) llvmgxx.html added (r1.1) --- Log message: Adding basic documentation for the LLVM C and C++ frontends. --- Diffs of the changes: Index: llvm/www/docs/CommandGuide/llvmgcc.html diff -c /dev/null llvm/www/docs/CommandGuide/llvmgcc.html:1.1 *** /dev/null Fri Oct 3 08:46:06 2003 --- llvm/www/docs/CommandGuide/llvmgcc.html Fri Oct 3 08:45:55 2003 *************** *** 0 **** --- 1,110 ---- + + + LLVM: llvmgcc tool + + + + +
                +

                LLVM: llvmgcc tool

                +
                +
                + +

                + NAME +

                + + llvmgcc + +

                + SYNOPSIS +

                + + llvmgcc [options] filename +

                + DESCRIPTION +

                + + The llvmgcc command is the LLVM C front end. It is a modified version of GCC + that takes C programs and compiles them into LLVM bytecode or assembly + language, depending upon the options. +

                + + The llvmgcc program uses the LLVM assembler gccas and the LLVM linker gccld to + do the work of creating complete programs. +

                + + Being derived from the GNU Compiler Collection, llvmgcc has many of gcc's + features and accepts most of gcc's options. It handles a number of gcc's + extensions to the C programming language. +

                + + Below you will find several commonly used options: + +

                + OPTIONS +

                + +
                  +
                • -S +
                  + Do not generate an LLVM bytecode file. Rather, compile the source file + into an LLVM assembly language file. +

                  + +

                • -c +
                  + Do not generate a linked bytecode executable. Rather, compile the source + file into an LLVM bytecode file. This bytecode file can then be linked + with other bytecode files later to generate a full LLVM executable. +

                  + +

                • -o filename +
                  + Specify the output file to be filename. If filename is -, + then llvmgcc sends its output to standard output. +

                  + +

                • -I directory +
                  + Add a directory to the header file search path. This option can be + repeated. +

                  + +

                • -L directory +
                  + Add directory to the library search path. This option can be + repeated. +

                  + +

                • -lname +
                  + Link in the library libname.[bc | a | so]. This library should be + a bytecode library. +

                  + +

                • -Wl,option +
                  + Pass option to the linker (usually gccld). +

                  +

                + +

                + EXIT STATUS +

                + + If llvmgcc succeeds, it will exit with 0. Otherwise, if an error occurs, it + will exit with a non-zero value. + +

                + SEE ALSO +

                + llvmg++, + gccas, + gccld + +
                + LLVM Team + + + Index: llvm/www/docs/CommandGuide/llvmgxx.html diff -c /dev/null llvm/www/docs/CommandGuide/llvmgxx.html:1.1 *** /dev/null Fri Oct 3 08:46:06 2003 --- llvm/www/docs/CommandGuide/llvmgxx.html Fri Oct 3 08:45:55 2003 *************** *** 0 **** --- 1,111 ---- + + + LLVM: llvmg++ tool + + + + +
                +

                LLVM: llvmg++ tool

                +
                +
                + +

                + NAME +

                + + llvmg++ + +

                + SYNOPSIS +

                + + llvmg++ [options] filename +

                + DESCRIPTION +

                + + The llvmg++ command is the LLVM C++ front end. It is a modified version of g++ + that takes C++ programs and compiles them into LLVM bytecode or assembly + language, depending upon the options. +

                + + The llvmg++ program uses the LLVM assembler gccas and the LLVM linker gccld to + do the work of creating complete programs. +

                + + Being derived from the GNU Compiler Collection, llvmg++ has many of g++'s + features and accepts most of g++'s options. It handles a number of g++'s + extensions to the C++ programming language. +

                + + Below you will find several commonly used options: + +

                + OPTIONS +

                + +
                  +
                • -S +
                  + Do not generate an LLVM bytecode file. Rather, compile the source file + into an LLVM assembly language file. +

                  + +

                • -c +
                  + Do not generate a linked executable. Rather, compile the source file into + an LLVM bytecode file. This bytecode file can then be linked with other + bytecode files later on to generate a full LLVM executable. +

                  + +

                • -o filename +
                  + Specify the output file to be filename. If filename is -, + then llvmgcc sends its output to standard output. +

                  + +

                • -I directory +
                  + Add a directory to the header file search path. This option can be + repeated. +

                  + +

                • -L directory +
                  + Add directory to the library search path. This option can be + repeated. +

                  + +

                • -lname +
                  + Link in the library libname.[bc | a | so]. This library should be + a bytecode library. +

                  + +

                • -Wl,option +
                  + Pass option to the linker (usually gccld). +

                  + +

                + +

                + EXIT STATUS +

                + + If llvmg++ succeeds, it will exit with 0. Otherwise, if an error occurs, it + will exit with a non-zero value. + +

                + SEE ALSO +

                + llvmg++, + gccas, + gccld + +
                + LLVM Team + + + From criswell at cs.uiuc.edu Fri Oct 3 08:49:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Oct 3 08:49:02 2003 Subject: [llvm-commits] CVS: llvm/www/docs/CommandGuide/index.html Message-ID: <200310031348.IAA14625@tank.cs.uiuc.edu> Changes in directory llvm/www/docs/CommandGuide: index.html updated: 1.3 -> 1.4 --- Log message: Added links to the C and C++ frontends. --- Diffs of the changes: Index: llvm/www/docs/CommandGuide/index.html diff -u llvm/www/docs/CommandGuide/index.html:1.3 llvm/www/docs/CommandGuide/index.html:1.4 --- llvm/www/docs/CommandGuide/index.html:1.3 Wed Sep 17 09:11:24 2003 +++ llvm/www/docs/CommandGuide/index.html Fri Oct 3 08:48:27 2003 @@ -79,6 +79,16 @@
                +
                llvmgcc +
                + GCC-based C front end for LLVM. +

                + +

                llvmg++ +
                + GCC-based C++ front end for LLVM. +

                +

                gccas
                LLVM assembler used by GCC and other native compiler tools. From criswell at cs.uiuc.edu Fri Oct 3 12:10:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Oct 3 12:10:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C++Frontend/2003-08-20-ExceptionFail.cpp 2003-08-21-EmptyClass.cpp 2003-08-24-Cleanup.cpp.tr 2003-08-27-TypeNamespaces.cpp 2003-08-28-ForwardType.cpp 2003-08-28-SaveExprBug.cpp 2003-08-29-ArgPassingBug.cpp.tr 2003-08-31-StructLayout.cpp 2003-09-22-CompositeExprValue.cpp 2003-09-29-ArgumentNumberMismatch.cpp 2003-09-30-NestedFunctionDecl.cpp Makefile Message-ID: <200310031709.MAA06158@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C++Frontend: 2003-08-20-ExceptionFail.cpp (r1.2) removed 2003-08-21-EmptyClass.cpp (r1.3) removed 2003-08-24-Cleanup.cpp.tr (r1.2) removed 2003-08-27-TypeNamespaces.cpp (r1.1) removed 2003-08-28-ForwardType.cpp (r1.1) removed 2003-08-28-SaveExprBug.cpp (r1.1) removed 2003-08-29-ArgPassingBug.cpp.tr (r1.1) removed 2003-08-31-StructLayout.cpp (r1.1) removed 2003-09-22-CompositeExprValue.cpp (r1.1) removed 2003-09-29-ArgumentNumberMismatch.cpp (r1.2) removed 2003-09-30-NestedFunctionDecl.cpp (r1.1) removed Makefile (r1.3) removed --- Log message: These are not needed here. They are not complete programs and are already located in llvm/test/Regressions/C++Frontend. --- Diffs of the changes: From criswell at cs.uiuc.edu Fri Oct 3 13:25:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Oct 3 13:25:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/LLC/BurgBadRegAlloc.ll badCallArgLR.llvm.ll yyparse.Burg.BadRegAlloc.ll Message-ID: <200310031824.NAA22274@choi.cs.uiuc.edu> Changes in directory llvm/test/Regression/LLC: BurgBadRegAlloc.ll updated: 1.1 -> 1.2 badCallArgLR.llvm.ll (r1.1) removed yyparse.Burg.BadRegAlloc.ll (r1.1) removed --- Log message: Renamed these tests so that they don't contain extra periods. This interferes with QMTest and the new test database. --- Diffs of the changes: Index: llvm/test/Regression/LLC/BurgBadRegAlloc.ll diff -u llvm/test/Regression/LLC/BurgBadRegAlloc.ll:1.1 llvm/test/Regression/LLC/BurgBadRegAlloc.ll:1.2 --- llvm/test/Regression/LLC/BurgBadRegAlloc.ll:1.1 Mon Oct 14 09:53:06 2002 +++ llvm/test/Regression/LLC/BurgBadRegAlloc.ll Fri Oct 3 13:24:47 2003 @@ -1,4 +1,5 @@ -;; Register allocation is doing a very poor job on this routine from Burg: +;; Register allocation is doing a very poor job on this routine from yyparse +;; in Burg: ;; -- at least two long-lived values are being allocated to %o? registers ;; -- even worse, those registers are being saved and restored repeatedly ;; at function calls, even though there are no intervening uses. From criswell at cs.uiuc.edu Fri Oct 3 13:40:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Oct 3 13:40:02 2003 Subject: [llvm-commits] CVS: llvm/test/QMTest/configuration Message-ID: <200310031839.NAA01926@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTest: configuration added (r1.1) --- Log message: Added configuration file for the new test database. --- Diffs of the changes: Index: llvm/test/QMTest/configuration diff -c /dev/null llvm/test/QMTest/configuration:1.1 *** /dev/null Fri Oct 3 13:39:06 2003 --- llvm/test/QMTest/configuration Fri Oct 3 13:38:56 2003 *************** *** 0 **** --- 1,2 ---- + + \ No newline at end of file From criswell at cs.uiuc.edu Fri Oct 3 13:40:13 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Oct 3 13:40:13 2003 Subject: [llvm-commits] CVS: llvm/test/QMTest/llvmdb.py Message-ID: <200310031839.NAA01939@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTest: llvmdb.py added (r1.1) --- Log message: New test database class. It will read tests straight out of their directories and figure out where test they are. Still experimental. --- Diffs of the changes: Index: llvm/test/QMTest/llvmdb.py diff -c /dev/null llvm/test/QMTest/llvmdb.py:1.1 *** /dev/null Fri Oct 3 13:39:50 2003 --- llvm/test/QMTest/llvmdb.py Fri Oct 3 13:39:40 2003 *************** *** 0 **** --- 1,240 ---- + ############################################################################## + # + # File: llvmdb.py + # + # Description: + # This file contains python classes that define a new test database + # for the LLVM test suite. + # + ############################################################################## + + import qm + import qm.test + import qm.test.test + import qm.fields + import qm.test.database + import qm.test.suite + import qm.attachment + + import os + import stat + import filecmp + import resource + + # + # Mapping between test directories and test names + # + RegressionMap={'Assembler':'llvm.AssembleTest', + 'Analysis':'llvm.TestRunner', + 'BugPoint':'llvm.TestRunner', + 'C++Frontend':'llvm.CXXTest', + 'CBackend':'llvm.LLToCTest', + 'CFrontend':'llvm.CTest', + 'Jello':'llvm.LLITest', + 'LLC':'llvm.MachineCodeTest', + 'Linker':'llvm.TestRunner', + 'Other':'llvm.TestRunner', + 'TableGen':'llvm.TestRunner', + 'Transforms':'llvm.TestRunner', + 'Reoptimizer':'llvm.TestRunner', + 'Verifier':'llvm.VerifierTest'} + + class llvmdb (qm.test.database.Database): + + # Pathname to the test database + dbpath='' + + def __init__ (self, path, arguments): + # + # Record the location of the test database. + # + self.dbpath = path + qm.test.database.Database.__init__ (self, path, arguments) + return + + # + # Method: GetTest () + # + # Description: + # Retrieve a test from the test database. + # + def GetTest (self, test_id): + # + # Split the test into its name and set of suffixes and + # convert the test ID into a pathname. + # + #(baselabel, suffix1) = self.SplitLabel (test_id) + #if (suffix1 == 'tr'): + #(baselabel, suffix2) = self.SplitLabel (baselabel) + #testpath=self.LabelToPath(baselabel) + '.' + suffix2 + '.' + suffix1 + #else: + #testpath=self.LabelToPath(baselabel) + '.' + suffix1 + # + #testpath = 'test/' + testpath + + + # + # Try to figure out whether this test exists or not. + # + exts=['ll', 'llx', 'c', 'cpp', 'td', 'c.tr', 'cpp.tr'] + + testpath = self.dbpath + '/' + self.LabelToPath (test_id) + for ext in exts: + if (os.path.exists (testpath + '.' + ext)): + break + else: + raise qm.test.database.NoSuchTestError(self) + + # + # Construct the pathname of the test relative to the LLVM source tree. + # + testpath = 'test/' + self.LabelToPath (test_id) + '.' + ext + + # + # If the file ends in .llx or .tr, then it is a TestRunner (as opposed + # to # HomeStar Runner) test. + # + if ((ext == 'llx') or (ext == 'c.tr') or (ext == 'cpp.tr')): + return qm.test.database.TestDescriptor(self, test_id, 'llvm.TestRunner', {'srcfile':testpath}) + + # + # Get the first part of the test name. + # + (firstsuite,suite) = self.SplitLabelLeft (test_id) + if (firstsuite == 'Regression'): + (testtype, suite) = self.SplitLabelLeft (suite) + testtype = RegressionMap[testtype] + testargs = {'srcfile':testpath} + + return qm.test.database.TestDescriptor(self, test_id, testtype, testargs) + + # + # Method: GetSuite () + # + # Description: + # Retrieve a test suite from the database. + # + def GetSuite (self, suite_id): + # + # If the empty suite ID is given, default to whatever suite is in + # the current directory. + # + # Otherwise, convert the suite name into a pathname. + # + if (suite_id == ''): + suitepath=self.dbpath + suite_header = '' + else: + suitepath=self.LabelToPath (suite_id) + suite_header = suite_id + '.' + + suitepath = self.dbpath + '/' + self.LabelToPath (suite_id) + + # + # Get a list of the tests located in this directory. + # + tests=os.listdir (suitepath) + dirs = [] + files = [] + for path in tests: + fileinfo = os.stat (suitepath + '/' + path) + if (stat.S_ISDIR(fileinfo.st_mode)): + if ((path != 'CVS') and (path != 'QMTest') and (path != 'QMTestDB') and (path != 'newdb') and (path != 'Scripts') and (path != 'Programs') and (path != 'Feature') and (path != 'Fragments')): + dirs = dirs + [suite_header + path] + else: + if ((suite_id != '') and (path != 'Makefile') and (path != 'README.txt') and (path != '.cvsignore')): + (filebase, fileext) = os.path.splitext(path) + if (fileext == '.tr'): + (filebase, fileext) = os.path.splitext(filebase) + files = files + [suite_header + filebase] + + # + # Load this suite + # + suite = qm.test.suite.Suite (self, suite_id, 0, files, dirs) + return suite + #raise qm.test.database.NoSuchSuiteError (suite_id) + + def GetAttachmentStore (self): + return qm.attachment.FileAttachmentStore (self) + + def GetSubdirectories (self, pathname): + pathname = self.dbpath + '/' + self.LabelToPath (pathname) + + tests=os.listdir (pathname) + dirs = [] + for path in tests: + fileinfo = os.stat (pathname + '/' + path) + if (stat.S_ISDIR(fileinfo.st_mode)): + if ((path != 'CVS') and (path != 'QMTest') and (path != 'QMTestDB') and (path != 'newdb') and (path != 'Scripts') and (path != 'Programs') and (path != 'Feature') and (path != 'Fragments')): + dirs = dirs + [path] + + return dirs + + def GetResourceIds(self, directory="", scan_subdirs=1): + return [] + + def GetSuiteIds(self, directory="", scan_subdirs=1): + # + # Adjust the directory name. + # + if (directory == ''): + dirpath = self.dbpath + else: + dirpath = self.dbpath + '/' + self.LabelToPath (directory) + + # + # Get a list of the tests located in this directory. + # + tests=os.listdir (dirpath) + dirs = [directory] + files = [] + for path in tests: + fileinfo = os.stat (dirpath + '/' + path) + if (stat.S_ISDIR(fileinfo.st_mode)): + if ((path != 'CVS') and (path != 'QMTest') and (path != 'QMTestDB') and (path != 'newdb') and (path != 'Scripts') and (path != 'Programs') and (path != 'Feature') and (path != 'Fragments')): + if (directory == ''): + dirs = dirs + [path] + else: + dirs = dirs + [directory + '.' + path] + + if (scan_subdirs == 1): + for dirlabel in dirs: + dirs = dirs + self.GetTestIds (dirlabel, 1) + return dirs + + def GetTestIds(self, directory="", scan_subdirs=1): + # + # Adjust the directory name. + # + if (directory == ''): + dirpath = self.dbpath + else: + dirpath = self.dbpath + '/' + self.LabelToPath (directory) + + # + # Get a list of the tests located in this directory. + # + tests=os.listdir (dirpath) + dirs = [directory] + files = [] + for path in tests: + fileinfo = os.stat (dirpath + '/' + path) + if (stat.S_ISDIR(fileinfo.st_mode)): + if ((path != 'CVS') and (path != 'QMTest') and (path != 'QMTestDB') and (path != 'newdb') and (path != 'Scripts') and (path != 'Programs') and (path != 'Feature') and (path != 'Fragments')): + if (directory == ''): + dirs = dirs + [path] + else: + dirs = dirs + [directory + '.' + path] + else: + if ((directory != '') and (path != 'Makefile')): + if (directory == ''): + files = files + [path] + else: + files = files + [directory + '.' + path] + + if (scan_subdirs == 1): + for dirlabel in dirs: + files = files + self.GetTestIds (dirlabel, 1) + return files + From lattner at cs.uiuc.edu Fri Oct 3 13:41:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Oct 3 13:41:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Constants.h Message-ID: <200310031840.NAA06329@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.30 -> 1.31 --- Log message: These methods are dead, remove them --- Diffs of the changes: Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.30 llvm/include/llvm/Constants.h:1.31 --- llvm/include/llvm/Constants.h:1.30 Tue Sep 30 13:37:37 2003 +++ llvm/include/llvm/Constants.h Fri Oct 3 13:39:40 2003 @@ -280,7 +280,6 @@ ConstantArray(const ConstantArray &); // DO NOT IMPLEMENT protected: ConstantArray(const ArrayType *T, const std::vector &Val); - void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); public: /// get() - Static factory methods - Return objects of the specified value static ConstantArray *get(const ArrayType *T, const std::vector &); @@ -336,7 +335,6 @@ ConstantStruct(const ConstantStruct &); // DO NOT IMPLEMENT protected: ConstantStruct(const StructType *T, const std::vector &Val); - void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); public: /// get() - Static factory methods - Return objects of the specified value static ConstantStruct *get(const StructType *T, @@ -409,7 +407,6 @@ ConstantPointerNull(const ConstantPointerNull &); // DO NOT IMPLEMENT protected: ConstantPointerNull(const PointerType *T) : ConstantPointer(T) {} - void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); public: @@ -494,7 +491,6 @@ // GEP instruction creation ctor ConstantExpr(Constant *C, const std::vector &IdxList, const Type *DestTy); - void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); public: // Static methods to construct a ConstantExpr of different kinds. Note that From lattner at cs.uiuc.edu Fri Oct 3 13:41:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Oct 3 13:41:10 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Message-ID: <200310031840.NAA06324@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.53 -> 1.54 --- Log message: These methods are dead, remove them. Because the bodies will soon be ressurected, just ifdef them out for now. --- Diffs of the changes: Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.53 llvm/lib/VMCore/Constants.cpp:1.54 --- llvm/lib/VMCore/Constants.cpp:1.53 Thu Oct 2 14:44:40 2003 +++ llvm/lib/VMCore/Constants.cpp Fri Oct 3 13:39:57 2003 @@ -576,6 +576,7 @@ destroyConstantImpl(); } +#if 0 /// refineAbstractType - If this callback is invoked, then this constant is of a /// derived type, change all users to use a concrete constant of the new type. /// @@ -593,7 +594,7 @@ destroyConstant(); // This constant is now dead, destroy it. } } - +#endif // ConstantArray::get(const string&) - Return an array that is initialized to // contain the specified string. A null terminator is added to the specified @@ -644,6 +645,7 @@ destroyConstantImpl(); } +#if 0 /// refineAbstractType - If this callback is invoked, then this constant is of a /// derived type, change all users to use a concrete constant of the new type. /// @@ -661,7 +663,7 @@ destroyConstant(); // This constant is now dead, destroy it. } } - +#endif //---- ConstantPointerNull::get() implementation... // @@ -687,6 +689,7 @@ destroyConstantImpl(); } +#if 0 /// refineAbstractType - If this callback is invoked, then this constant is of a /// derived type, change all users to use a concrete constant of the new type. /// @@ -703,6 +706,7 @@ destroyConstant(); } } +#endif @@ -820,6 +824,7 @@ destroyConstantImpl(); } +#if 0 /// refineAbstractType - If this callback is invoked, then this constant is of a /// derived type, change all users to use a concrete constant of the new type. /// @@ -853,6 +858,7 @@ destroyConstant(); // This constant is now dead, destroy it. } } +#endif From criswell at cs.uiuc.edu Fri Oct 3 13:43:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Oct 3 13:43:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll arraytest.ll badcases.ll basictest.ll fieldmerge.ll goodcases.ll indcalltest.ll misctests.ll physicalsubtype.ll recursion.ll simplest-test.ll simpletest.ll structpadding.ll Message-ID: <200310031842.NAA01996@choi.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/DSAnalysis: arraymerge.ll updated: 1.1 -> 1.2 arraytest.ll updated: 1.1 -> 1.2 badcases.ll updated: 1.1 -> 1.2 basictest.ll updated: 1.1 -> 1.2 fieldmerge.ll updated: 1.1 -> 1.2 goodcases.ll updated: 1.1 -> 1.2 indcalltest.ll updated: 1.1 -> 1.2 misctests.ll updated: 1.1 -> 1.2 physicalsubtype.ll updated: 1.1 -> 1.2 recursion.ll updated: 1.1 -> 1.2 simplest-test.ll updated: 1.1 -> 1.2 simpletest.ll updated: 1.1 -> 1.2 structpadding.ll updated: 1.1 -> 1.2 --- Log message: Changed all of these tests to be TestRunner tests (or, at least they can be TestRunner tests). This makes creating the new test database class easier to implement. --- Diffs of the changes: Index: llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll:1.1 llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll:1.2 --- llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll:1.1 Wed Oct 30 23:38:19 2002 +++ llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll Fri Oct 3 13:42:25 2003 @@ -2,6 +2,8 @@ ; folded completely away if possible. This is a very common case, so it should ; be efficient. ; +; RUN: analyze %s -tddatastructure +; implementation sbyte* %merge1([100 x sbyte] *%A, long %N) { Index: llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll:1.1 llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll:1.2 --- llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll:1.1 Wed Oct 30 22:48:32 2002 +++ llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll Fri Oct 3 13:42:25 2003 @@ -1,4 +1,5 @@ - +; +; RUN: analyze %s -tddatastructure %crazy = type [2 x { [2 x sbyte], short } ] implementation Index: llvm/test/Regression/Transforms/DSAnalysis/badcases.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/badcases.ll:1.1 llvm/test/Regression/Transforms/DSAnalysis/badcases.ll:1.2 --- llvm/test/Regression/Transforms/DSAnalysis/badcases.ll:1.1 Wed Nov 6 00:20:53 2002 +++ llvm/test/Regression/Transforms/DSAnalysis/badcases.ll Fri Oct 3 13:42:25 2003 @@ -1,4 +1,6 @@ ; This file contains a list of situations where node folding should happen... +; +; RUN: analyze %s -tddatastructure implementation Index: llvm/test/Regression/Transforms/DSAnalysis/basictest.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/basictest.ll:1.1 llvm/test/Regression/Transforms/DSAnalysis/basictest.ll:1.2 --- llvm/test/Regression/Transforms/DSAnalysis/basictest.ll:1.1 Wed Oct 30 19:25:13 2002 +++ llvm/test/Regression/Transforms/DSAnalysis/basictest.ll Fri Oct 3 13:42:25 2003 @@ -1,5 +1,6 @@ - ; very simple test +; +; RUN: analyze %s -tddatastructure implementation Index: llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll:1.1 llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll:1.2 --- llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll:1.1 Thu May 29 14:17:51 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll Fri Oct 3 13:42:25 2003 @@ -1,3 +1,5 @@ +; +; RUN: analyze %s -tddatastructure %str = type { int*, int* } Index: llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll:1.1 llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll:1.2 --- llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll:1.1 Wed Nov 6 00:20:53 2002 +++ llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll Fri Oct 3 13:42:25 2003 @@ -1,5 +1,7 @@ ; This file contains a list of cases where node folding should NOT happen ; +; RUN: analyze %s -tddatastructure +; implementation Index: llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll:1.1 llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll:1.2 --- llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll:1.1 Wed Oct 30 19:25:13 2002 +++ llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll Fri Oct 3 13:42:25 2003 @@ -1,3 +1,6 @@ +; +; RUN: analyze %s -tddatastructure + %G = global int 2 ; [#uses=1] %H = global int* null Index: llvm/test/Regression/Transforms/DSAnalysis/misctests.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/misctests.ll:1.1 llvm/test/Regression/Transforms/DSAnalysis/misctests.ll:1.2 --- llvm/test/Regression/Transforms/DSAnalysis/misctests.ll:1.1 Wed Oct 30 23:38:19 2002 +++ llvm/test/Regression/Transforms/DSAnalysis/misctests.ll Fri Oct 3 13:42:25 2003 @@ -1,4 +1,5 @@ - +; +; RUN: analyze %s -tddatastructure int* %test1(int *%A) { %R = getelementptr int* %A, long 1 Index: llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll:1.1 llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll:1.2 --- llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll:1.1 Mon Jun 16 07:05:38 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll Fri Oct 3 13:42:25 2003 @@ -1,5 +1,7 @@ ; A test for "physical subtyping" used in some C programs... ; +; RUN: analyze %s -tddatastructure +; %ST = type { int, int* } ; "Subtype" %DT = type { int, int*, int } ; "derived type" Index: llvm/test/Regression/Transforms/DSAnalysis/recursion.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/recursion.ll:1.1 llvm/test/Regression/Transforms/DSAnalysis/recursion.ll:1.2 --- llvm/test/Regression/Transforms/DSAnalysis/recursion.ll:1.1 Sun Nov 10 00:41:07 2002 +++ llvm/test/Regression/Transforms/DSAnalysis/recursion.ll Fri Oct 3 13:42:25 2003 @@ -1,3 +1,5 @@ +; RUN: analyze %s -tddatastructure + implementation ; Functions: declare void %__main() Index: llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll:1.1 llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll:1.2 --- llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll:1.1 Tue Nov 5 15:12:30 2002 +++ llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll Fri Oct 3 13:42:25 2003 @@ -1,4 +1,4 @@ - +; RUN: analyze %s -tddatastructure void %foo(int* %X) { store int 4, int* %X Index: llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll:1.1 llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll:1.2 --- llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll:1.1 Wed Oct 30 19:25:13 2002 +++ llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll Fri Oct 3 13:42:25 2003 @@ -1,3 +1,4 @@ +; RUN: analyze %s -tddatastructure implementation Index: llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll:1.1 llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll:1.2 --- llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll:1.1 Thu May 29 14:17:51 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll Fri Oct 3 13:42:25 2003 @@ -1,3 +1,4 @@ +; RUN: analyze %s -tddatastructure %str = type { int, int* } From lattner at cs.uiuc.edu Fri Oct 3 13:47:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Oct 3 13:47:02 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/AbstractTypeUser.h DerivedTypes.h SymbolTable.h Message-ID: <200310031846.NAA15951@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: AbstractTypeUser.h updated: 1.14 -> 1.15 DerivedTypes.h updated: 1.41 -> 1.42 SymbolTable.h updated: 1.24 -> 1.25 --- Log message: This checkin basically amounts to a complete rewrite of the type-resolution machinery. This dramatically simplifies how things works, removes irritating little corner cases, and overall improves speed and reliability. Highlights of this change are: 1. The exponential algorithm built into the code is now gone. For example the time to disassemble one bytecode file from the mesa benchmark went from taking 12.5s to taking 0.16s. 2. The linker bugs should be dramatically reduced. The one remaining bug has to do with constant handling, which I actually introduced in "union-find" checkins. 3. The code is much easier to follow, as a result of fewer special cases. It's probably also smaller. yaay. --- Diffs of the changes: Index: llvm/include/llvm/AbstractTypeUser.h diff -u llvm/include/llvm/AbstractTypeUser.h:1.14 llvm/include/llvm/AbstractTypeUser.h:1.15 --- llvm/include/llvm/AbstractTypeUser.h:1.14 Thu Oct 2 18:35:45 2003 +++ llvm/include/llvm/AbstractTypeUser.h Fri Oct 3 13:46:21 2003 @@ -38,24 +38,20 @@ virtual ~AbstractTypeUser() {} // Derive from me public: - // refineAbstractType - The callback method invoked when an abstract type - // has been found to be more concrete. A class must override this method to - // update its internal state to reference NewType instead of OldType. Soon - // after this method is invoked, OldType shall be deleted, so referencing it - // is quite unwise. - // - // Another case that is important to consider is when a type is refined, but - // stays in the same place in memory. In this case OldTy will equal NewTy. - // This callback just notifies ATU's that the underlying structure of the type - // has changed... but any previously used properties are still valid. - // - // Note that it is possible to refine a type with parameters OldTy==NewTy, and - // OldTy is no longer abstract. In this case, abstract type users should - // release their hold on a type, because it went from being abstract to - // concrete. - // + /// refineAbstractType - The callback method invoked when an abstract type is + /// resolved to another type. An object must override this method to update + /// its internal state to reference NewType instead of OldType. + /// virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) = 0; + + /// The other case which AbstractTypeUsers must be aware of is when a type + /// makes the transition from being abstract (where it has clients on it's + /// AbstractTypeUsers list) to concrete (where it does not). This method + /// notifies ATU's when this occurs for a type. + /// + virtual void typeBecameConcrete(const DerivedType *AbsTy) = 0; + // for debugging... virtual void dump() const = 0; }; Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.41 llvm/include/llvm/DerivedTypes.h:1.42 --- llvm/include/llvm/DerivedTypes.h:1.41 Thu Oct 2 18:35:45 2003 +++ llvm/include/llvm/DerivedTypes.h Fri Oct 3 13:46:21 2003 @@ -26,9 +26,6 @@ /// mutable unsigned RefCount; - // isRefining - Used for recursive types - char isRefining; - // AbstractTypeUsers - Implement a list of the users that need to be notified // if I am a type, and I get resolved into a more concrete type. // @@ -36,17 +33,17 @@ mutable std::vector AbstractTypeUsers; protected: - DerivedType(PrimitiveID id) : Type("", id), RefCount(0), isRefining(0) { + DerivedType(PrimitiveID id) : Type("", id), RefCount(0) { } ~DerivedType() { assert(AbstractTypeUsers.empty()); } - // typeIsRefined - Notify AbstractTypeUsers of this type that the current type - // has been refined a bit. The pointer is still valid and still should be - // used, but the subtypes have changed. - // - void typeIsRefined(); + /// notifyUsesThatTypeBecameConcrete - Notify AbstractTypeUsers of this type + /// that the current type has transitioned from being abstract to being + /// concrete. + /// + void notifyUsesThatTypeBecameConcrete(); // dropAllTypeUses - When this (abstract) type is resolved to be equal to // another (more concrete) type, we must eliminate all references to other @@ -146,6 +143,11 @@ virtual void dropAllTypeUses(bool inMap); public: + /// FunctionType::get - This static method is the primary way of constructing + /// a FunctionType + static FunctionType *get(const Type *Result, + const std::vector &Params, + bool isVarArg); inline bool isVarArg() const { return isVarArgs; } inline const Type *getReturnType() const { return ResultType; } @@ -166,16 +168,10 @@ } virtual unsigned getNumContainedTypes() const { return ParamTys.size()+1; } - // refineAbstractType - Called when a contained type is found to be more - // concrete - this could potentially change us from an abstract type to a - // concrete type. - // + // Implement the AbstractTypeUser interface. virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); - - static FunctionType *get(const Type *Result, - const std::vector &Params, - bool isVarArg); - + virtual void typeBecameConcrete(const DerivedType *AbsTy); + // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const FunctionType *T) { return true; } static inline bool classof(const Type *T) { @@ -244,6 +240,10 @@ virtual void dropAllTypeUses(bool inMap); public: + /// StructType::get - This static method is the primary way to create a + /// StructType. + static StructType *get(const std::vector &Params); + inline const ElementTypes &getElementTypes() const { return ETypes; } virtual const Type *getContainedType(unsigned i) const { @@ -262,13 +262,9 @@ // virtual const Type *getIndexType() const { return Type::UByteTy; } - // refineAbstractType - Called when a contained type is found to be more - // concrete - this could potentially change us from an abstract type to a - // concrete type. - // + // Implement the AbstractTypeUser interface. virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); - - static StructType *get(const std::vector &Params); + virtual void typeBecameConcrete(const DerivedType *AbsTy); // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const StructType *T) { return true; } @@ -353,15 +349,15 @@ virtual void dropAllTypeUses(bool inMap); public: + /// ArrayType::get - This static method is the primary way to construct an + /// ArrayType + static ArrayType *get(const Type *ElementType, unsigned NumElements); + inline unsigned getNumElements() const { return NumElements; } - // refineAbstractType - Called when a contained type is found to be more - // concrete - this could potentially change us from an abstract type to a - // concrete type. - // + // Implement the AbstractTypeUser interface. virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); - - static ArrayType *get(const Type *ElementType, unsigned NumElements); + virtual void typeBecameConcrete(const DerivedType *AbsTy); // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ArrayType *T) { return true; } @@ -393,16 +389,14 @@ // type from the internal tables of available types. virtual void dropAllTypeUses(bool inMap); public: - // PointerType::get - Named constructor for pointer types... + /// PointerType::get - This is the only way to construct a new pointer type. static PointerType *get(const Type *ElementType); - // refineAbstractType - Called when a contained type is found to be more - // concrete - this could potentially change us from an abstract type to a - // concrete type. - // + // Implement the AbstractTypeUser interface. virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); + virtual void typeBecameConcrete(const DerivedType *AbsTy); - // Methods for support type inquiry through isa, cast, and dyn_cast: + // Implement support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const PointerType *T) { return true; } static inline bool classof(const Type *T) { return T->getPrimitiveID() == PointerTyID; @@ -430,23 +424,20 @@ virtual void dropAllTypeUses(bool inMap) {} // No type uses public: - - // get - Static factory method for the OpaqueType class... + // OpaqueType::get - Static factory method for the OpaqueType class... static OpaqueType *get() { return new OpaqueType(); // All opaque types are distinct } - // refineAbstractType - Called when a contained type is found to be more - // concrete - this could potentially change us from an abstract type to a - // concrete type. - // + // Implement the AbstractTypeUser interface. virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { - // This class never uses other types! - abort(); + abort(); // FIXME: this is not really an AbstractTypeUser! + } + virtual void typeBecameConcrete(const DerivedType *AbsTy) { + abort(); // FIXME: this is not really an AbstractTypeUser! } - - // Methods for support type inquiry through isa, cast, and dyn_cast: + // Implement support for type inquiry through isa, cast, and dyn_cast: static inline bool classof(const OpaqueType *T) { return true; } static inline bool classof(const Type *T) { return T->getPrimitiveID() == OpaqueTyID; Index: llvm/include/llvm/SymbolTable.h diff -u llvm/include/llvm/SymbolTable.h:1.24 llvm/include/llvm/SymbolTable.h:1.25 --- llvm/include/llvm/SymbolTable.h:1.24 Tue Sep 30 13:37:37 2003 +++ llvm/include/llvm/SymbolTable.h Fri Oct 3 13:46:21 2003 @@ -118,6 +118,7 @@ // This function is called when one of the types in the type plane are refined virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); + virtual void typeBecameConcrete(const DerivedType *AbsTy); }; #endif From lattner at cs.uiuc.edu Fri Oct 3 13:47:15 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Oct 3 13:47:15 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/SymbolTable.cpp Type.cpp Message-ID: <200310031846.NAA15960@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: SymbolTable.cpp updated: 1.34 -> 1.35 Type.cpp updated: 1.71 -> 1.72 --- Log message: This checkin basically amounts to a complete rewrite of the type-resolution machinery. This dramatically simplifies how things works, removes irritating little corner cases, and overall improves speed and reliability. Highlights of this change are: 1. The exponential algorithm built into the code is now gone. For example the time to disassemble one bytecode file from the mesa benchmark went from taking 12.5s to taking 0.16s. 2. The linker bugs should be dramatically reduced. The one remaining bug has to do with constant handling, which I actually introduced in "union-find" checkins. 3. The code is much easier to follow, as a result of fewer special cases. It's probably also smaller. yaay. --- Diffs of the changes: Index: llvm/lib/VMCore/SymbolTable.cpp diff -u llvm/lib/VMCore/SymbolTable.cpp:1.34 llvm/lib/VMCore/SymbolTable.cpp:1.35 --- llvm/lib/VMCore/SymbolTable.cpp:1.34 Sun Sep 7 22:08:43 2003 +++ llvm/lib/VMCore/SymbolTable.cpp Fri Oct 3 13:46:24 2003 @@ -195,7 +195,7 @@ // Search to see if we have any values of the type oldtype. If so, we need to // move them into the newtype plane... iterator TPI = find(OldType); - if (OldType != NewType && TPI != end()) { + if (TPI != end()) { // Get a handle to the new type plane... iterator NewTypeIt = find(NewType); if (NewTypeIt == super::end()) { // If no plane exists, add one @@ -281,12 +281,6 @@ // Remove the plane that is no longer used erase(TPI); - } else if (TPI != end()) { - assert(OldType == NewType); -#if DEBUG_ABSTYPE - std::cerr << "Removing SELF type " << OldType->getDescription() << "\n"; -#endif - OldType->removeAbstractTypeUser(this); } TPI = find(Type::TypeTy); @@ -312,6 +306,27 @@ cast(NewType)->addAbstractTypeUser(this); } } + } +} + +void SymbolTable::typeBecameConcrete(const DerivedType *AbsTy) { + iterator TPI = find(AbsTy); + + // If there are any values in the symbol table of this type, then the type + // plan is a use of the abstract type which must be dropped. + if (TPI != end()) + AbsTy->removeAbstractTypeUser(this); + + TPI = find(Type::TypeTy); + if (TPI != end()) { + // Loop over all of the types in the symbol table, dropping any abstract + // type user entries for AbsTy which occur because there are names for the + // type. + // + VarMap &TyPlane = TPI->second; + for (VarMap::iterator I = TyPlane.begin(), E = TyPlane.end(); I != E; ++I) + if (I->second == (Value*)AbsTy) // FIXME when Types aren't const. + AbsTy->removeAbstractTypeUser(this); } } Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.71 llvm/lib/VMCore/Type.cpp:1.72 --- llvm/lib/VMCore/Type.cpp:1.71 Thu Oct 2 23:48:21 2003 +++ llvm/lib/VMCore/Type.cpp Fri Oct 3 13:46:24 2003 @@ -498,8 +498,8 @@ // our map if an abstract type gets refined somehow... // template -class TypeMap : public AbstractTypeUser { - typedef std::map MapTy; +class TypeMap { + typedef std::map MapTy; MapTy Map; public: typedef typename MapTy::iterator iterator; @@ -507,11 +507,11 @@ inline TypeClass *get(const ValType &V) { iterator I = Map.find(V); - return I != Map.end() ? (TypeClass*)I->second.get() : 0; + return I != Map.end() ? I->second : 0; } inline void add(const ValType &V, TypeClass *T) { - Map.insert(std::make_pair(V, PATypeHandle(T, this))); + Map.insert(std::make_pair(V, T)); print("add"); } @@ -519,57 +519,48 @@ iterator I = Map.find(ValType::get(Ty)); if (I == Map.end()) print("ERROR!"); assert(I != Map.end() && "Didn't find type entry!"); - assert(T->second == Ty && "Type entry wrong?"); + assert(I->second == Ty && "Type entry wrong?"); return I; } - void finishRefinement(TypeClass *Ty) { - //const TypeClass *Ty = (const TypeClass*)TyIt->second.get(); + void finishRefinement(TypeClass *Ty, iterator TyIt) { + // FIXME: this could eventually just pass in the iterator! + assert(TyIt->second == Ty && "Did not specify entry for the correct type!"); + + // The old record is now out-of-date, because one of the children has been + // updated. Remove the obsolete entry from the map. + Map.erase(TyIt); + + // Now we check to see if there is an existing entry in the table which is + // structurally identical to the newly refined type. If so, this type gets + // refined to the pre-existing type. + // for (iterator I = Map.begin(), E = Map.end(); I != E; ++I) - if (I->second.get() != Ty && TypesEqual(Ty, I->second.get())) { + if (TypesEqual(Ty, I->second)) { assert(Ty->isAbstract() && "Replacing a non-abstract type?"); - TypeClass *NewTy = (TypeClass*)I->second.get(); -#if 0 - //Map.erase(TyIt); // The old entry is now dead! -#endif + TypeClass *NewTy = I->second; + // Refined to a different type altogether? Ty->refineAbstractTypeToInternal(NewTy, false); return; } + // If there is no existing type of the same structure, we reinsert an + // updated record into the map. + Map.insert(std::make_pair(ValType::get(Ty), Ty)); + // If the type is currently thought to be abstract, rescan all of our // subtypes to see if the type has just become concrete! - if (Ty->isAbstract()) + if (Ty->isAbstract()) { Ty->setAbstract(Ty->isTypeAbstract()); - // This method may be called with either an abstract or a concrete type. - // Concrete types might get refined if a subelement type got refined which - // was previously marked as abstract, but was realized to be concrete. This - // can happen for recursive types. - Ty->typeIsRefined(); // Same type, different contents... - } - - // refineAbstractType - This is called when one of the contained abstract - // types gets refined... this simply removes the abstract type from our table. - // We expect that whoever refined the type will add it back to the table, - // corrected. - // - virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { -#ifdef DEBUG_MERGE_TYPES - std::cerr << "Removing Old type from Tab: " << (void*)OldTy << ", " - << *OldTy << " replacement == " << (void*)NewTy - << ", " << *NewTy << "\n"; -#endif - for (iterator I = Map.begin(), E = Map.end(); I != E; ++I) - if (I->second.get() == OldTy) { - // Check to see if the type just became concrete. If so, remove self - // from user list. - I->second.removeUserFromConcrete(); - I->second = cast(NewTy); - } + // If the type just became concrete, notify all users! + if (!Ty->isAbstract()) + Ty->notifyUsesThatTypeBecameConcrete(); + } } - + void remove(const ValType &OldVal) { iterator I = Map.find(OldVal); assert(I != Map.end() && "TypeMap::remove, element not found!"); @@ -587,8 +578,8 @@ unsigned i = 0; for (typename MapTy::const_iterator I = Map.begin(), E = Map.end(); I != E; ++I) - std::cerr << " " << (++i) << ". " << (void*)I->second.get() << " " - << *I->second.get() << "\n"; + std::cerr << " " << (++i) << ". " << (void*)I->second << " " + << *I->second << "\n"; #endif } @@ -596,50 +587,6 @@ }; -// ValTypeBase - This is the base class that is used by the various -// instantiations of TypeMap. This class is an AbstractType user that notifies -// the underlying TypeMap when it gets modified. -// -template -class ValTypeBase : public AbstractTypeUser { - TypeMap &MyTable; -protected: - inline ValTypeBase(TypeMap &tab) : MyTable(tab) {} - - // Subclass should override this... to update self as usual - virtual void doRefinement(const DerivedType *OldTy, const Type *NewTy) = 0; - - // typeBecameConcrete - This callback occurs when a contained type refines - // to itself, but becomes concrete in the process. Our subclass should remove - // itself from the ATU list of the specified type. - // - virtual void typeBecameConcrete(const DerivedType *Ty) = 0; - - virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { - assert(OldTy == NewTy || OldTy->isAbstract()); - - if (!OldTy->isAbstract()) - typeBecameConcrete(OldTy); - - TypeMap &Table = MyTable; // Copy MyTable reference - ValType Tmp(*(ValType*)this); // Copy this. - PATypeHandle OldType(Table.get(*(ValType*)this), this); - Table.remove(*(ValType*)this); // Destroy's this! - - // Refine temporary to new state... - if (OldTy != NewTy) - Tmp.doRefinement(OldTy, NewTy); - - // FIXME: when types are not const! - Table.add((ValType&)Tmp, (TypeClass*)OldType.get()); - } - - void dump() const { - std::cerr << "ValTypeBase instance!\n"; - } -}; - - //===----------------------------------------------------------------------===// // Function Type Factory and Value Class... @@ -647,52 +594,42 @@ // FunctionValType - Define a class to hold the key that goes into the TypeMap // -class FunctionValType : public ValTypeBase { - PATypeHandle RetTy; - std::vector ArgTypes; +class FunctionValType { + const Type *RetTy; + std::vector ArgTypes; bool isVarArg; public: FunctionValType(const Type *ret, const std::vector &args, - bool IVA, TypeMap &Tab) - : ValTypeBase(Tab), RetTy(ret, this), - isVarArg(IVA) { + bool IVA) : RetTy(ret), isVarArg(IVA) { for (unsigned i = 0; i < args.size(); ++i) - ArgTypes.push_back(PATypeHandle(args[i], this)); + ArgTypes.push_back(args[i]); } // We *MUST* have an explicit copy ctor so that the TypeHandles think that // this FunctionValType owns them, not the old one! // - FunctionValType(const FunctionValType &MVT) - : ValTypeBase(MVT), RetTy(MVT.RetTy, this), - isVarArg(MVT.isVarArg) { + FunctionValType(const FunctionValType &MVT) + : RetTy(MVT.RetTy), isVarArg(MVT.isVarArg) { ArgTypes.reserve(MVT.ArgTypes.size()); for (unsigned i = 0; i < MVT.ArgTypes.size(); ++i) - ArgTypes.push_back(PATypeHandle(MVT.ArgTypes[i], this)); + ArgTypes.push_back(MVT.ArgTypes[i]); } static FunctionValType get(const FunctionType *FT); // Subclass should override this... to update self as usual - virtual void doRefinement(const DerivedType *OldType, const Type *NewType) { + void doRefinement(const DerivedType *OldType, const Type *NewType) { if (RetTy == OldType) RetTy = NewType; for (unsigned i = 0, e = ArgTypes.size(); i != e; ++i) if (ArgTypes[i] == OldType) ArgTypes[i] = NewType; } - virtual void typeBecameConcrete(const DerivedType *Ty) { - if (RetTy == Ty) RetTy.removeUserFromConcrete(); - - for (unsigned i = 0; i < ArgTypes.size(); ++i) - if (ArgTypes[i] == Ty) ArgTypes[i].removeUserFromConcrete(); - } - inline bool operator<(const FunctionValType &MTV) const { - if (RetTy.get() < MTV.RetTy.get()) return true; - if (RetTy.get() > MTV.RetTy.get()) return false; + if (RetTy < MTV.RetTy) return true; + if (RetTy > MTV.RetTy) return false; if (ArgTypes < MTV.ArgTypes) return true; - return (ArgTypes == MTV.ArgTypes) && isVarArg < MTV.isVarArg; + return ArgTypes == MTV.ArgTypes && isVarArg < MTV.isVarArg; } }; @@ -705,8 +642,7 @@ ParamTypes.reserve(FT->getParamTypes().size()); for (unsigned i = 0, e = FT->getParamTypes().size(); i != e; ++i) ParamTypes.push_back(FT->getParamType(i)); - return FunctionValType(FT->getReturnType(), ParamTypes, FT->isVarArg(), - FunctionTypes); + return FunctionValType(FT->getReturnType(), ParamTypes, FT->isVarArg()); } @@ -714,7 +650,7 @@ FunctionType *FunctionType::get(const Type *ReturnType, const std::vector &Params, bool isVarArg) { - FunctionValType VT(ReturnType, Params, isVarArg, FunctionTypes); + FunctionValType VT(ReturnType, Params, isVarArg); FunctionType *MT = FunctionTypes.get(VT); if (MT) return MT; @@ -739,52 +675,40 @@ //===----------------------------------------------------------------------===// // Array Type Factory... // -class ArrayValType : public ValTypeBase { - PATypeHandle ValTy; +class ArrayValType { + const Type *ValTy; unsigned Size; public: - ArrayValType(const Type *val, int sz, TypeMap &Tab) - : ValTypeBase(Tab), ValTy(val, this), Size(sz) {} + ArrayValType(const Type *val, int sz) : ValTy(val), Size(sz) {} // We *MUST* have an explicit copy ctor so that the ValTy thinks that this // ArrayValType owns it, not the old one! // - ArrayValType(const ArrayValType &AVT) - : ValTypeBase(AVT), ValTy(AVT.ValTy, this), - Size(AVT.Size) {} - - static ArrayValType get(const ArrayType *AT); + ArrayValType(const ArrayValType &AVT) : ValTy(AVT.ValTy), Size(AVT.Size) {} + static ArrayValType get(const ArrayType *AT) { + return ArrayValType(AT->getElementType(), AT->getNumElements()); + } // Subclass should override this... to update self as usual - virtual void doRefinement(const DerivedType *OldType, const Type *NewType) { + void doRefinement(const DerivedType *OldType, const Type *NewType) { assert(ValTy == OldType); ValTy = NewType; } - virtual void typeBecameConcrete(const DerivedType *Ty) { - assert(ValTy == Ty && - "Contained type became concrete but we're not using it!"); - ValTy.removeUserFromConcrete(); - } - inline bool operator<(const ArrayValType &MTV) const { if (Size < MTV.Size) return true; - return Size == MTV.Size && ValTy.get() < MTV.ValTy.get(); + return Size == MTV.Size && ValTy < MTV.ValTy; } }; static TypeMap ArrayTypes; -ArrayValType ArrayValType::get(const ArrayType *AT) { - return ArrayValType(AT->getElementType(), AT->getNumElements(), ArrayTypes); -} - ArrayType *ArrayType::get(const Type *ElementType, unsigned NumElements) { assert(ElementType && "Can't get array of null types!"); - ArrayValType AVT(ElementType, NumElements, ArrayTypes); + ArrayValType AVT(ElementType, NumElements); ArrayType *AT = ArrayTypes.get(AVT); if (AT) return AT; // Found a match, return it! @@ -813,41 +737,29 @@ // StructValType - Define a class to hold the key that goes into the TypeMap // -class StructValType : public ValTypeBase { - std::vector ElTypes; +class StructValType { + std::vector ElTypes; public: - StructValType(const std::vector &args, - TypeMap &Tab) - : ValTypeBase(Tab) { - ElTypes.reserve(args.size()); - for (unsigned i = 0, e = args.size(); i != e; ++i) - ElTypes.push_back(PATypeHandle(args[i], this)); - } + StructValType(const std::vector &args) : ElTypes(args) {} - // We *MUST* have an explicit copy ctor so that the TypeHandles think that - // this StructValType owns them, not the old one! - // - StructValType(const StructValType &SVT) - : ValTypeBase(SVT){ - ElTypes.reserve(SVT.ElTypes.size()); - for (unsigned i = 0, e = SVT.ElTypes.size(); i != e; ++i) - ElTypes.push_back(PATypeHandle(SVT.ElTypes[i], this)); - } + // Explicit copy ctor not needed + StructValType(const StructValType &SVT) : ElTypes(SVT.ElTypes) {} - static StructValType get(const StructType *ST); + static StructValType get(const StructType *ST) { + std::vector ElTypes; + ElTypes.reserve(ST->getElementTypes().size()); + for (unsigned i = 0, e = ST->getElementTypes().size(); i != e; ++i) + ElTypes.push_back(ST->getElementTypes()[i]); + + return StructValType(ElTypes); + } // Subclass should override this... to update self as usual - virtual void doRefinement(const DerivedType *OldType, const Type *NewType) { + void doRefinement(const DerivedType *OldType, const Type *NewType) { for (unsigned i = 0; i < ElTypes.size(); ++i) if (ElTypes[i] == OldType) ElTypes[i] = NewType; } - virtual void typeBecameConcrete(const DerivedType *Ty) { - for (unsigned i = 0, e = ElTypes.size(); i != e; ++i) - if (ElTypes[i] == Ty) - ElTypes[i].removeUserFromConcrete(); - } - inline bool operator<(const StructValType &STV) const { return ElTypes < STV.ElTypes; } @@ -855,19 +767,8 @@ static TypeMap StructTypes; -StructValType StructValType::get(const StructType *ST) { - std::vector ElTypes; - ElTypes.reserve(ST->getElementTypes().size()); - for (unsigned i = 0, e = ST->getElementTypes().size(); i != e; ++i) - ElTypes.push_back(ST->getElementTypes()[i]); - - return StructValType(ElTypes, StructTypes); -} - - - StructType *StructType::get(const std::vector &ETypes) { - StructValType STV(ETypes, StructTypes); + StructValType STV(ETypes); StructType *ST = StructTypes.get(STV); if (ST) return ST; @@ -896,47 +797,34 @@ // PointerValType - Define a class to hold the key that goes into the TypeMap // -class PointerValType : public ValTypeBase { - PATypeHandle ValTy; +class PointerValType { + const Type *ValTy; public: - PointerValType(const Type *val, TypeMap &Tab) - : ValTypeBase(Tab), ValTy(val, this) {} + PointerValType(const Type *val) : ValTy(val) {} - // We *MUST* have an explicit copy ctor so that the ValTy thinks that this - // PointerValType owns it, not the old one! - // - PointerValType(const PointerValType &PVT) - : ValTypeBase(PVT), ValTy(PVT.ValTy, this) {} + // FIXME: delete explicit copy ctor + PointerValType(const PointerValType &PVT) : ValTy(PVT.ValTy) {} - static PointerValType get(const PointerType *PT); + static PointerValType get(const PointerType *PT) { + return PointerValType(PT->getElementType()); + } // Subclass should override this... to update self as usual - virtual void doRefinement(const DerivedType *OldType, const Type *NewType) { + void doRefinement(const DerivedType *OldType, const Type *NewType) { assert(ValTy == OldType); ValTy = NewType; } - virtual void typeBecameConcrete(const DerivedType *Ty) { - assert(ValTy == Ty && - "Contained type became concrete but we're not using it!"); - ValTy.removeUserFromConcrete(); - } - - inline bool operator<(const PointerValType &MTV) const { - return ValTy.get() < MTV.ValTy.get(); + bool operator<(const PointerValType &MTV) const { + return ValTy < MTV.ValTy; } }; static TypeMap PointerTypes; -PointerValType PointerValType::get(const PointerType *PT) { - return PointerValType(PT->getElementType(), PointerTypes); -} - - PointerType *PointerType::get(const Type *ValueType) { assert(ValueType && "Can't get a pointer to type!"); - PointerValType PVT(ValueType, PointerTypes); + PointerValType PVT(ValueType); PointerType *PT = PointerTypes.get(PVT); if (PT) return PT; @@ -1011,7 +899,8 @@ void DerivedType::refineAbstractTypeToInternal(const Type *NewType, bool inMap){ assert(isAbstract() && "refineAbstractTypeTo: Current type is not abstract!"); assert(this != NewType && "Can't refine to myself!"); - + assert(ForwardType == 0 && "This type has already been refined!"); + // The descriptions may be out of date. Conservatively clear them all! AbstractTypeDescriptions.clear(); @@ -1021,12 +910,13 @@ << *NewType << "]!\n"; #endif - // Make sure to put the type to be refined to into a holder so that if IT gets // refined, that we will not continue using a dead reference... // PATypeHolder NewTy(NewType); + // Any PATypeHolders referring to this type will now automatically forward to + // the type we are resolved to. ForwardType = NewType; if (NewType->isAbstract()) cast(NewType)->addRef(); @@ -1060,18 +950,6 @@ #endif User->refineAbstractType(this, NewTy); -#ifdef DEBUG_MERGE_TYPES - if (AbstractTypeUsers.size() == OldSize) { - User->refineAbstractType(this, NewTy); - if (AbstractTypeUsers.back() != User) - std::cerr << "User changed!\n"; - std::cerr << "Top of user list is:\n"; - AbstractTypeUsers.back()->dump(); - - std::cerr <<"\nOld User=\n"; - User->dump(); - } -#endif assert(AbstractTypeUsers.size() != OldSize && "AbsTyUser did not remove self from user list!"); } @@ -1082,69 +960,22 @@ // destroyed. } -// typeIsRefined - Notify AbstractTypeUsers of this type that the current type -// has been refined a bit. The pointer is still valid and still should be -// used, but the subtypes have changed. -// -void DerivedType::typeIsRefined() { - assert(isRefining >= 0 && isRefining <= 2 && "isRefining out of bounds!"); - if (isRefining == 1) return; // Kill recursion here... - ++isRefining; - +// notifyUsesThatTypeBecameConcrete - Notify AbstractTypeUsers of this type that +// the current type has transitioned from being abstract to being concrete. +// +void DerivedType::notifyUsesThatTypeBecameConcrete() { #ifdef DEBUG_MERGE_TYPES std::cerr << "typeIsREFINED type: " << (void*)this << " " << *this << "\n"; #endif - // In this loop we have to be very careful not to get into infinite loops and - // other problem cases. Specifically, we loop through all of the abstract - // type users in the user list, notifying them that the type has been refined. - // At their choice, they may or may not choose to remove themselves from the - // list of users. Regardless of whether they do or not, we have to be sure - // that we only notify each user exactly once. Because the refineAbstractType - // method can cause an arbitrary permutation to the user list, we cannot loop - // through it in any particular order and be guaranteed that we will be - // successful at this aim. Because of this, we keep track of all the users we - // have visited and only visit users we have not seen. Because this user list - // should be small, we use a vector instead of a full featured set to keep - // track of what users we have notified so far. - // - std::vector Refined; - while (1) { - unsigned i; - for (i = AbstractTypeUsers.size(); i != 0; --i) - if (find(Refined.begin(), Refined.end(), AbstractTypeUsers[i-1]) == - Refined.end()) - break; // Found an unrefined user? - - if (i == 0) break; // Noone to refine left, break out of here! - - AbstractTypeUser *ATU = AbstractTypeUsers[--i]; - Refined.push_back(ATU); // Keep track of which users we have refined! + unsigned OldSize = AbstractTypeUsers.size(); + while (!AbstractTypeUsers.empty()) { + AbstractTypeUser *ATU = AbstractTypeUsers.back(); + ATU->typeBecameConcrete(this); -#ifdef DEBUG_MERGE_TYPES - std::cerr << " typeIsREFINED user " << i << "[" << ATU - << "] of abstract type [" << (void*)this << " " - << *this << "]\n"; -#endif - ATU->refineAbstractType(this, this); - } - - --isRefining; - -#ifndef _NDEBUG - if (!(isAbstract() || AbstractTypeUsers.empty())) - for (unsigned i = 0; i < AbstractTypeUsers.size(); ++i) { - if (AbstractTypeUsers[i] != this) { - // Debugging hook - std::cerr << "FOUND FAILURE\nUser: "; - AbstractTypeUsers[i]->dump(); - std::cerr << "\nCatch:\n"; - AbstractTypeUsers[i]->refineAbstractType(this, this); - assert(0 && "Type became concrete," - " but it still has abstract type users hanging around!"); - } + assert(AbstractTypeUsers.size() < OldSize-- && + "AbstractTypeUser did not remove itself from the use list!"); } -#endif } @@ -1165,10 +996,8 @@ #endif // Look up our current type map entry.. -#if 0 TypeMap::iterator TMI = FunctionTypes.getEntryForType(this); -#endif // Find the type element we are refining... if (ResultType == OldType) { @@ -1181,7 +1010,11 @@ ParamTys[i] = NewType; } - FunctionTypes.finishRefinement(this); + FunctionTypes.finishRefinement(this, TMI); +} + +void FunctionType::typeBecameConcrete(const DerivedType *AbsTy) { + refineAbstractType(AbsTy, AbsTy); } @@ -1199,17 +1032,19 @@ << *NewType << "])\n"; #endif -#if 0 // Look up our current type map entry.. TypeMap::iterator TMI = ArrayTypes.getEntryForType(this); -#endif assert(getElementType() == OldType); ElementType.removeUserFromConcrete(); ElementType = NewType; - ArrayTypes.finishRefinement(this); + ArrayTypes.finishRefinement(this, TMI); +} + +void ArrayType::typeBecameConcrete(const DerivedType *AbsTy) { + refineAbstractType(AbsTy, AbsTy); } @@ -1227,11 +1062,9 @@ << *NewType << "])\n"; #endif -#if 0 // Look up our current type map entry.. TypeMap::iterator TMI = StructTypes.getEntryForType(this); -#endif for (int i = ETypes.size()-1; i >= 0; --i) if (ETypes[i] == OldType) { @@ -1241,7 +1074,11 @@ ETypes[i] = NewType; } - StructTypes.finishRefinement(this); + StructTypes.finishRefinement(this, TMI); +} + +void StructType::typeBecameConcrete(const DerivedType *AbsTy) { + refineAbstractType(AbsTy, AbsTy); } // refineAbstractType - Called when a contained type is found to be more @@ -1258,16 +1095,18 @@ << *NewType << "])\n"; #endif -#if 0 // Look up our current type map entry.. TypeMap::iterator TMI = PointerTypes.getEntryForType(this); -#endif assert(ElementType == OldType); ElementType.removeUserFromConcrete(); ElementType = NewType; - PointerTypes.finishRefinement(this); + PointerTypes.finishRefinement(this, TMI); +} + +void PointerType::typeBecameConcrete(const DerivedType *AbsTy) { + refineAbstractType(AbsTy, AbsTy); } From lattner at cs.uiuc.edu Fri Oct 3 13:59:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Oct 3 13:59:02 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h Message-ID: <200310031858.NAA24377@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: DerivedTypes.h updated: 1.42 -> 1.43 --- Log message: Minor cleanups --- Diffs of the changes: Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.42 llvm/include/llvm/DerivedTypes.h:1.43 --- llvm/include/llvm/DerivedTypes.h:1.42 Fri Oct 3 13:46:21 2003 +++ llvm/include/llvm/DerivedTypes.h Fri Oct 3 13:57:52 2003 @@ -47,13 +47,9 @@ // dropAllTypeUses - When this (abstract) type is resolved to be equal to // another (more concrete) type, we must eliminate all references to other - // types, to avoid some circular reference problems. This also removes the - // type from the internal tables of available types. - virtual void dropAllTypeUses(bool inMap) = 0; + // types, to avoid some circular reference problems. + virtual void dropAllTypeUses() = 0; - - void refineAbstractTypeToInternal(const Type *NewType, bool inMap); - public: //===--------------------------------------------------------------------===// @@ -82,9 +78,7 @@ // This causes all users of 'this' to switch to reference the more concrete // type NewType and for 'this' to be deleted. // - void refineAbstractTypeTo(const Type *NewType) { - refineAbstractTypeToInternal(NewType, true); - } + void refineAbstractTypeTo(const Type *NewType); void addRef() const { assert(isAbstract() && "Cannot add a reference to a non-abstract type!"); @@ -138,9 +132,8 @@ // dropAllTypeUses - When this (abstract) type is resolved to be equal to // another (more concrete) type, we must eliminate all references to other - // types, to avoid some circular reference problems. This also removes the - // type from the internal tables of available types. - virtual void dropAllTypeUses(bool inMap); + // types, to avoid some circular reference problems. + virtual void dropAllTypeUses(); public: /// FunctionType::get - This static method is the primary way of constructing @@ -235,9 +228,8 @@ // dropAllTypeUses - When this (abstract) type is resolved to be equal to // another (more concrete) type, we must eliminate all references to other - // types, to avoid some circular reference problems. This also removes the - // type from the internal tables of available types. - virtual void dropAllTypeUses(bool inMap); + // types, to avoid some circular reference problems. + virtual void dropAllTypeUses(); public: /// StructType::get - This static method is the primary way to create a @@ -344,9 +336,8 @@ // dropAllTypeUses - When this (abstract) type is resolved to be equal to // another (more concrete) type, we must eliminate all references to other - // types, to avoid some circular reference problems. This also removes the - // type from the internal tables of available types. - virtual void dropAllTypeUses(bool inMap); + // types, to avoid some circular reference problems. + virtual void dropAllTypeUses(); public: /// ArrayType::get - This static method is the primary way to construct an @@ -385,9 +376,8 @@ // dropAllTypeUses - When this (abstract) type is resolved to be equal to // another (more concrete) type, we must eliminate all references to other - // types, to avoid some circular reference problems. This also removes the - // type from the internal tables of available types. - virtual void dropAllTypeUses(bool inMap); + // types, to avoid some circular reference problems. + virtual void dropAllTypeUses(); public: /// PointerType::get - This is the only way to construct a new pointer type. static PointerType *get(const Type *ElementType); @@ -421,7 +411,9 @@ // dropAllTypeUses - When this (abstract) type is resolved to be equal to // another (more concrete) type, we must eliminate all references to other // types, to avoid some circular reference problems. - virtual void dropAllTypeUses(bool inMap) {} // No type uses + virtual void dropAllTypeUses() { + // FIXME: THIS IS NOT AN ABSTRACT TYPE USER! + } // No type uses public: // OpaqueType::get - Static factory method for the OpaqueType class... From lattner at cs.uiuc.edu Fri Oct 3 13:59:12 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Oct 3 13:59:12 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp Message-ID: <200310031858.NAA24419@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Type.cpp updated: 1.72 -> 1.73 --- Log message: Minor cleanups --- Diffs of the changes: Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.72 llvm/lib/VMCore/Type.cpp:1.73 --- llvm/lib/VMCore/Type.cpp:1.72 Fri Oct 3 13:46:24 2003 +++ llvm/lib/VMCore/Type.cpp Fri Oct 3 13:57:54 2003 @@ -524,9 +524,8 @@ } - void finishRefinement(TypeClass *Ty, iterator TyIt) { - // FIXME: this could eventually just pass in the iterator! - assert(TyIt->second == Ty && "Did not specify entry for the correct type!"); + void finishRefinement(iterator TyIt) { + TypeClass *Ty = TyIt->second; // The old record is now out-of-date, because one of the children has been // updated. Remove the obsolete entry from the map. @@ -542,7 +541,7 @@ TypeClass *NewTy = I->second; // Refined to a different type altogether? - Ty->refineAbstractTypeToInternal(NewTy, false); + Ty->refineAbstractTypeTo(NewTy); return; } @@ -662,11 +661,7 @@ return MT; } -void FunctionType::dropAllTypeUses(bool inMap) { -#if 0 - if (inMap) FunctionTypes.remove(FunctionTypes.getEntryForType(this)); - // Drop all uses of other types, which might be recursive. -#endif +void FunctionType::dropAllTypeUses() { ResultType = OpaqueType::get(); ParamTys.clear(); } @@ -721,10 +716,7 @@ return AT; } -void ArrayType::dropAllTypeUses(bool inMap) { -#if 0 - if (inMap) ArrayTypes.remove(ArrayTypes.getEntryForType(this)); -#endif +void ArrayType::dropAllTypeUses() { ElementType = OpaqueType::get(); } @@ -781,10 +773,7 @@ return ST; } -void StructType::dropAllTypeUses(bool inMap) { -#if 0 - if (inMap) StructTypes.remove(StructTypes.getEntryForType(this)); -#endif +void StructType::dropAllTypeUses() { ETypes.clear(); ETypes.push_back(PATypeHandle(OpaqueType::get(), this)); } @@ -838,10 +827,7 @@ return PT; } -void PointerType::dropAllTypeUses(bool inMap) { -#if 0 - if (inMap) PointerTypes.remove(PointerTypes.getEntryForType(this)); -#endif +void PointerType::dropAllTypeUses() { ElementType = OpaqueType::get(); } @@ -891,12 +877,12 @@ } -// refineAbstractTypeToInternal - This function is used to when it is discovered -// that the 'this' abstract type is actually equivalent to the NewType -// specified. This causes all users of 'this' to switch to reference the more -// concrete type NewType and for 'this' to be deleted. +// refineAbstractTypeTo - This function is used to when it is discovered that +// the 'this' abstract type is actually equivalent to the NewType specified. +// This causes all users of 'this' to switch to reference the more concrete type +// NewType and for 'this' to be deleted. // -void DerivedType::refineAbstractTypeToInternal(const Type *NewType, bool inMap){ +void DerivedType::refineAbstractTypeTo(const Type *NewType) { assert(isAbstract() && "refineAbstractTypeTo: Current type is not abstract!"); assert(this != NewType && "Can't refine to myself!"); assert(ForwardType == 0 && "This type has already been refined!"); @@ -930,7 +916,7 @@ // the type map, and to replace any type uses with uses of non-abstract types. // This dramatically limits the amount of recursive type trouble we can find // ourselves in. - dropAllTypeUses(inMap); + dropAllTypeUses(); // Iterate over all of the uses of this type, invoking callback. Each user // should remove itself from our use list automatically. We have to check to @@ -1010,7 +996,7 @@ ParamTys[i] = NewType; } - FunctionTypes.finishRefinement(this, TMI); + FunctionTypes.finishRefinement(TMI); } void FunctionType::typeBecameConcrete(const DerivedType *AbsTy) { @@ -1040,7 +1026,7 @@ ElementType.removeUserFromConcrete(); ElementType = NewType; - ArrayTypes.finishRefinement(this, TMI); + ArrayTypes.finishRefinement(TMI); } void ArrayType::typeBecameConcrete(const DerivedType *AbsTy) { @@ -1074,7 +1060,7 @@ ETypes[i] = NewType; } - StructTypes.finishRefinement(this, TMI); + StructTypes.finishRefinement(TMI); } void StructType::typeBecameConcrete(const DerivedType *AbsTy) { @@ -1103,7 +1089,7 @@ ElementType.removeUserFromConcrete(); ElementType = NewType; - PointerTypes.finishRefinement(this, TMI); + PointerTypes.finishRefinement(TMI); } void PointerType::typeBecameConcrete(const DerivedType *AbsTy) { From lattner at cs.uiuc.edu Fri Oct 3 14:03:04 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Oct 3 14:03:04 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp Message-ID: <200310031902.OAA27917@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Type.cpp updated: 1.73 -> 1.74 --- Log message: Explicit copy ctors are no longer needed --- Diffs of the changes: Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.73 llvm/lib/VMCore/Type.cpp:1.74 --- llvm/lib/VMCore/Type.cpp:1.73 Fri Oct 3 13:57:54 2003 +++ llvm/lib/VMCore/Type.cpp Fri Oct 3 14:02:41 2003 @@ -604,16 +604,6 @@ ArgTypes.push_back(args[i]); } - // We *MUST* have an explicit copy ctor so that the TypeHandles think that - // this FunctionValType owns them, not the old one! - // - FunctionValType(const FunctionValType &MVT) - : RetTy(MVT.RetTy), isVarArg(MVT.isVarArg) { - ArgTypes.reserve(MVT.ArgTypes.size()); - for (unsigned i = 0; i < MVT.ArgTypes.size(); ++i) - ArgTypes.push_back(MVT.ArgTypes[i]); - } - static FunctionValType get(const FunctionType *FT); // Subclass should override this... to update self as usual @@ -676,11 +666,6 @@ public: ArrayValType(const Type *val, int sz) : ValTy(val), Size(sz) {} - // We *MUST* have an explicit copy ctor so that the ValTy thinks that this - // ArrayValType owns it, not the old one! - // - ArrayValType(const ArrayValType &AVT) : ValTy(AVT.ValTy), Size(AVT.Size) {} - static ArrayValType get(const ArrayType *AT) { return ArrayValType(AT->getElementType(), AT->getNumElements()); } @@ -734,9 +719,6 @@ public: StructValType(const std::vector &args) : ElTypes(args) {} - // Explicit copy ctor not needed - StructValType(const StructValType &SVT) : ElTypes(SVT.ElTypes) {} - static StructValType get(const StructType *ST) { std::vector ElTypes; ElTypes.reserve(ST->getElementTypes().size()); @@ -790,9 +772,6 @@ const Type *ValTy; public: PointerValType(const Type *val) : ValTy(val) {} - - // FIXME: delete explicit copy ctor - PointerValType(const PointerValType &PVT) : ValTy(PVT.ValTy) {} static PointerValType get(const PointerType *PT) { return PointerValType(PT->getElementType()); From criswell at cs.uiuc.edu Fri Oct 3 14:22:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Oct 3 14:22:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTest/llvm.py llvmdb.py Message-ID: <200310031921.OAA05459@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTest: llvm.py updated: 1.12 -> 1.13 llvmdb.py updated: 1.1 -> 1.2 --- Log message: llvm.py: Modified all tests to have the same inputs. Also changed tests so that they always compile the bytecode themselves (I haven't figured out how to fit resources into this new database, and I don't think it's all that important). llvmdb.py: Adjusted methods so that the GUI reports the names of tests and not their extensions. --- Diffs of the changes: Index: llvm/test/QMTest/llvm.py diff -u llvm/test/QMTest/llvm.py:1.12 llvm/test/QMTest/llvm.py:1.13 --- llvm/test/QMTest/llvm.py:1.12 Thu Oct 2 13:18:36 2003 +++ llvm/test/QMTest/llvm.py Fri Oct 3 14:21:02 2003 @@ -92,7 +92,7 @@ # List of arguments that the objects accepts for test configuration. # arguments = [ - qm.fields.TextField(name='assembly_file', + qm.fields.TextField(name='srcfile', title='LLVM Assembly File', description='LLVM Assembly File to Assemble'), ] @@ -117,7 +117,7 @@ # # Construct the pathname of the source file and object file. # - srcfile=srcroot + '/' + self.assembly_file + srcfile=srcroot + '/' + self.srcfile bcpath=tmpdir + '/' + 'temp.bc' # @@ -167,7 +167,7 @@ # List of arguments that the objects accepts for test configuration. # arguments = [ - qm.fields.TextField(name='bytecode_file', + qm.fields.TextField(name='srcfile', title='LLVM Bytecode File', description='LLVM Bytecode File to Convert to C'), ] @@ -193,8 +193,8 @@ # # Construct the pathname of the source file and object file. # - srcfile=tmpdir + '/' + self.bytecode_file - objfile=tmpdir + '/' + self.bytecode_file + '.tc' + srcfile=tmpdir + '/' + self.srcfile + objfile=tmpdir + '/' + self.srcfile + '.tc' # # Construct the pathnames to the various utilities. @@ -333,9 +333,9 @@ # List of arguments that the objects accepts for test configuration. # arguments = [ - qm.fields.TextField(name='bytecode_file', - title='LLVM Bytecode File', - description='LLVM Bytecode File to Convert to Machine Code'), + qm.fields.TextField(name='srcfile', + title='LLVM Assembly Language File', + description='LLVM Assembly Language File to Convert to Machine Code'), ] @@ -359,22 +359,32 @@ # # Construct the pathname of the source file and object file. # - srcfile=tmpdir + '/' + self.bytecode_file - objfile=tmpdir + '/' + self.bytecode_file + '.mc' + srcfile=srcroot + '/' + self.srcfile + bcfile=tmpdir + '/' + os.path.basename (self.srcfile) + '.bc' + objfile=tmpdir + '/' + os.path.basename (self.srcfile) + '.mc' # # Construct the pathnames to the various utilities. # + as = buildroot + '/tools/' + context['buildtype'] + '/llvm-as' llc = buildroot + '/tools/' + context['buildtype'] + '/llc' # # Use the LLVM assembler to assemble the program. # - cmd = llc + ' ' + srcfile + ' -f -o=' + objfile + self.devnull + cmd = as + ' -f -o=' + bcfile + ' ' + srcfile + self.devnull + estatus=os.system (cmd) + if ((os.WIFEXITED(estatus)) and (os.WEXITSTATUS(estatus) != 0)): + result.Fail ('Failed to assemble program') + + # + # Use LLC to compile the program into native assembly code. + # + cmd = llc + ' ' + bcfile + ' -f -o=' + objfile + self.devnull estatus=os.system (cmd) if ((os.WIFEXITED(estatus)) and (os.WEXITSTATUS(estatus) != 0)): fail = 1 - result.Fail() + result.Fail('Failed to compile bytecode') else: fail = 0 @@ -406,7 +416,7 @@ # List of arguments that the objects accepts for test configuration. # arguments = [ - qm.fields.TextField(name='bytecode_file', + qm.fields.TextField(name='srcfile', title='LLVM Bytecode File', description='LLVM Bytecode File to Convert to Machine Code'), ] @@ -431,8 +441,8 @@ # # Construct the pathname of the source file and object file. # - srcfile=tmpdir + '/' + self.bytecode_file - objfile=tmpdir + '/' + self.bytecode_file + '.s' + srcfile=tmpdir + '/' + self.srcfile + objfile=tmpdir + '/' + self.srcfile + '.s' # # Construct the pathnames to the various utilities. @@ -468,7 +478,7 @@ # List of arguments that the objects accepts for test configuration. # arguments = [ - qm.fields.TextField(name='assembly_file', + qm.fields.TextField(name='srcfile', title='LLVM Assembly File', description='LLVM Assembly File to run through the Optimizer'), ] @@ -502,7 +512,7 @@ # # Construct the pathname of the source file. # - sourcefile=srcroot + '/' + self.assembly_file + sourcefile=srcroot + '/' + self.srcfile # # Construct the pathnames to the various utilities. @@ -614,7 +624,7 @@ # List of information that is passed into each test arguments = [ # Name of the file to assemble and disassemble - qm.fields.TextField(name="assembly_file", + qm.fields.TextField(name="srcfile", title="LLVM Assembly File", description="Name of the LLVM Assembly language file to assemble and disassemble"), ] @@ -650,7 +660,7 @@ # # Find the name of the file to assemble. # - input=testdir + '/' + self.assembly_file + input=testdir + '/' + self.srcfile # # Construct output filenames. @@ -723,7 +733,7 @@ # List of arguments that the objects accepts for test configuration. # arguments = [ - qm.fields.TextField(name='assembly_file', + qm.fields.TextField(name='srcfile', title='LLVM Assembly File', description='LLVM Assembly File to Verify'), ] @@ -747,7 +757,7 @@ # # Construct the pathname of the source file. # - srcfile=srcroot + '/' + self.assembly_file + srcfile=srcroot + '/' + self.srcfile # # Construct the pathnames to the various utilities. @@ -785,7 +795,7 @@ # List of arguments that the objects accepts for test configuration. # arguments = [ - qm.fields.TextField(name='bytecode_file', + qm.fields.TextField(name='srcfile', title='LLVM Bytecode File', description='LLVM Bytecode File to Convert to Machine Code'), ] @@ -810,17 +820,26 @@ # # Construct the pathname of the source file and object file. # - srcfile=tmpdir + '/' + self.bytecode_file + srcfile = srcroot + '/' + self.srcfile + bcfile = tmpdir + '/' + os.path.basename (self.srcfile) # # Construct the pathnames to the various utilities. # - lli = buildroot + '/tools/' + context['buildtype'] + '/lli -force-interpreter=false ' + as = buildroot + '/tools/' + context['buildtype'] + '/llvm-as' + lli = buildroot + '/tools/' + context['buildtype'] + '/lli -force-interpreter=false ' + + # + # Assemble the program. + # + estatus=os.system (as + ' -f -o ' + bcfile + ' ' + srcfile) + if ((os.WIFEXITED(estatus)) and (os.WEXITSTATUS(estatus) != 0)): + result.Fail('Failed to assemble LLVM code') # # Execute the program. # - estatus=os.system (lli + ' ' + srcfile + ' < /dev/null') + estatus=os.system (lli + ' ' + bcfile + ' < /dev/null') if ((os.WIFEXITED(estatus)) and (os.WEXITSTATUS(estatus) != 0)): result.Fail('LLI failed to execute bytecode') @@ -845,7 +864,7 @@ # List of arguments that the objects accepts for test configuration. # arguments = [ - qm.fields.TextField(name='assembly_file', + qm.fields.TextField(name='srcfile', title='LLVM Assembly File', description='LLVM Assembly File to Analyze'), ] @@ -869,7 +888,7 @@ # # Construct the pathname of the source file and object file. # - srcfile=srcroot + '/' + self.assembly_file + srcfile=srcroot + '/' + self.srcfile # # Construct the pathnames to the various utilities. @@ -984,6 +1003,7 @@ # Execute the script using TestRunner. # command = 'cd ' + tmpdir + ';/bin/sh ' + scriptfile + ' > ' + outputfile + ' 2>&1' + estatus=os.system (command) if ((os.WIFEXITED(estatus)) and (os.WEXITSTATUS(estatus) != 0)): result.Fail('Script: ' + scriptfile + '\n Output: ' + outputfile) Index: llvm/test/QMTest/llvmdb.py diff -u llvm/test/QMTest/llvmdb.py:1.1 llvm/test/QMTest/llvmdb.py:1.2 --- llvm/test/QMTest/llvmdb.py:1.1 Fri Oct 3 13:39:40 2003 +++ llvm/test/QMTest/llvmdb.py Fri Oct 3 14:21:02 2003 @@ -231,7 +231,10 @@ if (directory == ''): files = files + [path] else: - files = files + [directory + '.' + path] + (filebase, fileext) = os.path.splitext(path) + if (fileext == '.tr'): + (filebase, fileext) = os.path.splitext(filebase) + files = files + [directory + '.' + filebase] if (scan_subdirs == 1): for dirlabel in dirs: From lattner at cs.uiuc.edu Fri Oct 3 14:36:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri Oct 3 14:36:02 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Message-ID: <200310031935.OAA29855@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.54 -> 1.55 --- Log message: Minor random speedup: make Constant::getNullValue only call ConstantFOO::get once! --- Diffs of the changes: Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.54 llvm/lib/VMCore/Constants.cpp:1.55 --- llvm/lib/VMCore/Constants.cpp:1.54 Fri Oct 3 13:39:57 2003 +++ llvm/lib/VMCore/Constants.cpp Fri Oct 3 14:34:51 2003 @@ -59,25 +59,57 @@ // Static constructor to create a '0' constant of arbitrary type... Constant *Constant::getNullValue(const Type *Ty) { switch (Ty->getPrimitiveID()) { - case Type::BoolTyID: return ConstantBool::get(false); - case Type::SByteTyID: - case Type::ShortTyID: - case Type::IntTyID: - case Type::LongTyID: return ConstantSInt::get(Ty, 0); + case Type::BoolTyID: { + static Constant *NullBool = ConstantBool::get(false); + return NullBool; + } + case Type::SByteTyID: { + static Constant *NullSByte = ConstantSInt::get(Type::SByteTy, 0); + return NullSByte; + } + case Type::UByteTyID: { + static Constant *NullUByte = ConstantUInt::get(Type::UByteTy, 0); + return NullUByte; + } + case Type::ShortTyID: { + static Constant *NullShort = ConstantSInt::get(Type::ShortTy, 0); + return NullShort; + } + case Type::UShortTyID: { + static Constant *NullUShort = ConstantUInt::get(Type::UShortTy, 0); + return NullUShort; + } + case Type::IntTyID: { + static Constant *NullInt = ConstantSInt::get(Type::IntTy, 0); + return NullInt; + } + case Type::UIntTyID: { + static Constant *NullUInt = ConstantUInt::get(Type::UIntTy, 0); + return NullUInt; + } + case Type::LongTyID: { + static Constant *NullLong = ConstantSInt::get(Type::LongTy, 0); + return NullLong; + } + case Type::ULongTyID: { + static Constant *NullULong = ConstantUInt::get(Type::ULongTy, 0); + return NullULong; + } - case Type::UByteTyID: - case Type::UShortTyID: - case Type::UIntTyID: - case Type::ULongTyID: return ConstantUInt::get(Ty, 0); - - case Type::FloatTyID: - case Type::DoubleTyID: return ConstantFP::get(Ty, 0); + case Type::FloatTyID: { + static Constant *NullFloat = ConstantFP::get(Type::FloatTy, 0); + return NullFloat; + } + case Type::DoubleTyID: { + static Constant *NullDouble = ConstantFP::get(Type::DoubleTy, 0); + return NullDouble; + } case Type::PointerTyID: return ConstantPointerNull::get(cast(Ty)); + case Type::StructTyID: { const StructType *ST = cast(Ty); - const StructType::ElementTypes &ETs = ST->getElementTypes(); std::vector Elements; Elements.resize(ETs.size()); From criswell at cs.uiuc.edu Fri Oct 3 15:52:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Oct 3 15:52:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTest/llvmdb.py Message-ID: <200310032051.PAA19326@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTest: llvmdb.py updated: 1.2 -> 1.3 --- Log message: Removed old code. Refactored code to use the new GetDirsAndFiles() method. This method provides a central point for manipulating the test tree hierarchy and makes the code much cleaner. --- Diffs of the changes: Index: llvm/test/QMTest/llvmdb.py diff -u llvm/test/QMTest/llvmdb.py:1.2 llvm/test/QMTest/llvmdb.py:1.3 --- llvm/test/QMTest/llvmdb.py:1.2 Fri Oct 3 14:21:02 2003 +++ llvm/test/QMTest/llvmdb.py Fri Oct 3 15:51:17 2003 @@ -60,20 +60,6 @@ # def GetTest (self, test_id): # - # Split the test into its name and set of suffixes and - # convert the test ID into a pathname. - # - #(baselabel, suffix1) = self.SplitLabel (test_id) - #if (suffix1 == 'tr'): - #(baselabel, suffix2) = self.SplitLabel (baselabel) - #testpath=self.LabelToPath(baselabel) + '.' + suffix2 + '.' + suffix1 - #else: - #testpath=self.LabelToPath(baselabel) + '.' + suffix1 -# - #testpath = 'test/' + testpath - - - # # Try to figure out whether this test exists or not. # exts=['ll', 'llx', 'c', 'cpp', 'td', 'c.tr', 'cpp.tr'] @@ -109,6 +95,69 @@ return qm.test.database.TestDescriptor(self, test_id, testtype, testargs) # + # Method: GetDirsAndFiles + # + # Description: + # This method will take a given directory and find all of the test + # directories and tests inside of it. + # + # Inputs: + # dirpath - The pathname to the directory. + # + # Return value: + # (dirs, files) + # dirs = A list of directories inside this directory. + # files = A list of files within this directory. + # + def GetDirsAndFiles (self, dirpath): + # + # Get a list of the tests located in this directory. + # + tests=os.listdir (dirpath) + + # + # Record names of invalid directories and files. + # + invalid_dirs = ['CVS', 'QMTest', 'QMTestDB', 'Scripts', 'Programs', + 'Feature', 'Fragments'] + + invalid_files = ['Makefile', 'README.txt', '.cvsignore'] + + # + # Start with an empty list of files and directories. + # + dirs = [] + files = [] + + # + # Process each file inside the directory. + # + for path in tests: + # + # Determine the file's type. + # + fileinfo = os.stat (dirpath + '/' + path) + + # + # If the file is a directory, add it to the directory list, unless + # it is one of the ignored directories. + # + if (stat.S_ISDIR(fileinfo.st_mode)): + for x in invalid_dirs: + if (x == path): + break + else: + dirs = dirs + [path] + else: + for x in invalid_files: + if (x == path): + break + else: + files = files + [path] + + return (dirs, files) + + # # Method: GetSuite () # # Description: @@ -116,59 +165,59 @@ # def GetSuite (self, suite_id): # - # If the empty suite ID is given, default to whatever suite is in - # the current directory. - # - # Otherwise, convert the suite name into a pathname. + # Determine what we should prepend to every suite and test ID we + # return. # if (suite_id == ''): - suitepath=self.dbpath - suite_header = '' + suite_prefix = '' else: - suitepath=self.LabelToPath (suite_id) - suite_header = suite_id + '.' + suite_prefix = suite_id + '.' + # + # Convert the suite name into a pathname. + # suitepath = self.dbpath + '/' + self.LabelToPath (suite_id) # # Get a list of the tests located in this directory. # - tests=os.listdir (suitepath) - dirs = [] - files = [] - for path in tests: - fileinfo = os.stat (suitepath + '/' + path) - if (stat.S_ISDIR(fileinfo.st_mode)): - if ((path != 'CVS') and (path != 'QMTest') and (path != 'QMTestDB') and (path != 'newdb') and (path != 'Scripts') and (path != 'Programs') and (path != 'Feature') and (path != 'Fragments')): - dirs = dirs + [suite_header + path] - else: - if ((suite_id != '') and (path != 'Makefile') and (path != 'README.txt') and (path != '.cvsignore')): - (filebase, fileext) = os.path.splitext(path) - if (fileext == '.tr'): - (filebase, fileext) = os.path.splitext(filebase) - files = files + [suite_header + filebase] + (dirs, files) = self.GetDirsAndFiles (suitepath) + + # + # Convert the list of directories and files into labels. + # + dirlabels = [] + filelabels = [] + for path in dirs: + dirlabels = dirlabels + [suite_prefix + path] + + if (suite_id != ''): + for path in files: + (filebase, fileext) = os.path.splitext(path) + if (fileext == '.tr'): + (filebase, fileext) = os.path.splitext(filebase) + filelabels = filelabels + [suite_prefix + filebase] # # Load this suite # - suite = qm.test.suite.Suite (self, suite_id, 0, files, dirs) + suite = qm.test.suite.Suite (self, suite_id, 0, filelabels, dirlabels) return suite #raise qm.test.database.NoSuchSuiteError (suite_id) def GetAttachmentStore (self): return qm.attachment.FileAttachmentStore (self) - def GetSubdirectories (self, pathname): - pathname = self.dbpath + '/' + self.LabelToPath (pathname) - - tests=os.listdir (pathname) - dirs = [] - for path in tests: - fileinfo = os.stat (pathname + '/' + path) - if (stat.S_ISDIR(fileinfo.st_mode)): - if ((path != 'CVS') and (path != 'QMTest') and (path != 'QMTestDB') and (path != 'newdb') and (path != 'Scripts') and (path != 'Programs') and (path != 'Feature') and (path != 'Fragments')): - dirs = dirs + [path] + def GetSubdirectories (self, pathlabel): + # + # Convert the directory label into a full pathname. + # + pathname = self.dbpath + '/' + self.LabelToPath (pathlabel) + # + # Retrieve all of the directories within this directory. + # + (dirs, files) = self.GetDirsAndFiles (pathname) return dirs def GetResourceIds(self, directory="", scan_subdirs=1): @@ -176,7 +225,7 @@ def GetSuiteIds(self, directory="", scan_subdirs=1): # - # Adjust the directory name. + # Convert the directory label into a full pathname. # if (directory == ''): dirpath = self.dbpath @@ -186,26 +235,32 @@ # # Get a list of the tests located in this directory. # - tests=os.listdir (dirpath) - dirs = [directory] - files = [] - for path in tests: - fileinfo = os.stat (dirpath + '/' + path) - if (stat.S_ISDIR(fileinfo.st_mode)): - if ((path != 'CVS') and (path != 'QMTest') and (path != 'QMTestDB') and (path != 'newdb') and (path != 'Scripts') and (path != 'Programs') and (path != 'Feature') and (path != 'Fragments')): - if (directory == ''): - dirs = dirs + [path] - else: - dirs = dirs + [directory + '.' + path] + (dirs, files) = self.GetDirsAndFiles (dirpath) + + # + # Add the top suite to the list of suites in this directory, and then + # convert the rest of the directories into suite ID labels. + # + dirlabels = [directory] + + for path in dirs: + if (directory == ''): + dirlabels = dirlabels + [path] + else: + dirlabels = dirlabels + [directory + '.' + path] + # + # If we're asked to scan subdirectories, recurse on ourselves. + # if (scan_subdirs == 1): - for dirlabel in dirs: - dirs = dirs + self.GetTestIds (dirlabel, 1) - return dirs + for label in dirlabels: + dirlabels = dirlabels + self.GetTestIds (label, 1) + + return dirlabels def GetTestIds(self, directory="", scan_subdirs=1): # - # Adjust the directory name. + # Convert the directory label into a directory name. # if (directory == ''): dirpath = self.dbpath @@ -215,29 +270,36 @@ # # Get a list of the tests located in this directory. # - tests=os.listdir (dirpath) - dirs = [directory] - files = [] - for path in tests: - fileinfo = os.stat (dirpath + '/' + path) - if (stat.S_ISDIR(fileinfo.st_mode)): - if ((path != 'CVS') and (path != 'QMTest') and (path != 'QMTestDB') and (path != 'newdb') and (path != 'Scripts') and (path != 'Programs') and (path != 'Feature') and (path != 'Fragments')): - if (directory == ''): - dirs = dirs + [path] - else: - dirs = dirs + [directory + '.' + path] + (dirs, files) = self.GetDirsAndFiles (dirpath) + + # + # Convert all of the directories into labels. + # + for path in dirs: + if (directory == ''): + dirlabels = dirlabels + [path] + else: + dirlabels = dirlabels + [directory + '.' + path] + + + # + # Convert all of the file names into labels. + # + for path in files: + if (directory == ''): + filelabels = filelabels + [path] else: - if ((directory != '') and (path != 'Makefile')): - if (directory == ''): - files = files + [path] - else: - (filebase, fileext) = os.path.splitext(path) - if (fileext == '.tr'): - (filebase, fileext) = os.path.splitext(filebase) - files = files + [directory + '.' + filebase] + (filebase, fileext) = os.path.splitext(path) + if (fileext == '.tr'): + (filebase, fileext) = os.path.splitext(filebase) + filelabels = filelabels + [directory + '.' + filebase] + # + # Recurse through subdirectories using recursion if necessary. + # if (scan_subdirs == 1): - for dirlabel in dirs: - files = files + self.GetTestIds (dirlabel, 1) - return files + for label in dirlabels: + filelabels = filelabels + self.GetTestIds (label, 1) + + return filelabels From criswell at cs.uiuc.edu Fri Oct 3 16:04:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri Oct 3 16:04:01 2003 Subject: [llvm-commits] CVS: llvm/test/QMTest/llvmdb.py Message-ID: <200310032103.QAA22659@choi.cs.uiuc.edu> Changes in directory llvm/test/QMTest: llvmdb.py updated: 1.3 -> 1.4 --- Log message: Fixed some minor problems with method used by the QMTest GUI. Specifically, added initialization code and code to skip files found in the llvm/test directory. --- Diffs of the changes: Index: llvm/test/QMTest/llvmdb.py diff -u llvm/test/QMTest/llvmdb.py:1.3 llvm/test/QMTest/llvmdb.py:1.4 --- llvm/test/QMTest/llvmdb.py:1.3 Fri Oct 3 15:51:17 2003 +++ llvm/test/QMTest/llvmdb.py Fri Oct 3 16:03:05 2003 @@ -275,6 +275,7 @@ # # Convert all of the directories into labels. # + dirlabels = [] for path in dirs: if (directory == ''): dirlabels = dirlabels + [path] @@ -285,9 +286,10 @@ # # Convert all of the file names into labels. # + filelabels = [] for path in files: if (directory == ''): - filelabels = filelabels + [path] + continue else: (filebase, fileext) = os.path.splitext(path) if (fileext == '.tr'): From lattner at cs.uiuc.edu Sat Oct 4 13:29:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 13:29:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Assembler/2003-10-04-NotMergingGlobalConstants.ll Message-ID: <200310041828.NAA05922@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Assembler: 2003-10-04-NotMergingGlobalConstants.ll added (r1.1) --- Log message: Constants are not getting merged together correctly when types are resolved --- Diffs of the changes: Index: llvm/test/Regression/Assembler/2003-10-04-NotMergingGlobalConstants.ll diff -c /dev/null llvm/test/Regression/Assembler/2003-10-04-NotMergingGlobalConstants.ll:1.1 *** /dev/null Sat Oct 4 13:28:02 2003 --- llvm/test/Regression/Assembler/2003-10-04-NotMergingGlobalConstants.ll Sat Oct 4 13:27:51 2003 *************** *** 0 **** --- 1,6 ---- + + %T = type opaque + %X = global %T* null + %Y = global int* null + + %T = type int From lattner at cs.uiuc.edu Sat Oct 4 14:20:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 14:20:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Message-ID: <200310041919.OAA13280@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReaderWrappers.cpp updated: 1.9 -> 1.10 --- Log message: Do not leak the ModuleProvider if releaseModule() throws. --- Diffs of the changes: Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.9 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.10 --- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.9 Wed Sep 24 23:13:53 2003 +++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Sat Oct 4 14:19:37 2003 @@ -166,17 +166,14 @@ /// Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned Length, const std::string &ModuleID, std::string *ErrorStr){ - Module *M = 0; try { - AbstractModuleProvider *AMP = - getBytecodeBufferModuleProvider(Buffer, Length, ModuleID); - M = AMP->releaseModule(); - delete AMP; + std::auto_ptr + AMP(getBytecodeBufferModuleProvider(Buffer, Length, ModuleID)); + return AMP->releaseModule(); } catch (std::string &err) { if (ErrorStr) *ErrorStr = err; return 0; } - return M; } /// getBytecodeModuleProvider - lazy function-at-a-time loading from a file @@ -192,14 +189,12 @@ /// ParseBytecodeFile - Parse the given bytecode file /// Module *ParseBytecodeFile(const std::string &Filename, std::string *ErrorStr) { - Module *M = 0; try { - AbstractModuleProvider *AMP = getBytecodeModuleProvider(Filename); - M = AMP->releaseModule(); - delete AMP; + std::auto_ptr + AMP(getBytecodeModuleProvider(Filename)); + return AMP->releaseModule(); } catch (std::string &err) { if (ErrorStr) *ErrorStr = err; return 0; } - return M; } From lattner at cs.uiuc.edu Sat Oct 4 14:30:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 14:30:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200310041929.OAA13376@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.64 -> 1.65 --- Log message: Use V for values, not D. --- Diffs of the changes: Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.64 llvm/lib/Bytecode/Reader/Reader.cpp:1.65 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.64 Fri Sep 26 09:44:52 2003 +++ llvm/lib/Bytecode/Reader/Reader.cpp Sat Oct 4 14:29:21 2003 @@ -192,29 +192,28 @@ void BytecodeParser::postResolveValues(ValueTable &ValTab) { while (!ValTab.empty()) { - ValueList &DL = *ValTab.back(); + ValueList &VL = *ValTab.back(); ValTab.pop_back(); - while (!DL.empty()) { - Value *D = DL.back(); - unsigned IDNumber = getValueIDNumberFromPlaceHolder(D); - DL.pop_back(); + while (!VL.empty()) { + Value *V = VL.back(); + unsigned IDNumber = getValueIDNumberFromPlaceHolder(V); + VL.pop_back(); - Value *NewDef = getValue(D->getType(), IDNumber, false); - if (NewDef == 0) { + Value *NewVal = getValue(V->getType(), IDNumber, false); + if (NewVal == 0) throw std::string("Unresolvable reference found: <" + - D->getType()->getDescription() + ">:" + + V->getType()->getDescription() + ">:" + utostr(IDNumber) + "."); - } else { - // Fixup all of the uses of this placeholder def... - D->replaceAllUsesWith(NewDef); - // Now that all the uses are gone, delete the placeholder... - // If we couldn't find a def (error case), then leak a little - delete D; // memory, 'cause otherwise we can't remove all uses! - } + // Fixup all of the uses of this placeholder def... + V->replaceAllUsesWith(NewVal); + + // Now that all the uses are gone, delete the placeholder... + // If we couldn't find a def (error case), then leak a little + delete V; // memory, 'cause otherwise we can't remove all uses! } - delete &DL; + delete &VL; } } From lattner at cs.uiuc.edu Sat Oct 4 15:01:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 15:01:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ConstantReader.cpp Reader.cpp ReaderInternals.h Message-ID: <200310042000.PAA17108@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ConstantReader.cpp updated: 1.54 -> 1.55 Reader.cpp updated: 1.65 -> 1.66 ReaderInternals.h updated: 1.45 -> 1.46 --- Log message: Transform two methods to return pointers directly instead of returning them as 'by reference' arguments. --- Diffs of the changes: Index: llvm/lib/Bytecode/Reader/ConstantReader.cpp diff -u llvm/lib/Bytecode/Reader/ConstantReader.cpp:1.54 llvm/lib/Bytecode/Reader/ConstantReader.cpp:1.55 --- llvm/lib/Bytecode/Reader/ConstantReader.cpp:1.54 Thu Oct 2 15:26:18 2003 +++ llvm/lib/Bytecode/Reader/ConstantReader.cpp Sat Oct 4 15:00:03 2003 @@ -147,9 +147,9 @@ } -void BytecodeParser::parseConstantValue(const unsigned char *&Buf, - const unsigned char *EndBuf, - const Type *Ty, Constant *&V) { +Constant *BytecodeParser::parseConstantValue(const unsigned char *&Buf, + const unsigned char *EndBuf, + const Type *Ty) { // We must check for a ConstantExpr before switching by type because // a ConstantExpr can be of any type, and has no explicit value. @@ -183,14 +183,13 @@ // Construct a ConstantExpr of the appropriate kind if (isExprNumArgs == 1) { // All one-operand expressions assert(Opcode == Instruction::Cast); - V = ConstantExpr::getCast(ArgVec[0], Ty); + return ConstantExpr::getCast(ArgVec[0], Ty); } else if (Opcode == Instruction::GetElementPtr) { // GetElementPtr std::vector IdxList(ArgVec.begin()+1, ArgVec.end()); - V = ConstantExpr::getGetElementPtr(ArgVec[0], IdxList); + return ConstantExpr::getGetElementPtr(ArgVec[0], IdxList); } else { // All other 2-operand expressions - V = ConstantExpr::get(Opcode, ArgVec[0], ArgVec[1]); + return ConstantExpr::get(Opcode, ArgVec[0], ArgVec[1]); } - return; } // Ok, not an ConstantExpr. We now know how to read the given type... @@ -199,8 +198,7 @@ unsigned Val; if (read_vbr(Buf, EndBuf, Val)) throw Error_readvbr; if (Val != 0 && Val != 1) throw std::string("Invalid boolean value read."); - V = ConstantBool::get(Val == 1); - break; + return ConstantBool::get(Val == 1); } case Type::UByteTyID: // Unsigned integer types... @@ -210,15 +208,13 @@ if (read_vbr(Buf, EndBuf, Val)) throw Error_readvbr; if (!ConstantUInt::isValueValidForType(Ty, Val)) throw std::string("Invalid unsigned byte/short/int read."); - V = ConstantUInt::get(Ty, Val); - break; + return ConstantUInt::get(Ty, Val); } case Type::ULongTyID: { uint64_t Val; if (read_vbr(Buf, EndBuf, Val)) throw Error_readvbr; - V = ConstantUInt::get(Ty, Val); - break; + return ConstantUInt::get(Ty, Val); } case Type::SByteTyID: // Signed integer types... @@ -229,27 +225,23 @@ if (read_vbr(Buf, EndBuf, Val)) throw Error_readvbr; if (!ConstantSInt::isValueValidForType(Ty, Val)) throw std::string("Invalid signed byte/short/int/long read."); - V = ConstantSInt::get(Ty, Val); - break; + return ConstantSInt::get(Ty, Val); } case Type::FloatTyID: { float F; if (input_data(Buf, EndBuf, &F, &F+1)) throw Error_inputdata; - V = ConstantFP::get(Ty, F); - break; + return ConstantFP::get(Ty, F); } case Type::DoubleTyID: { double Val; if (input_data(Buf, EndBuf, &Val, &Val+1)) throw Error_inputdata; - V = ConstantFP::get(Ty, Val); - break; + return ConstantFP::get(Ty, Val); } case Type::TypeTyID: - assert(0 && "Type constants should be handled separately!!!"); - abort(); + throw std::string("Type constants shouldn't live in constant table!"); case Type::ArrayTyID: { const ArrayType *AT = cast(Ty); @@ -263,8 +255,7 @@ if (!C) throw std::string("Unable to get const value of array slot."); Elements.push_back(C); } - V = ConstantArray::get(AT, Elements); - break; + return ConstantArray::get(AT, Elements); } case Type::StructTyID: { @@ -280,8 +271,7 @@ Elements.push_back(C); } - V = ConstantStruct::get(ST, Elements); - break; + return ConstantStruct::get(ST, Elements); } case Type::PointerTyID: { @@ -294,8 +284,7 @@ switch (SubClass) { case 0: // ConstantPointerNull value... - V = ConstantPointerNull::get(PT); - break; + return ConstantPointerNull::get(PT); case 1: { // ConstantPointerRef value... unsigned Slot; @@ -336,23 +325,18 @@ } } - V = ConstantPointerRef::get(GV); - break; + return ConstantPointerRef::get(GV); } default: BCR_TRACE(5, "UNKNOWN Pointer Constant Type!\n"); throw std::string("Unknown pointer constant type."); } - break; } default: - std::cerr << __FILE__ << ":" << __LINE__ - << ": Don't know how to deserialize constant value of type '" - << Ty->getName() << "'\n"; throw std::string("Don't know how to deserialize constant value of type '"+ - Ty->getName()); + Ty->getDescription()); } } @@ -379,11 +363,10 @@ parseTypeConstants(Buf, EndBuf, TypeTab, NumEntries); } else { for (unsigned i = 0; i < NumEntries; ++i) { - Constant *C; - int Slot; - parseConstantValue(Buf, EndBuf, Ty, C); + Constant *C = parseConstantValue(Buf, EndBuf, Ty); assert(C && "parseConstantValue returned NULL!"); BCR_TRACE(4, "Read Constant: '" << *C << "'\n"); + int Slot; if ((Slot = insertValue(C, Tab)) == -1) throw std::string("Could not insert value into ValueTable."); Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.65 llvm/lib/Bytecode/Reader/Reader.cpp:1.66 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.65 Sat Oct 4 14:29:21 2003 +++ llvm/lib/Bytecode/Reader/Reader.cpp Sat Oct 4 15:00:03 2003 @@ -31,25 +31,21 @@ throw std::string("Alignment error in buffer: read past end of block."); } -void -BytecodeParser::getTypeSlot(const Type *Ty, unsigned &Slot) { - if (Ty->isPrimitiveType()) { - Slot = Ty->getPrimitiveID(); - } else { - // Check the function level types first... - TypeValuesListTy::iterator I = find(FunctionTypeValues.begin(), - FunctionTypeValues.end(), Ty); - if (I != FunctionTypeValues.end()) { - Slot = FirstDerivedTyID + ModuleTypeValues.size() + - (&*I - &FunctionTypeValues[0]); - } else { - I = find(ModuleTypeValues.begin(), ModuleTypeValues.end(), Ty); - if (I == ModuleTypeValues.end()) - throw std::string("Didn't find type in ModuleTypeValues."); - Slot = FirstDerivedTyID + (&*I - &ModuleTypeValues[0]); - } - } - //cerr << "getTypeSlot '" << Ty->getName() << "' = " << Slot << "\n"; +unsigned BytecodeParser::getTypeSlot(const Type *Ty) { + if (Ty->isPrimitiveType()) + return Ty->getPrimitiveID(); + + // Check the function level types first... + TypeValuesListTy::iterator I = find(FunctionTypeValues.begin(), + FunctionTypeValues.end(), Ty); + if (I != FunctionTypeValues.end()) + return FirstDerivedTyID + ModuleTypeValues.size() + + (&*I - &FunctionTypeValues[0]); + + I = find(ModuleTypeValues.begin(), ModuleTypeValues.end(), Ty); + if (I == ModuleTypeValues.end()) + throw std::string("Didn't find type in ModuleTypeValues."); + return FirstDerivedTyID + (&*I - &ModuleTypeValues[0]); } const Type *BytecodeParser::getType(unsigned ID) { @@ -68,8 +64,7 @@ Val->getType()->isPrimitiveType() || !cast(Val)->isNullValue()) && "Cannot read null values from bytecode!"); - unsigned type; - getTypeSlot(Val->getType(), type); + unsigned type = getTypeSlot(Val->getType()); assert(type != Type::TypeTyID && "Types should never be insertValue'd!"); if (ValueTab.size() <= type) { @@ -93,19 +88,16 @@ void BytecodeParser::setValueTo(ValueTable &ValueTab, unsigned Slot, Value *Val) { assert(&ValueTab == &ModuleValues && "Can only setValueTo on Module values!"); - unsigned type; - getTypeSlot(Val->getType(), type); - assert((!HasImplicitZeroInitializer || Slot != 0) && "Cannot change zero init"); + unsigned type = getTypeSlot(Val->getType()); assert(type < ValueTab.size() && Slot <= ValueTab[type]->size()); ValueTab[type]->setOperand(Slot-HasImplicitZeroInitializer, Val); } Value *BytecodeParser::getValue(const Type *Ty, unsigned oNum, bool Create) { unsigned Num = oNum; - unsigned type; // The type plane it lives in... - getTypeSlot(Ty, type); + unsigned type = getTypeSlot(Ty); // The type plane it lives in... if (type == Type::TypeTyID) { // The 'type' plane has implicit values assert(Create == false); Index: llvm/lib/Bytecode/Reader/ReaderInternals.h diff -u llvm/lib/Bytecode/Reader/ReaderInternals.h:1.45 llvm/lib/Bytecode/Reader/ReaderInternals.h:1.46 --- llvm/lib/Bytecode/Reader/ReaderInternals.h:1.45 Thu Oct 2 15:26:18 2003 +++ llvm/lib/Bytecode/Reader/ReaderInternals.h Sat Oct 4 15:00:03 2003 @@ -169,8 +169,9 @@ void ParseConstantPool(const unsigned char *&Buf, const unsigned char *EndBuf, ValueTable &Tab, TypeValuesListTy &TypeTab); - void parseConstantValue(const unsigned char *&Buf, const unsigned char *End, - const Type *Ty, Constant *&V); + Constant *parseConstantValue(const unsigned char *&Buf, + const unsigned char *End, + const Type *Ty); void parseTypeConstants(const unsigned char *&Buf, const unsigned char *EndBuf, TypeValuesListTy &Tab, unsigned NumEntries); @@ -185,7 +186,7 @@ void setValueTo(ValueTable &D, unsigned Slot, Value *V); void postResolveValues(ValueTable &ValTab); - void getTypeSlot(const Type *Ty, unsigned &Slot); + unsigned getTypeSlot(const Type *Ty); // resolve all references to the placeholder (if any) for the given value void ResolveReferencesToValue(Value *Val, unsigned Slot); From lattner at cs.uiuc.edu Sat Oct 4 15:15:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 15:15:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/ModuleProvider.h Message-ID: <200310042014.PAA20330@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: ModuleProvider.h updated: 1.3 -> 1.4 --- Log message: Rename AbstractModuleProvider -> ModuleProvider, to match the header file name, and because, while the class used by the interface is abstract, the actual concept is not. --- Diffs of the changes: Index: llvm/include/llvm/ModuleProvider.h diff -u llvm/include/llvm/ModuleProvider.h:1.3 llvm/include/llvm/ModuleProvider.h:1.4 --- llvm/include/llvm/ModuleProvider.h:1.3 Tue Sep 30 12:53:30 2003 +++ llvm/include/llvm/ModuleProvider.h Sat Oct 4 15:14:22 2003 @@ -14,13 +14,13 @@ class Function; class Module; -class AbstractModuleProvider { +class ModuleProvider { protected: Module *TheModule; - AbstractModuleProvider(); + ModuleProvider(); public: - virtual ~AbstractModuleProvider(); + virtual ~ModuleProvider(); /// getModule - returns the module this provider is encapsulating. /// From lattner at cs.uiuc.edu Sat Oct 4 15:15:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 15:15:10 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/Reader.h Message-ID: <200310042014.PAA20337@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bytecode: Reader.h updated: 1.13 -> 1.14 --- Log message: Rename AbstractModuleProvider -> ModuleProvider, to match the header file name, and because, while the class used by the interface is abstract, the actual concept is not. --- Diffs of the changes: Index: llvm/include/llvm/Bytecode/Reader.h diff -u llvm/include/llvm/Bytecode/Reader.h:1.13 llvm/include/llvm/Bytecode/Reader.h:1.14 --- llvm/include/llvm/Bytecode/Reader.h:1.13 Tue Sep 30 13:37:43 2003 +++ llvm/include/llvm/Bytecode/Reader.h Sat Oct 4 15:14:26 2003 @@ -18,16 +18,14 @@ /// getBytecodeModuleProvider - lazy function-at-a-time loading from a file /// -AbstractModuleProvider* -getBytecodeModuleProvider(const std::string &Filename); +ModuleProvider *getBytecodeModuleProvider(const std::string &Filename); /// getBytecodeBufferModuleProvider - lazy function-at-a-time loading from a /// buffer /// -AbstractModuleProvider* -getBytecodeBufferModuleProvider(const unsigned char *Buffer, - unsigned BufferSize, - const std::string &ModuleID = ""); +ModuleProvider *getBytecodeBufferModuleProvider(const unsigned char *Buffer, + unsigned BufferSize, + const std::string &ModuleID=""); /// ParseBytecodeFile - Parse the given bytecode file /// From lattner at cs.uiuc.edu Sat Oct 4 15:15:18 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 15:15:18 2003 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderInternals.h ReaderWrappers.cpp Message-ID: <200310042014.PAA20350@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReaderInternals.h updated: 1.46 -> 1.47 ReaderWrappers.cpp updated: 1.10 -> 1.11 --- Log message: Rename AbstractModuleProvider -> ModuleProvider, to match the header file name, and because, while the class used by the interface is abstract, the actual concept is not. --- Diffs of the changes: Index: llvm/lib/Bytecode/Reader/ReaderInternals.h diff -u llvm/lib/Bytecode/Reader/ReaderInternals.h:1.46 llvm/lib/Bytecode/Reader/ReaderInternals.h:1.47 --- llvm/lib/Bytecode/Reader/ReaderInternals.h:1.46 Sat Oct 4 15:00:03 2003 +++ llvm/lib/Bytecode/Reader/ReaderInternals.h Sat Oct 4 15:14:40 2003 @@ -43,7 +43,7 @@ unsigned FunctionSlot; }; -class BytecodeParser : public AbstractModuleProvider { +class BytecodeParser : public ModuleProvider { BytecodeParser(const BytecodeParser &); // DO NOT IMPLEMENT void operator=(const BytecodeParser &); // DO NOT IMPLEMENT public: Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.10 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.11 --- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.10 Sat Oct 4 14:19:37 2003 +++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Sat Oct 4 15:14:40 2003 @@ -156,7 +156,7 @@ /// getBytecodeBufferModuleProvider - lazy function-at-a-time loading from a /// buffer -AbstractModuleProvider* +ModuleProvider* getBytecodeBufferModuleProvider(const unsigned char *Buffer, unsigned Length, const std::string &ModuleID) { return new BytecodeBufferReader(Buffer, Length, ModuleID); @@ -167,7 +167,7 @@ Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned Length, const std::string &ModuleID, std::string *ErrorStr){ try { - std::auto_ptr + std::auto_ptr AMP(getBytecodeBufferModuleProvider(Buffer, Length, ModuleID)); return AMP->releaseModule(); } catch (std::string &err) { @@ -178,8 +178,7 @@ /// getBytecodeModuleProvider - lazy function-at-a-time loading from a file /// -AbstractModuleProvider* -getBytecodeModuleProvider(const std::string &Filename) { +ModuleProvider *getBytecodeModuleProvider(const std::string &Filename) { if (Filename != std::string("-")) // Read from a file... return new BytecodeFileReader(Filename); else // Read from stdin @@ -190,8 +189,7 @@ /// Module *ParseBytecodeFile(const std::string &Filename, std::string *ErrorStr) { try { - std::auto_ptr - AMP(getBytecodeModuleProvider(Filename)); + std::auto_ptr AMP(getBytecodeModuleProvider(Filename)); return AMP->releaseModule(); } catch (std::string &err) { if (ErrorStr) *ErrorStr = err; From lattner at cs.uiuc.edu Sat Oct 4 15:16:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 15:16:01 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ModuleProvider.cpp Message-ID: <200310042015.PAA20378@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ModuleProvider.cpp updated: 1.2 -> 1.3 --- Log message: Rename AbstractModuleProvider -> ModuleProvider, to match the header file name, and because, while the class used by the interface is abstract, the actual concept is not. --- Diffs of the changes: Index: llvm/lib/VMCore/ModuleProvider.cpp diff -u llvm/lib/VMCore/ModuleProvider.cpp:1.2 llvm/lib/VMCore/ModuleProvider.cpp:1.3 --- llvm/lib/VMCore/ModuleProvider.cpp:1.2 Mon Sep 22 18:44:13 2003 +++ llvm/lib/VMCore/ModuleProvider.cpp Sat Oct 4 15:14:59 2003 @@ -9,17 +9,17 @@ /// ctor - always have a valid Module /// -AbstractModuleProvider::AbstractModuleProvider() : TheModule(0) { } +ModuleProvider::ModuleProvider() : TheModule(0) { } /// dtor - when we leave, we take our Module with us /// -AbstractModuleProvider::~AbstractModuleProvider() { +ModuleProvider::~ModuleProvider() { delete TheModule; } /// materializeFunction - make sure the given function is fully read. /// -void AbstractModuleProvider::materializeModule() { +void ModuleProvider::materializeModule() { if (!TheModule) return; for (Module::iterator i = TheModule->begin(), e = TheModule->end(); From lattner at cs.uiuc.edu Sat Oct 4 19:10:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 19:10:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk/ Message-ID: <200310050009.TAA20596@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk: --- Log message: Directory /home/vadve/vadve/Research/DynOpt/CVSRepository/llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk added to the repository --- Diffs of the changes: From lattner at cs.uiuc.edu Sat Oct 4 19:10:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 19:10:10 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk/Makefile Message-ID: <200310050009.TAA20679@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk: Makefile added (r1.1) --- Log message: initial checkin of makefile --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk/Makefile diff -c /dev/null llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk/Makefile:1.1 *** /dev/null Sat Oct 4 19:09:43 2003 --- llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk/Makefile Sat Oct 4 19:09:33 2003 *************** *** 0 **** --- 1,5 ---- + LEVEL = ../../../../../.. + #RUN_OPTIONS = `cat $(REF_IN_DIR)control` + #STDOUT_FILENAME := input.compressed.out + CPPFLAGS = -DSPEC_CPU2000_LINUX -Dbool=char -DI_TIME -DI_SYS_TIME + include ../../Makefile.spec From lattner at cs.uiuc.edu Sat Oct 4 19:14:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 19:14:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Constants.h Message-ID: <200310050013.TAA21051@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.31 -> 1.32 --- Log message: Add some new methods to forward to --- Diffs of the changes: Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.31 llvm/include/llvm/Constants.h:1.32 --- llvm/include/llvm/Constants.h:1.31 Fri Oct 3 13:39:40 2003 +++ llvm/include/llvm/Constants.h Sat Oct 4 19:13:28 2003 @@ -17,6 +17,9 @@ template struct ConstantCreator; +template +struct ConvertConstantType; + //===--------------------------------------------------------------------------- /// ConstantIntegral - Shared superclass of boolean and integer constants. @@ -482,6 +485,7 @@ unsigned iType; // Operation type (an Instruction opcode) friend struct ConstantCreator > >; + friend struct ConvertConstantType; protected: // Cast creation ctor @@ -491,6 +495,15 @@ // GEP instruction creation ctor ConstantExpr(Constant *C, const std::vector &IdxList, const Type *DestTy); + + // These private methods are used by the type resolution code to create + // ConstantExprs in intermediate forms. + static Constant *getTy(const Type *Ty, unsigned Opcode, + Constant *C1, Constant *C2); + static Constant *getShiftTy(const Type *Ty, + unsigned Opcode, Constant *C1, Constant *C2); + static Constant *getGetElementPtrTy(const Type *Ty, Constant *C, + const std::vector &IdxList); public: // Static methods to construct a ConstantExpr of different kinds. Note that @@ -499,15 +512,23 @@ // expression into something simpler if possible. /// Cast constant expr + /// static Constant *getCast(Constant *C, const Type *Ty); /// Binary constant expr - Use with binary operators... - static Constant *get(unsigned Opcode, Constant *C1, Constant *C2); + /// + static Constant *get(unsigned Opcode, Constant *C1, Constant *C2) { + return getTy(C1->getType(), Opcode, C1, C2); + } /// getShift - Return a shift left or shift right constant expr - static Constant *getShift(unsigned Opcode, Constant *C1, Constant *C2); + /// + static Constant *getShift(unsigned Opcode, Constant *C1, Constant *C2) { + return getShiftTy(C1->getType(), Opcode, C1, C2); + } /// Getelementptr form... + /// static Constant *getGetElementPtr(Constant *C, const std::vector &IdxList); From lattner at cs.uiuc.edu Sat Oct 4 19:18:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 19:18:01 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Message-ID: <200310050017.TAA21141@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.55 -> 1.56 --- Log message: Type tables are now AbstractTypeUsers. This allows them to merge together constants as necessary due to type resolution. With this change, the following spec benchmarks now link: 176.gcc, 177.mesa, 252.eon, 253.perlbmk, & 300.twolf. IOW, all SPEC INT and FP benchmarks now link. --- Diffs of the changes: Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.55 llvm/lib/VMCore/Constants.cpp:1.56 --- llvm/lib/VMCore/Constants.cpp:1.55 Fri Oct 3 14:34:51 2003 +++ llvm/lib/VMCore/Constants.cpp Sat Oct 4 19:17:43 2003 @@ -524,19 +524,30 @@ } }; +template +struct ConvertConstantType { + static void convert(ConstantClass *OldC, const TypeClass *NewTy) { + assert(0 && "This type cannot be converted!\n"); + abort(); + } +}; + namespace { template - class ValueMap { - protected: - typedef std::pair ConstHashKey; - std::map Map; + class ValueMap : public AbstractTypeUser { + typedef std::pair MapKey; + typedef std::map MapTy; + typedef typename MapTy::iterator MapIterator; + MapTy Map; + + typedef std::map AbstractTypeMapTy; + AbstractTypeMapTy AbstractTypeMap; public: // getOrCreate - Return the specified constant from the map, creating it if // necessary. ConstantClass *getOrCreate(const TypeClass *Ty, const ValType &V) { - ConstHashKey Lookup(Ty, V); - typename std::map::iterator I = - Map.lower_bound(Lookup); + MapKey Lookup(Ty, V); + MapIterator I = Map.lower_bound(Lookup); if (I != Map.end() && I->first == Lookup) return I->second; // Is it in the map? @@ -544,20 +555,105 @@ ConstantClass *Result = ConstantCreator::create(Ty, V); - Map.insert(I, std::make_pair(ConstHashKey(Ty, V), Result)); + + /// FIXME: why does this assert fail when loading 176.gcc? + //assert(Result->getType() == Ty && "Type specified is not correct!"); + I = Map.insert(I, std::make_pair(MapKey(Ty, V), Result)); + + // If the type of the constant is abstract, make sure that an entry exists + // for it in the AbstractTypeMap. + if (Ty->isAbstract()) { + typename AbstractTypeMapTy::iterator TI = + AbstractTypeMap.lower_bound(Ty); + + if (TI == AbstractTypeMap.end() || TI->first != Ty) { + // Add ourselves to the ATU list of the type. + cast(Ty)->addAbstractTypeUser(this); + + AbstractTypeMap.insert(TI, std::make_pair(Ty, I)); + } + } return Result; } void remove(ConstantClass *CP) { - // FIXME: This could be sped up a LOT. If this gets to be a performance - // problem, someone should look at this. - for (typename std::map::iterator - I = Map.begin(), E = Map.end(); I != E; ++I) - if (I->second == CP) { - Map.erase(I); - return; + // FIXME: This should not use a linear scan. If this gets to be a + // performance problem, someone should look at this. + MapIterator I = Map.begin(); + for (MapIterator E = Map.end(); I != E && I->second != CP; ++I) + /* empty */; + + assert(I != Map.end() && "Constant not found in constant table!"); + + // Now that we found the entry, make sure this isn't the entry that + // the AbstractTypeMap points to. + const TypeClass *Ty = I->first.first; + if (Ty->isAbstract()) { + assert(AbstractTypeMap.count(Ty) && + "Abstract type not in AbstractTypeMap?"); + MapIterator &ATMEntryIt = AbstractTypeMap[Ty]; + if (ATMEntryIt == I) { + // Yes, we are removing the representative entry for this type. + // See if there are any other entries of the same type. + MapIterator TmpIt = ATMEntryIt; + + // First check the entry before this one... + if (TmpIt != Map.begin()) { + --TmpIt; + if (TmpIt->first.first != Ty) // Not the same type, move back... + ++TmpIt; + } + + // If we didn't find the same type, try to move forward... + if (TmpIt == ATMEntryIt) { + ++TmpIt; + if (TmpIt == Map.end() || TmpIt->first.first != Ty) + --TmpIt; // No entry afterwards with the same type + } + + // If there is another entry in the map of the same abstract type, + // update the AbstractTypeMap entry now. + if (TmpIt != ATMEntryIt) { + ATMEntryIt = TmpIt; + } else { + // Otherwise, we are removing the last instance of this type + // from the table. Remove from the ATM, and from user list. + cast(Ty)->removeAbstractTypeUser(this); + AbstractTypeMap.erase(Ty); + } } - assert(0 && "Constant not found in constant table!"); + } + + Map.erase(I); + } + + void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { + typename AbstractTypeMapTy::iterator I = + AbstractTypeMap.find(cast(OldTy)); + + assert(I != AbstractTypeMap.end() && + "Abstract type not in AbstractTypeMap?"); + + // Convert a constant at a time until the last one is gone. The last one + // leaving will remove() itself, causing the AbstractTypeMapEntry to be + // eliminated eventually. + do { + ConvertConstantType::convert(I->second->second, + cast(NewTy)); + + I = AbstractTypeMap.find(cast(OldTy)); + } while (I != AbstractTypeMap.end()); + } + + // If the type became concrete without being refined to any other existing + // type, we just remove ourselves from the ATU list. + void typeBecameConcrete(const DerivedType *AbsTy) { + AbsTy->removeAbstractTypeUser(this); + } + + void dump() const { + std::cerr << "Constant.cpp: ValueMap\n"; } }; } @@ -593,6 +689,22 @@ //---- ConstantArray::get() implementation... // + +template<> +struct ConvertConstantType { + static void convert(ConstantArray *OldC, const ArrayType *NewTy) { + // Make everyone now use a constant of the new type... + std::vector C; + for (unsigned i = 0, e = OldC->getNumOperands(); i != e; ++i) + C.push_back(cast(OldC->getOperand(i))); + Constant *New = ConstantArray::get(NewTy, C); + assert(New != OldC && "Didn't replace constant??"); + OldC->uncheckedReplaceAllUsesWith(New); + OldC->destroyConstant(); // This constant is now dead, destroy it. + } +}; + + static ValueMap, ArrayType, ConstantArray> ArrayConstants; @@ -608,26 +720,6 @@ destroyConstantImpl(); } -#if 0 -/// refineAbstractType - If this callback is invoked, then this constant is of a -/// derived type, change all users to use a concrete constant of the new type. -/// -void ConstantArray::refineAbstractType(const DerivedType *OldTy, - const Type *NewTy) { - if (OldTy == NewTy) return; - - // Make everyone now use a constant of the new type... - std::vector C; - for (unsigned i = 0, e = getNumOperands(); i != e; ++i) - C.push_back(cast(getOperand(i))); - Constant *New = ConstantArray::get(cast(NewTy), C); - if (New != this) { - uncheckedReplaceAllUsesWith(New); - destroyConstant(); // This constant is now dead, destroy it. - } -} -#endif - // ConstantArray::get(const string&) - Return an array that is initialized to // contain the specified string. A null terminator is added to the specified // string so that it may be used in a natural way... @@ -662,6 +754,22 @@ //---- ConstantStruct::get() implementation... // + +template<> +struct ConvertConstantType { + static void convert(ConstantStruct *OldC, const StructType *NewTy) { + // Make everyone now use a constant of the new type... + std::vector C; + for (unsigned i = 0, e = OldC->getNumOperands(); i != e; ++i) + C.push_back(cast(OldC->getOperand(i))); + Constant *New = ConstantStruct::get(NewTy, C); + assert(New != OldC && "Didn't replace constant??"); + + OldC->uncheckedReplaceAllUsesWith(New); + OldC->destroyConstant(); // This constant is now dead, destroy it. + } +}; + static ValueMap, StructType, ConstantStruct> StructConstants; @@ -677,26 +785,6 @@ destroyConstantImpl(); } -#if 0 -/// refineAbstractType - If this callback is invoked, then this constant is of a -/// derived type, change all users to use a concrete constant of the new type. -/// -void ConstantStruct::refineAbstractType(const DerivedType *OldTy, - const Type *NewTy) { - if (OldTy == NewTy) return; - - // Make everyone now use a constant of the new type... - std::vector C; - for (unsigned i = 0, e = getNumOperands(); i != e; ++i) - C.push_back(cast(getOperand(i))); - Constant *New = ConstantStruct::get(cast(NewTy), C); - if (New != this) { - uncheckedReplaceAllUsesWith(New); - destroyConstant(); // This constant is now dead, destroy it. - } -} -#endif - //---- ConstantPointerNull::get() implementation... // @@ -708,6 +796,17 @@ } }; +template<> +struct ConvertConstantType { + static void convert(ConstantPointerNull *OldC, const PointerType *NewTy) { + // Make everyone now use a constant of the new type... + Constant *New = ConstantPointerNull::get(NewTy); + assert(New != OldC && "Didn't replace constant??"); + OldC->uncheckedReplaceAllUsesWith(New); + OldC->destroyConstant(); // This constant is now dead, destroy it. + } +}; + static ValueMap NullPtrConstants; ConstantPointerNull *ConstantPointerNull::get(const PointerType *Ty) { @@ -721,26 +820,6 @@ destroyConstantImpl(); } -#if 0 -/// refineAbstractType - If this callback is invoked, then this constant is of a -/// derived type, change all users to use a concrete constant of the new type. -/// -void ConstantPointerNull::refineAbstractType(const DerivedType *OldTy, - const Type *NewTy) { - if (OldTy == NewTy) return; - - // Make everyone now use a constant of the new type... - Constant *New = ConstantPointerNull::get(cast(NewTy)); - if (New != this) { - uncheckedReplaceAllUsesWith(New); - - // This constant is now dead, destroy it. - destroyConstant(); - } -} -#endif - - //---- ConstantPointerRef::get() implementation... // @@ -775,17 +854,46 @@ assert(V.first == Instruction::GetElementPtr && "Invalid ConstantExpr!"); - // Check that the indices list is valid... - std::vector ValIdxList(V.second.begin()+1, V.second.end()); - const Type *DestTy = GetElementPtrInst::getIndexedType(Ty, ValIdxList, - true); - assert(DestTy && "Invalid index list for GetElementPtr expression"); - std::vector IdxList(V.second.begin()+1, V.second.end()); - return new ConstantExpr(V.second[0], IdxList, PointerType::get(DestTy)); + return new ConstantExpr(V.second[0], IdxList, Ty); } }; +template<> +struct ConvertConstantType { + static void convert(ConstantExpr *OldC, const Type *NewTy) { + Constant *New; + switch (OldC->getOpcode()) { + case Instruction::Cast: + New = ConstantExpr::getCast(OldC->getOperand(0), NewTy); + break; + case Instruction::Shl: + case Instruction::Shr: + New = ConstantExpr::getShiftTy(NewTy, OldC->getOpcode(), + OldC->getOperand(0), OldC->getOperand(1)); + break; + default: + assert(OldC->getOpcode() >= Instruction::BinaryOpsBegin && + OldC->getOpcode() < Instruction::BinaryOpsEnd); + New = ConstantExpr::getTy(NewTy, OldC->getOpcode(), OldC->getOperand(0), + OldC->getOperand(1)); + break; + case Instruction::GetElementPtr: + // Make everyone now use a constant of the new type... + std::vector C; + for (unsigned i = 1, e = OldC->getNumOperands(); i != e; ++i) + C.push_back(cast(OldC->getOperand(i))); + New = ConstantExpr::getGetElementPtrTy(NewTy, OldC->getOperand(0), C); + break; + } + + assert(New != OldC && "Didn't replace constant??"); + OldC->uncheckedReplaceAllUsesWith(New); + OldC->destroyConstant(); // This constant is now dead, destroy it. + } +}; + + static ValueMap ExprConstants; Constant *ConstantExpr::getCast(Constant *C, const Type *Ty) { @@ -798,24 +906,27 @@ return ExprConstants.getOrCreate(Ty, Key); } -Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2) { +Constant *ConstantExpr::getTy(const Type *ReqTy, unsigned Opcode, + Constant *C1, Constant *C2) { // Check the operands for consistency first assert((Opcode >= Instruction::BinaryOpsBegin && Opcode < Instruction::BinaryOpsEnd) && "Invalid opcode in binary constant expression"); assert(C1->getType() == C2->getType() && "Operand types in binary constant expression should match"); - - if (Constant *FC = ConstantFoldBinaryInstruction(Opcode, C1, C2)) - return FC; // Fold a few common cases... + + if (ReqTy == C1->getType()) + if (Constant *FC = ConstantFoldBinaryInstruction(Opcode, C1, C2)) + return FC; // Fold a few common cases... std::vector argVec(1, C1); argVec.push_back(C2); ExprMapKeyType Key = std::make_pair(Opcode, argVec); - return ExprConstants.getOrCreate(C1->getType(), Key); + return ExprConstants.getOrCreate(ReqTy, Key); } /// getShift - Return a shift left or shift right constant expr -Constant *ConstantExpr::getShift(unsigned Opcode, Constant *C1, Constant *C2) { +Constant *ConstantExpr::getShiftTy(const Type *ReqTy, unsigned Opcode, + Constant *C1, Constant *C2) { // Check the operands for consistency first assert((Opcode == Instruction::Shl || Opcode == Instruction::Shr) && @@ -829,71 +940,42 @@ // Look up the constant in the table first to ensure uniqueness std::vector argVec(1, C1); argVec.push_back(C2); ExprMapKeyType Key = std::make_pair(Opcode, argVec); - return ExprConstants.getOrCreate(C1->getType(), Key); + return ExprConstants.getOrCreate(ReqTy, Key); } -Constant *ConstantExpr::getGetElementPtr(Constant *C, - const std::vector &IdxList){ +Constant *ConstantExpr::getGetElementPtrTy(const Type *ReqTy, Constant *C, + const std::vector &IdxList) { if (Constant *FC = ConstantFoldGetElementPtr(C, IdxList)) return FC; // Fold a few common cases... - const Type *Ty = C->getType(); - assert(isa(Ty) && + assert(isa(C->getType()) && "Non-pointer type for constant GetElementPtr expression"); // Look up the constant in the table first to ensure uniqueness std::vector argVec(1, C); argVec.insert(argVec.end(), IdxList.begin(), IdxList.end()); - const ExprMapKeyType &Key = std::make_pair(Instruction::GetElementPtr,argVec); - return ExprConstants.getOrCreate(Ty, Key); + return ExprConstants.getOrCreate(ReqTy, Key); +} + +Constant *ConstantExpr::getGetElementPtr(Constant *C, + const std::vector &IdxList){ + // Get the result type of the getelementptr! + std::vector VIdxList(IdxList.begin(), IdxList.end()); + + const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), VIdxList, + true); + assert(Ty && "GEP indices invalid!"); + return getGetElementPtrTy(PointerType::get(Ty), C, IdxList); } + // destroyConstant - Remove the constant from the constant table... // void ConstantExpr::destroyConstant() { ExprConstants.remove(this); destroyConstantImpl(); } - -#if 0 -/// refineAbstractType - If this callback is invoked, then this constant is of a -/// derived type, change all users to use a concrete constant of the new type. -/// -void ConstantExpr::refineAbstractType(const DerivedType *OldTy, - const Type *NewTy) { - if (OldTy == NewTy) return; - - // FIXME: These need to use a lower-level implementation method, because the - // ::get methods intuit the type of the result based on the types of the - // operands. The operand types may not have had their types resolved yet. - // - Constant *New; - if (getOpcode() == Instruction::Cast) { - New = getCast(getOperand(0), NewTy); - } else if (getOpcode() >= Instruction::BinaryOpsBegin && - getOpcode() < Instruction::BinaryOpsEnd) { - New = get(getOpcode(), getOperand(0), getOperand(0)); - } else if (getOpcode() == Instruction::Shl || getOpcode() ==Instruction::Shr){ - New = getShift(getOpcode(), getOperand(0), getOperand(0)); - } else { - assert(getOpcode() == Instruction::GetElementPtr); - - // Make everyone now use a constant of the new type... - std::vector C; - for (unsigned i = 1, e = getNumOperands(); i != e; ++i) - C.push_back(cast(getOperand(i))); - New = ConstantExpr::getGetElementPtr(getOperand(0), C); - } - if (New != this) { - uncheckedReplaceAllUsesWith(New); - destroyConstant(); // This constant is now dead, destroy it. - } -} -#endif - - - const char *ConstantExpr::getOpcodeName() const { return Instruction::getOpcodeName(getOpcode()); From lattner at cs.uiuc.edu Sat Oct 4 19:30:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 19:30:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CFP2000/Makefile Message-ID: <200310050029.TAA21789@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CFP2000: Makefile updated: 1.4 -> 1.5 --- Log message: Mesa works now, enable it --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/CFP2000/Makefile diff -u llvm/test/Programs/External/SPEC/CFP2000/Makefile:1.4 llvm/test/Programs/External/SPEC/CFP2000/Makefile:1.5 --- llvm/test/Programs/External/SPEC/CFP2000/Makefile:1.4 Sat Sep 20 23:39:28 2003 +++ llvm/test/Programs/External/SPEC/CFP2000/Makefile Sat Oct 4 19:28:50 2003 @@ -1,5 +1,6 @@ LEVEL = ../../../../.. PARALLEL_DIRS := \ + 177.mesa \ 179.art \ 183.equake \ 188.ammp From lattner at cs.uiuc.edu Sat Oct 4 19:42:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 19:42:01 2003 Subject: [llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp Message-ID: <200310050041.TAA25607@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CWriter: Writer.cpp updated: 1.127 -> 1.128 --- Log message: A couple of minor code cleanups. Print literal doubles using ftostr instead of <<, because it yields higher precision numbers. --- Diffs of the changes: Index: llvm/lib/CWriter/Writer.cpp diff -u llvm/lib/CWriter/Writer.cpp:1.127 llvm/lib/CWriter/Writer.cpp:1.128 --- llvm/lib/CWriter/Writer.cpp:1.127 Sat Sep 20 09:39:05 2003 +++ llvm/lib/CWriter/Writer.cpp Sat Oct 4 19:40:51 2003 @@ -152,7 +152,7 @@ // A pointer type should not use parens around *'s alone, e.g., (**) inline bool ptrTypeNameNeedsParens(const std::string &NameSoFar) { - return (NameSoFar.find_last_not_of('*') != std::string::npos); + return NameSoFar.find_last_not_of('*') != std::string::npos; } // Pass the Type* and the variable name and this prints out the variable @@ -327,25 +327,23 @@ } } -/// FPCSafeToPrint - Returns true if we may assume that CFP may be -/// written out textually as a double (rather than as a reference to a -/// stack-allocated variable). We decide this by converting CFP to a -/// string and back into a double, and then checking whether the -/// conversion results in a bit-equal double to the original value of -/// CFP. This depends on us and the target C compiler agreeing on the -/// conversion process (which is pretty likely since we only deal in -/// IEEE FP.) This is adapted from similar code in -/// lib/VMCore/AsmWriter.cpp:WriteConstantInt(). -static bool FPCSafeToPrint (const ConstantFP *CFP) { +// isFPCSafeToPrint - Returns true if we may assume that CFP may be written out +// textually as a double (rather than as a reference to a stack-allocated +// variable). We decide this by converting CFP to a string and back into a +// double, and then checking whether the conversion results in a bit-equal +// double to the original value of CFP. This depends on us and the target C +// compiler agreeing on the conversion process (which is pretty likely since we +// only deal in IEEE FP). +// +static bool isFPCSafeToPrint(const ConstantFP *CFP) { std::string StrVal = ftostr(CFP->getValue()); - // Check to make sure that the stringized number is not some string like - // "Inf" or NaN, that atof will accept, but the lexer will not. Check that - // the string matches the "[-+]?[0-9]" regex. + // Check to make sure that the stringized number is not some string like "Inf" + // or NaN. Check that the string matches the "[-+]?[0-9]" regex. if ((StrVal[0] >= '0' && StrVal[0] <= '9') || ((StrVal[0] == '-' || StrVal[0] == '+') && (StrVal[1] >= '0' && StrVal[1] <= '9'))) // Reparse stringized version! - return (atof(StrVal.c_str()) == CFP->getValue()); + return atof(StrVal.c_str()) == CFP->getValue(); return false; } @@ -439,11 +437,8 @@ Out << "(*(" << (FPC->getType() == Type::FloatTy ? "float" : "double") << "*)&FloatConstant" << I->second << ")"; } else { - if (FPCSafeToPrint (FPC)) { - Out << ftostr (FPC->getValue ()); - } else { - Out << FPC->getValue(); // Who knows? Give it our best shot... - } + // Print out the constant as a floating point number. + Out << ftostr(FPC->getValue()); } break; } @@ -860,7 +855,7 @@ unsigned FPCounter = 0; for (constant_iterator I = constant_begin(F), E = constant_end(F); I != E;++I) if (const ConstantFP *FPC = dyn_cast(*I)) - if ((!FPCSafeToPrint(FPC)) // Do not put in FPConstantMap if safe. + if ((!isFPCSafeToPrint(FPC)) // Do not put in FPConstantMap if safe. && (FPConstantMap.find(FPC) == FPConstantMap.end())) { double Val = FPC->getValue(); From lattner at cs.uiuc.edu Sat Oct 4 19:42:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 19:42:10 2003 Subject: [llvm-commits] CVS: llvm/include/Support/StringExtras.h Message-ID: <200310050041.TAA26100@apoc.cs.uiuc.edu> Changes in directory llvm/include/Support: StringExtras.h updated: 1.5 -> 1.6 --- Log message: Output a very high-precision number --- Diffs of the changes: Index: llvm/include/Support/StringExtras.h diff -u llvm/include/Support/StringExtras.h:1.5 llvm/include/Support/StringExtras.h:1.6 --- llvm/include/Support/StringExtras.h:1.5 Tue Sep 30 13:37:23 2003 +++ llvm/include/Support/StringExtras.h Sat Oct 4 19:41:07 2003 @@ -80,7 +80,7 @@ static inline std::string ftostr(double V) { char Buffer[200]; - snprintf(Buffer, 200, "%e", V); + snprintf(Buffer, 200, "%20.6e", V); return Buffer; } From lattner at cs.uiuc.edu Sat Oct 4 20:54:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 20:54:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200310050153.UAA31509@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.42 -> 1.43 --- Log message: * Minor cleanups * Eliminate the KillList instance variable, instead, just delete loads and stores as they are "renamed", and delete allocas when they are done * Make the 'visited' set an instance variable to avoid passing it on the stack. --- Diffs of the changes: Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.42 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.43 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.42 Mon Aug 18 09:34:00 2003 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Oct 4 20:52:53 2003 @@ -51,7 +51,7 @@ namespace { struct PromoteMem2Reg { - const std::vector &Allocas; // the alloca instructions.. + const std::vector &Allocas; // the alloca instructions.. std::vector VersionNumbers; // Current version counters DominanceFrontier &DF; const TargetData &TD; @@ -60,33 +60,29 @@ std::vector > PhiNodes;// Idx corresponds 2 Allocas - // List of instructions to remove at end of pass - std::vector KillList; - - std::map > NewPhiNodes; // the PhiNodes we're adding + // NewPhiNodes - The PhiNodes we're adding. + std::map > NewPhiNodes; + + // Visited - The set of basic blocks the renamer has already visited. + std::set Visited; public: PromoteMem2Reg(const std::vector &A, DominanceFrontier &df, - const TargetData &td) - : Allocas(A), DF(df), TD(td) {} + const TargetData &td) : Allocas(A), DF(df), TD(td) {} void run(); private: void RenamePass(BasicBlock *BB, BasicBlock *Pred, - std::vector &IncVals, - std::set &Visited); + std::vector &IncVals); bool QueuePhiNode(BasicBlock *BB, unsigned AllocaIdx); }; } // end of anonymous namespace void PromoteMem2Reg::run() { - // If there is nothing to do, bail out... - if (Allocas.empty()) return; - Function &F = *DF.getRoot()->getParent(); + VersionNumbers.resize(Allocas.size()); for (unsigned i = 0, e = Allocas.size(); i != e; ++i) { @@ -97,11 +93,6 @@ AllocaLookup[Allocas[i]] = i; } - - // Add each alloca to the KillList. Note: KillList is destroyed MOST recently - // added to least recently. - KillList.assign(Allocas.begin(), Allocas.end()); - // Calculate the set of write-locations for each alloca. This is analogous to // counting the number of 'redefinitions' of each variable. std::vector > WriteSets;// Idx corresponds to Allocas @@ -153,27 +144,20 @@ // Walks all basic blocks in the function performing the SSA rename algorithm // and inserting the phi nodes we marked as necessary // - std::set Visited; // The basic blocks we've already visited - RenamePass(F.begin(), 0, Values, Visited); + RenamePass(F.begin(), 0, Values); + Visited.clear(); - // Remove all instructions marked by being placed in the KillList... - // - while (!KillList.empty()) { - Instruction *I = KillList.back(); - KillList.pop_back(); + // Remove the allocas themselves from the function... + for (unsigned i = 0, e = Allocas.size(); i != e; ++i) { + Instruction *A = Allocas[i]; - // If there are any uses of these instructions left, they must be in + // If there are any uses of the alloca instructions left, they must be in // sections of dead code that were not processed on the dominance frontier. // Just delete the users now. // - while (!I->use_empty()) { - Instruction *U = cast(I->use_back()); - if (!U->use_empty()) // If uses remain in dead code segment... - U->replaceAllUsesWith(Constant::getNullValue(U->getType())); - U->getParent()->getInstList().erase(U); - } - - I->getParent()->getInstList().erase(I); + if (!A->use_empty()) + A->replaceAllUsesWith(Constant::getNullValue(A->getType())); + A->getParent()->getInstList().erase(A); } } @@ -215,8 +199,7 @@ } void PromoteMem2Reg::RenamePass(BasicBlock *BB, BasicBlock *Pred, - std::vector &IncomingVals, - std::set &Visited) { + std::vector &IncomingVals) { // If this is a BB needing a phi node, lookup/create the phinode for each // variable we need phinodes for. std::vector &BBPNs = NewPhiNodes[BB]; @@ -240,9 +223,9 @@ // mark as visited Visited.insert(BB); - // keep track of the value of each variable we're watching.. how? - for (BasicBlock::iterator II = BB->begin(); II != BB->end(); ++II) { - Instruction *I = II; // get the instruction + BasicBlock::iterator II = BB->begin(); + while (1) { + Instruction *I = II++; // get the instruction, increment iterator if (LoadInst *LI = dyn_cast(I)) { if (AllocaInst *Src = dyn_cast(LI->getPointerOperand())) { @@ -252,7 +235,7 @@ // walk the use list of this load and replace all uses with r LI->replaceAllUsesWith(V); - KillList.push_back(LI); // Mark the load to be deleted + BB->getInstList().erase(LI); } } } else if (StoreInst *SI = dyn_cast(I)) { @@ -263,7 +246,7 @@ if (ai != AllocaLookup.end()) { // what value were we writing? IncomingVals[ai->second] = SI->getOperand(0); - KillList.push_back(SI); // Mark the store to be deleted + BB->getInstList().erase(SI); } } @@ -271,8 +254,9 @@ // Recurse across our successors for (unsigned i = 0; i != TI->getNumSuccessors(); i++) { std::vector OutgoingVals(IncomingVals); - RenamePass(TI->getSuccessor(i), BB, OutgoingVals, Visited); + RenamePass(TI->getSuccessor(i), BB, OutgoingVals); } + break; } } } @@ -284,5 +268,7 @@ /// void PromoteMemToReg(const std::vector &Allocas, DominanceFrontier &DF, const TargetData &TD) { + // If there is nothing to do, bail out... + if (Allocas.empty()) return; PromoteMem2Reg(Allocas, DF, TD).run(); } From lattner at cs.uiuc.edu Sat Oct 4 21:38:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 21:38:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200310050237.VAA01889@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.43 -> 1.44 --- Log message: Two small cleanups/speedups: * Do not insert a new entry into NewPhiNodes during the rename pass if there are no PHIs in a block. * Do not compute WriteSets in parallel --- Diffs of the changes: Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.43 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.44 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.43 Sat Oct 4 20:52:53 2003 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Oct 4 21:37:36 2003 @@ -93,26 +93,24 @@ AllocaLookup[Allocas[i]] = i; } - // Calculate the set of write-locations for each alloca. This is analogous to - // counting the number of 'redefinitions' of each variable. - std::vector > WriteSets;// Idx corresponds to Allocas - WriteSets.resize(Allocas.size()); + PhiNodes.resize(Allocas.size()); for (unsigned i = 0; i != Allocas.size(); ++i) { AllocaInst *AI = Allocas[i]; + + // Calculate the set of write-locations for each alloca. This is analogous + // to counting the number of 'redefinitions' of each variable. + std::vector WriteSets; for (Value::use_iterator U =AI->use_begin(), E = AI->use_end(); U != E; ++U) if (StoreInst *SI = dyn_cast(*U)) // jot down the basic-block it came from - WriteSets[i].push_back(SI->getParent()); - } - - // Compute the locations where PhiNodes need to be inserted. Look at the - // dominance frontier of EACH basic-block we have a write in - // - PhiNodes.resize(Allocas.size()); - for (unsigned i = 0; i != Allocas.size(); ++i) { - for (unsigned j = 0; j != WriteSets[i].size(); j++) { + WriteSets.push_back(SI->getParent()); + + // Compute the locations where PhiNodes need to be inserted. Look at the + // dominance frontier of EACH basic-block we have a write in. + // + for (unsigned j = 0; j != WriteSets.size(); j++) { // Look up the DF for this write, add it to PhiNodes - DominanceFrontier::const_iterator it = DF.find(WriteSets[i][j]); + DominanceFrontier::const_iterator it = DF.find(WriteSets[j]); if (it != DF.end()) { const DominanceFrontier::DomSetType &S = it->second; for (DominanceFrontier::DomSetType::iterator P = S.begin(),PE = S.end(); @@ -200,22 +198,26 @@ void PromoteMem2Reg::RenamePass(BasicBlock *BB, BasicBlock *Pred, std::vector &IncomingVals) { - // If this is a BB needing a phi node, lookup/create the phinode for each - // variable we need phinodes for. - std::vector &BBPNs = NewPhiNodes[BB]; - for (unsigned k = 0; k != BBPNs.size(); ++k) - if (PHINode *PN = BBPNs[k]) { - // The PHI node may have multiple entries for this predecessor. We must - // make sure we update all of them. - for (unsigned i = 0, e = PN->getNumOperands(); i != e; i += 2) { - if (PN->getOperand(i+1) == Pred) - // At this point we can assume that the array has phi nodes.. let's - // update the incoming data. - PN->setOperand(i, IncomingVals[k]); + // If this BB needs a PHI node, update the PHI node for each variable we need + // PHI nodes for. + std::map >::iterator + BBPNI = NewPhiNodes.find(BB); + if (BBPNI != NewPhiNodes.end()) { + std::vector &BBPNs = BBPNI->second; + for (unsigned k = 0; k != BBPNs.size(); ++k) + if (PHINode *PN = BBPNs[k]) { + // The PHI node may have multiple entries for this predecessor. We must + // make sure we update all of them. + for (unsigned i = 0, e = PN->getNumOperands(); i != e; i += 2) { + if (PN->getOperand(i+1) == Pred) + // At this point we can assume that the array has phi nodes.. let's + // update the incoming data. + PN->setOperand(i, IncomingVals[k]); + } + // also note that the active variable IS designated by the phi node + IncomingVals[k] = PN; } - // also note that the active variable IS designated by the phi node - IncomingVals[k] = PN; - } + } // don't revisit nodes if (Visited.count(BB)) return; From lattner at cs.uiuc.edu Sat Oct 4 22:17:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 22:17:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200310050316.WAA02806@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.44 -> 1.45 --- Log message: * Document instance vars better * Fuse two parallel loops * Use a more specific type for AllocaLookup --- Diffs of the changes: Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.44 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.45 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.44 Sat Oct 4 21:37:36 2003 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Oct 4 22:16:07 2003 @@ -51,14 +51,20 @@ namespace { struct PromoteMem2Reg { - const std::vector &Allocas; // the alloca instructions.. - std::vector VersionNumbers; // Current version counters + // Allocas - The alloca instructions being promoted + const std::vector &Allocas; DominanceFrontier &DF; const TargetData &TD; - std::map AllocaLookup; // reverse mapping of above + // AllocaLookup - Reverse mapping of Allocas + std::map AllocaLookup; + + // VersionNumbers - Current version counters for each alloca + std::vector VersionNumbers; - std::vector > PhiNodes;// Idx corresponds 2 Allocas + // PhiNodes - Each alloca contains a list of basic blocks which contain PHI + // nodes for the alloca. + std::vector > PhiNodes; // NewPhiNodes - The PhiNodes we're adding. std::map > NewPhiNodes; @@ -84,26 +90,25 @@ Function &F = *DF.getRoot()->getParent(); VersionNumbers.resize(Allocas.size()); + PhiNodes.resize(Allocas.size()); - for (unsigned i = 0, e = Allocas.size(); i != e; ++i) { - assert(isAllocaPromotable(Allocas[i], TD) && + for (unsigned i = 0; i != Allocas.size(); ++i) { + AllocaInst *AI = Allocas[i]; + + assert(isAllocaPromotable(AI, TD) && "Cannot promote non-promotable alloca!"); assert(Allocas[i]->getParent()->getParent() == &F && "All allocas should be in the same function, which is same as DF!"); - AllocaLookup[Allocas[i]] = i; - } - - PhiNodes.resize(Allocas.size()); - for (unsigned i = 0; i != Allocas.size(); ++i) { - AllocaInst *AI = Allocas[i]; // Calculate the set of write-locations for each alloca. This is analogous // to counting the number of 'redefinitions' of each variable. std::vector WriteSets; for (Value::use_iterator U =AI->use_begin(), E = AI->use_end(); U != E; ++U) - if (StoreInst *SI = dyn_cast(*U)) + if (StoreInst *SI = dyn_cast(cast(*U))) // jot down the basic-block it came from WriteSets.push_back(SI->getParent()); + + AllocaLookup[Allocas[i]] = i; // Compute the locations where PhiNodes need to be inserted. Look at the // dominance frontier of EACH basic-block we have a write in. @@ -120,12 +125,13 @@ } // Perform iterative step - for (unsigned k = 0; k != PhiNodes[i].size(); k++) { - DominanceFrontier::const_iterator it = DF.find(PhiNodes[i][k]); + std::vector &AllocaPhiNodes = PhiNodes[i]; + for (unsigned k = 0; k != AllocaPhiNodes.size(); k++) { + DominanceFrontier::const_iterator it = DF.find(AllocaPhiNodes[k]); if (it != DF.end()) { - const DominanceFrontier::DomSetType &S = it->second; - for (DominanceFrontier::DomSetType::iterator P = S.begin(),PE = S.end(); - P != PE; ++P) + const DominanceFrontier::DomSetType &S = it->second; + for (DominanceFrontier::DomSetType::iterator + P = S.begin(), PE = S.end(); P != PE; ++P) QueuePhiNode(*P, i); } } @@ -231,7 +237,7 @@ if (LoadInst *LI = dyn_cast(I)) { if (AllocaInst *Src = dyn_cast(LI->getPointerOperand())) { - std::map::iterator AI = AllocaLookup.find(Src); + std::map::iterator AI = AllocaLookup.find(Src); if (AI != AllocaLookup.end()) { Value *V = IncomingVals[AI->second]; @@ -244,7 +250,7 @@ // Delete this instruction and mark the name as the current holder of the // value if (AllocaInst *Dest = dyn_cast(SI->getPointerOperand())) { - std::map::iterator ai =AllocaLookup.find(Dest); + std::map::iterator ai = AllocaLookup.find(Dest); if (ai != AllocaLookup.end()) { // what value were we writing? IncomingVals[ai->second] = SI->getOperand(0); From lattner at cs.uiuc.edu Sat Oct 4 22:27:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 22:27:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200310050326.WAA03524@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.45 -> 1.46 --- Log message: The PhiNodes 2D vector is only used during PHI node placement. It doesn't need to be an instance variable! --- Diffs of the changes: Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.45 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.46 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.45 Sat Oct 4 22:16:07 2003 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Oct 4 22:26:25 2003 @@ -62,10 +62,6 @@ // VersionNumbers - Current version counters for each alloca std::vector VersionNumbers; - // PhiNodes - Each alloca contains a list of basic blocks which contain PHI - // nodes for the alloca. - std::vector > PhiNodes; - // NewPhiNodes - The PhiNodes we're adding. std::map > NewPhiNodes; @@ -90,7 +86,6 @@ Function &F = *DF.getRoot()->getParent(); VersionNumbers.resize(Allocas.size()); - PhiNodes.resize(Allocas.size()); for (unsigned i = 0; i != Allocas.size(); ++i) { AllocaInst *AI = Allocas[i]; @@ -110,6 +105,10 @@ AllocaLookup[Allocas[i]] = i; + // PhiNodeBlocks - A list of blocks that phi nodes have been inserted for + // this alloca. + std::vector PhiNodeBlocks; + // Compute the locations where PhiNodes need to be inserted. Look at the // dominance frontier of EACH basic-block we have a write in. // @@ -120,19 +119,20 @@ const DominanceFrontier::DomSetType &S = it->second; for (DominanceFrontier::DomSetType::iterator P = S.begin(),PE = S.end(); P != PE; ++P) - QueuePhiNode(*P, i); + if (QueuePhiNode(*P, i)) + PhiNodeBlocks.push_back(*P); } } // Perform iterative step - std::vector &AllocaPhiNodes = PhiNodes[i]; - for (unsigned k = 0; k != AllocaPhiNodes.size(); k++) { - DominanceFrontier::const_iterator it = DF.find(AllocaPhiNodes[k]); + for (unsigned k = 0; k != PhiNodeBlocks.size(); k++) { + DominanceFrontier::const_iterator it = DF.find(PhiNodeBlocks[k]); if (it != DF.end()) { const DominanceFrontier::DomSetType &S = it->second; for (DominanceFrontier::DomSetType::iterator P = S.begin(), PE = S.end(); P != PE; ++P) - QueuePhiNode(*P, i); + if (QueuePhiNode(*P, i)) + PhiNodeBlocks.push_back(*P); } } } @@ -198,7 +198,6 @@ PN->addIncoming(NullVal, Preds[i]); BBPNs[AllocaNo] = PN; - PhiNodes[AllocaNo].push_back(BB); return true; } From lattner at cs.uiuc.edu Sat Oct 4 22:40:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 22:40:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200310050339.WAA04580@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.46 -> 1.47 --- Log message: There is no need for separate WriteSets and PhiNodeBlocks lists. It is just a work-list of value definitions. This allows elimination of the explicit 'iterative' step of the algorithm, and also reuses temporary memory better. --- Diffs of the changes: Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.46 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.47 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.46 Sat Oct 4 22:26:25 2003 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Oct 4 22:39:10 2003 @@ -81,7 +81,6 @@ }; } // end of anonymous namespace - void PromoteMem2Reg::run() { Function &F = *DF.getRoot()->getParent(); @@ -97,11 +96,11 @@ // Calculate the set of write-locations for each alloca. This is analogous // to counting the number of 'redefinitions' of each variable. - std::vector WriteSets; + std::vector DefiningBlocks; for (Value::use_iterator U =AI->use_begin(), E = AI->use_end(); U != E; ++U) if (StoreInst *SI = dyn_cast(cast(*U))) // jot down the basic-block it came from - WriteSets.push_back(SI->getParent()); + DefiningBlocks.push_back(SI->getParent()); AllocaLookup[Allocas[i]] = i; @@ -112,27 +111,18 @@ // Compute the locations where PhiNodes need to be inserted. Look at the // dominance frontier of EACH basic-block we have a write in. // - for (unsigned j = 0; j != WriteSets.size(); j++) { + while (!DefiningBlocks.empty()) { + BasicBlock *BB = DefiningBlocks.back(); + DefiningBlocks.pop_back(); + // Look up the DF for this write, add it to PhiNodes - DominanceFrontier::const_iterator it = DF.find(WriteSets[j]); + DominanceFrontier::const_iterator it = DF.find(BB); if (it != DF.end()) { const DominanceFrontier::DomSetType &S = it->second; for (DominanceFrontier::DomSetType::iterator P = S.begin(),PE = S.end(); P != PE; ++P) if (QueuePhiNode(*P, i)) - PhiNodeBlocks.push_back(*P); - } - } - - // Perform iterative step - for (unsigned k = 0; k != PhiNodeBlocks.size(); k++) { - DominanceFrontier::const_iterator it = DF.find(PhiNodeBlocks[k]); - if (it != DF.end()) { - const DominanceFrontier::DomSetType &S = it->second; - for (DominanceFrontier::DomSetType::iterator - P = S.begin(), PE = S.end(); P != PE; ++P) - if (QueuePhiNode(*P, i)) - PhiNodeBlocks.push_back(*P); + DefiningBlocks.push_back(*P); } } } From lattner at cs.uiuc.edu Sat Oct 4 22:46:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 22:46:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200310050345.WAA05171@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.47 -> 1.48 --- Log message: Simplify the loop a bit --- Diffs of the changes: Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.47 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.48 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.47 Sat Oct 4 22:39:10 2003 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Oct 4 22:45:44 2003 @@ -193,6 +193,7 @@ void PromoteMem2Reg::RenamePass(BasicBlock *BB, BasicBlock *Pred, std::vector &IncomingVals) { + // If this BB needs a PHI node, update the PHI node for each variable we need // PHI nodes for. std::map >::iterator @@ -220,8 +221,7 @@ // mark as visited Visited.insert(BB); - BasicBlock::iterator II = BB->begin(); - while (1) { + for (BasicBlock::iterator II = BB->begin(); !isa(II); ) { Instruction *I = II++; // get the instruction, increment iterator if (LoadInst *LI = dyn_cast(I)) { @@ -246,15 +246,14 @@ BB->getInstList().erase(SI); } } - - } else if (TerminatorInst *TI = dyn_cast(I)) { - // Recurse across our successors - for (unsigned i = 0; i != TI->getNumSuccessors(); i++) { - std::vector OutgoingVals(IncomingVals); - RenamePass(TI->getSuccessor(i), BB, OutgoingVals); - } - break; } + } + + // Recurse to our successors + TerminatorInst *TI = BB->getTerminator(); + for (unsigned i = 0; i != TI->getNumSuccessors(); i++) { + std::vector OutgoingVals(IncomingVals); + RenamePass(TI->getSuccessor(i), BB, OutgoingVals); } } From lattner at cs.uiuc.edu Sat Oct 4 23:27:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 23:27:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200310050426.XAA06979@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.48 -> 1.49 --- Log message: * Update file header comment *** Revamp the code which handled unreachable code in the function. Now the code is much more efficient for high-degree basic blocks, such as those that occur in the 252.eon SPEC benchmark. For the interested, the time to promote a SINGLE alloca in _ZN7mrScene4ReadERSi function used to be > 3.5s. Now it is < .075s. The function has a LOT of allocas in it, so it appeared to be infinite looping, this should make it much nicer. :) --- Diffs of the changes: Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.48 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.49 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.48 Sat Oct 4 22:45:44 2003 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Oct 4 23:26:39 2003 @@ -1,18 +1,10 @@ -//===- PromoteMemoryToRegister.cpp - Convert memory refs to regs ----------===// +//===- PromoteMemoryToRegister.cpp - Convert allocas to registers ---------===// // -// This file is used to promote memory references to be register references. A -// simple example of the transformation performed by this function is: -// -// FROM CODE TO CODE -// %X = alloca int, uint 1 ret int 42 -// store int 42, int *%X -// %Y = load int* %X -// ret int %Y -// -// The code is transformed by looping over all of the alloca instruction, -// calculating dominator frontiers, then inserting phi-nodes following the usual -// SSA construction algorithm. This code does not modify the CFG of the -// function. +// This file promote memory references to be register references. It promotes +// alloca instructions which only have loads and stores as uses. An alloca is +// transformed by using dominator frontiers to place PHI nodes, then traversing +// the function in depth-first order to rewrite loads and stores as appropriate. +// This is just the standard SSA construction algorithm. // //===----------------------------------------------------------------------===// @@ -20,10 +12,8 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/iMemory.h" #include "llvm/iPHINode.h" -#include "llvm/iTerminators.h" #include "llvm/Function.h" #include "llvm/Constant.h" -#include "llvm/Type.h" #include "llvm/Support/CFG.h" #include "Support/StringExtras.h" @@ -139,6 +129,8 @@ // and inserting the phi nodes we marked as necessary // RenamePass(F.begin(), 0, Values); + + // The renamer uses the Visited set to avoid infinite loops. Clear it now. Visited.clear(); // Remove the allocas themselves from the function... @@ -153,6 +145,54 @@ A->replaceAllUsesWith(Constant::getNullValue(A->getType())); A->getParent()->getInstList().erase(A); } + + // At this point, the renamer has added entries to PHI nodes for all reachable + // code. Unfortunately, there may be blocks which are not reachable, which + // the renamer hasn't traversed. If this is the case, the PHI nodes may not + // have incoming values for all predecessors. Loop over all PHI nodes we have + // created, inserting null constants if they are missing any incoming values. + // + for (std::map >::iterator I = + NewPhiNodes.begin(), E = NewPhiNodes.end(); I != E; ++I) { + + std::vector Preds(pred_begin(I->first), pred_end(I->first)); + std::vector &PNs = I->second; + assert(!PNs.empty() && "Empty PHI node list??"); + + // Only do work here if there the PHI nodes are missing incoming values. We + // know that all PHI nodes that were inserted in a block will have the same + // number of incoming values, so we can just check any PHI node. + PHINode *FirstPHI = PNs[0]; + if (Preds.size() != FirstPHI->getNumIncomingValues()) { + // Ok, now we know that all of the PHI nodes are missing entries for some + // basic blocks. Start by sorting the incoming predecessors for efficient + // access. + std::sort(Preds.begin(), Preds.end()); + + // Now we loop through all BB's which have entries in FirstPHI and remove + // them from the Preds list. + for (unsigned i = 0, e = FirstPHI->getNumIncomingValues(); i != e; ++i) { + // Do a log(n) search of teh Preds list for the entry we want. + std::vector::iterator EntIt = + std::lower_bound(Preds.begin(), Preds.end(), + FirstPHI->getIncomingBlock(i)); + assert(EntIt != Preds.end() && *EntIt == FirstPHI->getIncomingBlock(i)&& + "PHI node has entry for a block which is not a predecessor!"); + + // Remove the entry + Preds.erase(EntIt); + } + + // At this point, the blocks left in the preds list must have dummy + // entries inserted into every PHI nodes for the block. + for (unsigned i = 0, e = PNs.size(); i != e; ++i) { + PHINode *PN = PNs[i]; + Value *NullVal = Constant::getNullValue(PN->getType()); + for (unsigned pred = 0, e = Preds.size(); pred != e; ++pred) + PN->addIncoming(NullVal, Preds[pred]); + } + } + } } @@ -169,25 +209,10 @@ // Create a PhiNode using the dereferenced type... and add the phi-node to the // BasicBlock. - PHINode *PN = new PHINode(Allocas[AllocaNo]->getAllocatedType(), - Allocas[AllocaNo]->getName() + "." + - utostr(VersionNumbers[AllocaNo]++), - BB->begin()); - - // Add null incoming values for all predecessors. This ensures that if one of - // the predecessors is not found in the depth-first traversal of the CFG (ie, - // because it is an unreachable predecessor), that all PHI nodes will have the - // correct number of entries for their predecessors. - Value *NullVal = Constant::getNullValue(PN->getType()); - - // This is necessary because adding incoming values to the PHI node adds uses - // to the basic blocks being used, which can invalidate the predecessor - // iterator! - std::vector Preds(pred_begin(BB), pred_end(BB)); - for (unsigned i = 0, e = Preds.size(); i != e; ++i) - PN->addIncoming(NullVal, Preds[i]); - - BBPNs[AllocaNo] = PN; + BBPNs[AllocaNo] = new PHINode(Allocas[AllocaNo]->getAllocatedType(), + Allocas[AllocaNo]->getName() + "." + + utostr(VersionNumbers[AllocaNo]++), + BB->begin()); return true; } @@ -202,15 +227,10 @@ std::vector &BBPNs = BBPNI->second; for (unsigned k = 0; k != BBPNs.size(); ++k) if (PHINode *PN = BBPNs[k]) { - // The PHI node may have multiple entries for this predecessor. We must - // make sure we update all of them. - for (unsigned i = 0, e = PN->getNumOperands(); i != e; i += 2) { - if (PN->getOperand(i+1) == Pred) - // At this point we can assume that the array has phi nodes.. let's - // update the incoming data. - PN->setOperand(i, IncomingVals[k]); - } - // also note that the active variable IS designated by the phi node + // Add this incoming value to the PHI node. + PN->addIncoming(IncomingVals[k], Pred); + + // The currently active variable for this block is now the PHI. IncomingVals[k] = PN; } } From lattner at cs.uiuc.edu Sat Oct 4 23:34:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat Oct 4 23:34:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200310050433.XAA07352@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.49 -> 1.50 --- Log message: The VersionNumbers vector is only used during PHI placement. Turn it into an argument, allowing us to get rid of the vector. --- Diffs of the changes: Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.49 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.50 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.49 Sat Oct 4 23:26:39 2003 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Oct 4 23:33:22 2003 @@ -49,9 +49,6 @@ // AllocaLookup - Reverse mapping of Allocas std::map AllocaLookup; - // VersionNumbers - Current version counters for each alloca - std::vector VersionNumbers; - // NewPhiNodes - The PhiNodes we're adding. std::map > NewPhiNodes; @@ -67,15 +64,13 @@ private: void RenamePass(BasicBlock *BB, BasicBlock *Pred, std::vector &IncVals); - bool QueuePhiNode(BasicBlock *BB, unsigned AllocaIdx); + bool QueuePhiNode(BasicBlock *BB, unsigned AllocaIdx, unsigned &Version); }; } // end of anonymous namespace void PromoteMem2Reg::run() { Function &F = *DF.getRoot()->getParent(); - VersionNumbers.resize(Allocas.size()); - for (unsigned i = 0; i != Allocas.size(); ++i) { AllocaInst *AI = Allocas[i]; @@ -101,6 +96,7 @@ // Compute the locations where PhiNodes need to be inserted. Look at the // dominance frontier of EACH basic-block we have a write in. // + unsigned CurrentVersion = 0; while (!DefiningBlocks.empty()) { BasicBlock *BB = DefiningBlocks.back(); DefiningBlocks.pop_back(); @@ -111,7 +107,7 @@ const DominanceFrontier::DomSetType &S = it->second; for (DominanceFrontier::DomSetType::iterator P = S.begin(),PE = S.end(); P != PE; ++P) - if (QueuePhiNode(*P, i)) + if (QueuePhiNode(*P, i, CurrentVersion)) DefiningBlocks.push_back(*P); } } @@ -199,7 +195,8 @@ // QueuePhiNode - queues a phi-node to be added to a basic-block for a specific // Alloca returns true if there wasn't already a phi-node for that variable // -bool PromoteMem2Reg::QueuePhiNode(BasicBlock *BB, unsigned AllocaNo) { +bool PromoteMem2Reg::QueuePhiNode(BasicBlock *BB, unsigned AllocaNo, + unsigned &Version) { // Look up the basic-block in question std::vector &BBPNs = NewPhiNodes[BB]; if (BBPNs.empty()) BBPNs.resize(Allocas.size()); @@ -211,8 +208,7 @@ // BasicBlock. BBPNs[AllocaNo] = new PHINode(Allocas[AllocaNo]->getAllocatedType(), Allocas[AllocaNo]->getName() + "." + - utostr(VersionNumbers[AllocaNo]++), - BB->begin()); + utostr(Version++), BB->begin()); return true; } From lattner at cs.uiuc.edu Sun Oct 5 00:35:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 00:35:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200310050534.AAA08524@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.50 -> 1.51 --- Log message: The first PHI node may be null, scan for the first non-null one --- Diffs of the changes: Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.50 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.51 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.50 Sat Oct 4 23:33:22 2003 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sun Oct 5 00:34:39 2003 @@ -158,7 +158,10 @@ // Only do work here if there the PHI nodes are missing incoming values. We // know that all PHI nodes that were inserted in a block will have the same // number of incoming values, so we can just check any PHI node. - PHINode *FirstPHI = PNs[0]; + PHINode *FirstPHI; + for (unsigned i = 0; (FirstPHI = PNs[i]) == 0; ++i) + /*empty*/; + if (Preds.size() != FirstPHI->getNumIncomingValues()) { // Ok, now we know that all of the PHI nodes are missing entries for some // basic blocks. Start by sorting the incoming predecessors for efficient From lattner at cs.uiuc.edu Sun Oct 5 12:45:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 12:45:01 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp Message-ID: <200310051744.MAA19464@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Verifier.cpp updated: 1.61 -> 1.62 --- Log message: Be more careful handling PHI nodes, which might be of potentially high degree. This reduces the time to verify a function from eon with a large number of large PHI nodes from 22996s (6.38 hours) to 10.5499s --- Diffs of the changes: Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.61 llvm/lib/VMCore/Verifier.cpp:1.62 --- llvm/lib/VMCore/Verifier.cpp:1.61 Sat Sep 20 09:39:07 2003 +++ llvm/lib/VMCore/Verifier.cpp Sun Oct 5 12:44:18 2003 @@ -238,6 +238,54 @@ // verifyBasicBlock - Verify that a basic block is well formed... // void Verifier::visitBasicBlock(BasicBlock &BB) { + // Check constraints that this basic block imposes on all of the PHI nodes in + // it. + if (isa(BB.front())) { + std::vector Preds(pred_begin(&BB), pred_end(&BB)); + std::sort(Preds.begin(), Preds.end()); + + for (BasicBlock::iterator I = BB.begin(); + PHINode *PN = dyn_cast(I); ++I) { + + // Ensure that PHI nodes have at least one entry! + Assert1(PN->getNumIncomingValues() != 0, + "PHI nodes must have at least one entry. If the block is dead, " + "the PHI should be removed!", PN); + Assert1(PN->getNumIncomingValues() >= Preds.size(), + "PHINode has more entries than the basic block has predecessors!", + PN); + Assert1(PN->getNumIncomingValues() <= Preds.size(), + "PHINode has less entries than the basic block has predecessors!", + PN); + + // Get and sort all incoming values in the PHI node... + std::vector > Values; + Values.reserve(PN->getNumIncomingValues()); + for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) + Values.push_back(std::make_pair(PN->getIncomingBlock(i), + PN->getIncomingValue(i))); + std::sort(Values.begin(), Values.end()); + + for (unsigned i = 0, e = Values.size(); i != e; ++i) { + // Check to make sure that if there is more than one entry for a + // particular basic block in this PHI node, that the incoming values are + // all identical. + // + Assert4(i == 0 || Values[i].first != Values[i-1].first || + Values[i].second == Values[i-1].second, + "PHI node has multiple entries for the same basic block with " + "different incoming values!", PN, Values[i].first, + Values[i].second, Values[i-1].second); + + // Check to make sure that the predecessors and PHI node entries are + // matched up. + Assert3(Values[i].first == Preds[i], + "PHI node entries do not match predecessors!", PN, + Values[i].first, Preds[i]); + } + } + } + // Ensure that basic blocks have terminators! Assert1(BB.getTerminator(), "Basic Block does not have terminator!", &BB); } @@ -279,61 +327,11 @@ // This can be tested by checking whether the instruction before this is // either nonexistant (because this is begin()) or is a PHI node. If not, // then there is some other instruction before a PHI. - Assert2(PN.getPrev() == 0 || isa(PN.getPrev()), + Assert2(&PN.getParent()->front() == &PN || isa(PN.getPrev()), "PHI nodes not grouped at top of basic block!", &PN, PN.getParent()); - // Ensure that PHI nodes have at least one entry! - Assert1(PN.getNumIncomingValues() != 0, - "PHI nodes must have at least one entry. If the block is dead, " - "the PHI should be removed!", - &PN); - - std::vector Preds(pred_begin(PN.getParent()), - pred_end(PN.getParent())); - // Loop over all of the incoming values, make sure that there are - // predecessors for each one... - // - for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) { - // Make sure all of the incoming values are the right types... - Assert2(PN.getType() == PN.getIncomingValue(i)->getType(), - "PHI node argument type does not agree with PHI node type!", - &PN, PN.getIncomingValue(i)); - - BasicBlock *BB = PN.getIncomingBlock(i); - std::vector::iterator PI = - find(Preds.begin(), Preds.end(), BB); - Assert2(PI != Preds.end(), "PHI node has entry for basic block that" - " is not a predecessor!", &PN, BB); - Preds.erase(PI); - } - - // There should be no entries left in the predecessor list... - for (std::vector::iterator I = Preds.begin(), - E = Preds.end(); I != E; ++I) - Assert2(0, "PHI node does not have entry for a predecessor basic block!", - &PN, *I); - - // Now we go through and check to make sure that if there is more than one - // entry for a particular basic block in this PHI node, that the incoming - // values are all identical. - // - std::vector > Values; - Values.reserve(PN.getNumIncomingValues()); - for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) - Values.push_back(std::make_pair(PN.getIncomingBlock(i), - PN.getIncomingValue(i))); - - // Sort the Values vector so that identical basic block entries are adjacent. - std::sort(Values.begin(), Values.end()); - - // Check for identical basic blocks with differing incoming values... - for (unsigned i = 1, e = PN.getNumIncomingValues(); i < e; ++i) - Assert4(Values[i].first != Values[i-1].first || - Values[i].second == Values[i-1].second, - "PHI node has multiple entries for the same basic block with " - "different incoming values!", &PN, Values[i].first, - Values[i].second, Values[i-1].second); + // All other PHI node constraints are checked in the visitBasicBlock method. visitInstruction(PN); } @@ -442,19 +440,6 @@ BasicBlock *BB = I.getParent(); Assert1(BB, "Instruction not embedded in basic block!", &I); - // Check that all uses of the instruction, if they are instructions - // themselves, actually have parent basic blocks. If the use is not an - // instruction, it is an error! - // - for (User::use_iterator UI = I.use_begin(), UE = I.use_end(); - UI != UE; ++UI) { - Assert1(isa(*UI), "Use of instruction is not an instruction!", - *UI); - Instruction *Used = cast(*UI); - Assert2(Used->getParent() != 0, "Instruction referencing instruction not" - " embeded in a basic block!", &I, Used); - } - if (!isa(I)) { // Check that non-phi nodes are not self referential for (Value::use_iterator UI = I.use_begin(), UE = I.use_end(); UI != UE; ++UI) @@ -466,42 +451,44 @@ Assert1(I.getType() != Type::VoidTy || !I.hasName(), "Instruction has a name, but provides a void value!", &I); - // Check that a definition dominates all of its uses. + // Check that all uses of the instruction, if they are instructions + // themselves, actually have parent basic blocks. If the use is not an + // instruction, it is an error! // for (User::use_iterator UI = I.use_begin(), UE = I.use_end(); UI != UE; ++UI) { - Instruction *Use = cast(*UI); - - // PHI nodes are more difficult than other nodes because they actually - // "use" the value in the predecessor basic blocks they correspond to. - if (PHINode *PN = dyn_cast(Use)) { - for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) - if (&I == PN->getIncomingValue(i)) { - // Make sure that I dominates the end of pred(i) - BasicBlock *Pred = PN->getIncomingBlock(i); - - // Use must be dominated by by definition unless use is unreachable! - Assert2(DS->dominates(BB, Pred) || - !DS->dominates(&BB->getParent()->getEntryBlock(), Pred), - "Instruction does not dominate all uses!", - &I, PN); - } - - } else { - // Use must be dominated by by definition unless use is unreachable! - Assert2(DS->dominates(&I, Use) || - !DS->dominates(&BB->getParent()->getEntryBlock(), - Use->getParent()), - "Instruction does not dominate all uses!", &I, Use); - } + Assert1(isa(*UI), "Use of instruction is not an instruction!", + *UI); + Instruction *Used = cast(*UI); + Assert2(Used->getParent() != 0, "Instruction referencing instruction not" + " embeded in a basic block!", &I, Used); } - // Check to make sure that the "address of" an intrinsic function is never - // taken. - for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) + for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) { + // Check to make sure that the "address of" an intrinsic function is never + // taken. if (Function *F = dyn_cast(I.getOperand(i))) Assert1(!F->isIntrinsic() || (i == 0 && isa(I)), "Cannot take the address of an intrinsic!", &I); + + else if (Instruction *Op = dyn_cast(I.getOperand(i))) { + // Check that a definition dominates all of its uses. + // + if (!isa(I)) { + // Definition must dominate use unless use is unreachable! + Assert2(DS->dominates(Op->getParent(), BB) || + !DS->dominates(&BB->getParent()->getEntryBlock(), BB), + "Instruction does not dominate all uses!", Op, &I); + } else { + // PHI nodes are more difficult than other nodes because they actually + // "use" the value in the predecessor basic blocks they correspond to. + BasicBlock *PredBB = cast(I.getOperand(i+1)); + Assert2(DS->dominates(Op->getParent(), PredBB) || + !DS->dominates(&BB->getParent()->getEntryBlock(), PredBB), + "Instruction does not dominate all uses!", Op, &I); + } + } + } } /// visitIntrinsicFunction - Allow intrinsics to be verified in different ways. From lattner at cs.uiuc.edu Sun Oct 5 13:38:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 13:38:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C/varargs.c Message-ID: <200310051837.NAA27857@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C: varargs.c (r1.1) removed --- Log message: Remove a test, which is thoroughly tested elsewhere. This test doesn't currently work with the CBE because -lm is not linked in anyway --- Diffs of the changes: From lattner at cs.uiuc.edu Sun Oct 5 14:15:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:15:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LowerInvoke.cpp Message-ID: <200310051914.OAA19613@neo.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LowerInvoke.cpp added (r1.1) --- Log message: Initial checkin of the LLVM->LLVM transform to support code generators which do not support stack unwinding yet --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/LowerInvoke.cpp diff -c /dev/null llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.1 *** /dev/null Sun Oct 5 14:14:52 2003 --- llvm/lib/Transforms/Scalar/LowerInvoke.cpp Sun Oct 5 14:14:42 2003 *************** *** 0 **** --- 1,74 ---- + //===- LowerInvoke.cpp - Eliminate Invoke & Unwind instructions -----------===// + // + // This transformation is designed for use by code generators which do not yet + // support stack unwinding. This pass gives them the ability to execute any + // program which does not throw an exception, by turning 'invoke' instructions + // into calls and by turning 'unwind' instructions into calls to abort(). + // + //===----------------------------------------------------------------------===// + + #include "llvm/Transforms/Scalar.h" + #include "llvm/Pass.h" + #include "llvm/iTerminators.h" + #include "llvm/iOther.h" + #include "llvm/Module.h" + #include "llvm/Type.h" + #include "llvm/Constant.h" + #include "Support/Statistic.h" + + namespace { + Statistic<> NumLowered("lowerinvoke", "Number of invoke & unwinds replaced"); + + class LowerInvoke : public FunctionPass { + Function *AbortFn; + public: + bool doInitialization(Module &M); + bool runOnFunction(Function &F); + }; + + RegisterOpt + X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); + } + + FunctionPass *createLowerInvokePass() { return new LowerInvoke(); } + + // doInitialization - Make sure that there is a prototype for abort in the + // current module. + bool LowerInvoke::doInitialization(Module &M) { + AbortFn = M.getOrInsertFunction("abort", Type::VoidTy, 0); + return true; + } + + bool LowerInvoke::runOnFunction(Function &F) { + bool Changed = false; + for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) + if (InvokeInst *II = dyn_cast(I->getTerminator())) { + // Insert a normal call instruction... + std::string Name = II->getName(); II->setName(""); + Value *NewCall = new CallInst(II->getCalledValue(), + std::vector(II->op_begin()+3, + II->op_end()), Name,II); + II->replaceAllUsesWith(NewCall); + + // Insert an unconditional branch to the normal destination + new BranchInst(II->getNormalDest(), II); + + // Remove the invoke instruction now. + I->getInstList().erase(II); + + ++NumLowered; Changed = true; + } else if (UnwindInst *UI = dyn_cast(I->getTerminator())) { + // Insert a call to abort() + new CallInst(AbortFn, std::vector(), "", UI); + + // Insert a return instruction. + new ReturnInst(F.getReturnType() == Type::VoidTy ? 0 : + Constant::getNullValue(F.getReturnType()), UI); + + // Remove the unwind instruction now. + I->getInstList().erase(UI); + + ++NumLowered; Changed = true; + } + return Changed; + } From lattner at cs.uiuc.edu Sun Oct 5 14:15:11 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:15:11 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/SimplifyCFG.cpp Message-ID: <200310051914.OAA19618@neo.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: SimplifyCFG.cpp updated: 1.6 -> 1.7 --- Log message: simplify-cfg is really a function pass --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.6 llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.7 --- llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.6 Tue Oct 1 17:38:41 2002 +++ llvm/lib/Transforms/Scalar/SimplifyCFG.cpp Sun Oct 5 14:14:16 2003 @@ -28,7 +28,7 @@ RegisterOpt X("simplifycfg", "Simplify the CFG"); } -Pass *createCFGSimplificationPass() { +FunctionPass *createCFGSimplificationPass() { return new CFGSimplifyPass(); } From lattner at cs.uiuc.edu Sun Oct 5 14:16:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:16:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Scalar.h Message-ID: <200310051915.OAA19629@neo.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: Scalar.h updated: 1.25 -> 1.26 --- Log message: Add new prototype for createLowerInvokePass(). Make simplifycfg be a functionpass --- Diffs of the changes: Index: llvm/include/llvm/Transforms/Scalar.h diff -u llvm/include/llvm/Transforms/Scalar.h:1.25 llvm/include/llvm/Transforms/Scalar.h:1.26 --- llvm/include/llvm/Transforms/Scalar.h:1.25 Tue Sep 30 13:37:49 2003 +++ llvm/include/llvm/Transforms/Scalar.h Sun Oct 5 14:15:13 2003 @@ -197,7 +197,7 @@ // CFG Simplification - Merge basic blocks, eliminate unreachable blocks, // simplify terminator instructions, etc... // -Pass *createCFGSimplificationPass(); +FunctionPass *createCFGSimplificationPass(); //===----------------------------------------------------------------------===// @@ -260,6 +260,15 @@ // branch instructions. // FunctionPass *createLowerSwitchPass(); + + +//===----------------------------------------------------------------------===// +// This pass converts 'invoke' instructions calls, and 'unwind' instructions +// into calls to abort(). +// +FunctionPass *createLowerInvokePass(); + + //===----------------------------------------------------------------------===// // From lattner at cs.uiuc.edu Sun Oct 5 14:16:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:16:10 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp X86TargetMachine.cpp Message-ID: <200310051915.OAA04428@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: InstSelectSimple.cpp updated: 1.126 -> 1.127 X86TargetMachine.cpp updated: 1.29 -> 1.30 --- Log message: Instead of hacking in custom support for Invoke/Unwind, use the LowerInvoke pass --- Diffs of the changes: Index: llvm/lib/Target/X86/InstSelectSimple.cpp diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.126 llvm/lib/Target/X86/InstSelectSimple.cpp:1.127 --- llvm/lib/Target/X86/InstSelectSimple.cpp:1.126 Mon Sep 8 14:44:21 2003 +++ llvm/lib/Target/X86/InstSelectSimple.cpp Sun Oct 5 14:15:46 2003 @@ -131,8 +131,6 @@ void doCall(const ValueRecord &Ret, MachineInstr *CallMI, const std::vector &Args); void visitCallInst(CallInst &I); - void visitInvokeInst(InvokeInst &II); - void visitUnwindInst(UnwindInst &UI); void visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &I); // Arithmetic operators @@ -996,35 +994,6 @@ doCall(ValueRecord(DestReg, CI.getType()), TheCall, Args); } - -// visitInvokeInst - For now, we don't support the llvm.unwind intrinsic, so -// invoke's are just calls with an unconditional branch after them! -void ISel::visitInvokeInst(InvokeInst &II) { - MachineInstr *TheCall; - if (Function *F = II.getCalledFunction()) { - // Emit a CALL instruction with PC-relative displacement. - TheCall = BuildMI(X86::CALLpcrel32, 1).addGlobalAddress(F, true); - } else { // Emit an indirect call... - unsigned Reg = getReg(II.getCalledValue()); - TheCall = BuildMI(X86::CALLr32, 1).addReg(Reg); - } - - std::vector Args; - for (unsigned i = 3, e = II.getNumOperands(); i != e; ++i) - Args.push_back(ValueRecord(II.getOperand(i))); - - unsigned DestReg = II.getType() != Type::VoidTy ? getReg(II) : 0; - doCall(ValueRecord(DestReg, II.getType()), TheCall, Args); - - // If the normal destination is not the next basic block, emit a 'jmp'. - if (II.getNormalDest() != getBlockAfter(II.getParent())) - BuildMI(BB, X86::JMP, 1).addPCDisp(II.getNormalDest()); -} - -void ISel::visitUnwindInst(UnwindInst &UI) { - // unwind is not supported yet! Just abort when the unwind inst is executed! - BuildMI(BB, X86::CALLpcrel32, 1).addExternalSymbol("abort", true); -} void ISel::visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &CI) { unsigned TmpReg1, TmpReg2; Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.29 llvm/lib/Target/X86/X86TargetMachine.cpp:1.30 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.29 Thu Oct 2 11:57:49 2003 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Sun Oct 5 14:15:47 2003 @@ -50,6 +50,13 @@ // FIXME: Implement the switch instruction in the instruction selector! PM.add(createLowerSwitchPass()); + // FIXME: Implement the invoke/unwind instructions! + PM.add(createLowerInvokePass()); + + // FIXME: The code generator does not properly handle functions with + // unreachable basic blocks. + PM.add(createCFGSimplificationPass()); + if (NoPatternISel) PM.add(createX86SimpleInstructionSelector(*this)); else @@ -93,6 +100,13 @@ bool X86TargetMachine::addPassesToJITCompile(FunctionPassManager &PM) { // FIXME: Implement the switch instruction in the instruction selector! PM.add(createLowerSwitchPass()); + + // FIXME: Implement the invoke/unwind instructions! + PM.add(createLowerInvokePass()); + + // FIXME: The code generator does not properly handle functions with + // unreachable basic blocks. + PM.add(createCFGSimplificationPass()); if (NoPatternISel) PM.add(createX86SimpleInstructionSelector(*this)); From lattner at cs.uiuc.edu Sun Oct 5 14:17:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:17:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/Sparc.cpp Message-ID: <200310051916.OAA04438@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: Sparc.cpp updated: 1.83 -> 1.84 --- Log message: Add support for the Invoke instruction by using the LowerInvoke pass --- Diffs of the changes: Index: llvm/lib/Target/Sparc/Sparc.cpp diff -u llvm/lib/Target/Sparc/Sparc.cpp:1.83 llvm/lib/Target/Sparc/Sparc.cpp:1.84 --- llvm/lib/Target/Sparc/Sparc.cpp:1.83 Tue Sep 30 17:24:00 2003 +++ llvm/lib/Target/Sparc/Sparc.cpp Sun Oct 5 14:16:09 2003 @@ -158,6 +158,9 @@ // FIXME: implement the switch instruction in the instruction selector. PM.add(createLowerSwitchPass()); + + // FIXME: implement the invoke/unwind instructions! + PM.add(createLowerInvokePass()); // decompose multi-dimensional array references into single-dim refs PM.add(createDecomposeMultiDimRefsPass()); @@ -233,6 +236,9 @@ // FIXME: implement the switch instruction in the instruction selector. PM.add(createLowerSwitchPass()); + + // FIXME: implement the invoke/unwind instructions! + PM.add(createLowerInvokePass()); // decompose multi-dimensional array references into single-dim refs PM.add(createDecomposeMultiDimRefsPass()); From lattner at cs.uiuc.edu Sun Oct 5 14:18:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:18:01 2003 Subject: [llvm-commits] CVS: llvm/www/releases/1.0/ReleaseNotes.html Message-ID: <200310051917.OAA05153@tank.cs.uiuc.edu> Changes in directory llvm/www/releases/1.0: ReleaseNotes.html updated: 1.4 -> 1.5 --- Log message: The sparc backend now support invoke, but still doesn't support unwind --- Diffs of the changes: Index: llvm/www/releases/1.0/ReleaseNotes.html diff -u llvm/www/releases/1.0/ReleaseNotes.html:1.4 llvm/www/releases/1.0/ReleaseNotes.html:1.5 --- llvm/www/releases/1.0/ReleaseNotes.html:1.4 Thu Oct 2 11:38:05 2003 +++ llvm/www/releases/1.0/ReleaseNotes.html Sun Oct 5 14:17:10 2003 @@ -294,9 +294,9 @@


              Known problems with the Sparc back-end

                -
              • The Sparc code generator does not currently support the invoke or -unwind instructions, so code produced by the C++ front-end and C code -that calls the setjmp or longjmp functions will not compile. +
              • The Sparc code generator does not currently support the unwind +instruction, so code that throws a C++ exception or calls the C longjmp +function will abort.

                @@ -345,6 +345,6 @@

                By: Chris Lattner
                -Last modified: Thu Oct 2 11:37:25 CDT 2003 +Last modified: Sun Oct 5 14:01:10 CDT 2003 From lattner at cs.uiuc.edu Sun Oct 5 14:25:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:25:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/Makefile Message-ID: <200310051924.OAA06016@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Support: Makefile updated: 1.4 -> 1.5 --- Log message: Move support/lib/Support back to lib/Support --- Diffs of the changes: Index: llvm/lib/Support/Makefile diff -u llvm/lib/Support/Makefile:1.4 llvm/lib/Support/Makefile:1.5 --- llvm/lib/Support/Makefile:1.4 Mon Sep 29 10:02:30 2003 +++ llvm/lib/Support/Makefile Sun Oct 5 14:24:38 2003 @@ -1,4 +1,4 @@ -LEVEL = ../../.. +LEVEL = ../.. LIBRARYNAME = support BUILD_ARCHIVE = 1 From lattner at cs.uiuc.edu Sun Oct 5 14:29:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:29:01 2003 Subject: [llvm-commits] CVS: llvm/utils/Makefile Message-ID: <200310051928.OAA10936@apoc.cs.uiuc.edu> Changes in directory llvm/utils: Makefile updated: 1.2 -> 1.3 --- Log message: Move support/tools/* back into utils --- Diffs of the changes: Index: llvm/utils/Makefile diff -u /dev/null llvm/utils/Makefile:1.3 --- /dev/null Sun Oct 5 14:28:06 2003 +++ llvm/utils/Makefile Sun Oct 5 14:27:56 2003 @@ -0,0 +1,6 @@ +LEVEL = .. + +DIRS = Burg TableGen + +include $(LEVEL)/Makefile.common + From lattner at cs.uiuc.edu Sun Oct 5 14:29:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:29:10 2003 Subject: [llvm-commits] CVS: llvm/utils/Burg/Makefile Message-ID: <200310051928.OAA11235@apoc.cs.uiuc.edu> Changes in directory llvm/utils/Burg: Makefile updated: 1.21 -> 1.22 --- Log message: Move support/tools/* back into utils --- Diffs of the changes: Index: llvm/utils/Burg/Makefile diff -u llvm/utils/Burg/Makefile:1.21 llvm/utils/Burg/Makefile:1.22 --- llvm/utils/Burg/Makefile:1.21 Mon Sep 29 09:48:28 2003 +++ llvm/utils/Burg/Makefile Sun Oct 5 14:27:58 2003 @@ -1,4 +1,4 @@ -LEVEL = ../../.. +LEVEL = ../.. TOOLNAME = burg ExtraSource = gram.tab.c From lattner at cs.uiuc.edu Sun Oct 5 14:29:19 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:29:19 2003 Subject: [llvm-commits] CVS: llvm/utils/TableGen/Makefile Message-ID: <200310051928.OAA11353@apoc.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: Makefile updated: 1.7 -> 1.8 --- Log message: Move support/tools/* back into utils --- Diffs of the changes: Index: llvm/utils/TableGen/Makefile diff -u llvm/utils/TableGen/Makefile:1.7 llvm/utils/TableGen/Makefile:1.8 --- llvm/utils/TableGen/Makefile:1.7 Mon Sep 29 09:48:29 2003 +++ llvm/utils/TableGen/Makefile Sun Oct 5 14:27:59 2003 @@ -1,4 +1,4 @@ -LEVEL = ../../.. +LEVEL = ../.. TOOLNAME = tblgen USEDLIBS = support.a From lattner at cs.uiuc.edu Sun Oct 5 14:29:29 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:29:29 2003 Subject: [llvm-commits] CVS: llvm/Makefile Message-ID: <200310051928.OAA11366@apoc.cs.uiuc.edu> Changes in directory llvm: Makefile updated: 1.7 -> 1.8 --- Log message: Revert back to keeping Burg and TableGen in the utils directory --- Diffs of the changes: Index: llvm/Makefile diff -u llvm/Makefile:1.7 llvm/Makefile:1.8 --- llvm/Makefile:1.7 Mon Sep 29 09:52:28 2003 +++ llvm/Makefile Sun Oct 5 14:28:27 2003 @@ -1,5 +1,5 @@ LEVEL = . -DIRS = support lib tools runtime +DIRS = lib/Support utils lib tools runtime OPTIONAL_DIRS = projects include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Oct 5 14:29:38 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:29:38 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk/Makefile Message-ID: <200310051928.OAA12098@apoc.cs.uiuc.edu> Changes in directory llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk: Makefile updated: 1.1 -> 1.2 --- Log message: Update arguments --- Diffs of the changes: Index: llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk/Makefile diff -u llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk/Makefile:1.1 llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk/Makefile:1.2 --- llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk/Makefile:1.1 Sat Oct 4 19:09:33 2003 +++ llvm/test/Programs/External/SPEC/CINT2000/253.perlbmk/Makefile Sun Oct 5 14:28:48 2003 @@ -1,5 +1,5 @@ LEVEL = ../../../../../.. -#RUN_OPTIONS = `cat $(REF_IN_DIR)control` -#STDOUT_FILENAME := input.compressed.out +RUN_OPTIONS = $(RUN_TYPE).pl +STDOUT_FILENAME := $(RUN_TYPE).out CPPFLAGS = -DSPEC_CPU2000_LINUX -Dbool=char -DI_TIME -DI_SYS_TIME include ../../Makefile.spec From lattner at cs.uiuc.edu Sun Oct 5 14:33:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:33:01 2003 Subject: [llvm-commits] CVS: llvm/support/Makefile Message-ID: <200310051932.OAA18325@apoc.cs.uiuc.edu> Changes in directory llvm/support: Makefile (r1.1) removed --- Log message: Move support/lib into lib/Support Move support/tools into utils --- Diffs of the changes: From lattner at cs.uiuc.edu Sun Oct 5 14:33:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:33:10 2003 Subject: [llvm-commits] CVS: llvm/support/lib/Makefile Message-ID: <200310051932.OAA18508@apoc.cs.uiuc.edu> Changes in directory llvm/support/lib: Makefile (r1.1) removed --- Log message: Move support/lib into lib/Support Move support/tools into utils --- Diffs of the changes: From lattner at cs.uiuc.edu Sun Oct 5 14:33:20 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:33:20 2003 Subject: [llvm-commits] CVS: llvm/support/lib/Support/Annotation.cpp CommandLine.cpp ConstantRange.cpp Debug.cpp FileUtilities.cpp LeakDetector.cpp Makefile Mangler.cpp PluginLoader.cpp Signals.cpp Statistic.cpp SystemUtils.cpp Timer.cpp ToolRunner.cpp ValueHolder.cpp Message-ID: <200310051932.OAA18604@apoc.cs.uiuc.edu> Changes in directory llvm/support/lib/Support: Annotation.cpp (r1.9) removed CommandLine.cpp (r1.38) removed ConstantRange.cpp (r1.5) removed Debug.cpp (r1.2) removed FileUtilities.cpp (r1.7) removed LeakDetector.cpp (r1.3) removed Makefile (r1.4) removed Mangler.cpp (r1.5) removed PluginLoader.cpp (r1.4) removed Signals.cpp (r1.8) removed Statistic.cpp (r1.10) removed SystemUtils.cpp (r1.16) removed Timer.cpp (r1.24) removed ToolRunner.cpp (r1.1) removed ValueHolder.cpp (r1.1) removed --- Log message: Move support/lib into lib/Support Move support/tools into utils --- Diffs of the changes: From lattner at cs.uiuc.edu Sun Oct 5 14:33:29 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:33:29 2003 Subject: [llvm-commits] CVS: llvm/support/tools/Makefile Message-ID: <200310051932.OAA18610@apoc.cs.uiuc.edu> Changes in directory llvm/support/tools: Makefile (r1.1) removed --- Log message: Move support/lib into lib/Support Move support/tools into utils --- Diffs of the changes: From lattner at cs.uiuc.edu Sun Oct 5 14:33:39 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:33:39 2003 Subject: [llvm-commits] CVS: llvm/support/tools/Burg/COPYRIGHT LOG_CHANGES Makefile README b.h be.c burg.shar.gz burs.c closure.c delta.c fe.c fe.h gram.yc item.c lex.c list.c main.c map.c nonterminal.c operator.c pattern.c plank.c queue.c rule.c sample.gr string.c symtab.c table.c trim.c zalloc.c Message-ID: <200310051932.OAA18708@apoc.cs.uiuc.edu> Changes in directory llvm/support/tools/Burg: COPYRIGHT (r1.1) removed LOG_CHANGES (r1.2) removed Makefile (r1.21) removed README (r1.1) removed b.h (r1.2) removed be.c (r1.3) removed burg.shar.gz (r1.1) removed burs.c (r1.1) removed closure.c (r1.1) removed delta.c (r1.1) removed fe.c (r1.1) removed fe.h (r1.3) removed gram.yc (r1.2) removed item.c (r1.1) removed lex.c (r1.2) removed list.c (r1.1) removed main.c (r1.2) removed map.c (r1.2) removed nonterminal.c (r1.2) removed operator.c (r1.1) removed pattern.c (r1.1) removed plank.c (r1.3) removed queue.c (r1.1) removed rule.c (r1.1) removed sample.gr (r1.1) removed string.c (r1.1) removed symtab.c (r1.1) removed table.c (r1.1) removed trim.c (r1.1) removed zalloc.c (r1.2) removed --- Log message: Move support/lib into lib/Support Move support/tools into utils --- Diffs of the changes: From lattner at cs.uiuc.edu Sun Oct 5 14:33:48 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:33:48 2003 Subject: [llvm-commits] CVS: llvm/support/tools/Burg/Doc/Makefile doc.aux doc.dvi doc.log doc.tex Message-ID: <200310051932.OAA18889@apoc.cs.uiuc.edu> Changes in directory llvm/support/tools/Burg/Doc: Makefile (r1.1) removed doc.aux (r1.1) removed doc.dvi (r1.1) removed doc.log (r1.1) removed doc.tex (r1.1) removed --- Log message: Move support/lib into lib/Support Move support/tools into utils --- Diffs of the changes: From lattner at cs.uiuc.edu Sun Oct 5 14:33:58 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:33:58 2003 Subject: [llvm-commits] CVS: llvm/support/tools/TableGen/CodeEmitterGen.cpp CodeEmitterGen.h CodeGenWrappers.cpp CodeGenWrappers.h FileLexer.l FileParser.y InstrInfoEmitter.cpp InstrInfoEmitter.h InstrSelectorEmitter.cpp InstrSelectorEmitter.h Makefile Record.cpp Record.h RegisterInfoEmitter.cpp RegisterInfoEmitter.h TableGen.cpp TableGenBackend.cpp TableGenBackend.h Message-ID: <200310051932.OAA18934@apoc.cs.uiuc.edu> Changes in directory llvm/support/tools/TableGen: CodeEmitterGen.cpp (r1.27) removed CodeEmitterGen.h (r1.8) removed CodeGenWrappers.cpp (r1.3) removed CodeGenWrappers.h (r1.5) removed FileLexer.l (r1.15) removed FileParser.y (r1.23) removed InstrInfoEmitter.cpp (r1.4) removed InstrInfoEmitter.h (r1.3) removed InstrSelectorEmitter.cpp (r1.34) removed InstrSelectorEmitter.h (r1.21) removed Makefile (r1.7) removed Record.cpp (r1.28) removed Record.h (r1.36) removed RegisterInfoEmitter.cpp (r1.12) removed RegisterInfoEmitter.h (r1.4) removed TableGen.cpp (r1.21) removed TableGenBackend.cpp (r1.3) removed TableGenBackend.h (r1.4) removed --- Log message: Move support/lib into lib/Support Move support/tools into utils --- Diffs of the changes: From lattner at cs.uiuc.edu Sun Oct 5 14:35:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:35:01 2003 Subject: [llvm-commits] CVS: llvm/utils/getsrcs.sh Message-ID: <200310051933.OAA22443@apoc.cs.uiuc.edu> Changes in directory llvm/utils: getsrcs.sh updated: 1.10 -> 1.11 --- Log message: The support directory no longer exists --- Diffs of the changes: Index: llvm/utils/getsrcs.sh diff -u llvm/utils/getsrcs.sh:1.10 llvm/utils/getsrcs.sh:1.11 --- llvm/utils/getsrcs.sh:1.10 Wed Oct 1 16:12:46 2003 +++ llvm/utils/getsrcs.sh Sun Oct 5 14:33:27 2003 @@ -1,7 +1,7 @@ #!/bin/sh # This is useful because it prints out all of the source files. Useful for # greps. -find support www include lib tools utils -name \*.\[cdhyl\]\* | grep -v Lexer.cpp | \ +find www include lib tools utils -name \*.\[cdhyl\]\* | grep -v Lexer.cpp | \ grep -v llvmAsmParser.cpp | grep -v llvmAsmParser.h | grep -v '~$' | \ grep -v '\.ll$' | grep -v .flc | grep -v Sparc.burm.c | grep -v '\.d$' |\ grep -v '\.dir$' | grep -v www/docs/doxygen | grep -v include/boost | \ From lattner at cs.uiuc.edu Sun Oct 5 14:35:11 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:35:11 2003 Subject: [llvm-commits] CVS: llvm/support/tools/Burg/.cvsignore Message-ID: <200310051933.OAA20839@apoc.cs.uiuc.edu> Changes in directory llvm/support/tools/Burg: .cvsignore (r1.2) removed --- Log message: Oops, missed the . files --- Diffs of the changes: From lattner at cs.uiuc.edu Sun Oct 5 14:35:20 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 14:35:20 2003 Subject: [llvm-commits] CVS: llvm/support/tools/TableGen/.cvsignore Message-ID: <200310051933.OAA20845@apoc.cs.uiuc.edu> Changes in directory llvm/support/tools/TableGen: .cvsignore (r1.1) removed --- Log message: Oops, missed the . files --- Diffs of the changes: From lattner at cs.uiuc.edu Sun Oct 5 15:55:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 15:55:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200310052054.PAA15404@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.51 -> 1.52 --- Log message: Speed up the mem2reg transform for allocas which are only read/written in a single basic block. This is amazingly common in code generated by the C/C++ front-ends. This change makes it not have to insert ANY phi nodes, whereas before it would insert a ton of dead ones which DCE would have to clean up. Thus, this fix improves compile-time performance of these trivial allocas in two ways: 1. It doesn't have to do the walking and book-keeping for renaming 2. It does not insert dead phi nodes for them which would have to subsequently be cleaned up. On my favorite testcase from 252.eon, this special case handles 305 out of 356 promoted allocas in the function. It speeds up the mem2reg pass from 7.5256s to 1.2505s. It inserts 677 fewer dead PHI nodes, which speeds up a subsequent -dce pass from 18.7524s to 2.4806s. There are still 120 trivially dead PHI nodes being inserted for variables used in multiple basic blocks, but they are not handled by this patch. --- Diffs of the changes: Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.51 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.52 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.51 Sun Oct 5 00:34:39 2003 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sun Oct 5 15:54:03 2003 @@ -38,11 +38,10 @@ return true; } - namespace { struct PromoteMem2Reg { // Allocas - The alloca instructions being promoted - const std::vector &Allocas; + std::vector Allocas; DominanceFrontier &DF; const TargetData &TD; @@ -62,6 +61,8 @@ void run(); private: + void PromoteLocallyUsedAlloca(AllocaInst *AI); + void RenamePass(BasicBlock *BB, BasicBlock *Pred, std::vector &IncVals); bool QueuePhiNode(BasicBlock *BB, unsigned AllocaIdx, unsigned &Version); @@ -79,13 +80,53 @@ assert(Allocas[i]->getParent()->getParent() == &F && "All allocas should be in the same function, which is same as DF!"); + if (AI->use_empty()) { + // If there are no uses of the alloca, just delete it now. + AI->getParent()->getInstList().erase(AI); + + // Remove the alloca from the Allocas list, since it has been processed + Allocas[i] = Allocas.back(); + Allocas.pop_back(); + --i; + continue; + } + // Calculate the set of write-locations for each alloca. This is analogous // to counting the number of 'redefinitions' of each variable. std::vector DefiningBlocks; - for (Value::use_iterator U =AI->use_begin(), E = AI->use_end(); U != E; ++U) - if (StoreInst *SI = dyn_cast(cast(*U))) - // jot down the basic-block it came from + + BasicBlock *OnlyBlock = 0; + bool OnlyUsedInOneBlock = true; + + // As we scan the uses of the alloca instruction, keep track of stores, and + // decide whether all of the loads and stores to the alloca are within the + // same basic block. + for (Value::use_iterator U =AI->use_begin(), E = AI->use_end(); U != E;++U){ + Instruction *User = cast(*U); + if (StoreInst *SI = dyn_cast(User)) { + // Remember the basic blocks which define new values for the alloca DefiningBlocks.push_back(SI->getParent()); + } + + if (OnlyUsedInOneBlock) { + if (OnlyBlock == 0) + OnlyBlock = User->getParent(); + else if (OnlyBlock != User->getParent()) + OnlyUsedInOneBlock = false; + } + } + + // If the alloca is only read and written in one basic block, just perform a + // linear sweep over the block to eliminate it. + if (OnlyUsedInOneBlock) { + PromoteLocallyUsedAlloca(AI); + + // Remove the alloca from the Allocas list, since it has been processed + Allocas[i] = Allocas.back(); + Allocas.pop_back(); + --i; + continue; + } AllocaLookup[Allocas[i]] = i; @@ -112,6 +153,9 @@ } } } + + if (Allocas.empty()) + return; // All of the allocas must have been trivial! // Set the incoming values for the basic block to be null values for all of // the alloca's. We do this in case there is a load of a value that has not @@ -194,6 +238,41 @@ } } +// PromoteLocallyUsedAlloca - Many allocas are only used within a single basic +// block. If this is the case, avoid traversing the CFG and inserting a lot of +// potentially useless PHI nodes by just performing a single linear pass over +// the basic block using the Alloca. +// +void PromoteMem2Reg::PromoteLocallyUsedAlloca(AllocaInst *AI) { + assert(!AI->use_empty() && "There are no uses of the alloca!"); + + // Uses of the uninitialized memory location shall get zero... + Value *CurVal = Constant::getNullValue(AI->getAllocatedType()); + + BasicBlock *BB = cast(AI->use_back())->getParent(); + + for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) { + Instruction *Inst = I++; + if (LoadInst *LI = dyn_cast(Inst)) { + if (LI->getOperand(0) == AI) { + // Loads just return the "current value"... + LI->replaceAllUsesWith(CurVal); + BB->getInstList().erase(LI); + } + } else if (StoreInst *SI = dyn_cast(Inst)) { + if (SI->getOperand(1) == AI) { + // Loads just update the "current value"... + CurVal = SI->getOperand(0); + BB->getInstList().erase(SI); + } + } + } + + // After traversing the basic block, there should be no more uses of the + // alloca, remove it now. + assert(AI->use_empty() && "Uses of alloca from more than one BB??"); + AI->getParent()->getInstList().erase(AI); +} // QueuePhiNode - queues a phi-node to be added to a basic-block for a specific // Alloca returns true if there wasn't already a phi-node for that variable From lattner at cs.uiuc.edu Sun Oct 5 16:13:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 16:13:02 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll Message-ID: <200310052112.QAA15674@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/Mem2Reg: 2003-10-05-DeadPHIInsertion.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: Index: llvm/test/Regression/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll diff -c /dev/null llvm/test/Regression/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll:1.1 *** /dev/null Sun Oct 5 16:12:07 2003 --- llvm/test/Regression/Transforms/Mem2Reg/2003-10-05-DeadPHIInsertion.ll Sun Oct 5 16:11:57 2003 *************** *** 0 **** --- 1,21 ---- + ; Mem2reg should not insert dead PHI nodes! The naive algorithm inserts a PHI + ; node in L3, even though there is no load of %A in anything dominated by L3. + + ; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep phi + + void %test(int %B, bool %C) { + %A = alloca int + store int %B, int* %A + br bool %C, label %L1, label %L2 + L1: + store int %B, int* %A + %D = load int* %A + call void %test(int %D, bool false) + br label %L3 + L2: + %E = load int* %A + call void %test(int %E, bool true) + br label %L3 + L3: + ret void + } From lattner at cs.uiuc.edu Sun Oct 5 16:21:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 16:21:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp Mem2Reg.cpp ScalarReplAggregates.cpp Message-ID: <200310052120.QAA17127@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LICM.cpp updated: 1.34 -> 1.35 Mem2Reg.cpp updated: 1.5 -> 1.6 ScalarReplAggregates.cpp updated: 1.14 -> 1.15 --- Log message: Change the interface to PromoteMemToReg to also take a DominatorTree --- Diffs of the changes: Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.34 llvm/lib/Transforms/Scalar/LICM.cpp:1.35 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.34 Thu Sep 11 11:26:10 2003 +++ llvm/lib/Transforms/Scalar/LICM.cpp Sun Oct 5 16:20:02 2003 @@ -63,6 +63,7 @@ private: LoopInfo *LI; // Current LoopInfo AliasAnalysis *AA; // Current AliasAnalysis information + DominanceFrontier *DF; // Current Dominance Frontier bool Changed; // Set to true when we change anything. BasicBlock *Preheader; // The preheader block of the current loop... Loop *CurLoop; // The current loop we are working on... @@ -173,6 +174,7 @@ // Get our Loop and Alias Analysis information... LI = &getAnalysis(); AA = &getAnalysis(); + DF = &getAnalysis(); DT = &getAnalysis(); // Hoist expressions out of all of the top-level loops. @@ -405,8 +407,7 @@ PromotedAllocas.reserve(PromotedValues.size()); for (unsigned i = 0, e = PromotedValues.size(); i != e; ++i) PromotedAllocas.push_back(PromotedValues[i].first); - PromoteMemToReg(PromotedAllocas, getAnalysis(), - AA->getTargetData()); + PromoteMemToReg(PromotedAllocas, *DT, *DF, AA->getTargetData()); } /// findPromotableValuesInLoop - Check the current loop for stores to definite Index: llvm/lib/Transforms/Scalar/Mem2Reg.cpp diff -u llvm/lib/Transforms/Scalar/Mem2Reg.cpp:1.5 llvm/lib/Transforms/Scalar/Mem2Reg.cpp:1.6 --- llvm/lib/Transforms/Scalar/Mem2Reg.cpp:1.5 Sat Sep 20 09:38:50 2003 +++ llvm/lib/Transforms/Scalar/Mem2Reg.cpp Sun Oct 5 16:20:02 2003 @@ -25,6 +25,7 @@ // getAnalysisUsage - We need dominance frontiers // virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); AU.addRequired(); AU.addRequired(); AU.setPreservesCFG(); @@ -41,6 +42,9 @@ BasicBlock &BB = F.getEntryBlock(); // Get the entry node for the function bool Changed = false; + + DominatorTree &DT = getAnalysis(); + DominanceFrontier &DF = getAnalysis(); while (1) { Allocas.clear(); @@ -54,7 +58,7 @@ if (Allocas.empty()) break; - PromoteMemToReg(Allocas, getAnalysis(), TD); + PromoteMemToReg(Allocas, DT, DF, TD); NumPromoted += Allocas.size(); Changed = true; } Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.14 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.15 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.14 Sat Sep 20 09:38:50 2003 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Sun Oct 5 16:20:02 2003 @@ -38,6 +38,7 @@ // getAnalysisUsage - This pass does not require any passes, but we know it // will not alter the CFG, so say so. virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); AU.addRequired(); AU.addRequired(); AU.setPreservesCFG(); @@ -74,6 +75,8 @@ bool SROA::performPromotion(Function &F) { std::vector Allocas; const TargetData &TD = getAnalysis(); + DominatorTree &DT = getAnalysis(); + DominanceFrontier &DF = getAnalysis(); BasicBlock &BB = F.getEntryBlock(); // Get the entry node for the function @@ -91,7 +94,7 @@ if (Allocas.empty()) break; - PromoteMemToReg(Allocas, getAnalysis(), TD); + PromoteMemToReg(Allocas, DT, DF, TD); NumPromoted += Allocas.size(); Changed = true; } From lattner at cs.uiuc.edu Sun Oct 5 16:21:11 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 16:21:11 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200310052120.QAA17136@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.52 -> 1.53 --- Log message: Change the interface to PromoteMemToReg to also take a DominatorTree --- Diffs of the changes: Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.52 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.53 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.52 Sun Oct 5 15:54:03 2003 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sun Oct 5 16:20:04 2003 @@ -361,7 +361,8 @@ /// of the function at all. All allocas must be from the same function. /// void PromoteMemToReg(const std::vector &Allocas, - DominanceFrontier &DF, const TargetData &TD) { + DominatorTree &DT, DominanceFrontier &DF, + const TargetData &TD) { // If there is nothing to do, bail out... if (Allocas.empty()) return; PromoteMem2Reg(Allocas, DF, TD).run(); From lattner at cs.uiuc.edu Sun Oct 5 16:21:20 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 16:21:20 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h Message-ID: <200310052120.QAA17143@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms/Utils: PromoteMemToReg.h updated: 1.2 -> 1.3 --- Log message: Change the interface to PromoteMemToReg to also take a DominatorTree --- Diffs of the changes: Index: llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h diff -u llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h:1.2 llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h:1.3 --- llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h:1.2 Mon Mar 3 11:25:15 2003 +++ llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h Sun Oct 5 16:20:13 2003 @@ -9,6 +9,7 @@ #define TRANSFORMS_UTILS_PROMOTEMEMTOREG_H class AllocaInst; +class DominatorTree; class DominanceFrontier; class TargetData; #include @@ -24,6 +25,7 @@ /// of the function at all. All allocas must be from the same function. /// void PromoteMemToReg(const std::vector &Allocas, - DominanceFrontier &DF, const TargetData &TD); + DominatorTree &DT, DominanceFrontier &DF, + const TargetData &TD); #endif From lattner at cs.uiuc.edu Sun Oct 5 17:20:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 17:20:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200310052219.RAA19855@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.53 -> 1.54 --- Log message: This changes the PromoteMemToReg function to create "pruned" SSA form, not "minimal" SSA form (in other words, it doesn't insert dead PHIs). This speeds up the mem2reg pass very significantly because it doesn't have to do a lot of frivolous work in many common cases. In the 252.eon function I have been playing with, this doesn't even insert the 120 PHI nodes that it used to which were trivially dead (in the process of promoting 356 alloca instructions overall). This speeds up the mem2reg pass from 1.2459s to 0.1284s. More significantly, the DCE pass used to take 2.4138s to remove the 120 dead PHI nodes that mem2reg constructed, now it takes 0.0134s (which is the time to scan the function and decide that there is nothing dead). So overall, on this one function, we speed things up a total of 3.5179s, which is a 24.8x speedup! :) This change is tested by the Mem2Reg/2003-10-05-DeadPHIInsertion.ll test, which now passes. --- Diffs of the changes: Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.53 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.54 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.53 Sun Oct 5 16:20:04 2003 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sun Oct 5 17:19:20 2003 @@ -4,7 +4,8 @@ // alloca instructions which only have loads and stores as uses. An alloca is // transformed by using dominator frontiers to place PHI nodes, then traversing // the function in depth-first order to rewrite loads and stores as appropriate. -// This is just the standard SSA construction algorithm. +// This is just the standard SSA construction algorithm to construct "pruned" +// SSA form. // //===----------------------------------------------------------------------===// @@ -42,6 +43,7 @@ struct PromoteMem2Reg { // Allocas - The alloca instructions being promoted std::vector Allocas; + DominatorTree &DT; DominanceFrontier &DF; const TargetData &TD; @@ -55,29 +57,33 @@ std::set Visited; public: - PromoteMem2Reg(const std::vector &A, DominanceFrontier &df, - const TargetData &td) : Allocas(A), DF(df), TD(td) {} + PromoteMem2Reg(const std::vector &A, DominatorTree &dt, + DominanceFrontier &df, const TargetData &td) + : Allocas(A), DT(dt), DF(df), TD(td) {} void run(); private: + void MarkDominatingPHILive(BasicBlock *BB, unsigned AllocaNum, + std::set &DeadPHINodes); void PromoteLocallyUsedAlloca(AllocaInst *AI); void RenamePass(BasicBlock *BB, BasicBlock *Pred, std::vector &IncVals); - bool QueuePhiNode(BasicBlock *BB, unsigned AllocaIdx, unsigned &Version); + bool QueuePhiNode(BasicBlock *BB, unsigned AllocaIdx, unsigned &Version, + std::set &InsertedPHINodes); }; } // end of anonymous namespace void PromoteMem2Reg::run() { Function &F = *DF.getRoot()->getParent(); - for (unsigned i = 0; i != Allocas.size(); ++i) { - AllocaInst *AI = Allocas[i]; + for (unsigned AllocaNum = 0; AllocaNum != Allocas.size(); ++AllocaNum) { + AllocaInst *AI = Allocas[AllocaNum]; assert(isAllocaPromotable(AI, TD) && "Cannot promote non-promotable alloca!"); - assert(Allocas[i]->getParent()->getParent() == &F && + assert(AI->getParent()->getParent() == &F && "All allocas should be in the same function, which is same as DF!"); if (AI->use_empty()) { @@ -85,15 +91,17 @@ AI->getParent()->getInstList().erase(AI); // Remove the alloca from the Allocas list, since it has been processed - Allocas[i] = Allocas.back(); + Allocas[AllocaNum] = Allocas.back(); Allocas.pop_back(); - --i; + --AllocaNum; continue; } - // Calculate the set of write-locations for each alloca. This is analogous - // to counting the number of 'redefinitions' of each variable. + // Calculate the set of read and write-locations for each alloca. This is + // analogous to counting the number of 'uses' and 'definitions' of each + // variable. std::vector DefiningBlocks; + std::vector UsingBlocks; BasicBlock *OnlyBlock = 0; bool OnlyUsedInOneBlock = true; @@ -106,6 +114,9 @@ if (StoreInst *SI = dyn_cast(User)) { // Remember the basic blocks which define new values for the alloca DefiningBlocks.push_back(SI->getParent()); + } else { + // Otherwise it must be a load instruction, keep track of variable reads + UsingBlocks.push_back(cast(User)->getParent()); } if (OnlyUsedInOneBlock) { @@ -122,22 +133,17 @@ PromoteLocallyUsedAlloca(AI); // Remove the alloca from the Allocas list, since it has been processed - Allocas[i] = Allocas.back(); + Allocas[AllocaNum] = Allocas.back(); Allocas.pop_back(); - --i; + --AllocaNum; continue; } - AllocaLookup[Allocas[i]] = i; - - // PhiNodeBlocks - A list of blocks that phi nodes have been inserted for - // this alloca. - std::vector PhiNodeBlocks; - // Compute the locations where PhiNodes need to be inserted. Look at the // dominance frontier of EACH basic-block we have a write in. // unsigned CurrentVersion = 0; + std::set InsertedPHINodes; while (!DefiningBlocks.empty()) { BasicBlock *BB = DefiningBlocks.back(); DefiningBlocks.pop_back(); @@ -148,10 +154,45 @@ const DominanceFrontier::DomSetType &S = it->second; for (DominanceFrontier::DomSetType::iterator P = S.begin(),PE = S.end(); P != PE; ++P) - if (QueuePhiNode(*P, i, CurrentVersion)) + if (QueuePhiNode(*P, AllocaNum, CurrentVersion, InsertedPHINodes)) DefiningBlocks.push_back(*P); } } + + // Now that we have inserted PHI nodes along the Iterated Dominance Frontier + // of the writes to the variable, scan through the reads of the variable, + // marking PHI nodes which are actually necessary as alive (by removing them + // from the InsertedPHINodes set). This is not perfect: there may PHI + // marked alive because of loads which are dominated by stores, but there + // will be no unmarked PHI nodes which are actually used. + // + for (unsigned i = 0, e = UsingBlocks.size(); i != e; ++i) + MarkDominatingPHILive(UsingBlocks[i], AllocaNum, InsertedPHINodes); + UsingBlocks.clear(); + + // If there are any PHI nodes which are now known to be dead, remove them! + for (std::set::iterator I = InsertedPHINodes.begin(), + E = InsertedPHINodes.end(); I != E; ++I) { + PHINode *PN = *I; + std::vector &BBPNs = NewPhiNodes[PN->getParent()]; + BBPNs[AllocaNum] = 0; + + // Check to see if we just removed the last inserted PHI node from this + // basic block. If so, remove the entry for the basic block. + bool HasOtherPHIs = false; + for (unsigned i = 0, e = BBPNs.size(); i != e; ++i) + if (BBPNs[i]) { + HasOtherPHIs = true; + break; + } + if (!HasOtherPHIs) + NewPhiNodes.erase(PN->getParent()); + + PN->getParent()->getInstList().erase(PN); + } + + // Keep the reverse mapping of the 'Allocas' array. + AllocaLookup[Allocas[AllocaNum]] = AllocaNum; } if (Allocas.empty()) @@ -215,7 +256,7 @@ // Now we loop through all BB's which have entries in FirstPHI and remove // them from the Preds list. for (unsigned i = 0, e = FirstPHI->getNumIncomingValues(); i != e; ++i) { - // Do a log(n) search of teh Preds list for the entry we want. + // Do a log(n) search of the Preds list for the entry we want. std::vector::iterator EntIt = std::lower_bound(Preds.begin(), Preds.end(), FirstPHI->getIncomingBlock(i)); @@ -238,6 +279,43 @@ } } +// MarkDominatingPHILive - Mem2Reg wants to construct "pruned" SSA form, not +// "minimal" SSA form. To do this, it inserts all of the PHI nodes on the IDF +// as usual (inserting the PHI nodes in the DeadPHINodes set), then processes +// each read of the variable. For each block that reads the variable, this +// function is called, which removes used PHI nodes from the DeadPHINodes set. +// After all of the reads have been processed, any PHI nodes left in the +// DeadPHINodes set are removed. +// +void PromoteMem2Reg::MarkDominatingPHILive(BasicBlock *BB, unsigned AllocaNum, + std::set &DeadPHINodes) { + // Scan the immediate dominators of this block looking for a block which has a + // PHI node for Alloca num. If we find it, mark the PHI node as being alive! + for (DominatorTree::Node *N = DT[BB]; N; N = N->getIDom()) { + BasicBlock *DomBB = N->getBlock(); + std::map >::iterator + I = NewPhiNodes.find(DomBB); + if (I != NewPhiNodes.end() && I->second[AllocaNum]) { + // Ok, we found an inserted PHI node which dominates this value. + PHINode *DominatingPHI = I->second[AllocaNum]; + + // Find out if we previously thought it was dead. + std::set::iterator DPNI = DeadPHINodes.find(DominatingPHI); + if (DPNI != DeadPHINodes.end()) { + // Ok, until now, we thought this PHI node was dead. Mark it as being + // alive/needed. + DeadPHINodes.erase(DPNI); + + // Now that we have marked the PHI node alive, also mark any PHI nodes + // which it might use as being alive as well. + for (pred_iterator PI = pred_begin(DomBB), PE = pred_end(DomBB); + PI != PE; ++PI) + MarkDominatingPHILive(*PI, AllocaNum, DeadPHINodes); + } + } + } +} + // PromoteLocallyUsedAlloca - Many allocas are only used within a single basic // block. If this is the case, avoid traversing the CFG and inserting a lot of // potentially useless PHI nodes by just performing a single linear pass over @@ -278,7 +356,8 @@ // Alloca returns true if there wasn't already a phi-node for that variable // bool PromoteMem2Reg::QueuePhiNode(BasicBlock *BB, unsigned AllocaNo, - unsigned &Version) { + unsigned &Version, + std::set &InsertedPHINodes) { // Look up the basic-block in question std::vector &BBPNs = NewPhiNodes[BB]; if (BBPNs.empty()) BBPNs.resize(Allocas.size()); @@ -291,9 +370,15 @@ BBPNs[AllocaNo] = new PHINode(Allocas[AllocaNo]->getAllocatedType(), Allocas[AllocaNo]->getName() + "." + utostr(Version++), BB->begin()); + InsertedPHINodes.insert(BBPNs[AllocaNo]); return true; } + +// RenamePass - Recursively traverse the CFG of the function, renaming loads and +// stores to the allocas which we are promoting. IncomingVals indicates what +// value each Alloca contains on exit from the predecessor block Pred. +// void PromoteMem2Reg::RenamePass(BasicBlock *BB, BasicBlock *Pred, std::vector &IncomingVals) { @@ -347,7 +432,7 @@ } } - // Recurse to our successors + // Recurse to our successors. TerminatorInst *TI = BB->getTerminator(); for (unsigned i = 0; i != TI->getNumSuccessors(); i++) { std::vector OutgoingVals(IncomingVals); @@ -365,5 +450,5 @@ const TargetData &TD) { // If there is nothing to do, bail out... if (Allocas.empty()) return; - PromoteMem2Reg(Allocas, DF, TD).run(); + PromoteMem2Reg(Allocas, DT, DF, TD).run(); } From lattner at cs.uiuc.edu Sun Oct 5 21:10:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 21:10:02 2003 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200310060209.VAA22582@apoc.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.31 -> 1.32 --- Log message: Changes for the move of the support directory back into utils --- Diffs of the changes: Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.31 llvm/autoconf/configure.ac:1.32 --- llvm/autoconf/configure.ac:1.31 Thu Oct 2 14:02:30 2003 +++ llvm/autoconf/configure.ac Sun Oct 5 21:09:25 2003 @@ -64,6 +64,7 @@ AC_CONFIG_MAKEFILE(lib/ExecutionEngine/Makefile) AC_CONFIG_MAKEFILE(lib/ExecutionEngine/Interpreter/Makefile) AC_CONFIG_MAKEFILE(lib/ExecutionEngine/JIT/Makefile) +AC_CONFIG_MAKEFILE(lib/Support/Makefile) AC_CONFIG_MAKEFILE(lib/Target/Makefile) AC_CONFIG_MAKEFILE(lib/Target/Sparc/Makefile) AC_CONFIG_MAKEFILE(lib/Target/X86/Makefile) @@ -202,6 +203,10 @@ AC_CONFIG_MAKEFILE(tools/llvm-dis/Makefile) AC_CONFIG_MAKEFILE(tools/llvm-link/Makefile) AC_CONFIG_MAKEFILE(tools/opt/Makefile) +AC_CONFIG_MAKEFILE(utils/Makefile) +AC_CONFIG_MAKEFILE(utils/Burg/Makefile) +AC_CONFIG_MAKEFILE(utils/Burg/Doc/Makefile) +AC_CONFIG_MAKEFILE(utils/TableGen/Makefile) AC_CONFIG_MAKEFILE(www/docs/Makefile) AC_CONFIG_MAKEFILE(projects/Makefile) AC_CONFIG_MAKEFILE(projects/sample/Makefile) @@ -215,13 +220,6 @@ AC_CONFIG_MAKEFILE(projects/ModuleMaker/Makefile.common) AC_CONFIG_MAKEFILE(projects/ModuleMaker/tools/Makefile) AC_CONFIG_MAKEFILE(projects/ModuleMaker/tools/ModuleMaker/Makefile) -AC_CONFIG_MAKEFILE(support/Makefile) -AC_CONFIG_MAKEFILE(support/lib/Makefile) -AC_CONFIG_MAKEFILE(support/lib/Support/Makefile) -AC_CONFIG_MAKEFILE(support/tools/Makefile) -AC_CONFIG_MAKEFILE(support/tools/Burg/Makefile) -AC_CONFIG_MAKEFILE(support/tools/Burg/Doc/Makefile) -AC_CONFIG_MAKEFILE(support/tools/TableGen/Makefile) dnl ************************************************************************** dnl * Determine which system we are building on From lattner at cs.uiuc.edu Sun Oct 5 21:14:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Oct 5 21:14:01 2003 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200310060213.VAA22608@apoc.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.39 -> 1.40 --- Log message: Hand update the configure script for moved directories --- Diffs of the changes: Index: llvm/configure diff -u llvm/configure:1.39 llvm/configure:1.40 --- llvm/configure:1.39 Thu Oct 2 14:02:28 2003 +++ llvm/configure Sun Oct 5 21:13:00 2003 @@ -2058,25 +2058,19 @@ ac_config_commands="$ac_config_commands projects/ModuleMaker/tools/ModuleMaker/Makefile" - ac_config_commands="$ac_config_commands support/Makefile" + ac_config_commands="$ac_config_commands lib/Support/Makefile" - ac_config_commands="$ac_config_commands support/lib/Makefile" + ac_config_commands="$ac_config_commands utils/Makefile" - ac_config_commands="$ac_config_commands support/lib/Support/Makefile" + ac_config_commands="$ac_config_commands utils/Burg/Makefile" - ac_config_commands="$ac_config_commands support/tools/Makefile" + ac_config_commands="$ac_config_commands utils/Burg/Doc/Makefile" - ac_config_commands="$ac_config_commands support/tools/Burg/Makefile" - - - ac_config_commands="$ac_config_commands support/tools/Burg/Doc/Makefile" - - - ac_config_commands="$ac_config_commands support/tools/TableGen/Makefile" + ac_config_commands="$ac_config_commands utils/TableGen/Makefile" @@ -23531,13 +23525,11 @@ ${srcdir}/autoconf/mkinstalldirs `dirname projects/ModuleMaker/Makefile.common` ${srcdir}/autoconf/mkinstalldirs `dirname projects/ModuleMaker/tools/Makefile` ${srcdir}/autoconf/mkinstalldirs `dirname projects/ModuleMaker/tools/ModuleMaker/Makefile` -${srcdir}/autoconf/mkinstalldirs `dirname support/Makefile` -${srcdir}/autoconf/mkinstalldirs `dirname support/lib/Makefile` -${srcdir}/autoconf/mkinstalldirs `dirname support/lib/Support/Makefile` -${srcdir}/autoconf/mkinstalldirs `dirname support/tools/Makefile` -${srcdir}/autoconf/mkinstalldirs `dirname support/tools/Burg/Makefile` -${srcdir}/autoconf/mkinstalldirs `dirname support/tools/Burg/Doc/Makefile` -${srcdir}/autoconf/mkinstalldirs `dirname support/tools/TableGen/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname lib/Support/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname utils/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname utils/Burg/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname utils/Burg/Doc/Makefile` +${srcdir}/autoconf/mkinstalldirs `dirname utils/TableGen/Makefile` _ACEOF @@ -23722,13 +23714,11 @@ "projects/ModuleMaker/Makefile.common" ) CONFIG_COMMANDS="$CONFIG_COMMANDS projects/ModuleMaker/Makefile.common" ;; "projects/ModuleMaker/tools/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS projects/ModuleMaker/tools/Makefile" ;; "projects/ModuleMaker/tools/ModuleMaker/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS projects/ModuleMaker/tools/ModuleMaker/Makefile" ;; - "support/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS support/Makefile" ;; - "support/lib/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS support/lib/Makefile" ;; - "support/lib/Support/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS support/lib/Support/Makefile" ;; - "support/tools/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS support/tools/Makefile" ;; - "support/tools/Burg/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS support/tools/Burg/Makefile" ;; - "support/tools/Burg/Doc/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS support/tools/Burg/Doc/Makefile" ;; - "support/tools/TableGen/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS support/tools/TableGen/Makefile" ;; + "lib/Support/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Support/Makefile" ;; + "utils/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS utils/Makefile" ;; + "utils/Burg/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS utils/Burg/Makefile" ;; + "utils/Burg/Doc/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS utils/Burg/Doc/Makefile" ;; + "utils/TableGen/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS utils/TableGen/Makefile" ;; "include/Config/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/Config/config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} @@ -24544,13 +24534,11 @@ projects/ModuleMaker/Makefile.common ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/projects/ModuleMaker/Makefile.common projects/ModuleMaker/Makefile.common ;; projects/ModuleMaker/tools/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/projects/ModuleMaker/tools/Makefile projects/ModuleMaker/tools/Makefile ;; projects/ModuleMaker/tools/ModuleMaker/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/projects/ModuleMaker/tools/ModuleMaker/Makefile projects/ModuleMaker/tools/ModuleMaker/Makefile ;; - support/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/Makefile support/Makefile ;; - support/lib/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/lib/Makefile support/lib/Makefile ;; - support/lib/Support/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/lib/Support/Makefile support/lib/Support/Makefile ;; - support/tools/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/tools/Makefile support/tools/Makefile ;; - support/tools/Burg/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/tools/Burg/Makefile support/tools/Burg/Makefile ;; - support/tools/Burg/Doc/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/tools/Burg/Doc/Makefile support/tools/Burg/Doc/Makefile ;; - support/tools/TableGen/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/support/tools/TableGen/Makefile support/tools/TableGen/Makefile ;; + lib/Support/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Support/Makefile lib/Support/Makefile ;; + utils/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/utils/Makefile utils/Makefile ;; + utils/Burg/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/utils/Burg/Makefile utils/Burg/Makefile ;; + utils/Burg/Doc/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/utils/Burg/Doc/Makefile utils/Burg/Doc/Makefile ;; + utils/TableGen/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/utils/TableGen/Makefile utils/TableGen/Makefile ;; esac done _ACEOF From gaeke at cs.uiuc.edu Sun Oct 5 22:31:02 2003 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Sun Oct 5 22:31:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Message-ID: <200310060330.WAA26292@psmith.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReaderWrappers.cpp updated: 1.11 -> 1.12 --- Log message: All of our supported operating systems (so far) and FreeBSD technically want you to include for fstat(), struct stat, and friends. --- Diffs of the changes: Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.11 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.12 --- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.11 Sat Oct 4 15:14:40 2003 +++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Sun Oct 5 22:30:28 2003 @@ -8,6 +8,7 @@ #include "ReaderInternals.h" #include "Support/StringExtras.h" #include "Config/fcntl.h" +#include #include "Config/unistd.h" #include "Config/sys/mman.h"