[llvm-commits] CVS: llvm/docs/CFEBuildInstrs.html
Changes in directory llvm/docs: CFEBuildInstrs.html updated: 1.59 -> 1.60 --- Log message: Cleaned up the document. Added "doc_code" divisions for code examples. --- Diffs of the changes: (+283 -208) CFEBuildInstrs.html | 490 ++-- 1 files changed, 283 insertions(+), 207 deletions(-) Index: llvm/docs/CFEBuildInstrs.html diff -u llvm/docs/CFEBuildInstrs.html:1.59 llvm/docs/CFEBuildInstrs.html:1.60 --- llvm/docs/CFEBuildInstrs.html:1.59 Mon Jul 31 16:37:55 2006 +++ llvm/docs/CFEBuildInstrs.html Thu Nov 16 03:31:19 2006 @@ -36,22 +36,24 @@ -This document is intended to explain the process of building the -LLVM C/C++ front-end from its source code. You have to do this, for example, if -you are porting LLVM to a new architecture or operating system, if you are -working from Top-Of-Tree CVS/SVN, or if there is no precompiled snapshot -available. -NOTE: This is currently a somewhat fragile, error-prone -process, and you should only try to do it if: +This document is intended to explain the process of building the LLVM C/C++ +front-end from its source code. You have to do this, for example, if you are +porting LLVM to a new architecture or operating system, if you are working from +Top-Of-Tree CVS/SVN, or if there is no precompiled snapshot available. + +NOTE: This is currently a somewhat fragile, error-prone process, and +you should only try to do it if: - you really, really, really can't use the binaries we distribute + you really, really, really can't use the + binaries we distribute you are an elite GCC hacker. you want to use the latest bits from CVS. We welcome patches to help make this process simpler. + @@ -61,38 +63,48 @@ + If you are building LLVM and the GCC front-end under Cygwin, please note that the LLVM and GCC makefiles do not correctly handle spaces in paths. To deal -with this issue, make sure that your LLVM and GCC source and build trees are -located in a top-level directory (like /cygdrive/c/llvm and +with this issue, make sure that your LLVM and GCC source and build trees are +located in a top-level directory (like /cygdrive/c/llvm and /cygdrive/c/llvm-cfrontend), not in a directory that contains a space -(which includes your "home directory", because it lives under the "Documents -and Settings" directory). We welcome patches to fix this issue. - +(which includes your "home directory", because it lives under the "Documents and +Settings" directory). We welcome patches to fix this issue. + It has been found that the GCC 3.3.3 compiler provided with recent Cygwin versions is incapable of compiling the LLVM GCC front-end correctly. If your -Cygwin -installation includes GCC 3.3.3, we strongly recommend that you download -GCC 3.4.3, build it separately, and use it for compiling the LLVM GCC front-end. - This has been -shown to work correctly. +Cygwin installation includes GCC 3.3.3, we strongly recommend that you +download GCC 3.4.3, build it separately, and use it for compiling the LLVM GCC +front-end. This has been shown to work correctly. + Some versions of Cygwin utilize an experimental version of GNU binutils that will cause the GNU ld linker to fail an assertion when linking components of the libstdc++. It is recommended that you replace the entire binutils package with version 2.15 such that "ld --version" responds with + + GNU ld version 2.15 -not with: + + +not with: + + GNU ld version 2.15.91 20040725 + + Building under AIX + + If you are building LLVM and the GCC front-end under AIX, do NOT use GNU Binutils. They are not stable under AIX and may produce incorrect and/or -invalid code. Instead, use the system assembler and linker. - +invalid code. Instead, use the system assembler and linker. + @@ -104,33 +116,37 @@ This section describes how to aquire and build llvm-gcc4, which is based on -the GCC 4.0.1 front-end. This front-end supports C, C++, Objective-C, and +the GCC 4.0.1 front-end. This front-end supports C, C++, Objective-C, and Objective-C++. Note that the instructions for building this front-end are -completely different than those for building llvm-gcc3. - +completely different than those for building llvm-gcc3. - -Retrieve the appropriate llvm-gcc4-x.y.source.tar.gz archive from the llvm -web site. -It is also possible to download the sources of the llvm-gcc4 front end from -a read-only mirror using subversion. To check out the code the first time use: - + Retrieve the appropriate llvm-gcc4-x.y.source.tar.gz archive from the + llvm web site. -svn co svn://anonsvn.opensource.apple.com/svn/llvm/trunk -dst-directory + It is also possible to download the sources of the llvm-gcc4 front end + from a read-only mirror using subversion. To check out the code the + first time use: -After that, the code can be be updated in the destination directory using; - + + +svn co svn://anonsvn.o
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCBranchSelector.cpp updated: 1.29 -> 1.30 --- Log message: add a statistic --- Diffs of the changes: (+6 -1) PPCBranchSelector.cpp |7 ++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.29 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.30 --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.29 Fri Oct 13 12:56:02 2006 +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Thu Nov 16 12:13:49 2006 @@ -19,12 +19,16 @@ #include "PPCInstrBuilder.h" #include "PPCInstrInfo.h" #include "llvm/CodeGen/MachineFunctionPass.h" -#include "llvm/Support/Compiler.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetAsmInfo.h" +#include "llvm/ADT/Statistic.h" +#include "llvm/Support/Compiler.h" #include using namespace llvm; +static Statistic<> NumExpanded("ppc-branch-select", + "Num branches expanded to long format"); + namespace { struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass { /// OffsetMap - Mapping between BB and byte offset from start of function. @@ -131,6 +135,7 @@ BuildMI(*MBB, MBBJ, Opcode, 2).addReg(CRReg).addMBB(trueMBB); } else { // Long branch, skip next branch instruction (i.e. $PC+8). + ++NumExpanded; BuildMI(*MBB, MBBJ, Inverted, 2).addReg(CRReg).addImm(2); BuildMI(*MBB, MBBJ, PPC::B, 1).addMBB(trueMBB); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/findmisopt
Changes in directory llvm/utils: findmisopt updated: 1.5 -> 1.6 --- Log message: Use a release version of bugpoint, if found. Include gccld passes. --- Diffs of the changes: (+19 -5) findmisopt | 24 +++- 1 files changed, 19 insertions(+), 5 deletions(-) Index: llvm/utils/findmisopt diff -u llvm/utils/findmisopt:1.5 llvm/utils/findmisopt:1.6 --- llvm/utils/findmisopt:1.5 Mon Nov 13 10:08:51 2006 +++ llvm/utils/findmisopt Thu Nov 16 12:32:47 2006 @@ -12,7 +12,9 @@ # uses (in the same order) and will narrow down which optimizations # cause the program either generate different output or return a # different result code. When the passes have been narrowed down, -# bugpoint is invoked to further refine the problem to its origin. +# bugpoint is invoked to further refine the problem to its origin. If a +# release version of bugpoint is available it will be used, otherwise +# debug. # # Usage: # findmisopt bcfile outdir progargs [match] @@ -24,7 +26,7 @@ # is a directory into which intermediate results are placed # progargs # is a single argument containing all the arguments the program needs -# match +# match # if specified to any value causes the result code of the program to # be used to determine success/fail. If not specified success/fail is # determined by diffing the program's output with the non-optimized @@ -35,6 +37,16 @@ exit 1 fi +dir="${0%%/utils/findmisopt}" +if [ -x "$dir/Release/bin/bugpoint" ] ; then + bugpoint="$dir/Release/bin/bugpoint" +elif [ -x "$dir/Debug/bin/bugpoint" ] ; then + bugpoint="$dir/Debug/bin/bugpoint" +else + echo "findmisopt: bugpoint not found" + exit 1 +fi + bcfile="$1" outdir="$2" args="$3" @@ -71,8 +83,9 @@ llc "$bcfile" -o "$s" -f || exit 1 gcc "$s" -o "$prog" -lstdc++ -lc -lm || exit 1 -# Define the list of optimizations to run -all_switches="-verify -lowersetjmp -funcresolve -raiseallocs -simplifycfg -mem2reg -globalopt -globaldce -ipconstprop -deadargelim -instcombine -simplifycfg -prune-eh -inline -simplify-libcalls -argpromotion -raise -tailduplicate -simplifycfg -scalarrepl -instcombine -predsimplify -condprop -tailcallelim -simplifycfg -reassociate -licm -loop-unswitch -instcombine -indvars -loop-unroll -instcombine -load-vn -gcse -sccp -instcombine -condprop -dse -dce -simplifycfg -deadtypeelim -constmerge" +# Define the list of optimizations to run. This comprises the same set of +# optimizations that gccas and gccld run, in the same order. +all_switches="-verify -lowersetjmp -funcresolve -raiseallocs -simplifycfg -mem2reg -globalopt -globaldce -ipconstprop -deadargelim -instcombine -simplifycfg -prune-eh -inline -simplify-libcalls -argpromotion -raise -tailduplicate -simplifycfg -scalarrepl -instcombine -predsimplify -condprop -tailcallelim -simplifycfg -reassociate -licm -loop-unswitch -instcombine -indvars -loop-unroll -instcombine -load-vn -gcse -sccp -instcombine -condprop -dse -dce -simplifycfg -deadtypeelim -constmerge -funcresolve -internalize -ipsccp -globalopt -constmerge -deadargelim -inline -prune-eh -globalopt -globaldce -argpromotion -instcombine -predsimplify -scalarrepl -globalsmodref-aa -licm -load-vn -gcse -dse -instcombine -simplify-cfg -verify" # Current set of switches is empty function tryit { @@ -138,7 +151,8 @@ exit 0 fi echo "Smallest Optimization list=$final" -bpcmd="bugpoint -run-llc --output "$out" --input /dev/null $bcfile $final --args $args" + +bpcmd="$bugpoint -run-llc -disable-loop-extraction --output "$out" --input /dev/null $bcfile $final --args $args" echo "Running: $bpcmd" $bpcmd ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineCodeEmitter.h
Changes in directory llvm/include/llvm/CodeGen: MachineCodeEmitter.h updated: 1.41 -> 1.42 --- Log message: Allow target to specify alignment for function stub. --- Diffs of the changes: (+1 -1) MachineCodeEmitter.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/MachineCodeEmitter.h diff -u llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.41 llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.42 --- llvm/include/llvm/CodeGen/MachineCodeEmitter.h:1.41 Tue Jun 20 19:29:14 2006 +++ llvm/include/llvm/CodeGen/MachineCodeEmitter.h Thu Nov 16 14:02:22 2006 @@ -80,7 +80,7 @@ /// have constant pools, the can only use the other emitByte*/emitWord* /// methods. /// - virtual void startFunctionStub(unsigned StubSize) = 0; + virtual void startFunctionStub(unsigned StubSize, unsigned Alignment = 1) = 0; /// finishFunctionStub - This callback is invoked to terminate a function /// stub. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
Changes in directory llvm/lib/ExecutionEngine/JIT: JITEmitter.cpp updated: 1.118 -> 1.119 --- Log message: Allow target to specify alignment for function stub. --- Diffs of the changes: (+11 -5) JITEmitter.cpp | 16 +++- 1 files changed, 11 insertions(+), 5 deletions(-) Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.118 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.119 --- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.118 Thu Nov 9 13:32:13 2006 +++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Thu Nov 16 14:04:54 2006 @@ -275,7 +275,7 @@ JITMemoryManager(bool useGOT); ~JITMemoryManager(); -inline unsigned char *allocateStub(unsigned StubSize); +inline unsigned char *allocateStub(unsigned StubSize, unsigned Alignment); /// startFunctionBody - When a function starts, allocate a block of free /// executable memory, returning a pointer to it and its actual size. @@ -403,8 +403,11 @@ Blocks.clear(); } -unsigned char *JITMemoryManager::allocateStub(unsigned StubSize) { +unsigned char *JITMemoryManager::allocateStub(unsigned StubSize, + unsigned Alignment) { CurStubPtr -= StubSize; + CurStubPtr = (unsigned char*)(((intptr_t)CurStubPtr) & +~(intptr_t)(Alignment-1)); if (CurStubPtr < StubBase) { // FIXME: allocate a new block std::cerr << "JIT ran out of memory for function stubs!\n"; @@ -700,7 +703,7 @@ void initJumpTableInfo(MachineJumpTableInfo *MJTI); void emitJumpTableInfo(MachineJumpTableInfo *MJTI); -virtual void startFunctionStub(unsigned StubSize); +virtual void startFunctionStub(unsigned StubSize, unsigned Alignment = 1); virtual void* finishFunctionStub(const Function *F); virtual void addRelocation(const MachineRelocation &MR) { @@ -769,6 +772,9 @@ BufferBegin = CurBufferPtr = MemMgr.startFunctionBody(ActualSize); BufferEnd = BufferBegin+ActualSize; + // Ensure the constant pool/jump table info is at least 4-byte aligned. + emitAlignment(16); + emitConstantPool(F.getConstantPool()); initJumpTableInfo(F.getJumpTableInfo()); @@ -928,12 +934,12 @@ } } -void JITEmitter::startFunctionStub(unsigned StubSize) { +void JITEmitter::startFunctionStub(unsigned StubSize, unsigned Alignment) { SavedBufferBegin = BufferBegin; SavedBufferEnd = BufferEnd; SavedCurBufferPtr = CurBufferPtr; - BufferBegin = CurBufferPtr = MemMgr.allocateStub(StubSize); + BufferBegin = CurBufferPtr = MemMgr.allocateStub(StubSize, Alignment); BufferEnd = BufferBegin+StubSize+1; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/ELFWriter.cpp MachOWriter.cpp
Changes in directory llvm/lib/CodeGen: ELFWriter.cpp updated: 1.27 -> 1.28 MachOWriter.cpp updated: 1.6 -> 1.7 --- Log message: Match MachineCodeEmitter changes. --- Diffs of the changes: (+2 -2) ELFWriter.cpp |2 +- MachOWriter.cpp |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/ELFWriter.cpp diff -u llvm/lib/CodeGen/ELFWriter.cpp:1.27 llvm/lib/CodeGen/ELFWriter.cpp:1.28 --- llvm/lib/CodeGen/ELFWriter.cpp:1.27 Thu Nov 2 14:25:49 2006 +++ llvm/lib/CodeGen/ELFWriter.cpp Thu Nov 16 14:04:04 2006 @@ -81,7 +81,7 @@ } /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE! -void startFunctionStub(unsigned StubSize) { +void startFunctionStub(unsigned StubSize, unsigned Alignment = 1) { assert(0 && "JIT specific function called!"); abort(); } Index: llvm/lib/CodeGen/MachOWriter.cpp diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.6 llvm/lib/CodeGen/MachOWriter.cpp:1.7 --- llvm/lib/CodeGen/MachOWriter.cpp:1.6Sun Sep 10 18:03:44 2006 +++ llvm/lib/CodeGen/MachOWriter.cppThu Nov 16 14:04:04 2006 @@ -100,7 +100,7 @@ } /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE! -void startFunctionStub(unsigned StubSize) { +void startFunctionStub(unsigned StubSize, unsigned Alignment = 1) { assert(0 && "JIT specific function called!"); abort(); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/Passes.cpp
Changes in directory llvm/lib/CodeGen: Passes.cpp updated: 1.22 -> 1.23 --- Log message: --- Diffs of the changes: (+0 -1) Passes.cpp |1 - 1 files changed, 1 deletion(-) Index: llvm/lib/CodeGen/Passes.cpp diff -u llvm/lib/CodeGen/Passes.cpp:1.22 llvm/lib/CodeGen/Passes.cpp:1.23 --- llvm/lib/CodeGen/Passes.cpp:1.22Wed Aug 2 19:16:56 2006 +++ llvm/lib/CodeGen/Passes.cpp Thu Nov 16 14:11:33 2006 @@ -14,7 +14,6 @@ #include "llvm/CodeGen/RegAllocRegistry.h" #include "llvm/CodeGen/Passes.h" -#include using namespace llvm; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86JITInfo.cpp
Changes in directory llvm/lib/Target/X86: X86JITInfo.cpp updated: 1.30 -> 1.31 --- Log message: Align stubs on 4 byte boundary. This fixes 447.dealII. --- Diffs of the changes: (+2 -2) X86JITInfo.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86JITInfo.cpp diff -u llvm/lib/Target/X86/X86JITInfo.cpp:1.30 llvm/lib/Target/X86/X86JITInfo.cpp:1.31 --- llvm/lib/Target/X86/X86JITInfo.cpp:1.30 Mon Oct 16 18:44:08 2006 +++ llvm/lib/Target/X86/X86JITInfo.cpp Thu Nov 16 14:13:34 2006 @@ -288,13 +288,13 @@ bool NotCC = Fn != (void*)(intptr_t)X86CompilationCallback; #endif if (NotCC) { -MCE.startFunctionStub(5); +MCE.startFunctionStub(5, 4); MCE.emitByte(0xE9); MCE.emitWordLE((intptr_t)Fn-MCE.getCurrentPCValue()-4); return MCE.finishFunctionStub(0); } - MCE.startFunctionStub(6); + MCE.startFunctionStub(6, 4); MCE.emitByte(0xE8); // Call with 32 bit pc-rel destination... MCE.emitWordLE((intptr_t)Fn-MCE.getCurrentPCValue()-4); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/CodeGen/Passes.cpp
Sorry that there's no log message. It should be: removed unnecessary #include -bw On 11/16/06, Bill Wendling <[EMAIL PROTECTED]> wrote: > > > Changes in directory llvm/lib/CodeGen: > > Passes.cpp updated: 1.22 -> 1.23 > --- > Log message: > > > > --- > Diffs of the changes: (+0 -1) > > Passes.cpp |1 - > 1 files changed, 1 deletion(-) > > > Index: llvm/lib/CodeGen/Passes.cpp > diff -u llvm/lib/CodeGen/Passes.cpp:1.22 llvm/lib/CodeGen/Passes.cpp:1.23 > --- llvm/lib/CodeGen/Passes.cpp:1.22Wed Aug 2 19:16:56 2006 > +++ llvm/lib/CodeGen/Passes.cpp Thu Nov 16 14:11:33 2006 > @@ -14,7 +14,6 @@ > > #include "llvm/CodeGen/RegAllocRegistry.h" > #include "llvm/CodeGen/Passes.h" > -#include > > using namespace llvm; > > > > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp PPCInstr64Bit.td
Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.207 -> 1.208 PPCInstr64Bit.td updated: 1.30 -> 1.31 --- Log message: fix a regression that I introduced. stdu should scale the offset by 4 before printing it. --- Diffs of the changes: (+11 -2) PPCAsmPrinter.cpp | 11 ++- PPCInstr64Bit.td |2 +- 2 files changed, 11 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.207 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.208 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.207 Fri Nov 3 23:27:39 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Thu Nov 16 15:45:30 2006 @@ -127,7 +127,16 @@ O << (unsigned short)MI->getOperand(OpNo).getImmedValue(); } void printS16X4ImmOperand(const MachineInstr *MI, unsigned OpNo) { - O << (short)(MI->getOperand(OpNo).getImmedValue()*4); + if (MI->getOperand(OpNo).isImmediate()) { +O << (short)(MI->getOperand(OpNo).getImmedValue()*4); + } else { +O << "lo16("; +printOp(MI->getOperand(OpNo)); +if (TM.getRelocationModel() == Reloc::PIC_) + O << "-\"L" << getFunctionNumber() << "$pb\")"; +else + O << ')'; + } } void printBranchOperand(const MachineInstr *MI, unsigned OpNo) { // Branches can take an immediate operand. This is used by the branch Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.30 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.31 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.30 Wed Nov 15 18:57:19 2006 +++ llvm/lib/Target/PowerPC/PPCInstr64Bit.tdThu Nov 16 15:45:30 2006 @@ -413,7 +413,7 @@ def STDU : DSForm_1<62, 1, (ops ptr_rc:$ea_res, G8RC:$rS, -symbolLo:$ptroff, ptr_rc:$ptrreg), +s16immX4:$ptroff, ptr_rc:$ptrreg), "stdu $rS, $ptroff($ptrreg)", LdStSTD, [(set ptr_rc:$ea_res, (pre_store G8RC:$rS, ptr_rc:$ptrreg, iaddroff:$ptroff))]>, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/Makefile README.txt
Changes in directory llvm/runtime: Makefile (r1.28) removed README.txt (r1.2) removed --- Log message: In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will be dropped. This patch pertains to removing the runtime directory from LLVM. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/libtrace/Makefile README.txt tracelib.c tracelib.h
Changes in directory llvm/runtime/libtrace: Makefile (r1.14) removed README.txt (r1.1) removed tracelib.c (r1.12) removed tracelib.h (r1.3) removed --- Log message: In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will be dropped. This patch pertains to removing the runtime directory from LLVM. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/GCCLibraries/libc/COPYING.LIB LICENSE.TXT LICENSES Makefile README.txt atox.c io.c qsort.c remove.c string.c
Changes in directory llvm/runtime/GCCLibraries/libc: COPYING.LIB (r1.1) removed LICENSE.TXT (r1.4) removed LICENSES (r1.1) removed Makefile (r1.8) removed README.txt (r1.1) removed atox.c (r1.2) removed io.c (r1.1) removed qsort.c (r1.5) removed remove.c (r1.2) removed string.c (r1.9) removed --- Log message: In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will be dropped. This patch pertains to removing the runtime directory from LLVM. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.cpp
Changes in directory llvm/lib/Target/X86: X86InstrInfo.cpp updated: 1.73 -> 1.74 --- Log message: Fix a potential bug: MOVPDI2DI, etc. are not copy instructions. --- Diffs of the changes: (+1 -3) X86InstrInfo.cpp |4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/lib/Target/X86/X86InstrInfo.cpp diff -u llvm/lib/Target/X86/X86InstrInfo.cpp:1.73 llvm/lib/Target/X86/X86InstrInfo.cpp:1.74 --- llvm/lib/Target/X86/X86InstrInfo.cpp:1.73 Wed Nov 15 14:58:11 2006 +++ llvm/lib/Target/X86/X86InstrInfo.cppThu Nov 16 17:22:26 2006 @@ -44,9 +44,7 @@ oc == X86::FsMOVAPSrr || oc == X86::FsMOVAPDrr || oc == X86::MOVAPSrr || oc == X86::MOVAPDrr || oc == X86::MOVSS2PSrr || oc == X86::MOVSD2PDrr || - oc == X86::MOVPS2SSrr || oc == X86::MOVPD2SDrr || - oc == X86::MOVDI2PDIrr || oc == X86::MOVQI2PQIrr || - oc == X86::MOVPDI2DIrr) { + oc == X86::MOVPS2SSrr || oc == X86::MOVPD2SDrr) { assert(MI.getNumOperands() == 2 && MI.getOperand(0).isRegister() && MI.getOperand(1).isRegister() && ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/GCCLibraries/libm/Makefile temp.c
Changes in directory llvm/runtime/GCCLibraries/libm: Makefile (r1.10) removed temp.c (r1.2) removed --- Log message: In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will be dropped. This patch pertains to removing the runtime directory from LLVM. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/GCCLibraries/Makefile README.txt
Changes in directory llvm/runtime/GCCLibraries: Makefile (r1.8) removed README.txt (r1.1) removed --- Log message: In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will be dropped. This patch pertains to removing the runtime directory from LLVM. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/libdummy/Makefile README.txt dummylib.c
Changes in directory llvm/runtime/libdummy: Makefile (r1.8) removed README.txt (r1.1) removed dummylib.c (r1.6) removed --- Log message: In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will be dropped. This patch pertains to removing the runtime directory from LLVM. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/Makefile Makefile.config.in Makefile.rules configure
Changes in directory llvm: Makefile updated: 1.65 -> 1.66 Makefile.config.in updated: 1.66 -> 1.67 Makefile.rules updated: 1.410 -> 1.411 configure updated: 1.255 -> 1.256 --- Log message: In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will be dropped. This patch pertains to removing the runtime directory from LLVM. --- Diffs of the changes: (+34 -80) Makefile | 13 ++- Makefile.config.in |5 --- Makefile.rules |8 configure | 88 ++--- 4 files changed, 34 insertions(+), 80 deletions(-) Index: llvm/Makefile diff -u llvm/Makefile:1.65 llvm/Makefile:1.66 --- llvm/Makefile:1.65 Sun Sep 3 23:27:07 2006 +++ llvm/Makefile Thu Nov 16 17:17:26 2006 @@ -15,28 +15,23 @@ # 3. Build VMCore, which builds the Intrinsics.inc file used by libs. # 4. Build libs, which are needed by llvm-config. # 5. Build llvm-config, which determines inter-lib dependencies for tools. -# 6. Build tools, runtime, docs. +# 6. Build tools, docs. # DIRS := lib/System lib/Support utils lib/VMCore lib tools/llvm-config \ -tools runtime docs +tools docs OPTIONAL_DIRS := examples projects EXTRA_DIST := test llvm.spec include win32 Xcode include $(LEVEL)/Makefile.config -# llvm-gcc4 doesn't need runtime libs. -ifeq ($(LLVMGCC_MAJVERS),4) - DIRS := $(filter-out runtime, $(DIRS)) -endif - ifeq ($(MAKECMDGOALS),libs-only) - DIRS := $(filter-out tools runtime docs, $(DIRS)) + DIRS := $(filter-out tools docs, $(DIRS)) OPTIONAL_DIRS := endif ifeq ($(MAKECMDGOALS),tools-only) - DIRS := $(filter-out runtime docs, $(DIRS)) + DIRS := $(filter-out docs, $(DIRS)) OPTIONAL_DIRS := endif Index: llvm/Makefile.config.in diff -u llvm/Makefile.config.in:1.66 llvm/Makefile.config.in:1.67 --- llvm/Makefile.config.in:1.66Sun Nov 5 14:10:16 2006 +++ llvm/Makefile.config.in Thu Nov 16 17:17:26 2006 @@ -207,11 +207,6 @@ #DISABLE_ASSERTIONS = 1 @DISABLE_ASSERTIONS@ -# When DEBUG_RUNTIME is enabled, the runtime libraries will retain debug -# symbols. -#DEBUG_RUNTIME = 1 [EMAIL PROTECTED]@ - # When ENABLE_PROFILING is enabled, the llvm source base is built with profile # information to allow gprof to be used to get execution frequencies. #ENABLE_PROFILING = 1 Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.410 llvm/Makefile.rules:1.411 --- llvm/Makefile.rules:1.410 Wed Nov 15 15:04:15 2006 +++ llvm/Makefile.rules Thu Nov 16 17:17:26 2006 @@ -1099,18 +1099,10 @@ $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG) $(MAYBE_PIC_Compile.C) $< -o $@ -S - # make the C and C++ compilers strip debug info out of bytecode libraries. -ifdef DEBUG_RUNTIME -$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(GCCAS) - $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)" - $(Verb) $(GCCAS) $< -o $@ -else $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(GCCAS) $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)" $(Verb) $(GCCAS) -strip-debug $< -o $@ -endif - #- # Provide rule to build .bc files from .ll sources, Index: llvm/configure diff -u llvm/configure:1.255 llvm/configure:1.256 --- llvm/configure:1.255Mon Nov 13 18:59:52 2006 +++ llvm/configure Thu Nov 16 17:17:26 2006 @@ -830,7 +830,6 @@ CVSBUILD ENABLE_OPTIMIZED DISABLE_ASSERTIONS -DEBUG_RUNTIME JIT TARGET_HAS_JIT ENABLE_DOXYGEN @@ -1520,7 +1519,6 @@ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-optimized --enable-assertions - --enable-debug-runtime --enable-jitEnable Just In Time Compiling (default is YES) --enable-doxygenBuild doxygen documentation (default is NO) --enable-threadsUse threads if available (default is YES) @@ -4563,21 +4561,6 @@ fi -# Check whether --enable-debug-runtime was given. -if test "${enable_debug_runtime+set}" = set; then - enableval=$enable_debug_runtime; -else - enableval=no -fi - -if test ${enableval} = "no" ; then - DEBUG_RUNTIME= - -else - DEBUG_RUNTIME=DEBUG_RUNTIME=1 - -fi - # Check whether --enable-jit was given. if test "${enable_jit+set}" = set; then enableval=$enable_jit; @@ -10298,7 +10281,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext + echo '#line 12428 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -14160,11 +14143,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14163: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14146: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - ec
[llvm-commits] CVS: llvm/runtime/libprofile/BasicBlockTracing.c BlockProfiling.c CommonProfiling.c EdgeProfiling.c FunctionProfiling.c Makefile Profiling.h exported_symbols.lst
Changes in directory llvm/runtime/libprofile: BasicBlockTracing.c (r1.2) removed BlockProfiling.c (r1.3) removed CommonProfiling.c (r1.8) removed EdgeProfiling.c (r1.2) removed FunctionProfiling.c (r1.3) removed Makefile (r1.8) removed Profiling.h (r1.5) removed exported_symbols.lst (r1.2) removed --- Log message: In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will be dropped. This patch pertains to removing the runtime directory from LLVM. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/GC/SemiSpace/Makefile semispace.c
Changes in directory llvm/runtime/GC/SemiSpace: Makefile (r1.7) removed semispace.c (r1.5) removed --- Log message: In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will be dropped. This patch pertains to removing the runtime directory from LLVM. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/GCCLibraries/libgcc/Makefile eprintf.c
Changes in directory llvm/runtime/GCCLibraries/libgcc: Makefile (r1.8) removed eprintf.c (r1.1) removed --- Log message: In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will be dropped. This patch pertains to removing the runtime directory from LLVM. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/GC/GCInterface.h Makefile gc_exported_symbols.lst
Changes in directory llvm/runtime/GC: GCInterface.h (r1.4) removed Makefile (r1.3) removed gc_exported_symbols.lst (r1.1) removed --- Log message: In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will be dropped. This patch pertains to removing the runtime directory from LLVM. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/autoconf/configure.ac
Changes in directory llvm/autoconf: configure.ac updated: 1.250 -> 1.251 --- Log message: In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will be dropped. This patch pertains to removing the runtime directory from LLVM. --- Diffs of the changes: (+2 -14) configure.ac | 16 ++-- 1 files changed, 2 insertions(+), 14 deletions(-) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.250 llvm/autoconf/configure.ac:1.251 --- llvm/autoconf/configure.ac:1.250Mon Nov 6 23:31:00 2006 +++ llvm/autoconf/configure.ac Thu Nov 16 17:17:26 2006 @@ -268,15 +268,6 @@ AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]]) fi -dnl --enable-debug-runtime : should runtime libraries have debug symbols? -AC_ARG_ENABLE(debug-runtime, - AS_HELP_STRING([--enable-debug-runtime,Build runtime libs with debug symbols (default is NO)]),,enableval=no) -if test ${enableval} = "no" ; then - AC_SUBST(DEBUG_RUNTIME,[[]]) -else - AC_SUBST(DEBUG_RUNTIME,[[DEBUG_RUNTIME=1]]) -fi - dnl --enable-jit: check whether they want to enable the jit AC_ARG_ENABLE(jit, AS_HELP_STRING(--enable-jit, @@ -820,7 +811,6 @@ AC_CONFIG_MAKEFILE(Makefile.common) AC_CONFIG_MAKEFILE(examples/Makefile) AC_CONFIG_MAKEFILE(lib/Makefile) -AC_CONFIG_MAKEFILE(runtime/Makefile) AC_CONFIG_MAKEFILE(test/Makefile) AC_CONFIG_MAKEFILE(test/Makefile.tests) AC_CONFIG_MAKEFILE(tools/Makefile) @@ -833,8 +823,6 @@ dnl Warn loudly if llvm-gcc was not obviously working if test "$llvm_cv_llvmgcc_sanity" = "no" ; then AC_MSG_WARN([* llvm-gcc/llvm-g++ was not found, or does not appear to be ]) - AC_MSG_WARN([* working. Please make sure you have llvm-gcc and llvm-g++ in]) - AC_MSG_WARN([* your path before configuring LLVM. The runtime libraries]) - AC_MSG_WARN([* (llvm/runtime) will not be built but you should be able to]) - AC_MSG_WARN([* build the llvm tools.]) + AC_MSG_WARN([* working. Please make sure you have llvm-gcc and llvm-g++ ]) + AC_MSG_WARN([* in your path before configuring LLVM.]) fi ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/GCCLibraries/crtend/Exception.cpp Exception.h Makefile README.txt SJLJ-Exception.cpp SJLJ-Exception.h comp_genericeh.lst comp_main.lst comp_sjljeh.lst crtend.c
Changes in directory llvm/runtime/GCCLibraries/crtend: Exception.cpp (r1.2) removed Exception.h (r1.10) removed Makefile (r1.34) removed README.txt (r1.2) removed SJLJ-Exception.cpp (r1.5) removed SJLJ-Exception.h (r1.5) removed comp_genericeh.lst (r1.1) removed comp_main.lst (r1.1) removed comp_sjljeh.lst (r1.1) removed crtend.c (r1.6) removed --- Log message: In LLVM 2.0 we won't use the runtime libraries as llvm-gcc3 support will be dropped. This patch pertains to removing the runtime directory from LLVM. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/xmm-r64.ll fabs.ll
Changes in directory llvm/test/Regression/CodeGen/X86: xmm-r64.ll added (r1.1) fabs.ll updated: 1.9 -> 1.10 --- Log message: New test case. --- Diffs of the changes: (+13 -2) fabs.ll|4 ++-- xmm-r64.ll | 11 +++ 2 files changed, 13 insertions(+), 2 deletions(-) Index: llvm/test/Regression/CodeGen/X86/xmm-r64.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/xmm-r64.ll:1.1 *** /dev/null Thu Nov 16 17:38:31 2006 --- llvm/test/Regression/CodeGen/X86/xmm-r64.ll Thu Nov 16 17:38:21 2006 *** *** 0 --- 1,11 + ; RUN: llvm-as < %s | llc -march=x86-64 + + <4 x int> %test() { + %tmp1039 = call <4 x int> %llvm.x86.sse2.psll.d( <4 x int> zeroinitializer, <4 x int> zeroinitializer ) ; <<4 x int>> [#uses=1] + %tmp1040 = cast <4 x int> %tmp1039 to <2 x long>; <<2 x long>> [#uses=1] + %tmp1048 = add <2 x long> %tmp1040, zeroinitializer ; <<2 x long>> [#uses=1] + %tmp1048 = cast <2 x long> %tmp1048 to <4 x int>; <<4 x int>> [#uses=1] + ret <4 x int> %tmp1048 + } + + declare <4 x int> %llvm.x86.sse2.psll.d(<4 x int>, <4 x int>) Index: llvm/test/Regression/CodeGen/X86/fabs.ll diff -u llvm/test/Regression/CodeGen/X86/fabs.ll:1.9 llvm/test/Regression/CodeGen/X86/fabs.ll:1.10 --- llvm/test/Regression/CodeGen/X86/fabs.ll:1.9Tue Aug 29 17:01:39 2006 +++ llvm/test/Regression/CodeGen/X86/fabs.llThu Nov 16 17:38:21 2006 @@ -7,12 +7,12 @@ declare float %fabsf(float) -float %fabsftest(float %X) { +float %test1(float %X) { %Y = call float %fabsf(float %X) ret float %Y } -double %fabstest2(double %X) { +double %test2(double %X) { %Y = setge double %X, -0.0 %Z = sub double -0.0, %X %Q = select bool %Y, double %X, double %Z ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86InstrSSE.td X86InstrX86-64.td X86RegisterInfo.cpp
Changes in directory llvm/lib/Target/X86: X86InstrSSE.td updated: 1.171 -> 1.172 X86InstrX86-64.td updated: 1.6 -> 1.7 X86RegisterInfo.cpp updated: 1.178 -> 1.179 --- Log message: Correct instructions for moving data between GR64 and SSE registers; also correct load i64 / store i64 from v2i64. --- Diffs of the changes: (+34 -6) X86InstrSSE.td | 11 ++- X86InstrX86-64.td | 26 ++ X86RegisterInfo.cpp |3 ++- 3 files changed, 34 insertions(+), 6 deletions(-) Index: llvm/lib/Target/X86/X86InstrSSE.td diff -u llvm/lib/Target/X86/X86InstrSSE.td:1.171 llvm/lib/Target/X86/X86InstrSSE.td:1.172 --- llvm/lib/Target/X86/X86InstrSSE.td:1.171Fri Nov 10 15:43:37 2006 +++ llvm/lib/Target/X86/X86InstrSSE.td Thu Nov 16 17:33:25 2006 @@ -1682,17 +1682,18 @@ "movd {$src, $dst|$dst, $src}", [(set VR128:$dst, (v4i32 (scalar_to_vector (loadi32 addr:$src]>; + // SSE2 instructions with XS prefix -def MOVQI2PQIrr : I<0x7E, MRMSrcReg, (ops VR128:$dst, VR64:$src), -"movq {$src, $dst|$dst, $src}", -[(set VR128:$dst, - (v2i64 (scalar_to_vector VR64:$src)))]>, XS, - Requires<[HasSSE2]>; def MOVQI2PQIrm : I<0x7E, MRMSrcMem, (ops VR128:$dst, i64mem:$src), "movq {$src, $dst|$dst, $src}", [(set VR128:$dst, (v2i64 (scalar_to_vector (loadi64 addr:$src]>, XS, Requires<[HasSSE2]>; +def MOVPQI2QImr : PDI<0xD6, MRMDestMem, (ops i64mem:$dst, VR128:$src), + "movq {$src, $dst|$dst, $src}", + [(store (i64 (vector_extract (v2i64 VR128:$src), +(iPTR 0))), addr:$dst)]>; + // FIXME: may not be able to eliminate this movss with coalescing the src and // dest register classes are different. We really want to write this pattern // like this: Index: llvm/lib/Target/X86/X86InstrX86-64.td diff -u llvm/lib/Target/X86/X86InstrX86-64.td:1.6 llvm/lib/Target/X86/X86InstrX86-64.td:1.7 --- llvm/lib/Target/X86/X86InstrX86-64.td:1.6 Fri Nov 3 17:48:56 2006 +++ llvm/lib/Target/X86/X86InstrX86-64.td Thu Nov 16 17:33:25 2006 @@ -59,6 +59,8 @@ : SSI, REX_W; class RSDI o, Format F, dag ops, string asm, list pattern> : SDI, REX_W; +class RPDI o, Format F, dag ops, string asm, list pattern> + : PDI, REX_W; //===--===// // Pattern fragments... @@ -1076,3 +1078,27 @@ def : Pat<(store (or (shl (loadi64 addr:$dst), CL:$amt), (srl GR64:$src2, (sub 64, CL:$amt))), addr:$dst), (SHLD64mrCL addr:$dst, GR64:$src2)>; + +//===--===// +// X86-64 SSE Instructions +//===--===// + +// Move instructions... + +def MOV64toPQIrr : RPDI<0x6E, MRMSrcReg, (ops VR128:$dst, GR64:$src), +"movq {$src, $dst|$dst, $src}", +[(set VR128:$dst, + (v2i64 (scalar_to_vector GR64:$src)))]>; +def MOV64toPQIrm : RPDI<0x6E, MRMSrcMem, (ops VR128:$dst, i64mem:$src), +"movq {$src, $dst|$dst, $src}", +[(set VR128:$dst, + (v2i64 (scalar_to_vector (loadi64 addr:$src]>; + +def MOVPQIto64rr : RPDI<0x7E, MRMDestReg, (ops GR64:$dst, VR128:$src), + "movd {$src, $dst|$dst, $src}", + [(set GR64:$dst, (vector_extract (v2i64 VR128:$src), + (iPTR 0)))]>; +def MOVPQIto64mr : RPDI<0x7E, MRMDestMem, (ops i64mem:$dst, VR128:$src), + "movd {$src, $dst|$dst, $src}", + [(store (i64 (vector_extract (v2i64 VR128:$src), + (iPTR 0))), addr:$dst)]>; Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.178 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.179 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.178 Wed Nov 15 14:58:11 2006 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Thu Nov 16 17:33:25 2006 @@ -509,6 +509,7 @@ { X86::MOVAPDrr,X86::MOVAPDmr }, { X86::MOVAPSrr,X86::MOVAPSmr }, { X86::MOVPDI2DIrr, X86::MOVPDI2DImr }, + { X86::MOVPQIto64rr,X86::MOVPQIto64mr }, { X86::MOVPS2SSrr, X86::MOVPS2SSmr }, { X86::MOVSDrr, X86::MOVSDmr }, { X86::MOVSSrr, X86::MOVSSmr }, @@ -606,12 +607,12 @@ { X86::MOV16rr, X86::MOV16rm }, { X86::MOV32rr, X86::MOV32rm }, { X86::MOV64rr, X86::MOV64rm }, + { X86::MOV64toPQIrr,X86::MOV64toPQIrm }, { X86::MOV8rr, X86::MOV8rm }, { X86::MOVAPDrr,X86::MO
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCBranchSelector.cpp updated: 1.30 -> 1.31 --- Log message: implicit_def_vrrc doesn't generate code. --- Diffs of the changes: (+31 -31) PPCBranchSelector.cpp | 62 +- 1 files changed, 31 insertions(+), 31 deletions(-) Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.30 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.31 --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.30 Thu Nov 16 12:13:49 2006 +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Thu Nov 16 17:49:52 2006 @@ -64,6 +64,7 @@ case PPC::IMPLICIT_DEF_G8RC: // no asm emitted case PPC::IMPLICIT_DEF_F4: // no asm emitted case PPC::IMPLICIT_DEF_F8: // no asm emitted + case PPC::IMPLICIT_DEF_VRRC: // no asm emitted return 0; case PPC::INLINEASM: { // Inline Asm: Variable size. MachineFunction *MF = MI->getParent()->getParent(); @@ -114,38 +115,37 @@ // We may end up deleting the MachineInstr that MBBI points to, so // remember its opcode now so we can refer to it after calling erase() unsigned ByteSize = getNumBytesForInstruction(MBBI); - if (MBBI->getOpcode() == PPC::COND_BRANCH) { -MachineBasicBlock::iterator MBBJ = MBBI; -++MBBJ; - -// condbranch operands: -// 0. CR0 register -// 1. bc opcode -// 2. target MBB -// 3. fallthrough MBB -MachineBasicBlock *trueMBB = - MBBI->getOperand(2).getMachineBasicBlock(); - -int Displacement = OffsetMap[trueMBB] - ByteCount; -unsigned Opcode = MBBI->getOperand(1).getImmedValue(); -unsigned CRReg = MBBI->getOperand(0).getReg(); -unsigned Inverted = PPCInstrInfo::invertPPCBranchOpcode(Opcode); - -if (Displacement >= -32768 && Displacement <= 32767) { - BuildMI(*MBB, MBBJ, Opcode, 2).addReg(CRReg).addMBB(trueMBB); -} else { - // Long branch, skip next branch instruction (i.e. $PC+8). - ++NumExpanded; - BuildMI(*MBB, MBBJ, Inverted, 2).addReg(CRReg).addImm(2); - BuildMI(*MBB, MBBJ, PPC::B, 1).addMBB(trueMBB); -} - -// Erase the psuedo COND_BRANCH instruction, and then back up the -// iterator so that when the for loop increments it, we end up in -// the correct place rather than iterating off the end. -MBB->erase(MBBI); -MBBI = --MBBJ; + if (MBBI->getOpcode() != PPC::COND_BRANCH) { +ByteCount += ByteSize; +continue; } + + // condbranch operands: + // 0. CR register + // 1. PPC branch opcode + // 2. Target MBB + MachineBasicBlock *DestMBB = MBBI->getOperand(2).getMachineBasicBlock(); + unsigned Opcode = MBBI->getOperand(1).getImmedValue(); + unsigned CRReg = MBBI->getOperand(0).getReg(); + + int Displacement = OffsetMap[DestMBB] - ByteCount; + unsigned Inverted = PPCInstrInfo::invertPPCBranchOpcode(Opcode); + + MachineBasicBlock::iterator MBBJ; + if (Displacement >= -32768 && Displacement <= 32767) { +MBBJ = BuildMI(*MBB, MBBJ, Opcode, 2).addReg(CRReg).addMBB(DestMBB); + } else { +// Long branch, skip next branch instruction (i.e. $PC+8). +++NumExpanded; +BuildMI(*MBB, MBBJ, Inverted, 2).addReg(CRReg).addImm(2); +MBBJ = BuildMI(*MBB, MBBJ, PPC::B, 1).addMBB(DestMBB); + } + + // Erase the psuedo COND_BRANCH instruction, and then back up the + // iterator so that when the for loop increments it, we end up in + // the correct place rather than iterating off the end. + MBB->erase(MBBI); + MBBI = MBBJ; ByteCount += ByteSize; } } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h PPCFrameInfo.h PPCISelLowering.cpp PPCISelLowering.h PPCInstr64Bit.td PPCInstrInfo.td PPCRegisterInfo.cpp PPCRegisterInfo.h PPCRegi
Changes in directory llvm/lib/Target/PowerPC: PPCMachineFunctionInfo.h added (r1.1) PPCFrameInfo.h updated: 1.9 -> 1.10 PPCISelLowering.cpp updated: 1.227 -> 1.228 PPCISelLowering.h updated: 1.56 -> 1.57 PPCInstr64Bit.td updated: 1.31 -> 1.32 PPCInstrInfo.td updated: 1.265 -> 1.266 PPCRegisterInfo.cpp updated: 1.85 -> 1.86 PPCRegisterInfo.h updated: 1.17 -> 1.18 PPCRegisterInfo.td updated: 1.39 -> 1.40 --- Log message: This is a general clean up of the PowerPC ABI. Address several problems and bugs including making sure that the TOS links back to the previous frame, that the maximum call frame size is not included twice when using frame pointers, no longer growing the frame on calls, double storing of SP and a cleaner/faster dynamic alloca. --- Diffs of the changes: (+409 -150) PPCFrameInfo.h | 34 PPCISelLowering.cpp | 75 +++-- PPCISelLowering.h|5 PPCInstr64Bit.td |6 PPCInstrInfo.td | 11 + PPCMachineFunctionInfo.h | 43 + PPCRegisterInfo.cpp | 376 ++- PPCRegisterInfo.h|5 PPCRegisterInfo.td |4 9 files changed, 409 insertions(+), 150 deletions(-) Index: llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h diff -c /dev/null llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h:1.1 *** /dev/null Thu Nov 16 16:43:47 2006 --- llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.hThu Nov 16 16:43:37 2006 *** *** 0 --- 1,43 + //===-- PPCMachineFunctionInfo.h - Private data used for PowerPC --*- C++ -*-=// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by James M. Laskey and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===--===// + // + // This file declares the PowerPC specific subclass of MachineFunctionInfo. + // + //===--===// + + #ifndef PPC_MACHINE_FUNCTION_INFO_H + #define PPC_MACHINE_FUNCTION_INFO_H + + #include "llvm/CodeGen/MachineFunction.h" + + namespace llvm { + + /// PPCFunctionInfo - This class is derived from MachineFunction private + /// PowerPC target-specific information for each MachineFunction. + class PPCFunctionInfo : public MachineFunctionInfo { + private: + /// FramePointerSaveIndex - Frame index of where the old frame pointer is + /// stored. Also used as an anchor for instructions that need to be altered + /// when using frame pointers (dyna_add, dyna_sub.) + int FramePointerSaveIndex; + + public: + PPCFunctionInfo(MachineFunction& MF) + : FramePointerSaveIndex(0) + {} + + int getFramePointerSaveIndex() const { return FramePointerSaveIndex; } + void setFramePointerSaveIndex(int Idx) { FramePointerSaveIndex = Idx; } + + }; + + } // end of namespace llvm + + + #endif \ No newline at end of file Index: llvm/lib/Target/PowerPC/PPCFrameInfo.h diff -u llvm/lib/Target/PowerPC/PPCFrameInfo.h:1.9 llvm/lib/Target/PowerPC/PPCFrameInfo.h:1.10 --- llvm/lib/Target/PowerPC/PPCFrameInfo.h:1.9 Sun Oct 16 00:39:50 2005 +++ llvm/lib/Target/PowerPC/PPCFrameInfo.h Thu Nov 16 16:43:37 2006 @@ -35,6 +35,40 @@ NumEntries = 1; return &LR[0]; } + + /// getFramePointerSaveOffset - Return the previous frame offset to save the + /// frame pointer. + static unsigned getFramePointerSaveOffset(bool LP64) { +// Use the TOC save slot in the PowerPC linkage area for saving the frame +// pointer (if needed.) LLVM does not generate code that uses the TOC (R2 +// is treated as a caller saved register.) +return LP64 ? 40 : 20; + } + + /// getLinkageSize - Return the size of the PowerPC ABI linkage area. + /// + static unsigned getLinkageSize(bool LP64) { +return 6 * (LP64 ? 8 : 4); + } + + /// getMinCallArgumentsSize - Return the size of the minium PowerPC ABI + /// argument area. + static unsigned getMinCallArgumentsSize(bool LP64) { + // The prolog code of the callee may store up to 8 GPR argument registers to + // the stack, allowing va_start to index over them in memory if its varargs. + // Because we cannot tell if this is needed on the caller side, we have to + // conservatively assume that it is needed. As such, make sure we have at + // least enough stack space for the caller to store the 8 GPRs. +return 8 * (LP64 ? 8 : 4); + } + + /// getMinCallFrameSize - Return the minimum size a call frame can be using + /// the PowerPC ABI. + static unsigned getMinCallFrameSize(bool LP64) { +// The call frame needs to be at least big enough for linkage and 8 args. +return getLinkageSize(LP64) + getMinCallArgumentsSize(LP64); + } + }; } // End llvm namespace Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.227 llvm/lib/Target
[llvm-commits] CVS: llvm/include/llvm/Support/Debug.h
Changes in directory llvm/include/llvm/Support: Debug.h updated: 1.7 -> 1.8 --- Log message: Added "DOUT" macro. This is used as a replacement for the std::cerr stream. It centralizes the use of std::cerr so that static c'tor/d'tors aren't scattered around all over the place. The way to use it is like this: DOUT << "This is a status line: " << Var << "\n"; If "-debug" is specified, it will print. Otherwise, it'll not print. If NDEBUG is defined, the DOUT does nothing. --- Diffs of the changes: (+30 -0) Debug.h | 30 ++ 1 files changed, 30 insertions(+) Index: llvm/include/llvm/Support/Debug.h diff -u llvm/include/llvm/Support/Debug.h:1.7 llvm/include/llvm/Support/Debug.h:1.8 --- llvm/include/llvm/Support/Debug.h:1.7 Sun Jan 22 16:54:51 2006 +++ llvm/include/llvm/Support/Debug.h Thu Nov 16 18:49:12 2006 @@ -26,6 +26,8 @@ #ifndef LLVM_SUPPORT_DEBUG_H #define LLVM_SUPPORT_DEBUG_H +#include // Doesn't have static d'tors!! + namespace llvm { // DebugFlag - This boolean is set to true if the '-debug' command line option @@ -59,6 +61,34 @@ do { if (DebugFlag && isCurrentDebugType(DEBUG_TYPE)) { X; } } while (0) #endif +// llvm_ostream - Acts like an ostream. However, it doesn't print things out if +// an ostream isn't specified. +// +class llvm_ostream { + std::ostream* Stream; +public: + llvm_ostream() : Stream(0) {} + llvm_ostream(std::ostream& OStream) : Stream(&OStream) {} + + template + llvm_ostream& operator << (const Ty& Thing) { +if (Stream) *Stream << Thing; +return *this; + } +}; + +// getErrorOutputStream - Returns the error output stream (std::cerr). This +// places the std::c* I/O streams into one .cpp file and relieves the whole +// program from having to have hundreds of static c'tor/d'tors for them. +// +llvm_ostream getErrorOutputStream(const char *DebugType); + +#ifdef NDEBUG +#define DOUT llvm_ostream() +#else +#define DOUT getErrorOutputStream(DEBUG_TYPE) +#endif + } // End llvm namespace #endif ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/RegAllocLinearScan.cpp
Changes in directory llvm/lib/CodeGen: RegAllocLinearScan.cpp updated: 1.131 -> 1.132 --- Log message: Replace std::cerr uses of the "DEBUG" macro with "DOUT" instead. Removes a #include of iostream. --- Diffs of the changes: (+27 -29) RegAllocLinearScan.cpp | 56 +++-- 1 files changed, 27 insertions(+), 29 deletions(-) Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.131 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.132 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.131 Wed Nov 8 13:16:43 2006 +++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Thu Nov 16 18:50:36 2006 @@ -29,7 +29,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/Compiler.h" #include -#include #include #include #include @@ -138,14 +137,14 @@ template void printIntervals(const char* const str, ItTy i, ItTy e) const { - if (str) std::cerr << str << " intervals:\n"; + if (str) DOUT << str << " intervals:\n"; for (; i != e; ++i) { -std::cerr << "\t" << *i->first << " -> "; +DOUT << "\t" << *i->first << " -> "; unsigned reg = i->first->reg; if (MRegisterInfo::isVirtualRegister(reg)) { reg = vrm_->getPhys(reg); } -std::cerr << mri_->getName(reg) << '\n'; +DOUT << mri_->getName(reg) << '\n'; } } }; @@ -243,9 +242,8 @@ void RA::linearScan() { // linear scan algorithm - DEBUG(std::cerr << "** LINEAR SCAN **\n"); - DEBUG(std::cerr << "** Function: " -<< mf_->getFunction()->getName() << '\n'); + DOUT << "** LINEAR SCAN **\n"; + DOUT << "** Function: " << mf_->getFunction()->getName() << '\n'; // DEBUG(printIntervals("unhandled", unhandled_.begin(), unhandled_.end())); DEBUG(printIntervals("fixed", fixed_.begin(), fixed_.end())); @@ -257,7 +255,7 @@ LiveInterval* cur = unhandled_.top(); unhandled_.pop(); ++numIterations; -DEBUG(std::cerr << "\n*** CURRENT ***: " << *cur << '\n'); +DOUT << "\n*** CURRENT ***: " << *cur << '\n'; processActiveIntervals(cur->beginNumber()); processInactiveIntervals(cur->beginNumber()); @@ -280,7 +278,7 @@ for (IntervalPtrs::reverse_iterator i = active_.rbegin(); i != active_.rend(); ) { unsigned reg = i->first->reg; -DEBUG(std::cerr << "\tinterval " << *i->first << " expired\n"); +DOUT << "\tinterval " << *i->first << " expired\n"; assert(MRegisterInfo::isVirtualRegister(reg) && "Can only allocate virtual registers!"); reg = vrm_->getPhys(reg); @@ -291,18 +289,18 @@ // expire any remaining inactive intervals for (IntervalPtrs::reverse_iterator i = inactive_.rbegin(); i != inactive_.rend(); ) { -DEBUG(std::cerr << "\tinterval " << *i->first << " expired\n"); +DOUT << "\tinterval " << *i->first << " expired\n"; i = IntervalPtrs::reverse_iterator(inactive_.erase(i.base()-1)); } - DEBUG(std::cerr << *vrm_); + DOUT << *vrm_; } /// processActiveIntervals - expire old intervals and move non-overlapping ones /// to the inactive list. void RA::processActiveIntervals(unsigned CurPoint) { - DEBUG(std::cerr << "\tprocessing active intervals:\n"); + DOUT << "\tprocessing active intervals:\n"; for (unsigned i = 0, e = active_.size(); i != e; ++i) { LiveInterval *Interval = active_[i].first; @@ -312,7 +310,7 @@ IntervalPos = Interval->advanceTo(IntervalPos, CurPoint); if (IntervalPos == Interval->end()) { // Remove expired intervals. - DEBUG(std::cerr << "\t\tinterval " << *Interval << " expired\n"); + DOUT << "\t\tinterval " << *Interval << " expired\n"; assert(MRegisterInfo::isVirtualRegister(reg) && "Can only allocate virtual registers!"); reg = vrm_->getPhys(reg); @@ -325,7 +323,7 @@ } else if (IntervalPos->start > CurPoint) { // Move inactive intervals to inactive list. - DEBUG(std::cerr << "\t\tinterval " << *Interval << " inactive\n"); + DOUT << "\t\tinterval " << *Interval << " inactive\n"; assert(MRegisterInfo::isVirtualRegister(reg) && "Can only allocate virtual registers!"); reg = vrm_->getPhys(reg); @@ -348,7 +346,7 @@ /// ones to the active list. void RA::processInactiveIntervals(unsigned CurPoint) { - DEBUG(std::cerr << "\tprocessing inactive intervals:\n"); + DOUT << "\tprocessing inactive intervals:\n"; for (unsigned i = 0, e = inactive_.size(); i != e; ++i) { LiveInterval *Interval = inactive_[i].first; @@ -358,7 +356,7 @@ IntervalPos = Interval->advanceTo(IntervalPos, CurPoint); if (IntervalPos == Interval->end()) { // remove expired intervals. - DEBUG(std::cerr << "\t\tinterval " << *Interval << " expired\n"); + DOUT << "\t\tinterval " << *Interval << " expired\n"; // Pop off the end of the list. inactive_[i] =
[llvm-commits] CVS: llvm/lib/Support/Debug.cpp
Changes in directory llvm/lib/Support: Debug.cpp updated: 1.7 -> 1.8 --- Log message: Added "DOUT" macro. This is used as a replacement for the std::cerr stream. It centralizes the use of std::cerr so that static c'tor/d'tors aren't scattered around all over the place. The way to use it is like this: DOUT << "This is a status line: " << Var << "\n"; If "-debug" is specified, it will print. Otherwise, it'll not print. If NDEBUG is defined, the DOUT does nothing. --- Diffs of the changes: (+12 -0) Debug.cpp | 12 1 files changed, 12 insertions(+) Index: llvm/lib/Support/Debug.cpp diff -u llvm/lib/Support/Debug.cpp:1.7 llvm/lib/Support/Debug.cpp:1.8 --- llvm/lib/Support/Debug.cpp:1.7 Thu Apr 21 17:52:05 2005 +++ llvm/lib/Support/Debug.cpp Thu Nov 16 18:49:12 2006 @@ -25,6 +25,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/CommandLine.h" +#include using namespace llvm; bool llvm::DebugFlag; // DebugFlag - Exported boolean set by the -debug option @@ -63,3 +64,14 @@ return false; #endif } + +// getErrorOutputStream - Returns the error output stream (std::cerr). This +// places the std::c* I/O streams into one .cpp file and relieves the whole +// program from having to have hundreds of static c'tor/d'tors for them. +// +llvm_ostream llvm::getErrorOutputStream(const char *DebugType) { + if (DebugFlag && isCurrentDebugType(DebugType)) +return llvm_ostream(std::cerr); + else +return llvm_ostream(); +} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCBranchSelector.cpp updated: 1.31 -> 1.32 --- Log message: fix typo --- Diffs of the changes: (+2 -2) PPCBranchSelector.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.31 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.32 --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.31 Thu Nov 16 17:49:52 2006 +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Thu Nov 16 18:49:36 2006 @@ -133,12 +133,12 @@ MachineBasicBlock::iterator MBBJ; if (Displacement >= -32768 && Displacement <= 32767) { -MBBJ = BuildMI(*MBB, MBBJ, Opcode, 2).addReg(CRReg).addMBB(DestMBB); +MBBJ = BuildMI(*MBB, MBBI, Opcode, 2).addReg(CRReg).addMBB(DestMBB); } else { // Long branch, skip next branch instruction (i.e. $PC+8). ++NumExpanded; BuildMI(*MBB, MBBJ, Inverted, 2).addReg(CRReg).addImm(2); -MBBJ = BuildMI(*MBB, MBBJ, PPC::B, 1).addMBB(DestMBB); +MBBJ = BuildMI(*MBB, MBBI, PPC::B, 1).addMBB(DestMBB); } // Erase the psuedo COND_BRANCH instruction, and then back up the ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Support/Debug.h
Changes in directory llvm/include/llvm/Support: Debug.h updated: 1.8 -> 1.9 --- Log message: Adjusted the // comments so that doxygen picks them up. --- Diffs of the changes: (+7 -7) Debug.h | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/include/llvm/Support/Debug.h diff -u llvm/include/llvm/Support/Debug.h:1.8 llvm/include/llvm/Support/Debug.h:1.9 --- llvm/include/llvm/Support/Debug.h:1.8 Thu Nov 16 18:49:12 2006 +++ llvm/include/llvm/Support/Debug.h Thu Nov 16 19:13:12 2006 @@ -61,9 +61,9 @@ do { if (DebugFlag && isCurrentDebugType(DEBUG_TYPE)) { X; } } while (0) #endif -// llvm_ostream - Acts like an ostream. However, it doesn't print things out if -// an ostream isn't specified. -// +/// llvm_ostream - Acts like an ostream. However, it doesn't print things out if +/// an ostream isn't specified. +/// class llvm_ostream { std::ostream* Stream; public: @@ -77,10 +77,10 @@ } }; -// getErrorOutputStream - Returns the error output stream (std::cerr). This -// places the std::c* I/O streams into one .cpp file and relieves the whole -// program from having to have hundreds of static c'tor/d'tors for them. -// +/// getErrorOutputStream - Returns the error output stream (std::cerr). This +/// places the std::c* I/O streams into one .cpp file and relieves the whole +/// program from having to have hundreds of static c'tor/d'tors for them. +/// llvm_ostream getErrorOutputStream(const char *DebugType); #ifdef NDEBUG ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/include/llvm/Support/Debug.h
Bill, On Thu, 2006-11-16 at 18:49 -0600, Bill Wendling wrote: > > Changes in directory llvm/include/llvm/Support: > > Debug.h updated: 1.7 -> 1.8 > --- > Log message: > > Added "DOUT" macro. This is used as a replacement for the std::cerr > stream. It centralizes the use of std::cerr so that static c'tor/d'tors > aren't scattered around all over the place. The way to use it is like this: > >DOUT << "This is a status line: " << Var << "\n"; > > If "-debug" is specified, it will print. Otherwise, it'll not print. If > NDEBUG is defined, the DOUT does nothing. While this may not print anything when NDEBUG is *not* defined, it isn't sufficient. You're going to leave template functions scattered all over the place and calls to them. The existing solution completely eliminates the code from an NDEBUG build. That's what we want. What's wrong with the existing solution? Or, perhaps a combination is needed. Something like: DEBUG(DOUT << "This is a debug message\n"); > > > --- > Diffs of the changes: (+30 -0) > > Debug.h | 30 ++ > 1 files changed, 30 insertions(+) > > > Index: llvm/include/llvm/Support/Debug.h > diff -u llvm/include/llvm/Support/Debug.h:1.7 > llvm/include/llvm/Support/Debug.h:1.8 > --- llvm/include/llvm/Support/Debug.h:1.7 Sun Jan 22 16:54:51 2006 > +++ llvm/include/llvm/Support/Debug.h Thu Nov 16 18:49:12 2006 > @@ -26,6 +26,8 @@ > #ifndef LLVM_SUPPORT_DEBUG_H > #define LLVM_SUPPORT_DEBUG_H > > +#include // Doesn't have static d'tors!! > + > namespace llvm { > > // DebugFlag - This boolean is set to true if the '-debug' command line > option > @@ -59,6 +61,34 @@ >do { if (DebugFlag && isCurrentDebugType(DEBUG_TYPE)) { X; } } while (0) > #endif > > +// llvm_ostream - Acts like an ostream. However, it doesn't print things out > if > +// an ostream isn't specified. > +// > +class llvm_ostream { > + std::ostream* Stream; > +public: > + llvm_ostream() : Stream(0) {} > + llvm_ostream(std::ostream& OStream) : Stream(&OStream) {} > + > + template > + llvm_ostream& operator << (const Ty& Thing) { > +if (Stream) *Stream << Thing; > +return *this; > + } > +}; > + > +// getErrorOutputStream - Returns the error output stream (std::cerr). This > +// places the std::c* I/O streams into one .cpp file and relieves the whole > +// program from having to have hundreds of static c'tor/d'tors for them. > +// > +llvm_ostream getErrorOutputStream(const char *DebugType); > + > +#ifdef NDEBUG > +#define DOUT llvm_ostream() > +#else > +#define DOUT getErrorOutputStream(DEBUG_TYPE) > +#endif > + > } // End llvm namespace > > #endif > > > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrInfo.h
Changes in directory llvm/include/llvm/Target: TargetInstrInfo.h updated: 1.105 -> 1.106 --- Log message: Add opcode to TargetInstrDescriptor. --- Diffs of the changes: (+2 -1) TargetInstrInfo.h |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Target/TargetInstrInfo.h diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.105 llvm/include/llvm/Target/TargetInstrInfo.h:1.106 --- llvm/include/llvm/Target/TargetInstrInfo.h:1.105Wed Nov 8 20:20:58 2006 +++ llvm/include/llvm/Target/TargetInstrInfo.h Thu Nov 16 19:36:01 2006 @@ -110,8 +110,9 @@ class TargetInstrDescriptor { public: + MachineOpCode Opcode;// The opcode. + unsigned short numOperands; // Num of args (may be more if variable_ops). const char *Name; // Assembly language mnemonic for the opcode. - unsignednumOperands; // Num of args (may be more if variable_ops). InstrSchedClass schedClass;// enum identifying instr sched class unsignedFlags; // flags identifying machine instr class unsignedTSFlags; // Target Specific Flag values ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/InstrInfoEmitter.cpp
Changes in directory llvm/utils/TableGen: InstrInfoEmitter.cpp updated: 1.53 -> 1.54 --- Log message: Add opcode to TargetInstrDescriptor. --- Diffs of the changes: (+4 -3) InstrInfoEmitter.cpp |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/utils/TableGen/InstrInfoEmitter.cpp diff -u llvm/utils/TableGen/InstrInfoEmitter.cpp:1.53 llvm/utils/TableGen/InstrInfoEmitter.cpp:1.54 --- llvm/utils/TableGen/InstrInfoEmitter.cpp:1.53 Tue Nov 14 20:38:17 2006 +++ llvm/utils/TableGen/InstrInfoEmitter.cppThu Nov 16 19:46:27 2006 @@ -197,7 +197,9 @@ else MinOperands = 0; - OS << " { \""; + OS << " { "; + OS << Num << ",\t" << MinOperands << ",\t\""; + if (Inst.Name.empty()) OS << Inst.TheDef->getName(); else @@ -206,8 +208,7 @@ unsigned ItinClass = !IsItineraries ? 0 : ItinClassNumber(Inst.TheDef->getValueAsDef("Itinerary")->getName()); - OS << "\",\t" << MinOperands << ", " << ItinClass - << ", 0"; + OS << "\",\t" << ItinClass << ", 0"; // Try to determine (from the pattern), if the instruction is a store. bool isStore = false; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Support/Debug.h
Changes in directory llvm/include/llvm/Support: Debug.h updated: 1.9 -> 1.10 --- Log message: #ifndef NDEBUG the "if (Stream) ..." stuff. --- Diffs of the changes: (+2 -0) Debug.h |2 ++ 1 files changed, 2 insertions(+) Index: llvm/include/llvm/Support/Debug.h diff -u llvm/include/llvm/Support/Debug.h:1.9 llvm/include/llvm/Support/Debug.h:1.10 --- llvm/include/llvm/Support/Debug.h:1.9 Thu Nov 16 19:13:12 2006 +++ llvm/include/llvm/Support/Debug.h Thu Nov 16 19:43:48 2006 @@ -72,7 +72,9 @@ template llvm_ostream& operator << (const Ty& Thing) { +#ifndef NDEBUG if (Stream) *Stream << Thing; +#endif return *this; } }; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/include/llvm/Support/Debug.h
On 11/16/06, Reid Spencer <[EMAIL PROTECTED]> wrote: > On Thu, 2006-11-16 at 18:49 -0600, Bill Wendling wrote: > > Added "DOUT" macro. This is used as a replacement for the std::cerr > > stream. It centralizes the use of std::cerr so that static c'tor/d'tors > > aren't scattered around all over the place. The way to use it is like this: > > > >DOUT << "This is a status line: " << Var << "\n"; > > > > If "-debug" is specified, it will print. Otherwise, it'll not print. If > > NDEBUG is defined, the DOUT does nothing. > > While this may not print anything when NDEBUG is *not* defined, it isn't > sufficient. You're going to leave template functions scattered all over > the place and calls to them. The existing solution completely eliminates > the code from an NDEBUG build. That's what we want. What's wrong with > the existing solution? Or, perhaps a combination is needed. Something > like: > > DEBUG(DOUT << "This is a debug message\n"); > Hi Reid, Basically, this is to get rid of static c'tor/d'tors scattered all over the source tree. (You get them whenever you #include .) A smart compiler should be able to remove all of the empty functions because they don't have any side-effects. -bw ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCBranchSelector.cpp updated: 1.32 -> 1.33 --- Log message: implement a todo: change a map into a vector --- Diffs of the changes: (+6 -6) PPCBranchSelector.cpp | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.32 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.33 --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.32 Thu Nov 16 18:49:36 2006 +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Thu Nov 16 19:52:23 2006 @@ -23,7 +23,6 @@ #include "llvm/Target/TargetAsmInfo.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Compiler.h" -#include using namespace llvm; static Statistic<> NumExpanded("ppc-branch-select", @@ -31,9 +30,8 @@ namespace { struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass { -/// OffsetMap - Mapping between BB and byte offset from start of function. -/// TODO: replace this with a vector, using the MBB idx as the key. -std::map OffsetMap; +/// OffsetMap - Mapping between BB # and byte offset from start of function. +std::vector OffsetMap; virtual bool runOnMachineFunction(MachineFunction &Fn); @@ -81,12 +79,14 @@ // Running total of instructions encountered since beginning of function unsigned ByteCount = 0; + OffsetMap.resize(Fn.getNumBlockIDs()); + // For each MBB, add its offset to the offset map, and count up its // instructions for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E; ++MFI) { MachineBasicBlock *MBB = MFI; -OffsetMap[MBB] = ByteCount; +OffsetMap[MBB->getNumber()] = ByteCount; for (MachineBasicBlock::iterator MBBI = MBB->begin(), EE = MBB->end(); MBBI != EE; ++MBBI) @@ -128,7 +128,7 @@ unsigned Opcode = MBBI->getOperand(1).getImmedValue(); unsigned CRReg = MBBI->getOperand(0).getReg(); - int Displacement = OffsetMap[DestMBB] - ByteCount; + int Displacement = OffsetMap[DestMBB->getNumber()] - ByteCount; unsigned Inverted = PPCInstrInfo::invertPPCBranchOpcode(Opcode); MachineBasicBlock::iterator MBBJ; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/RegAllocLocal.cpp VirtRegMap.cpp VirtRegMap.h
Changes in directory llvm/lib/CodeGen: RegAllocLocal.cpp updated: 1.95 -> 1.96 VirtRegMap.cpp updated: 1.79 -> 1.80 VirtRegMap.h updated: 1.22 -> 1.23 --- Log message: More removal of std::cerr and DEBUG, replacing with DOUT instead. --- Diffs of the changes: (+72 -65) RegAllocLocal.cpp | 53 +- VirtRegMap.cpp| 82 -- VirtRegMap.h |2 + 3 files changed, 72 insertions(+), 65 deletions(-) Index: llvm/lib/CodeGen/RegAllocLocal.cpp diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.95 llvm/lib/CodeGen/RegAllocLocal.cpp:1.96 --- llvm/lib/CodeGen/RegAllocLocal.cpp:1.95 Wed Nov 15 14:55:15 2006 +++ llvm/lib/CodeGen/RegAllocLocal.cpp Thu Nov 16 20:09:07 2006 @@ -30,7 +30,6 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include -#include using namespace llvm; namespace { @@ -270,10 +269,10 @@ assert(VirtReg && "Spilling a physical register is illegal!" " Must not have appropriate kill for the register or use exists beyond" " the intended one."); - DEBUG(std::cerr << " Spilling register " << RegInfo->getName(PhysReg); -std::cerr << " containing %reg" << VirtReg; -if (!isVirtRegModified(VirtReg)) -std::cerr << " which has not been modified, so no store necessary!"); + DOUT << " Spilling register " << RegInfo->getName(PhysReg) + << " containing %reg" << VirtReg; + if (!isVirtRegModified(VirtReg)) +DOUT << " which has not been modified, so no store necessary!"; // Otherwise, there is a virtual register corresponding to this physical // register. We only need to spill it into its stack slot if it has been @@ -281,14 +280,14 @@ if (isVirtRegModified(VirtReg)) { const TargetRegisterClass *RC = MF->getSSARegMap()->getRegClass(VirtReg); int FrameIndex = getStackSpaceFor(VirtReg, RC); -DEBUG(std::cerr << " to stack slot #" << FrameIndex); +DOUT << " to stack slot #" << FrameIndex; RegInfo->storeRegToStackSlot(MBB, I, PhysReg, FrameIndex, RC); ++NumStores; // Update statistics } getVirt2PhysRegMapSlot(VirtReg) = 0; // VirtReg no longer available - DEBUG(std::cerr << "\n"); + DOUT << "\n"; removePhysReg(PhysReg); } @@ -318,9 +317,9 @@ // No more use of %EAX, %AH, etc. // %EAX isn't dead upon definition, but %AH is. However %AH isn't // an operand of definition MI so it's not marked as such. - DEBUG(std::cerr << " Register " << RegInfo->getName(*AliasSet) -<< " [%reg" << *AliasSet -<< "] is never used, removing it frame live list\n"); + DOUT << " Register " << RegInfo->getName(*AliasSet) + << " [%reg" << *AliasSet + << "] is never used, removing it frame live list\n"; removePhysReg(*AliasSet); } else spillVirtReg(MBB, I, PhysRegsUsed[*AliasSet], *AliasSet); @@ -506,8 +505,8 @@ markVirtRegModified(VirtReg, false); // Note that this reg was just reloaded - DEBUG(std::cerr << " Reloading %reg" << VirtReg << " into " - << RegInfo->getName(PhysReg) << "\n"); + DOUT << " Reloading %reg" << VirtReg << " into " + << RegInfo->getName(PhysReg) << "\n"; // Add move instruction(s) RegInfo->loadRegFromStackSlot(MBB, MI, PhysReg, FrameIndex, RC); @@ -526,7 +525,7 @@ const TargetInstrInfo &TII = *TM->getInstrInfo(); DEBUG(const BasicBlock *LBB = MBB.getBasicBlock(); -if (LBB) std::cerr << "\nStarting RegAlloc of BB: " << LBB->getName()); +if (LBB) DOUT << "\nStarting RegAlloc of BB: " << LBB->getName()); // If this is the first basic block in the machine function, add live-in // registers as active. @@ -552,13 +551,13 @@ while (MII != MBB.end()) { MachineInstr *MI = MII++; const TargetInstrDescriptor &TID = TII.get(MI->getOpcode()); -DEBUG(std::cerr << "\nStarting RegAlloc of: " << *MI; - std::cerr << " Regs have values: "; +DEBUG(DOUT << "\nStarting RegAlloc of: " << *MI; + DOUT << " Regs have values: "; for (unsigned i = 0; i != RegInfo->getNumRegs(); ++i) if (PhysRegsUsed[i] != -1 && PhysRegsUsed[i] != -2) - std::cerr << "[" << RegInfo->getName(i) - << ",%reg" << PhysRegsUsed[i] << "] "; - std::cerr << "\n"); + DOUT << "[" << RegInfo->getName(i) +<< ",%reg" << PhysRegsUsed[i] << "] "; + DOUT << "\n"); // Loop over the implicit uses, making sure that they are at the head of the // use order list, so they don't get reallocated. @@ -608,15 +607,15 @@ } if (PhysReg) { -DEBUG(std::cerr << " Last use of " << RegInfo->getName(PhysReg) - << "[%reg" << VirtReg <<"], removing it from live set\n"); +DOUT << " Last use of " << RegInfo->getName(PhysReg) +
Re: [llvm-commits] CVS: llvm/include/llvm/Support/Debug.h
Hi Bill, On Thu, 2006-11-16 at 17:44 -0800, Bill Wendling wrote: > On 11/16/06, Reid Spencer <[EMAIL PROTECTED]> wrote: > > While this may not print anything when NDEBUG is *not* defined, it isn't > > sufficient. You're going to leave template functions scattered all over > > the place and calls to them. The existing solution completely eliminates > > the code from an NDEBUG build. That's what we want. What's wrong with > > the existing solution? Or, perhaps a combination is needed. Something > > like: > > > > DEBUG(DOUT << "This is a debug message\n"); > > > Hi Reid, > > Basically, this is to get rid of static c'tor/d'tors scattered all > over the source tree. (You get them whenever you #include .) > A smart compiler should be able to remove all of the empty functions > because they don't have any side-effects. I understand the motivation for the change and I commend it, but I'm concerned about getting it right. You're assuming a few things: a) the compiler is smart enough to get rid of calls that have no side effects, b) the compiler knows how to determine if a function has no side effects without help (operator<< isn't marked "pure"), and c) that there aren't any side effects. c) can probably be proven by your iostream implementation but a) and b) are a little tougher. Can we build an optimized, with symbols (-g -O2) version of one of these modules and see if those symbols are getting removed ? If so, I'm fine with it. If not, we need a new strategy. Reid. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/GCCLibraries/libm/Makefile temp.c
Changes in directory llvm/runtime/GCCLibraries/libm: Makefile updated: 1.11 -> 1.12 temp.c updated: 1.3 -> 1.4 --- Log message: Undo removal of the runtime libraries. While this may have been a bit premature, these libraries will be going away for the 2.0 release. Other arrangements for profiling, gc, etc. should be made in the next few months. --- Diffs of the changes: (+17 -0) Makefile | 16 temp.c |1 + 2 files changed, 17 insertions(+) Index: llvm/runtime/GCCLibraries/libm/Makefile diff -u /dev/null llvm/runtime/GCCLibraries/libm/Makefile:1.12 --- /dev/null Thu Nov 16 21:32:43 2006 +++ llvm/runtime/GCCLibraries/libm/Makefile Thu Nov 16 21:32:33 2006 @@ -0,0 +1,16 @@ +##===- runtime/GCCLibraries/libm/Makefile --*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file was developed by the LLVM research group and is distributed under +# the University of Illinois Open Source License. See LICENSE.TXT for details. +# +##===--===## + +LEVEL = ../../.. +BYTECODE_LIBRARY = 1 +DONT_BUILD_RELINKED = 1 +LIBRARYNAME = m +BYTECODE_DESTINATION = $(CFERuntimeLibDir) + +include $(LEVEL)/Makefile.common Index: llvm/runtime/GCCLibraries/libm/temp.c diff -u /dev/null llvm/runtime/GCCLibraries/libm/temp.c:1.4 --- /dev/null Thu Nov 16 21:33:09 2006 +++ llvm/runtime/GCCLibraries/libm/temp.c Thu Nov 16 21:32:33 2006 @@ -0,0 +1 @@ +typedef int INTEGER; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/autoconf/configure.ac
Changes in directory llvm/autoconf: configure.ac updated: 1.251 -> 1.252 --- Log message: Undo removal of the runtime libraries. While this may have been a bit premature, these libraries will be going away for the 2.0 release. Other arrangements for profiling, gc, etc. should be made in the next few months. --- Diffs of the changes: (+14 -2) configure.ac | 16 ++-- 1 files changed, 14 insertions(+), 2 deletions(-) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.251 llvm/autoconf/configure.ac:1.252 --- llvm/autoconf/configure.ac:1.251Thu Nov 16 17:17:26 2006 +++ llvm/autoconf/configure.ac Thu Nov 16 21:32:33 2006 @@ -268,6 +268,15 @@ AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]]) fi +dnl --enable-debug-runtime : should runtime libraries have debug symbols? +AC_ARG_ENABLE(debug-runtime, + AS_HELP_STRING([--enable-debug-runtime,Build runtime libs with debug symbols (default is NO)]),,enableval=no) +if test ${enableval} = "no" ; then + AC_SUBST(DEBUG_RUNTIME,[[]]) +else + AC_SUBST(DEBUG_RUNTIME,[[DEBUG_RUNTIME=1]]) +fi + dnl --enable-jit: check whether they want to enable the jit AC_ARG_ENABLE(jit, AS_HELP_STRING(--enable-jit, @@ -811,6 +820,7 @@ AC_CONFIG_MAKEFILE(Makefile.common) AC_CONFIG_MAKEFILE(examples/Makefile) AC_CONFIG_MAKEFILE(lib/Makefile) +AC_CONFIG_MAKEFILE(runtime/Makefile) AC_CONFIG_MAKEFILE(test/Makefile) AC_CONFIG_MAKEFILE(test/Makefile.tests) AC_CONFIG_MAKEFILE(tools/Makefile) @@ -823,6 +833,8 @@ dnl Warn loudly if llvm-gcc was not obviously working if test "$llvm_cv_llvmgcc_sanity" = "no" ; then AC_MSG_WARN([* llvm-gcc/llvm-g++ was not found, or does not appear to be ]) - AC_MSG_WARN([* working. Please make sure you have llvm-gcc and llvm-g++ ]) - AC_MSG_WARN([* in your path before configuring LLVM.]) + AC_MSG_WARN([* working. Please make sure you have llvm-gcc and llvm-g++ in]) + AC_MSG_WARN([* your path before configuring LLVM. The runtime libraries]) + AC_MSG_WARN([* (llvm/runtime) will not be built but you should be able to]) + AC_MSG_WARN([* build the llvm tools.]) fi ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/GCCLibraries/Makefile README.txt
Changes in directory llvm/runtime/GCCLibraries: Makefile updated: 1.9 -> 1.10 README.txt updated: 1.2 -> 1.3 --- Log message: Undo removal of the runtime libraries. While this may have been a bit premature, these libraries will be going away for the 2.0 release. Other arrangements for profiling, gc, etc. should be made in the next few months. --- Diffs of the changes: (+19 -0) Makefile | 12 README.txt |7 +++ 2 files changed, 19 insertions(+) Index: llvm/runtime/GCCLibraries/Makefile diff -u /dev/null llvm/runtime/GCCLibraries/Makefile:1.10 --- /dev/null Thu Nov 16 21:32:43 2006 +++ llvm/runtime/GCCLibraries/Makefile Thu Nov 16 21:32:33 2006 @@ -0,0 +1,12 @@ +##===- runtime/GCCLibraries/Makefile ---*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file was developed by the LLVM research group and is distributed under +# the University of Illinois Open Source License. See LICENSE.TXT for details. +# +##===--===## + +LEVEL := ../.. +PARALLEL_DIRS := crtend libc libgcc libm +include $(LEVEL)/Makefile.common Index: llvm/runtime/GCCLibraries/README.txt diff -u /dev/null llvm/runtime/GCCLibraries/README.txt:1.3 --- /dev/null Thu Nov 16 21:33:06 2006 +++ llvm/runtime/GCCLibraries/README.txtThu Nov 16 21:32:33 2006 @@ -0,0 +1,7 @@ +This directory contains libraries which are used when building the GCC +front-end. For the most part, these are just stub libraries, but some +of them contain actual code. + +In particular, the crtend library contains the runtime code to handle +static constructors and destructors for C and C++ programs. + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/GC/SemiSpace/Makefile semispace.c
Changes in directory llvm/runtime/GC/SemiSpace: Makefile updated: 1.8 -> 1.9 semispace.c updated: 1.6 -> 1.7 --- Log message: Undo removal of the runtime libraries. While this may have been a bit premature, these libraries will be going away for the 2.0 release. Other arrangements for profiling, gc, etc. should be made in the next few months. --- Diffs of the changes: (+141 -0) Makefile| 19 + semispace.c | 122 2 files changed, 141 insertions(+) Index: llvm/runtime/GC/SemiSpace/Makefile diff -u /dev/null llvm/runtime/GC/SemiSpace/Makefile:1.9 --- /dev/null Thu Nov 16 21:32:43 2006 +++ llvm/runtime/GC/SemiSpace/Makefile Thu Nov 16 21:32:33 2006 @@ -0,0 +1,19 @@ +##===- runtime/GC/SemiSpace/Makefile ---*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file was developed by the LLVM research group and is distributed under +# the University of Illinois Open Source License. See LICENSE.TXT for details. +# +##===--===## + +LEVEL = ../../.. +BYTECODE_LIBRARY = 1 +LIBRARYNAME = gcsemispace +BYTECODE_DESTINATION = $(CFERuntimeLibDir) +EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/../gc_exported_symbols.lst + +include $(LEVEL)/Makefile.common + +CompileCommonOpts := $(filter-out -pedantic,$(CompileCommonOpts)) +CompileCommonOpts := $(filter-out -Wno-long-long,$(CompileCommonOpts)) Index: llvm/runtime/GC/SemiSpace/semispace.c diff -u /dev/null llvm/runtime/GC/SemiSpace/semispace.c:1.7 --- /dev/null Thu Nov 16 21:33:09 2006 +++ llvm/runtime/GC/SemiSpace/semispace.c Thu Nov 16 21:32:33 2006 @@ -0,0 +1,122 @@ +/*===-- semispace.c - Simple semi-space copying garbage collector -===*\ +|* +|* The LLVM Compiler Infrastructure +|* +|* This file was developed by the LLVM research group and is distributed under +|* the University of Illinois Open Source License. See LICENSE.TXT for details. +|* +|*===--===*| +|* +|* This garbage collector is an extremely simple copying collector. It splits +|* the managed region of memory into two pieces: the current space to allocate +|* from, and the copying space. When the portion being allocated from fills up, +|* a garbage collection cycle happens, which copies all live blocks to the other +|* half of the managed space. +|* +\*===--===*/ + +#include "../GCInterface.h" +#include +#include +#include + +/* AllocPtr - This points to the next byte that is available for allocation. + */ +static char *AllocPtr; + +/* AllocEnd - This points to the first byte not available for allocation. When + * AllocPtr passes this, we have run out of space. + */ +static char *AllocEnd; + +/* CurSpace/OtherSpace - These pointers point to the two regions of memory that + * we switch between. The unallocated portion of the CurSpace is known to be + * zero'd out, but the OtherSpace contains junk. + */ +static void *CurSpace, *OtherSpace; + +/* SpaceSize - The size of each space. */ +static unsigned SpaceSize; + +/* llvm_gc_initialize - Allocate the two spaces that we plan to switch between. + */ +void llvm_gc_initialize(unsigned InitialHeapSize) { + SpaceSize = InitialHeapSize/2; + CurSpace = AllocPtr = calloc(1, SpaceSize); + OtherSpace = malloc(SpaceSize); + AllocEnd = AllocPtr + SpaceSize; +} + +/* We always want to inline the fast path, but never want to inline the slow + * path. + */ +void *llvm_gc_allocate(unsigned Size) __attribute__((always_inline)); +static void* llvm_gc_alloc_slow(unsigned Size) __attribute__((noinline)); + +void *llvm_gc_allocate(unsigned Size) { + char *OldAP = AllocPtr; + char *NewEnd = OldAP+Size; + if (NewEnd > AllocEnd) +return llvm_gc_alloc_slow(Size); + AllocPtr = NewEnd; + return OldAP; +} + +static void* llvm_gc_alloc_slow(unsigned Size) { + llvm_gc_collect(); + if (AllocPtr+Size > AllocEnd) { +fprintf(stderr, "Garbage collector ran out of memory " +"allocating object of size: %d\n", Size); +exit(1); + } + + return llvm_gc_allocate(Size); +} + + +static void process_pointer(void **Root, void *Meta) { + printf("process_root[0x%p] = 0x%p\n", (void*) Root, (void*) *Root); +} + +void llvm_gc_collect() { + // Clear out the space we will be copying into. + // FIXME: This should do the copy, then clear out whatever space is left. + memset(OtherSpace, 0, SpaceSize); + + printf("Garbage collecting!!\n"); + llvm_cg_walk_gcroots(process_pointer); + abort(); +} + +/* We use no read/write barriers */ +void *llvm_gc_read(void *ObjPtr, void **FieldPtr) { return *FieldPtr; } +void llvm_gc_write(void *V, void *ObjPtr, void **FieldPtr) { *FieldPtr = V; } + + +/*===--===** + * FIXME: This sho
[llvm-commits] CVS: llvm/runtime/libprofile/BasicBlockTracing.c BlockProfiling.c CommonProfiling.c EdgeProfiling.c FunctionProfiling.c Makefile Profiling.h exported_symbols.lst
Changes in directory llvm/runtime/libprofile: BasicBlockTracing.c updated: 1.3 -> 1.4 BlockProfiling.c updated: 1.4 -> 1.5 CommonProfiling.c updated: 1.9 -> 1.10 EdgeProfiling.c updated: 1.3 -> 1.4 FunctionProfiling.c updated: 1.4 -> 1.5 Makefile updated: 1.9 -> 1.10 Profiling.h updated: 1.6 -> 1.7 exported_symbols.lst updated: 1.3 -> 1.4 --- Log message: Undo removal of the runtime libraries. While this may have been a bit premature, these libraries will be going away for the 2.0 release. Other arrangements for profiling, gc, etc. should be made in the next few months. --- Diffs of the changes: (+371 -0) BasicBlockTracing.c | 67 + BlockProfiling.c | 45 +++ CommonProfiling.c| 117 +++ EdgeProfiling.c | 45 +++ FunctionProfiling.c | 42 ++ Makefile | 19 Profiling.h | 31 + exported_symbols.lst |5 ++ 8 files changed, 371 insertions(+) Index: llvm/runtime/libprofile/BasicBlockTracing.c diff -u /dev/null llvm/runtime/libprofile/BasicBlockTracing.c:1.4 --- /dev/null Thu Nov 16 21:32:43 2006 +++ llvm/runtime/libprofile/BasicBlockTracing.c Thu Nov 16 21:32:33 2006 @@ -0,0 +1,67 @@ +/*===-- BasicBlockTracing.c - Support library for basic block tracing -===*\ +|* +|* The LLVM Compiler Infrastructure +|* +|* This file was developed by the LLVM research group and is distributed under +|* the University of Illinois Open Source License. See LICENSE.TXT for details. +|* +|*===--===*| +|* +|* This file implements the call back routines for the basic block tracing +|* instrumentation pass. This should be used with the -trace-basic-blocks +|* LLVM pass. +|* +\*===--===*/ + +#include "Profiling.h" +#include +#include + +static unsigned *ArrayStart, *ArrayEnd, *ArrayCursor; + +/* WriteAndFlushBBTraceData - write out the currently accumulated trace data + * and reset the cursor to point to the beginning of the buffer. + */ +static void WriteAndFlushBBTraceData () { + write_profiling_data(BBTraceInfo, ArrayStart, (ArrayCursor - ArrayStart)); + ArrayCursor = ArrayStart; +} + +/* BBTraceAtExitHandler - When the program exits, just write out any remaining + * data and free the trace buffer. + */ +static void BBTraceAtExitHandler() { + WriteAndFlushBBTraceData (); + free (ArrayStart); +} + +/* llvm_trace_basic_block - called upon hitting a new basic block. */ +void llvm_trace_basic_block (unsigned BBNum) { + *ArrayCursor++ = BBNum; + if (ArrayCursor == ArrayEnd) +WriteAndFlushBBTraceData (); +} + +/* llvm_start_basic_block_tracing - This is the main entry point of the basic + * block tracing library. It is responsible for setting up the atexit + * handler and allocating the trace buffer. + */ +int llvm_start_basic_block_tracing(int argc, const char **argv, + unsigned *arrayStart, unsigned numElements) { + int Ret; + const unsigned BufferSize = 128 * 1024; + unsigned ArraySize; + + Ret = save_arguments(argc, argv); + + /* Allocate a buffer to contain BB tracing data */ + ArraySize = BufferSize / sizeof (unsigned); + ArrayStart = malloc (ArraySize * sizeof (unsigned)); + ArrayEnd = ArrayStart + ArraySize; + ArrayCursor = ArrayStart; + + /* Set up the atexit handler. */ + atexit (BBTraceAtExitHandler); + + return Ret; +} Index: llvm/runtime/libprofile/BlockProfiling.c diff -u /dev/null llvm/runtime/libprofile/BlockProfiling.c:1.5 --- /dev/null Thu Nov 16 21:33:09 2006 +++ llvm/runtime/libprofile/BlockProfiling.cThu Nov 16 21:32:33 2006 @@ -0,0 +1,45 @@ +/*===-- BlockProfiling.c - Support library for block profiling ===*\ +|* +|* The LLVM Compiler Infrastructure +|* +|* This file was developed by the LLVM research group and is distributed under +|* the University of Illinois Open Source License. See LICENSE.TXT for details. +|* +|*===--===*| +|* +|* This file implements the call back routines for the block profiling +|* instrumentation pass. This should be used with the -insert-block-profiling +|* LLVM pass. +|* +\*===--===*/ + +#include "Profiling.h" +#include + +static unsigned *ArrayStart; +static unsigned NumElements; + +/* BlockProfAtExitHandler - When the program exits, just write out the profiling + * data. + */ +static void BlockProfAtExitHandler() { + /* Note that if this were doing something more intelligent with the + * instrumentation, we could do some computation here to expand what we + * collected into simple block profiles. (Or we could do it in llvm-prof.) + * Regardless, we directly count each block, so no
[llvm-commits] CVS: llvm/runtime/libdummy/Makefile README.txt dummylib.c
Changes in directory llvm/runtime/libdummy: Makefile updated: 1.9 -> 1.10 README.txt updated: 1.2 -> 1.3 dummylib.c updated: 1.7 -> 1.8 --- Log message: Undo removal of the runtime libraries. While this may have been a bit premature, these libraries will be going away for the 2.0 release. Other arrangements for profiling, gc, etc. should be made in the next few months. --- Diffs of the changes: (+165 -0) Makefile | 19 README.txt |2 dummylib.c | 144 + 3 files changed, 165 insertions(+) Index: llvm/runtime/libdummy/Makefile diff -u /dev/null llvm/runtime/libdummy/Makefile:1.10 --- /dev/null Thu Nov 16 21:32:43 2006 +++ llvm/runtime/libdummy/Makefile Thu Nov 16 21:32:33 2006 @@ -0,0 +1,19 @@ +##===- runtime/libdummy/Makefile ---*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file was developed by the LLVM research group and is distributed under +# the University of Illinois Open Source License. See LICENSE.TXT for details. +# +##===--===## + +LEVEL = ../.. +BYTECODE_LIBRARY = 1 +DONT_BUILD_RELINKED = 1 +LIBRARYNAME = dummy +BYTECODE_DESTINATION = $(CFERuntimeLibDir) + +include $(LEVEL)/Makefile.common + +CompileCommonOpts := $(filter-out -pedantic,$(CompileCommonOpts)) +CompileCommonOpts := $(filter-out -Wno-long-long,$(CompileCommonOpts)) Index: llvm/runtime/libdummy/README.txt diff -u /dev/null llvm/runtime/libdummy/README.txt:1.3 --- /dev/null Thu Nov 16 21:33:05 2006 +++ llvm/runtime/libdummy/README.txtThu Nov 16 21:32:33 2006 @@ -0,0 +1,2 @@ +This directory contains stub routines which are occasionally useful when +performing alias analysis research. Index: llvm/runtime/libdummy/dummylib.c diff -u /dev/null llvm/runtime/libdummy/dummylib.c:1.8 --- /dev/null Thu Nov 16 21:33:05 2006 +++ llvm/runtime/libdummy/dummylib.cThu Nov 16 21:32:33 2006 @@ -0,0 +1,144 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#if 0 +int stat(const char *file_name, struct stat *buf) { return 0; } +int fstat(int filedes, struct stat *buf) { return 0; } +int lstat(const char *file_name, struct stat *buf) { return 0; } + +// Varargs function definitions +int ioctl(int d, int request, ...) {return 0; } +int printf(const char *X) {return 0; } +int sscanf(const char *X, const char *Y, ...) { return 0; } +int fprintf(FILE *stream, const char *format, ...) { return 0; } + + +int gettimeofday(struct timeval *tv, void *tz) { return 0; } +void *xmalloc(size_t X) { return malloc(X); } + +void srand(unsigned x) {} +double exp(double x) { return 0; } +double log(double x) { return 0; } +double sqrt(double x) { return 0; } +void exit(int x) {} +int puts(const char *x) { return 0; } +void __main() {} +int atoi(const char*x) { return 1; } +char *fgets(char*Ptr, int x, FILE*F) { return Ptr; } +char *gets(char *C) { return C; } +int fclose(FILE*F) { return 0; } +FILE *fopen(const char *n, const char*x) { return malloc(sizeof(FILE)); } +FILE *freopen(const char *path, const char *mode, FILE *stream) { return 0; } +int fflush(FILE *F) { return 0; } +size_t fwrite(const void* str, size_t N, size_t n, FILE *F) { return N; } +void *memset(void *P, int X, size_t N) { return P; } +void *memcpy(void *P, void *S, size_t N) { return P; } +void *memmove(void *P, void *S, size_t N) { return P; } +char *strcpy(char*Str1, const char *Str) { return Str1; } +char *strcat(char*Str1, const char *Str) { return Str1; } +size_t strlen(char *X) { return 0; } +#undef putchar +int putchar(int N) { return N; } +int putc(int c, FILE *stream) { return c; } +int fputc(int c, FILE *stream) { return c; } +int fgetc(FILE *S) { return 0; } +long ftell(FILE *F) { return 0; } +int getc(FILE *S) { return 0; } +size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream) { return 0; } +int fseek(FILE *stream, long offset, int whence) { return 0; } +int feof(FILE *stream) { return 0; } +int fputs(const char *s, char *stream) { return 0; } +int ferror(FILE *F) { return 0; } +FILE *fdopen(int fildes, const char *mode) { return 0;} +FILE *popen(const char *command, const char *type) { return 0; } +int pclose(FILE *stream) { return 0; } + +int ungetc(int c, FILE *stream) { return 0; } +int setvbuf(FILE *stream, char *buf, int mode , size_t size) { return 0; } +void rewind(FILE*F) { } +int fileno(FILE *stream) { return 1; } +char *ttyname(int desc) { return 0; } +long sysconf(int name) { return 0; } +char *tmpnam(char *s) { return s; } + +void *calloc(size_t A, size_t B) { return malloc(A*B); } +void *realloc(void *ptr, size_t N) { return ptr; } +const char *strerror(int N) { return 0; } +int unlink(const char *path) { return 0; } +void perror(const char *err) {} +char *strrchr(const char *S, int C) { return (char*)S; } +int memcmp(const char *A, const char *B, size_t N) { return 0; }
[llvm-commits] CVS: llvm/Makefile Makefile.config.in Makefile.rules configure
Changes in directory llvm: Makefile updated: 1.66 -> 1.67 Makefile.config.in updated: 1.67 -> 1.68 Makefile.rules updated: 1.411 -> 1.412 configure updated: 1.256 -> 1.257 --- Log message: Undo removal of the runtime libraries. While this may have been a bit premature, these libraries will be going away for the 2.0 release. Other arrangements for profiling, gc, etc. should be made in the next few months. --- Diffs of the changes: (+80 -34) Makefile | 13 +-- Makefile.config.in |5 +++ Makefile.rules |8 configure | 88 ++--- 4 files changed, 80 insertions(+), 34 deletions(-) Index: llvm/Makefile diff -u llvm/Makefile:1.66 llvm/Makefile:1.67 --- llvm/Makefile:1.66 Thu Nov 16 17:17:26 2006 +++ llvm/Makefile Thu Nov 16 21:32:33 2006 @@ -15,23 +15,28 @@ # 3. Build VMCore, which builds the Intrinsics.inc file used by libs. # 4. Build libs, which are needed by llvm-config. # 5. Build llvm-config, which determines inter-lib dependencies for tools. -# 6. Build tools, docs. +# 6. Build tools, runtime, docs. # DIRS := lib/System lib/Support utils lib/VMCore lib tools/llvm-config \ -tools docs +tools runtime docs OPTIONAL_DIRS := examples projects EXTRA_DIST := test llvm.spec include win32 Xcode include $(LEVEL)/Makefile.config +# llvm-gcc4 doesn't need runtime libs. +ifeq ($(LLVMGCC_MAJVERS),4) + DIRS := $(filter-out runtime, $(DIRS)) +endif + ifeq ($(MAKECMDGOALS),libs-only) - DIRS := $(filter-out tools docs, $(DIRS)) + DIRS := $(filter-out tools runtime docs, $(DIRS)) OPTIONAL_DIRS := endif ifeq ($(MAKECMDGOALS),tools-only) - DIRS := $(filter-out docs, $(DIRS)) + DIRS := $(filter-out runtime docs, $(DIRS)) OPTIONAL_DIRS := endif Index: llvm/Makefile.config.in diff -u llvm/Makefile.config.in:1.67 llvm/Makefile.config.in:1.68 --- llvm/Makefile.config.in:1.67Thu Nov 16 17:17:26 2006 +++ llvm/Makefile.config.in Thu Nov 16 21:32:33 2006 @@ -207,6 +207,11 @@ #DISABLE_ASSERTIONS = 1 @DISABLE_ASSERTIONS@ +# When DEBUG_RUNTIME is enabled, the runtime libraries will retain debug +# symbols. +#DEBUG_RUNTIME = 1 [EMAIL PROTECTED]@ + # When ENABLE_PROFILING is enabled, the llvm source base is built with profile # information to allow gprof to be used to get execution frequencies. #ENABLE_PROFILING = 1 Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.411 llvm/Makefile.rules:1.412 --- llvm/Makefile.rules:1.411 Thu Nov 16 17:17:26 2006 +++ llvm/Makefile.rules Thu Nov 16 21:32:33 2006 @@ -1099,10 +1099,18 @@ $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG) $(MAYBE_PIC_Compile.C) $< -o $@ -S + # make the C and C++ compilers strip debug info out of bytecode libraries. +ifdef DEBUG_RUNTIME +$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(GCCAS) + $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)" + $(Verb) $(GCCAS) $< -o $@ +else $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(GCCAS) $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)" $(Verb) $(GCCAS) -strip-debug $< -o $@ +endif + #- # Provide rule to build .bc files from .ll sources, Index: llvm/configure diff -u llvm/configure:1.256 llvm/configure:1.257 --- llvm/configure:1.256Thu Nov 16 17:17:26 2006 +++ llvm/configure Thu Nov 16 21:32:33 2006 @@ -830,6 +830,7 @@ CVSBUILD ENABLE_OPTIMIZED DISABLE_ASSERTIONS +DEBUG_RUNTIME JIT TARGET_HAS_JIT ENABLE_DOXYGEN @@ -1519,6 +1520,7 @@ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-optimized --enable-assertions + --enable-debug-runtime --enable-jitEnable Just In Time Compiling (default is YES) --enable-doxygenBuild doxygen documentation (default is NO) --enable-threadsUse threads if available (default is YES) @@ -4561,6 +4563,21 @@ fi +# Check whether --enable-debug-runtime was given. +if test "${enable_debug_runtime+set}" = set; then + enableval=$enable_debug_runtime; +else + enableval=no +fi + +if test ${enableval} = "no" ; then + DEBUG_RUNTIME= + +else + DEBUG_RUNTIME=DEBUG_RUNTIME=1 + +fi + # Check whether --enable-jit was given. if test "${enable_jit+set}" = set; then enableval=$enable_jit; @@ -10281,7 +10298,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext + echo '#line 12445 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -14143,11 +14160,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14146: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14163: $lt_compile\"" >&5) (eval "$lt_comp
[llvm-commits] CVS: llvm/runtime/GCCLibraries/crtend/Exception.cpp Exception.h Makefile README.txt SJLJ-Exception.cpp SJLJ-Exception.h comp_genericeh.lst comp_main.lst comp_sjljeh.lst crtend.c
Changes in directory llvm/runtime/GCCLibraries/crtend: Exception.cpp updated: 1.3 -> 1.4 Exception.h updated: 1.11 -> 1.12 Makefile updated: 1.35 -> 1.36 README.txt updated: 1.3 -> 1.4 SJLJ-Exception.cpp updated: 1.6 -> 1.7 SJLJ-Exception.h updated: 1.6 -> 1.7 comp_genericeh.lst updated: 1.2 -> 1.3 comp_main.lst updated: 1.2 -> 1.3 comp_sjljeh.lst updated: 1.2 -> 1.3 crtend.c updated: 1.7 -> 1.8 --- Log message: Undo removal of the runtime libraries. While this may have been a bit premature, these libraries will be going away for the 2.0 release. Other arrangements for profiling, gc, etc. should be made in the next few months. --- Diffs of the changes: (+484 -0) Exception.cpp | 54 +++ Exception.h| 71 + Makefile | 83 ++ README.txt | 15 + SJLJ-Exception.cpp | 146 + SJLJ-Exception.h | 80 + comp_genericeh.lst |9 +++ comp_main.lst |3 + comp_sjljeh.lst|7 ++ crtend.c | 16 + 10 files changed, 484 insertions(+) Index: llvm/runtime/GCCLibraries/crtend/Exception.cpp diff -u /dev/null llvm/runtime/GCCLibraries/crtend/Exception.cpp:1.4 --- /dev/null Thu Nov 16 21:32:43 2006 +++ llvm/runtime/GCCLibraries/crtend/Exception.cpp Thu Nov 16 21:32:33 2006 @@ -0,0 +1,54 @@ +//===- Exception.cpp - Generic language-independent exceptions ===// +// +// This file defines the the shared data structures used by all language +// specific exception handling runtime libraries. +// +//===--===// + +#include "Exception.h" + +// Thread local state for exception handling. FIXME: This should really be made +// thread-local! + +// UncaughtExceptionStack - The stack of exceptions currently being thrown. +static llvm_exception *UncaughtExceptionStack = 0; + +// __llvm_eh_has_uncaught_exception - This is used to implement +// std::uncaught_exception. +// +bool __llvm_eh_has_uncaught_exception() throw() { + return UncaughtExceptionStack != 0; +} + +// __llvm_eh_current_uncaught_exception - This function checks to see if the +// current uncaught exception is of the specified language type. If so, it +// returns a pointer to the exception area data. +// +void *__llvm_eh_current_uncaught_exception_type(unsigned HandlerType) throw() { + if (UncaughtExceptionStack->ExceptionType == HandlerType) +return UncaughtExceptionStack+1; + return 0; +} + +// __llvm_eh_add_uncaught_exception - This adds the specified exception to the +// top of the uncaught exception stack. The exception should not already be on +// the stack! +void __llvm_eh_add_uncaught_exception(llvm_exception *E) throw() { + E->Next = UncaughtExceptionStack; + UncaughtExceptionStack = E; +} + + +// __llvm_eh_get_uncaught_exception - Returns the current uncaught exception. +// There must be an uncaught exception for this to work! +llvm_exception *__llvm_eh_get_uncaught_exception() throw() { + return UncaughtExceptionStack; +} + +// __llvm_eh_pop_from_uncaught_stack - Remove the current uncaught exception +// from the top of the stack. +llvm_exception *__llvm_eh_pop_from_uncaught_stack() throw() { + llvm_exception *E = __llvm_eh_get_uncaught_exception(); + UncaughtExceptionStack = E->Next; + return E; +} Index: llvm/runtime/GCCLibraries/crtend/Exception.h diff -u /dev/null llvm/runtime/GCCLibraries/crtend/Exception.h:1.12 --- /dev/null Thu Nov 16 21:33:05 2006 +++ llvm/runtime/GCCLibraries/crtend/Exception.hThu Nov 16 21:32:33 2006 @@ -0,0 +1,71 @@ +//===- Exception.h - Generic language-independent exceptions *- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by the LLVM research group and is distributed under +// the University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===--===// +// +// This file defines the the shared data structures used by all language +// specific exception handling runtime libraries. +// +// NOTE NOTE NOTE: A copy of this file lives in llvmgcc/libstdc++-v3/libsupc++/ +// Any modifications to this file must keep it in sync! +// +//===--===// + +#ifndef EXCEPTION_H +#define EXCEPTION_H + +struct llvm_exception { + // ExceptionDestructor - This call-back function is used to destroy the + // current exception, without requiring the caller to know what the concrete + // exception type is. + // + void (*ExceptionDestructor)(llvm_exception *); + + // ExceptionType - This field identifies what runtime library this exception + // came from. Currently defined values are: + // 0 - Error + // 1 - longjmp exception (see longjmp-exception.c) + // 2 - C++ exception (see c++-e
[llvm-commits] CVS: llvm/runtime/GCCLibraries/libgcc/Makefile eprintf.c
Changes in directory llvm/runtime/GCCLibraries/libgcc: Makefile updated: 1.9 -> 1.10 eprintf.c updated: 1.2 -> 1.3 --- Log message: Undo removal of the runtime libraries. While this may have been a bit premature, these libraries will be going away for the 2.0 release. Other arrangements for profiling, gc, etc. should be made in the next few months. --- Diffs of the changes: (+29 -0) Makefile | 16 eprintf.c | 13 + 2 files changed, 29 insertions(+) Index: llvm/runtime/GCCLibraries/libgcc/Makefile diff -u /dev/null llvm/runtime/GCCLibraries/libgcc/Makefile:1.10 --- /dev/null Thu Nov 16 21:32:44 2006 +++ llvm/runtime/GCCLibraries/libgcc/Makefile Thu Nov 16 21:32:33 2006 @@ -0,0 +1,16 @@ +##===- runtime/GCCLibraries/libgcc/Makefile *- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file was developed by the LLVM research group and is distributed under +# the University of Illinois Open Source License. See LICENSE.TXT for details. +# +##===--===## + +LEVEL = ../../.. +BYTECODE_LIBRARY = 1 +DONT_BUILD_RELINKED = 1 +LIBRARYNAME = gcc +BYTECODE_DESTINATION = $(CFERuntimeLibDir) + +include $(LEVEL)/Makefile.common Index: llvm/runtime/GCCLibraries/libgcc/eprintf.c diff -u /dev/null llvm/runtime/GCCLibraries/libgcc/eprintf.c:1.3 --- /dev/null Thu Nov 16 21:33:06 2006 +++ llvm/runtime/GCCLibraries/libgcc/eprintf.c Thu Nov 16 21:32:33 2006 @@ -0,0 +1,13 @@ +#include +void abort(void); + +/* This is used by the `assert' macro. */ +void +__eprintf (const char *string, const char *expression, + unsigned int line, const char *filename) +{ + fprintf (stderr, string, expression, line, filename); + fflush (stderr); + abort (); +} + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/GC/GCInterface.h Makefile gc_exported_symbols.lst
Changes in directory llvm/runtime/GC: GCInterface.h updated: 1.5 -> 1.6 Makefile updated: 1.4 -> 1.5 gc_exported_symbols.lst updated: 1.2 -> 1.3 --- Log message: Undo removal of the runtime libraries. While this may have been a bit premature, these libraries will be going away for the 2.0 release. Other arrangements for profiling, gc, etc. should be made in the next few months. --- Diffs of the changes: (+74 -0) GCInterface.h | 48 Makefile| 19 +++ gc_exported_symbols.lst |7 +++ 3 files changed, 74 insertions(+) Index: llvm/runtime/GC/GCInterface.h diff -u /dev/null llvm/runtime/GC/GCInterface.h:1.6 --- /dev/null Thu Nov 16 21:32:43 2006 +++ llvm/runtime/GC/GCInterface.h Thu Nov 16 21:32:33 2006 @@ -0,0 +1,48 @@ +/*===-- GCInterface.h - Public interface exposed by garbage collectors ===*\ +|* +|* The LLVM Compiler Infrastructure +|* +|* This file was developed by the LLVM research group and is distributed under +|* the University of Illinois Open Source License. See LICENSE.TXT for details. +|* +|*===--===*| +|* +|* This file defines the common public interface that must be exposed by all +|* LLVM garbage collectors. +|* +\*===--===*/ + +#ifndef GCINTERFACE_H +#define GCINTERFACE_H + +/* llvm_cg_walk_gcroots - This function is exposed by the LLVM code generator, + * and allows us to traverse the roots on the stack. + */ +void llvm_cg_walk_gcroots(void (*FP)(void **Root, void *Meta)); + + +/* llvm_gc_initialize - This function is called to initalize the garbage + * collector. + */ +void llvm_gc_initialize(unsigned InitialHeapSize); + +/* llvm_gc_allocate - This function allocates Size bytes from the heap and + * returns a pointer to it. + */ +void *llvm_gc_allocate(unsigned Size); + +/* llvm_gc_collect - This function forces a garbage collection cycle. + */ +void llvm_gc_collect(); + +/* llvm_gc_read - This function should be implemented to include any read + * barrier code that is needed by the garbage collector. + */ +void *llvm_gc_read(void *ObjPtr, void **FieldPtr); + +/* llvm_gc_write - This function should be implemented to include any write + * barrier code that is needed by the garbage collector. + */ +void llvm_gc_write(void *V, void *ObjPtr, void **FieldPtr); + +#endif Index: llvm/runtime/GC/Makefile diff -u /dev/null llvm/runtime/GC/Makefile:1.5 --- /dev/null Thu Nov 16 21:33:09 2006 +++ llvm/runtime/GC/MakefileThu Nov 16 21:32:33 2006 @@ -0,0 +1,19 @@ +##===- runtime/GC/Makefile -*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file was developed by the LLVM research group and is distributed under +# the University of Illinois Open Source License. See LICENSE.TXT for details. +# +##===--===## + +LEVEL = ../.. +PARALLEL_DIRS := SemiSpace +EXTRA_DIST := gc_exported_symbols.lst +include $(LEVEL)/Makefile.common + +# Install target for libraries: Copy into $LLVMGCCDIR/bytecode-libs +# +install:: + +clean:: Index: llvm/runtime/GC/gc_exported_symbols.lst diff -u /dev/null llvm/runtime/GC/gc_exported_symbols.lst:1.3 --- /dev/null Thu Nov 16 21:33:09 2006 +++ llvm/runtime/GC/gc_exported_symbols.lst Thu Nov 16 21:32:33 2006 @@ -0,0 +1,7 @@ +llvm_gc_initialize +llvm_gc_allocate +llvm_gc_collect +llvm_gc_write +llvm_gc_read + +llvm_gc_root_chain \ No newline at end of file ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/libtrace/Makefile README.txt tracelib.c tracelib.h
Changes in directory llvm/runtime/libtrace: Makefile updated: 1.15 -> 1.16 README.txt updated: 1.2 -> 1.3 tracelib.c updated: 1.13 -> 1.14 tracelib.h updated: 1.4 -> 1.5 --- Log message: Undo removal of the runtime libraries. While this may have been a bit premature, these libraries will be going away for the 2.0 release. Other arrangements for profiling, gc, etc. should be made in the next few months. --- Diffs of the changes: (+452 -0) Makefile | 18 ++ README.txt |2 tracelib.c | 392 + tracelib.h | 40 ++ 4 files changed, 452 insertions(+) Index: llvm/runtime/libtrace/Makefile diff -u /dev/null llvm/runtime/libtrace/Makefile:1.16 --- /dev/null Thu Nov 16 21:32:43 2006 +++ llvm/runtime/libtrace/Makefile Thu Nov 16 21:32:33 2006 @@ -0,0 +1,18 @@ +##===- runtime/libtrace/Makefile ---*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file was developed by the LLVM research group and is distributed under +# the University of Illinois Open Source License. See LICENSE.TXT for details. +# +##===--===## + +LEVEL = ../.. +BYTECODE_LIBRARY = 1 +LIBRARYNAME = trace +BYTECODE_DESTINATION = $(CFERuntimeLibDir) + +include $(LEVEL)/Makefile.common + +CompileCommonOpts := $(filter-out -pedantic,$(CompileCommonOpts)) +CompileCommonOpts := $(filter-out -Wno-long-long,$(CompileCommonOpts)) Index: llvm/runtime/libtrace/README.txt diff -u /dev/null llvm/runtime/libtrace/README.txt:1.3 --- /dev/null Thu Nov 16 21:33:10 2006 +++ llvm/runtime/libtrace/README.txtThu Nov 16 21:32:33 2006 @@ -0,0 +1,2 @@ +These routines form the support library for the LLVM -trace and -tracem +instrumentation passes. Index: llvm/runtime/libtrace/tracelib.c diff -u /dev/null llvm/runtime/libtrace/tracelib.c:1.14 --- /dev/null Thu Nov 16 21:33:10 2006 +++ llvm/runtime/libtrace/tracelib.cThu Nov 16 21:32:33 2006 @@ -0,0 +1,392 @@ +/*===-- tracelib.c - Runtime routines for tracing ---*- C++ -*-===* + * + * Runtime routines for supporting tracing of execution for code generated by + * LLVM. + * + *===--===*/ + +#include "tracelib.h" +#include +#include +#include +#include +#include "llvm/Support/DataTypes.h" + +/*===-= + * HASH FUNCTIONS + *===-===*/ + +/* use #defines until we have inlining */ +typedef uintptr_t Index; /* type of keys, size for hash table */ +typedef uint32_t Generic; /* type of values stored in table */ + +/* Index IntegerHashFunc(const Generic value, const Index size) */ +#define IntegerHashFunc(value, size) \ + ( Index) value) << 3) ^ (((Index) value) >> 3)) % size ) + +/* Index IntegerRehashFunc(const Generic oldHashValue, const Index size) */ +#define IntegerRehashFunc(oldHashValue, size) \ + ((Index) ((oldHashValue+16) % size)) /* 16 is relatively prime to a Mersenne prime! */ + +/* Index PointerHashFunc(const void* value, const Index size) */ +#define PointerHashFunc(value, size) \ + IntegerHashFunc((Index) value, size) + +/* Index PointerRehashFunc(const void* value, const Index size) */ +#define PointerRehashFunc(value, size) \ + IntegerRehashFunc((Index) value, size) + +/*===-= + * POINTER-TO-GENERIC HASH TABLE. + * These should be moved to a separate location: HashTable.[ch] + *===-===*/ + +typedef enum { FIND, ENTER } ACTION; +typedef char FULLEMPTY; +const FULLEMPTY EMPTY = '\0'; +const FULLEMPTY FULL = '\1'; + +// List of primes closest to powers of 2 in [2^20 -- 2^30], obtained from +// http://www.utm.edu/research/primes/lists/2small/0bit.html. +// Use these as the successive sizes of the hash table. +#define NUMPRIMES 11 +#define FIRSTENTRY 2 +const unsigned PRIMES[NUMPRIMES] = { (1<<20)-3, (1<<21)-9, (1<<22)-3, (1<<23)-15, + (1<<24)-3, (1<<25)-39, (1<<26)-5, (1<<27)-39, + (1<<28)-57, (1<<29)-3, (1<<30)-35 }; +unsigned CurrentSizeEntry = FIRSTENTRY; + +const unsigned MAX_NUM_PROBES = 4; + +typedef struct PtrValueHashEntry_struct { + void* key; + Generic value; +} PtrValueHashEntry; + +typedef struct PtrValueHashTable_struct { + PtrValueHashEntry* table; + FULLEMPTY* fullEmptyFlags; + Index capacity; + Index size; +} PtrValueHashTable; + + +static Generic LookupOrInsertPtr(PtrValueHashTable* ptrTable, void* ptr, + ACTION action, Generic value); + +static void Insert(PtrValueHashTable* ptrTable, void* ptr, Generic value); + +static void Delete(PtrValueHashTable* ptrTable,
Re: [llvm-commits] CVS: llvm/include/llvm/Support/Debug.h
On Nov 16, 2006, at 6:25 PM, Reid Spencer wrote: > On Thu, 2006-11-16 at 17:44 -0800, Bill Wendling wrote: >> Basically, this is to get rid of static c'tor/d'tors scattered all >> over the source tree. (You get them whenever you #include >> .) >> A smart compiler should be able to remove all of the empty functions >> because they don't have any side-effects. > Hi Reid, > I understand the motivation for the change and I commend it, but I'm > concerned about getting it right. You're assuming a few things: a) the > compiler is smart enough to get rid of calls that have no side > effects, > b) the compiler knows how to determine if a function has no side > effects > without help (operator<< isn't marked "pure"), and c) that there > aren't > any side effects. c) can probably be proven by your iostream > implementation but a) and b) are a little tougher. > Of course, LLVM is self-hosted, so it should be smart enough to handle it. :-) > Can we build an optimized, with symbols (-g -O2) version of one of > these > modules and see if those symbols are getting removed ? If so, I'm > fine > with it. If not, we need a new strategy. > I hope I did this correctly. Anyway, here are the files: t.h: #include class llvm_ostream { std::ostream* Stream; public: llvm_ostream() : Stream(0) {} llvm_ostream(std::ostream& OStream) : Stream(&OStream) {} template llvm_ostream& operator << (const Ty& Thing) { #ifndef NDEBUG if (Stream) *Stream << Thing; #endif return *this; } }; /// getErrorOutputStream - Returns the error output stream (std::cerr). This /// places the std::c* I/O streams into one .cpp file and relieves the whole /// program from having to have hundreds of static c'tor/d'tors for them. /// llvm_ostream getErrorOutputStream(const char *DebugType); #ifdef NDEBUG #define DOUT llvm_ostream() #else #define DOUT getErrorOutputStream(DEBUG_TYPE) #endif t.cpp: #define DEBUG_TYPE "experiment" #include "t.h" int main() { DOUT << "Hello world\n"; } foo.cpp: #include "t.h" #include llvm_ostream getErrorOutputStream(const char *DebugType) { if (DebugType) return llvm_ostream(std::cerr); else return llvm_ostream(); } Compiled with -DNDEBUG -g -O2 gives: $ nm -A foo.o foo.o: 0170 s EH_frame1 foo.o: 0160 s __GLOBAL__I__Z20getErrorOutputStreamPKc foo.o: a __GLOBAL__I__Z20getErrorOutputStreamPKc.eh foo.o: T __Z20getErrorOutputStreamPKc foo.o: A __Z20getErrorOutputStreamPKc.eh foo.o: 00d0 s __Z41__static_initialization_and_destruction_0ii foo.o: 018c s __Z41__static_initialization_and_destruction_0ii.eh foo.o: U __ZNSt8ios_base4InitC1Ev foo.o: U __ZNSt8ios_base4InitD1Ev foo.o: U __ZSt4cerr foo.o: 01d0 b __ZSt8__ioinit foo.o: U ___cxa_atexit foo.o: U ___dso_handle foo.o: U ___gxx_personality_v0 foo.o: 0040 t ___tcf_0 foo.o: a ___tcf_0.eh foo.o: U dyld_stub_binding_helper $ nm -A t.o t.o: T _main t.o: A _main.eh Compiling with -g -O2 gives: $ nm -A foo.o foo.o: 0170 s EH_frame1 foo.o: 0160 s __GLOBAL__I__Z20getErrorOutputStreamPKc foo.o: a __GLOBAL__I__Z20getErrorOutputStreamPKc.eh foo.o: T __Z20getErrorOutputStreamPKc foo.o: A __Z20getErrorOutputStreamPKc.eh foo.o: 00d0 s __Z41__static_initialization_and_destruction_0ii foo.o: 018c s __Z41__static_initialization_and_destruction_0ii.eh foo.o: U __ZNSt8ios_base4InitC1Ev foo.o: U __ZNSt8ios_base4InitD1Ev foo.o: U __ZSt4cerr foo.o: 01d0 b __ZSt8__ioinit foo.o: U ___cxa_atexit foo.o: U ___dso_handle foo.o: U ___gxx_personality_v0 foo.o: 0040 t ___tcf_0 foo.o: a ___tcf_0.eh foo.o: U dyld_stub_binding_helper $ nm -A t.o t.o: 00bc s EH_frame1 t.o: U __Z20getErrorOutputStreamPKc t.o: U __ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc t.o: U ___gxx_personality_v0 t.o: T _main t.o: 00d8 S _main.eh t.o: U dyld_stub_binding_helper So it seems like gcc is doing the right thing, I suppose. I'm going to give it a try with the LLVM source in the CodeGen directory. -bw ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/Makefile README.txt
Changes in directory llvm/runtime: Makefile updated: 1.29 -> 1.30 README.txt updated: 1.3 -> 1.4 --- Log message: Undo removal of the runtime libraries. While this may have been a bit premature, these libraries will be going away for the 2.0 release. Other arrangements for profiling, gc, etc. should be made in the next few months. --- Diffs of the changes: (+47 -0) Makefile | 43 +++ README.txt |4 2 files changed, 47 insertions(+) Index: llvm/runtime/Makefile diff -u /dev/null llvm/runtime/Makefile:1.30 --- /dev/null Thu Nov 16 21:32:43 2006 +++ llvm/runtime/Makefile Thu Nov 16 21:32:33 2006 @@ -0,0 +1,43 @@ +##===- runtime/Makefile *- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file was developed by the LLVM research group and is distributed under +# the University of Illinois Open Source License. See LICENSE.TXT for details. +# +##===--===## + +LEVEL = .. +include $(LEVEL)/Makefile.config + +ifeq ($(LLVMGCC_MAJVERS),4) +PARALLEL_DIRS := +install all:: + $(Echo) "Warning: These runtime libraries only need to be built with" + $(Echo) "Warning: llvm-gcc version 3. They are automatically included" + $(Echo) "Warning: with llvm-gcc version 4 and beyond" +else +ifneq ($(wildcard $(LLVMGCC)),) +PARALLEL_DIRS := GCCLibraries libdummy libprofile libtrace GC +else +PARALLEL_DIRS := +install all :: + @echo '' Warning: Your LLVMGCCDIR is set incorrectly. Check + @echo '' Warning: llvm/Makefile.config to make sure it matches + @echo '' Warning: the directory where the C front-end is + @echo '' Warning: installed,and re-run configure if it does not. +endif + +# Disable libprofile: a faulty libtool is generated by autoconf which breaks the +# build on Sparc +ifeq ($(ARCH), Sparc) +PARALLEL_DIRS := $(filter-out libprofile, $(PARALLEL_DIRS)) +endif +endif + +include $(LEVEL)/Makefile.common + +# Install target for libraries: Copy into $LLVMGCCDIR/bytecode-libs +# +install:: + Index: llvm/runtime/README.txt diff -u /dev/null llvm/runtime/README.txt:1.4 --- /dev/null Thu Nov 16 21:33:05 2006 +++ llvm/runtime/README.txt Thu Nov 16 21:32:33 2006 @@ -0,0 +1,4 @@ +This directory contains the various runtime libraries used by components of +the LLVM compiler. For example, the automatic pool allocation transformation +inserts calls to an external pool allocator library. This runtime library is +an example of the type of library that lives in these directories. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/include/llvm/Support/Debug.h
On Nov 16, 2006, at 6:25 PM, Reid Spencer wrote: > Can we build an optimized, with symbols (-g -O2) version of one of > these > modules and see if those symbols are getting removed ? If so, I'm > fine > with it. If not, we need a new strategy. > I just compiled the normal way (with -g) and RegAllocLinearScan had a bunch of strings when I ran "strings" on it. When I compiled it with "-g -O2 -DNDEBUG", it gave this: Linear Scan Register Allocator regalloc Ratio of intervals processed over total intervals Number of times we had to backtrack linearscan linear scan register allocator vector::_M_insert_aux }d[x9) And there was only llvm_ostream in the -g way of compiling things. -bw ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll
Changes in directory llvm/test/Regression/Transforms/LoopStrengthReduce: var_stride_used_by_compare.ll added (r1.1) --- Log message: New testcase. --- Diffs of the changes: (+48 -0) var_stride_used_by_compare.ll | 48 ++ 1 files changed, 48 insertions(+) Index: llvm/test/Regression/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll diff -c /dev/null llvm/test/Regression/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll:1.1 *** /dev/null Fri Nov 17 00:09:59 2006 --- llvm/test/Regression/Transforms/LoopStrengthReduce/var_stride_used_by_compare.ll Fri Nov 17 00:09:49 2006 *** *** 0 --- 1,48 + ; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis && + + ; Base should not be i*3, it should be i*2. + ; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | not grep 'mul.*%i, 3' && + + ; Indvar should not start at zero: + ; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | not grep 'phi uint .* 0' + + ; mul uint %i, 3 + + ; ModuleID = 't.bc' + target datalayout = "e-p:32:32" + target endian = little + target pointersize = 32 + target triple = "i686-apple-darwin8" + %flags2 = external global [8193 x sbyte], align 32; <[8193 x sbyte]*> [#uses=1] + + implementation ; Functions: + + void %foo(int %k, int %i) { + entry: + %i = cast int %i to uint; [#uses=2] + %k_addr.012 = shl int %i, ubyte 1 ; [#uses=1] + %tmp14 = setgt int %k_addr.012, 8192; [#uses=1] + br bool %tmp14, label %return, label %bb.preheader + + bb.preheader: ; preds = %entry + %tmp. = shl uint %i, ubyte 1; [#uses=1] + br label %bb + + bb: ; preds = %bb, %bb.preheader + %indvar = phi uint [ %indvar.next, %bb ], [ 0, %bb.preheader ] ; [#uses=2] + %tmp.15 = mul uint %indvar, %i ; [#uses=1] + %tmp.16 = add uint %tmp.15, %tmp. ; [#uses=2] + %k_addr.0.0 = cast uint %tmp.16 to int ; [#uses=1] + %tmp = getelementptr [8193 x sbyte]* %flags2, int 0, uint %tmp.16 ; [#uses=1] + store sbyte 0, sbyte* %tmp + %k_addr.0 = add int %k_addr.0.0, %i ; [#uses=1] + %tmp = setgt int %k_addr.0, 8192; [#uses=1] + %indvar.next = add uint %indvar, 1 ; [#uses=1] + br bool %tmp, label %return.loopexit, label %bb + + return.loopexit: ; preds = %bb + br label %return + + return: ; preds = %return.loopexit, %entry + ret void + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Changes in directory llvm/lib/Transforms/Scalar: LoopStrengthReduce.cpp updated: 1.93 -> 1.94 --- Log message: If an indvar with a variable stride is used by the exit condition, go ahead and handle it like constant stride vars. This fixes some bad codegen in variable stride cases. For example, it compiles this: void foo(int k, int i) { for (k=i+i; k <= 8192; k+=i) flags2[k] = 0; } to: LBB1_1: #bb.preheader movl %eax, %ecx addl %ecx, %ecx movl L_flags2$non_lazy_ptr, %edx LBB1_2: #bb movb $0, (%edx,%ecx) addl %eax, %ecx cmpl $8192, %ecx jle LBB1_2 #bb LBB1_5: #return ret or (if the array is local and we are in dynamic-nonpic or static mode): LBB3_2: #bb movb $0, _flags2(%ecx) addl %eax, %ecx cmpl $8192, %ecx jle LBB3_2 #bb and: lis r2, ha16(L_flags2$non_lazy_ptr) lwz r2, lo16(L_flags2$non_lazy_ptr)(r2) slwi r3, r4, 1 LBB1_2: ;bb li r5, 0 add r6, r4, r3 stbx r5, r2, r3 cmpwi cr0, r6, 8192 bgt cr0, LBB1_5 ;return instead of: leal (%eax,%eax,2), %ecx movl %eax, %edx addl %edx, %edx addl L_flags2$non_lazy_ptr, %edx xorl %esi, %esi LBB1_2: #bb movb $0, (%edx,%esi) movl %eax, %edi addl %esi, %edi addl %ecx, %esi cmpl $8192, %esi jg LBB1_5 #return and: lis r2, ha16(L_flags2$non_lazy_ptr) lwz r2, lo16(L_flags2$non_lazy_ptr)(r2) mulli r3, r4, 3 slwi r5, r4, 1 li r6, 0 add r2, r2, r5 LBB1_2: ;bb li r5, 0 add r7, r3, r6 stbx r5, r2, r6 add r6, r4, r6 cmpwi cr0, r7, 8192 ble cr0, LBB1_2 ;bb This speeds up Benchmarks/Shootout/sieve from 8.533s to 6.464s and implements LoopStrengthReduce/var_stride_used_by_compare.ll --- Diffs of the changes: (+0 -4) LoopStrengthReduce.cpp |4 1 files changed, 4 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.93 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.94 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.93 Thu Nov 2 14:25:50 2006 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Fri Nov 17 00:17:33 2006 @@ -1217,10 +1217,6 @@ } if (!CondUse) return; // setcc doesn't use the IV. - // setcc stride is complex, don't mess with users. - // FIXME: Evaluate whether this is a good idea or not. - if (!isa(*CondStride)) return; - // It's possible for the setcc instruction to be anywhere in the loop, and // possible for it to have multiple users. If it is not immediately before // the latch block branch, move it. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysis.cpp PostDominators.cpp
Changes in directory llvm/lib/Analysis: AliasAnalysis.cpp updated: 1.29 -> 1.30 PostDominators.cpp updated: 1.61 -> 1.62 --- Log message: Removed unneeded #include. --- Diffs of the changes: (+0 -2) AliasAnalysis.cpp |1 - PostDominators.cpp |1 - 2 files changed, 2 deletions(-) Index: llvm/lib/Analysis/AliasAnalysis.cpp diff -u llvm/lib/Analysis/AliasAnalysis.cpp:1.29 llvm/lib/Analysis/AliasAnalysis.cpp:1.30 --- llvm/lib/Analysis/AliasAnalysis.cpp:1.29Wed Jun 7 17:00:26 2006 +++ llvm/lib/Analysis/AliasAnalysis.cpp Fri Nov 17 01:10:51 2006 @@ -30,7 +30,6 @@ #include "llvm/Instructions.h" #include "llvm/Type.h" #include "llvm/Target/TargetData.h" -#include using namespace llvm; // Register the AliasAnalysis interface, providing a nice name to refer to. Index: llvm/lib/Analysis/PostDominators.cpp diff -u llvm/lib/Analysis/PostDominators.cpp:1.61 llvm/lib/Analysis/PostDominators.cpp:1.62 --- llvm/lib/Analysis/PostDominators.cpp:1.61 Wed Sep 27 12:18:05 2006 +++ llvm/lib/Analysis/PostDominators.cppFri Nov 17 01:10:51 2006 @@ -16,7 +16,6 @@ #include "llvm/Support/CFG.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/SetOperations.h" -#include using namespace llvm; //===--===// ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp
Changes in directory llvm/lib/Analysis/IPA: Andersens.cpp updated: 1.35 -> 1.36 --- Log message: Replaced DEBUG(std::cerr with DOUT. --- Diffs of the changes: (+5 -6) Andersens.cpp | 11 +-- 1 files changed, 5 insertions(+), 6 deletions(-) Index: llvm/lib/Analysis/IPA/Andersens.cpp diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.35 llvm/lib/Analysis/IPA/Andersens.cpp:1.36 --- llvm/lib/Analysis/IPA/Andersens.cpp:1.35Wed Nov 8 00:47:33 2006 +++ llvm/lib/Analysis/IPA/Andersens.cpp Fri Nov 17 01:36:54 2006 @@ -1036,7 +1036,7 @@ while (Changed) { Changed = false; ++NumIters; -DEBUG(std::cerr << "Starting iteration #" << Iteration++ << "!\n"); +DOUT << "Starting iteration #" << Iteration++ << "!\n"; // Loop over all of the constraints, applying them in turn. for (unsigned i = 0, e = Constraints.size(); i != e; ++i) { @@ -1069,8 +1069,7 @@ // We found a function that is just now escaping. Mark it as if it // didn't have internal linkage. AddConstraintsForNonInternalLinkage(F); -DEBUG(std::cerr << "Found escaping internal function: " -<< F->getName() << "\n"); +DOUT << "Found escaping internal function: " << F->getName() <<"\n"; ++NumEscapingFunctions; } @@ -1088,9 +1087,9 @@ if (IP == KnownCallees.end() || *IP != F) { // Add the constraints for the call now. AddConstraintsForCall(CS, F); - DEBUG(std::cerr << "Found actual callee '" - << F->getName() << "' for call: " - << *CS.getInstruction() << "\n"); + DOUT << "Found actual callee '" + << F->getName() << "' for call: " + << *CS.getInstruction() << "\n"; ++NumIndirectCallees; KnownCallees.insert(IP, F); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp CompleteBottomUp.cpp DataStructure.cpp EquivClassGraphs.cpp Local.cpp TopDownClosure.cpp
Changes in directory llvm/lib/Analysis/DataStructure: BottomUpClosure.cpp updated: 1.123 -> 1.124 CompleteBottomUp.cpp updated: 1.37 -> 1.38 DataStructure.cpp updated: 1.249 -> 1.250 EquivClassGraphs.cpp updated: 1.49 -> 1.50 Local.cpp updated: 1.159 -> 1.160 TopDownClosure.cpp updated: 1.93 -> 1.94 --- Log message: Replace DEBUG(std::cerr with DOUT. Removed some iostream #includes. --- Diffs of the changes: (+95 -106) BottomUpClosure.cpp | 60 --- CompleteBottomUp.cpp | 23 +-- DataStructure.cpp| 42 +-- EquivClassGraphs.cpp | 37 ++- Local.cpp| 14 +-- TopDownClosure.cpp | 25 - 6 files changed, 95 insertions(+), 106 deletions(-) Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.123 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.124 --- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.123 Mon Oct 23 14:55:24 2006 +++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp Fri Nov 17 01:33:59 2006 @@ -138,8 +138,8 @@ DSNode *N = new DSNode(F->getType()->getElementType(), GI); // Create the node N->addGlobal(F); NHF.setTo(N,0); -DEBUG(std::cerr << "Adding " << F->getName() << " to a call node in " - << D.getCaller().getName() << "\n"); +DOUT << "Adding " << F->getName() << " to a call node in " + << D.getCaller().getName() << "\n"; } DL.getCalleeNode()->mergeWith(NHF, 0); } @@ -171,8 +171,8 @@ for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if (!I->isExternal() && !DSInfo.count(I)) { if (MainFunc) -DEBUG(std::cerr << "*** BU: Function unreachable from main: " - << I->getName() << "\n"); +DOUT << "*** BU: Function unreachable from main: " + << I->getName() << "\n"; calculateGraphs(I, Stack, NextID, ValMap); // Calculate all graphs. } @@ -203,7 +203,7 @@ BuildGlobalECs(*GlobalsGraph, ECGlobals); if (!ECGlobals.empty()) { NamedRegionTimer X("Bottom-UP EC Cleanup"); -DEBUG(std::cerr << "Eliminating " << ECGlobals.size() << " EC Globals!\n"); +DOUT << "Eliminating " << ECGlobals.size() << " EC Globals!\n"; for (hash_map::iterator I = DSInfo.begin(), E = DSInfo.end(); I != E; ++I) EliminateUsesOfECGlobals(*I->second, ECGlobals); @@ -235,12 +235,12 @@ ee = MainGraph.afc_end(); ii != ee; ++ii) { std::vector Funcs; GetAllCalleesN(*ii, Funcs); - DEBUG(std::cerr << "Lost site\n"); + DOUT << "Lost site\n"; DEBUG(ii->getCallSite().getInstruction()->dump()); for (std::vector::iterator iif = Funcs.begin(), eef = Funcs.end(); iif != eef; ++iif) { AddGlobalToNode(this, *ii, *iif); -DEBUG(std::cerr << "Adding\n"); +DOUT << "Adding\n"; ActualCallees.insert(std::make_pair(ii->getCallSite().getInstruction(), *iif)); } } @@ -383,15 +383,15 @@ // If this is a new SCC, process it now. if (Stack.back() == F) { // Special case the single "SCC" case here. -DEBUG(std::cerr << "Visiting single node SCC #: " << MyID << " fn: " -<< F->getName() << "\n"); +DOUT << "Visiting single node SCC #: " << MyID << " fn: " + << F->getName() << "\n"; Stack.pop_back(); DSGraph &G = getDSGraph(*F); -DEBUG(std::cerr << " [BU] Calculating graph for: " << F->getName()<< "\n"); +DOUT << " [BU] Calculating graph for: " << F->getName()<< "\n"; calculateGraph(G); -DEBUG(std::cerr << " [BU] Done inlining: " << F->getName() << " [" -<< G.getGraphSize() << "+" << G.getAuxFunctionCalls().size() -<< "]\n"); +DOUT << " [BU] Done inlining: " << F->getName() << " [" + << G.getGraphSize() << "+" << G.getAuxFunctionCalls().size() + << "]\n"; if (MaxSCC < 1) MaxSCC = 1; @@ -399,7 +399,7 @@ // callees. GetAllAuxCallees(Graph, CalleeFunctions); if (!CalleeFunctions.empty()) { - DEBUG(std::cerr << "Recalculating " << F->getName() << " due to new knowledge\n"); + DOUT << "Recalculating " << F->getName() << " due to new knowledge\n"; ValMap.erase(F); return calculateGraphs(F, Stack, NextID, ValMap); } else { @@ -440,8 +440,8 @@ } Stack.pop_back(); -DEBUG(std::cerr << "Calculating graph for SCC #: " << MyID << " of size: " -<< SCCSize << "\n"); +DOUT << "Calculating graph for SCC #: " << MyID << " of size: " + << SCCSize << "\n"; // Compute the Max SCC Size. if (MaxSCC < SCCSize) @@ -453,10 +453,9 @@ // Now that we have one big happy family, resolve all of the call sites in // the graph... calculateGraph(SC
[llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86CodeEmitter.cpp X86ISelDAGToDAG.cpp X86JITInfo.cpp X86TargetMachine.cpp
Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.72 -> 1.73 X86CodeEmitter.cpp updated: 1.122 -> 1.123 X86ISelDAGToDAG.cpp updated: 1.127 -> 1.128 X86JITInfo.cpp updated: 1.31 -> 1.32 X86TargetMachine.cpp updated: 1.127 -> 1.128 --- Log message: Removed even more std::cerr and #include things. --- Diffs of the changes: (+20 -31) X86ATTAsmPrinter.cpp |1 - X86CodeEmitter.cpp |4 +--- X86ISelDAGToDAG.cpp | 34 ++ X86JITInfo.cpp | 11 +-- X86TargetMachine.cpp |1 - 5 files changed, 20 insertions(+), 31 deletions(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.72 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.73 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.72 Tue Oct 31 14:12:30 2006 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cppFri Nov 17 01:52:03 2006 @@ -23,7 +23,6 @@ #include "llvm/Support/Mangler.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetOptions.h" -#include using namespace llvm; /// getSectionForFunction - Return the section that we should emit the Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.122 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.123 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.122Thu Nov 9 19:28:43 2006 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Fri Nov 17 01:52:03 2006 @@ -26,7 +26,6 @@ #include "llvm/ADT/Statistic.h" #include "llvm/Support/Compiler.h" #include "llvm/Target/TargetOptions.h" -#include using namespace llvm; namespace { @@ -623,8 +622,7 @@ default: assert(0 && "psuedo instructions should be removed before code emission"); case TargetInstrInfo::INLINEASM: - std::cerr << "JIT does not support inline asm!\n"; - abort(); + assert(0 && "JIT does not support inline asm!\n"); case X86::IMPLICIT_USE: case X86::IMPLICIT_DEF: case X86::IMPLICIT_DEF_GR8: Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.127 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.128 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.127 Mon Nov 13 17:36:35 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Fri Nov 17 01:52:03 2006 @@ -464,12 +464,12 @@ // Codegen the basic block. #ifndef NDEBUG - DEBUG(std::cerr << "= Instruction selection begins:\n"); + DOUT << "= Instruction selection begins:\n"; Indent = 0; #endif DAG.setRoot(SelectRoot(DAG.getRoot())); #ifndef NDEBUG - DEBUG(std::cerr << "= Instruction selection ends:\n"); + DOUT << "= Instruction selection ends:\n"; #endif DAG.RemoveDeadNodes(); @@ -966,19 +966,17 @@ unsigned Opcode = Node->getOpcode(); #ifndef NDEBUG - DEBUG(std::cerr << std::string(Indent, ' ')); - DEBUG(std::cerr << "Selecting: "); + DOUT << std::string(Indent, ' ') << "Selecting: "; DEBUG(Node->dump(CurDAG)); - DEBUG(std::cerr << "\n"); + DOUT << "\n"; Indent += 2; #endif if (Opcode >= ISD::BUILTIN_OP_END && Opcode < X86ISD::FIRST_NUMBER) { #ifndef NDEBUG -DEBUG(std::cerr << std::string(Indent-2, ' ')); -DEBUG(std::cerr << "== "); +DOUT << std::string(Indent-2, ' ') << "== "; DEBUG(Node->dump(CurDAG)); -DEBUG(std::cerr << "\n"); +DOUT << "\n"; Indent -= 2; #endif return NULL; // Already selected. @@ -1106,10 +1104,9 @@ ReplaceUses(N1.getValue(1), Result.getValue(1)); #ifndef NDEBUG - DEBUG(std::cerr << std::string(Indent-2, ' ')); - DEBUG(std::cerr << "=> "); + DOUT << std::string(Indent-2, ' ') << "=> "; DEBUG(Result.Val->dump(CurDAG)); - DEBUG(std::cerr << "\n"); + DOUT << "\n"; Indent -= 2; #endif return NULL; @@ -1218,10 +1215,9 @@ ReplaceUses(N1.getValue(1), Result.getValue(1)); #ifndef NDEBUG - DEBUG(std::cerr << std::string(Indent-2, ' ')); - DEBUG(std::cerr << "=> "); + DOUT << std::string(Indent-2, ' ') << "=> "; DEBUG(Result.Val->dump(CurDAG)); - DEBUG(std::cerr << "\n"); + DOUT << "\n"; Indent -= 2; #endif @@ -1252,10 +1248,9 @@ SDNode *ResNode = CurDAG->getTargetNode(Opc2, NVT, Tmp); #ifndef NDEBUG -DEBUG(std::cerr << std::string(Indent-2, ' ')); -DEBUG(std::cerr << "=> "); +DOUT << std::string(Indent-2, ' ') << "=> "; DEBUG(ResNode->dump(CurDAG)); -DEBUG(std::cerr << "\n"); +DOUT << "\n"; Indent -= 2; #endif return ResNode; @@ -1268,13 +1263,12 @@ SDNode *ResNode = SelectCode(N); #ifndef NDEBUG - DEBUG(std::cerr << std::string(Indent-2, ' ')); - DEBUG(std::cerr << "=> "); + DOUT << std::string(Indent-2, ' ') << "=> "; if (ResNode == NULL || ResNode == N.Val) DEBUG(N.Val->dump(CurDAG)); else DEBUG(ResNode->dump(CurDAG)); - DEBUG(std::cerr << "\n"); + DOUT << "\n"; Indent -= 2; #endif Ind