From brukman at cs.uiuc.edu Mon Feb 14 03:07:34 2005 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon, 14 Feb 2005 03:07:34 -0600 Subject: [llvm-commits] CVS: llvm/CREDITS.TXT Message-ID: <200502140907.DAA31582@zion.cs.uiuc.edu> Changes in directory llvm: CREDITS.TXT updated: 1.35 -> 1.36 --- Log message: Give props to Andrew for the Alpha backend --- Diffs of the changes: (+6 -2) CREDITS.TXT | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/CREDITS.TXT diff -u llvm/CREDITS.TXT:1.35 llvm/CREDITS.TXT:1.36 --- llvm/CREDITS.TXT:1.35 Wed Feb 9 20:07:57 2005 +++ llvm/CREDITS.TXT Mon Feb 14 03:07:23 2005 @@ -52,10 +52,9 @@ N: Brian Gaeke E: gaeke at uiuc.edu W: http://www.students.uiuc.edu/~gaeke/ -D: Portions of X86 static and JIT compilers. +D: Portions of X86 static and JIT compilers; SparcV8 backend D: Dynamic trace optimizer D: FreeBSD/X86 compatibility fixes, the llvm-nm tool -D: SparcV8 backend N: Louis Gerbarg D: Portions of the PowerPC backend @@ -77,6 +76,11 @@ W: http://nondot.org/~sabre/ D: Primary architect of LLVM +N: Andrew Lenharth +E: alenhar2 at cs.uiuc.edu +W: http://www.lenharth.org/~andrewl/ +D: Alpha backend + N: Michael McCracken E: michael.mccracken at gmail.com D: Line number support for llvmgcc From alenhar2 at cs.uiuc.edu Mon Feb 14 09:03:15 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 14 Feb 2005 09:03:15 -0600 Subject: [llvm-commits] CVS: llvm-www/Developers.html Message-ID: <200502141503.j1EF3FhN024803@apoc.cs.uiuc.edu> Changes in directory llvm-www: Developers.html updated: 1.21 -> 1.22 --- Log message: Andrew's picture added --- Diffs of the changes: (+9 -0) Developers.html | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm-www/Developers.html diff -u llvm-www/Developers.html:1.21 llvm-www/Developers.html:1.22 --- llvm-www/Developers.html:1.21 Sat Jan 22 16:01:32 2005 +++ llvm-www/Developers.html Mon Feb 14 09:02:59 2005 @@ -78,6 +78,15 @@ Bill + + Andrew Lenharth + + brg + + + + From alenhar2 at cs.uiuc.edu Mon Feb 14 09:03:15 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 14 Feb 2005 09:03:15 -0600 Subject: [llvm-commits] CVS: llvm-www/img/PhotoAndrew.jpg Message-ID: <200502141503.j1EF3FIh024806@apoc.cs.uiuc.edu> Changes in directory llvm-www/img: PhotoAndrew.jpg added (r1.1) --- Log message: Andrew's picture added --- Diffs of the changes: (+0 -0) PhotoAndrew.jpg | 0 1 files changed Index: llvm-www/img/PhotoAndrew.jpg From reid at x10sys.com Mon Feb 14 10:02:30 2005 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Feb 2005 10:02:30 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.common Message-ID: <200502141602.KAA10577@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.common updated: 1.136 -> 1.137 --- Log message: Update comments to reflect new variable names. Patch contributed by Vladimir Merzliakov. --- Diffs of the changes: (+5 -5) Makefile.common | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/Makefile.common diff -u llvm/Makefile.common:1.136 llvm/Makefile.common:1.137 --- llvm/Makefile.common:1.136 Sat Jan 15 20:20:30 2005 +++ llvm/Makefile.common Mon Feb 14 10:02:19 2005 @@ -39,18 +39,18 @@ # # 6. LLVM_SRC_ROOT - If specified, points to the top of the LLVM source tree. # -# 8. BUILD_SRC_DIR - The directory which contains the current set of Makefiles +# 8. PROJ_SRC_DIR - The directory which contains the current set of Makefiles # and usually the source code too (unless SourceDir is set). # -# 9. BUILD_SRC_ROOT - The root directory of the source code being compiled. +# 9. PROJ_SRC_ROOT - The root directory of the source code being compiled. # -# 10. BUILD_OBJ_DIR - The directory where object code should be placed. +# 10. PROJ_OBJ_DIR - The directory where object code should be placed. # -# 11. BUILD_OBJ_ROOT - The root directory for where object code should be +# 11. PROJ_OBJ_ROOT - The root directory for where object code should be # placed. # # For building, -# LLVM, LLVM_SRC_ROOT = BUILD_SRC_ROOT +# LLVM, LLVM_SRC_ROOT = PROJ_SRC_ROOT # #===-----------------------------------------------------------------------==== From reid at x10sys.com Mon Feb 14 10:04:39 2005 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Feb 2005 10:04:39 -0600 Subject: [llvm-commits] CVS: llvm/projects/Stacker/test/Makefile Message-ID: <200502141604.KAA10608@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker/test: Makefile updated: 1.9 -> 1.10 --- Log message: Update makefile to use PROJ_* makefile variables intead of BUILD_* as required by changes to the Makefile.rules. Patch contributed by Vladimir Merzliakov. --- Diffs of the changes: (+2 -2) Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/projects/Stacker/test/Makefile diff -u llvm/projects/Stacker/test/Makefile:1.9 llvm/projects/Stacker/test/Makefile:1.10 --- llvm/projects/Stacker/test/Makefile:1.9 Sat Dec 4 23:18:28 2004 +++ llvm/projects/Stacker/test/Makefile Mon Feb 14 10:04:28 2005 @@ -37,8 +37,8 @@ test_each: $(TESTS) $(Echo) "Running Tests..." - $(Verb) LD_LIBRARY_PATH=$(BUILD_OBJ_ROOT)/lib/$(CONFIGURATION) \ - $(BUILD_SRC_DIR)/runtests $(BUILD_OBJ_DIR) $(TESTS) + $(Verb) LD_LIBRARY_PATH=$(PROJ_OBJ_ROOT)/lib/$(CONFIGURATION) \ + $(PROJ_SRC_DIR)/runtests $(PROJ_OBJ_DIR) $(TESTS) % : %.st Makefile testing.bc $(Echo) "Building $*" From alenhar2 at cs.uiuc.edu Mon Feb 14 10:06:47 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 14 Feb 2005 10:06:47 -0600 Subject: [llvm-commits] CVS: llvm-www/testresults/index.html Message-ID: <200502141606.j1EG6lTb025051@apoc.cs.uiuc.edu> Changes in directory llvm-www/testresults: index.html updated: 1.26 -> 1.27 --- Log message: Added alpha nightly tester --- Diffs of the changes: (+7 -0) index.html | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm-www/testresults/index.html diff -u llvm-www/testresults/index.html:1.26 llvm-www/testresults/index.html:1.27 --- llvm-www/testresults/index.html:1.26 Thu Jan 13 15:32:31 2005 +++ llvm-www/testresults/index.html Mon Feb 14 10:06:31 2005 @@ -46,6 +46,13 @@ build +

Alpha

+
    + +
  1. Linux (Single 21164 EV56 500 MHz) -- debug +build
  2. +
+ From alenhar2 at cs.uiuc.edu Mon Feb 14 10:21:32 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 14 Feb 2005 10:21:32 -0600 Subject: [llvm-commits] CVS: llvm-www/Developers.html Message-ID: <200502141621.j1EGLWWv025094@apoc.cs.uiuc.edu> Changes in directory llvm-www: Developers.html updated: 1.22 -> 1.23 --- Log message: Alpha ordering by column in a table. Head hurts. --- Diffs of the changes: (+16 -17) Developers.html | 33 ++++++++++++++++----------------- 1 files changed, 16 insertions(+), 17 deletions(-) Index: llvm-www/Developers.html diff -u llvm-www/Developers.html:1.22 llvm-www/Developers.html:1.23 --- llvm-www/Developers.html:1.22 Mon Feb 14 09:02:59 2005 +++ llvm-www/Developers.html Mon Feb 14 10:21:19 2005 @@ -21,10 +21,9 @@ vadve - Brad Jones - - KungFooMaster + Chris Lattner + + Sabre Nate Begeman @@ -32,9 +31,10 @@ Sampo - Chris Lattner - - Sabre + Tanya Lattner + + tonic + Misha Brukman @@ -43,10 +43,11 @@ title="Misha"/> - Tanya Lattner - - tonic - + Andrew Lenharth + + Andrew + John Criswell @@ -79,12 +80,10 @@ src="img/PhotoBill.jpg" alt="Bill" title="Bill"> - Andrew Lenharth - - brg - - + Brad Jones + + KungFooMaster From lattner at cs.uiuc.edu Mon Feb 14 10:45:53 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 10:45:53 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/CBackend/2005-02-14-VolatileOperations.ll Message-ID: <200502141645.j1EGjro3025732@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/CBackend: 2005-02-14-VolatileOperations.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+7 -0) 2005-02-14-VolatileOperations.ll | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/test/Regression/CodeGen/CBackend/2005-02-14-VolatileOperations.ll diff -c /dev/null llvm/test/Regression/CodeGen/CBackend/2005-02-14-VolatileOperations.ll:1.1 *** /dev/null Mon Feb 14 10:45:48 2005 --- llvm/test/Regression/CodeGen/CBackend/2005-02-14-VolatileOperations.ll Mon Feb 14 10:45:38 2005 *************** *** 0 **** --- 1,7 ---- + ; RUN: llvm-as < %s | llc -march=c | grep volatile + + void %test(int* %P) { + %X = volatile load int*%P + volatile store int %X, int* %P + ret void + } From lattner at cs.uiuc.edu Mon Feb 14 10:48:04 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 10:48:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200502141648.j1EGm4aC025748@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.220 -> 1.221 --- Log message: Implement CodeGen/CBackend/2005-02-14-VolatileOperations.ll Volatile loads and stores need to emit volatile pointer operations in C. --- Diffs of the changes: (+15 -0) Writer.cpp | 15 +++++++++++++++ 1 files changed, 15 insertions(+) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.220 llvm/lib/Target/CBackend/Writer.cpp:1.221 --- llvm/lib/Target/CBackend/Writer.cpp:1.220 Mon Jan 31 00:19:57 2005 +++ llvm/lib/Target/CBackend/Writer.cpp Mon Feb 14 10:47:52 2005 @@ -1655,12 +1655,27 @@ void CWriter::visitLoadInst(LoadInst &I) { Out << "*"; + if (I.isVolatile()) { + Out << "((volatile "; + printType(Out, I.getOperand(0)->getType()); + Out << ")"; + } + writeOperand(I.getOperand(0)); + + if (I.isVolatile()) + Out << ")"; } void CWriter::visitStoreInst(StoreInst &I) { Out << "*"; + if (I.isVolatile()) { + Out << "((volatile "; + printType(Out, I.getPointerOperand()->getType()); + Out << ")"; + } writeOperand(I.getPointerOperand()); + if (I.isVolatile()) Out << ")"; Out << " = "; writeOperand(I.getOperand(0)); } From lattner at cs.uiuc.edu Mon Feb 14 10:58:11 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 10:58:11 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200502141658.j1EGwBJP025800@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.294 -> 1.295 --- Log message: Bugs fixed --- Diffs of the changes: (+12 -4) ReleaseNotes.html | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.294 llvm/docs/ReleaseNotes.html:1.295 --- llvm/docs/ReleaseNotes.html:1.294 Sun Feb 13 16:27:24 2005 +++ llvm/docs/ReleaseNotes.html Mon Feb 14 10:57:55 2005 @@ -136,23 +136,31 @@
+

Bugs fixed in the LLVM Core:

+
    +
  1. [dse] DSE deletes stores that + are partially overwritten by smaller stores
  2. +
+

Code Generator Bugs:

  1. [cbackend] Logical constant expressions (and/or/xor) not implemented
  2. -
  3. [dse] DSE deletes stores that - are partially overwritten by smaller stores
  4. +
  5. [cbackend] C backend does not + respect 'volatile'

Bugs in the C/C++ front-end:

-
  1. [llvmgcc] llvm-gcc incorrectly rejects some constant initializers involving the addresses of array elements
  2. [llvm-g++] Crash compiling anonymous union
  3. +
  4. [llvm-g++] Do not use dynamic + initialization where static init will do
  5. +
@@ -574,7 +582,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
- Last modified: $Date: 2005/02/13 22:27:24 $ + Last modified: $Date: 2005/02/14 16:57:55 $ From brukman at cs.uiuc.edu Mon Feb 14 12:52:46 2005 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon, 14 Feb 2005 12:52:46 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200502141852.MAA20077@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.221 -> 1.222 --- Log message: Write out single characters as chars, not strings. --- Diffs of the changes: (+67 -67) Writer.cpp | 134 ++++++++++++++++++++++++++++++------------------------------- 1 files changed, 67 insertions(+), 67 deletions(-) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.221 llvm/lib/Target/CBackend/Writer.cpp:1.222 --- llvm/lib/Target/CBackend/Writer.cpp:1.221 Mon Feb 14 10:47:52 2005 +++ llvm/lib/Target/CBackend/Writer.cpp Mon Feb 14 12:52:35 2005 @@ -287,7 +287,7 @@ // Check to see if the type is named. if (!IgnoreName || isa(Ty)) { std::map::iterator I = TypeNames.find(Ty); - if (I != TypeNames.end()) return Out << I->second << " " << NameSoFar; + if (I != TypeNames.end()) return Out << I->second << ' ' << NameSoFar; } switch (Ty->getTypeID()) { @@ -307,7 +307,7 @@ } else if (!MTy->getNumParams()) { FunctionInnards << "void"; } - FunctionInnards << ")"; + FunctionInnards << ')'; std::string tstr = FunctionInnards.str(); printType(Out, MTy->getReturnType(), tstr); return Out; @@ -322,7 +322,7 @@ printType(Out, *I, "field" + utostr(Idx++)); Out << ";\n"; } - return Out << "}"; + return Out << '}'; } case Type::PointerTyID: { @@ -348,7 +348,7 @@ std::string TyName = "struct opaque_" + itostr(Count++); assert(TypeNames.find(Ty) == TypeNames.end()); TypeNames[Ty] = TyName; - return Out << TyName << " " << NameSoFar; + return Out << TyName << ' ' << NameSoFar; } default: assert(0 && "Unhandled case in getTypeProps!"); @@ -372,7 +372,7 @@ isString = false; if (isString) { - Out << "\""; + Out << '\"'; // Keep track of whether the last number was a hexadecimal escape bool LastWasHex = false; @@ -411,11 +411,11 @@ } } } - Out << "\""; + Out << '\"'; } else { - Out << "{"; + Out << '{'; if (CPA->getNumOperands()) { - Out << " "; + Out << ' '; printConstant(cast(CPA->getOperand(0))); for (unsigned i = 1, e = CPA->getNumOperands(); i != e; ++i) { Out << ", "; @@ -468,9 +468,9 @@ case Instruction::Cast: Out << "(("; printType(Out, CPV->getType()); - Out << ")"; + Out << ')'; printConstant(CE->getOperand(0)); - Out << ")"; + Out << ')'; return; case Instruction::GetElementPtr: @@ -480,13 +480,13 @@ Out << "))"; return; case Instruction::Select: - Out << "("; + Out << '('; printConstant(CE->getOperand(0)); - Out << "?"; + Out << '?'; printConstant(CE->getOperand(1)); - Out << ":"; + Out << ':'; printConstant(CE->getOperand(2)); - Out << ")"; + Out << ')'; return; case Instruction::Add: case Instruction::Sub: @@ -504,7 +504,7 @@ case Instruction::SetGE: case Instruction::Shl: case Instruction::Shr: - Out << "("; + Out << '('; printConstant(CE->getOperand(0)); switch (CE->getOpcode()) { case Instruction::Add: Out << " + "; break; @@ -526,7 +526,7 @@ default: assert(0 && "Illegal opcode here!"); } printConstant(CE->getOperand(1)); - Out << ")"; + Out << ')'; return; default: @@ -543,7 +543,7 @@ switch (CPV->getType()->getTypeID()) { case Type::BoolTyID: - Out << (CPV == ConstantBool::False ? "0" : "1"); break; + Out << (CPV == ConstantBool::False ? '0' : '1'); break; case Type::SByteTyID: case Type::ShortTyID: Out << cast(CPV)->getValue(); break; @@ -564,7 +564,7 @@ case Type::UShortTyID: Out << cast(CPV)->getValue(); break; case Type::UIntTyID: - Out << cast(CPV)->getValue() << "u"; break; + Out << cast(CPV)->getValue() << 'u'; break; case Type::ULongTyID: Out << cast(CPV)->getValue() << "ull"; break; @@ -576,7 +576,7 @@ // Because of FP precision problems we must load from a stack allocated // value that holds the value in hex. Out << "(*(" << (FPC->getType() == Type::FloatTy ? "float" : "double") - << "*)&FPConstant" << I->second << ")"; + << "*)&FPConstant" << I->second << ')'; } else { if (IsNAN(FPC->getValue())) { // The value is NaN @@ -607,7 +607,7 @@ << Buffer << "\") /*nan*/ "; } else if (IsInf(FPC->getValue())) { // The value is Inf - if (FPC->getValue() < 0) Out << "-"; + if (FPC->getValue() < 0) Out << '-'; Out << "LLVM_INF" << (FPC->getType() == Type::FloatTy ? "F" : "") << " /*inf*/ "; } else { @@ -629,9 +629,9 @@ case Type::ArrayTyID: if (isa(CPV) || isa(CPV)) { const ArrayType *AT = cast(CPV->getType()); - Out << "{"; + Out << '{'; if (AT->getNumElements()) { - Out << " "; + Out << ' '; Constant *CZ = Constant::getNullValue(AT->getElementType()); printConstant(CZ); for (unsigned i = 1, e = AT->getNumElements(); i != e; ++i) { @@ -648,9 +648,9 @@ case Type::StructTyID: if (isa(CPV) || isa(CPV)) { const StructType *ST = cast(CPV->getType()); - Out << "{"; + Out << '{'; if (ST->getNumElements()) { - Out << " "; + Out << ' '; printConstant(Constant::getNullValue(ST->getElementType(0))); for (unsigned i = 1, e = ST->getNumElements(); i != e; ++i) { Out << ", "; @@ -659,9 +659,9 @@ } Out << " }"; } else { - Out << "{"; + Out << '{'; if (CPV->getNumOperands()) { - Out << " "; + Out << ' '; printConstant(cast(CPV->getOperand(0))); for (unsigned i = 1, e = CPV->getNumOperands(); i != e; ++i) { Out << ", "; @@ -693,9 +693,9 @@ if (Instruction *I = dyn_cast(Operand)) if (isInlinableInst(*I) && !isDirectAlloca(I)) { // Should we inline this instruction to build a tree? - Out << "("; + Out << '('; visit(*I); - Out << ")"; + Out << ')'; return; } @@ -714,7 +714,7 @@ writeOperandInternal(Operand); if (isa(Operand) || isDirectAlloca(Operand)) - Out << ")"; + Out << ')'; } // generateCompilerSpecificCode - This is where we add conditional compilation @@ -980,7 +980,7 @@ assert(0 && "Unknown float type!"); } - Out << "\n"; + Out << '\n'; } @@ -1005,7 +1005,7 @@ TypeNames.insert(std::make_pair(STy, Name)); } - Out << "\n"; + Out << '\n'; // Now we can print out typedefs... Out << "/* Typedefs */\n"; @@ -1017,7 +1017,7 @@ Out << ";\n"; } - Out << "\n"; + Out << '\n'; // Keep track of which structures have been printed so far... std::set StructPrinted; @@ -1072,7 +1072,7 @@ std::stringstream FunctionInnards; // Print out the name... - FunctionInnards << Mang->getValueName(F) << "("; + FunctionInnards << Mang->getValueName(F) << '('; if (!F->isExternal()) { if (!F->aempty()) { @@ -1108,7 +1108,7 @@ } else if (!FT->isVarArg() && FT->getNumParams() == 0) { FunctionInnards << "void"; // ret() -> ret(void) in C. } - FunctionInnards << ")"; + FunctionInnards << ')'; // Print out the return type and the entire signature for that matter printType(Out, F->getReturnType(), FunctionInnards.str()); } @@ -1136,7 +1136,7 @@ } } - Out << "\n"; + Out << '\n'; if (F.hasExternalLinkage() && F.getName() == "main") printCodeForMain(); @@ -1225,7 +1225,7 @@ Out << " return"; if (I.getNumOperands()) { - Out << " "; + Out << ' '; writeOperand(I.getOperand(0)); } Out << ";\n"; @@ -1362,9 +1362,9 @@ switch (I.getOpcode()) { case Instruction::Add: Out << " + "; break; case Instruction::Sub: Out << " - "; break; - case Instruction::Mul: Out << "*"; break; - case Instruction::Div: Out << "/"; break; - case Instruction::Rem: Out << "%"; break; + case Instruction::Mul: Out << '*'; break; + case Instruction::Div: Out << '/'; break; + case Instruction::Rem: Out << '%'; break; case Instruction::And: Out << " & "; break; case Instruction::Or: Out << " | "; break; case Instruction::Xor: Out << " ^ "; break; @@ -1388,14 +1388,14 @@ void CWriter::visitCastInst(CastInst &I) { if (I.getType() == Type::BoolTy) { - Out << "("; + Out << '('; writeOperand(I.getOperand(0)); Out << " != 0)"; return; } - Out << "("; + Out << '('; printType(Out, I.getType()); - Out << ")"; + Out << ')'; if (isa(I.getType())&&I.getOperand(0)->getType()->isIntegral() || isa(I.getOperand(0)->getType())&&I.getType()->isIntegral()) { // Avoid "cast to pointer from integer of different size" warnings @@ -1464,13 +1464,13 @@ abort(); } writeOperand(&I.getParent()->getParent()->aback()); - Out << ")"; + Out << ')'; return; case Intrinsic::vaend: if (!isa(I.getOperand(1))) { Out << "va_end(*(va_list*)&"; writeOperand(I.getOperand(1)); - Out << ")"; + Out << ')'; } else { Out << "va_end(*(va_list*)0)"; } @@ -1480,29 +1480,29 @@ Out << "va_copy(*(va_list*)&" << Mang->getValueName(&I) << ", "; Out << "*(va_list*)&"; writeOperand(I.getOperand(1)); - Out << ")"; + Out << ')'; return; case Intrinsic::returnaddress: Out << "__builtin_return_address("; writeOperand(I.getOperand(1)); - Out << ")"; + Out << ')'; return; case Intrinsic::frameaddress: Out << "__builtin_frame_address("; writeOperand(I.getOperand(1)); - Out << ")"; + Out << ')'; return; case Intrinsic::setjmp: Out << "setjmp(*(jmp_buf*)"; writeOperand(I.getOperand(1)); - Out << ")"; + Out << ')'; return; case Intrinsic::longjmp: Out << "longjmp(*(jmp_buf*)"; writeOperand(I.getOperand(1)); Out << ", "; writeOperand(I.getOperand(2)); - Out << ")"; + Out << ')'; return; } } @@ -1538,7 +1538,7 @@ printType(Out, CE->getType()); Out << ")(void*)"; printConstant(RF); - Out << ")"; + Out << ')'; WroteCallee = true; } } @@ -1548,16 +1548,16 @@ const Type *RetTy = FTy->getReturnType(); if (!WroteCallee) writeOperand(Callee); - Out << "("; + Out << '('; unsigned NumDeclaredParams = FTy->getNumParams(); if (I.getNumOperands() != 1) { CallSite::arg_iterator AI = I.op_begin()+1, AE = I.op_end(); if (NumDeclaredParams && (*AI)->getType() != FTy->getParamType(0)) { - Out << "("; + Out << '('; printType(Out, FTy->getParamType(0)); - Out << ")"; + Out << ')'; } writeOperand(*AI); @@ -1567,14 +1567,14 @@ Out << ", "; if (ArgNo < NumDeclaredParams && (*AI)->getType() != FTy->getParamType(ArgNo)) { - Out << "("; + Out << '('; printType(Out, FTy->getParamType(ArgNo)); - Out << ")"; + Out << ')'; } writeOperand(*AI); } } - Out << ")"; + Out << ')'; } void CWriter::visitMallocInst(MallocInst &I) { @@ -1582,16 +1582,16 @@ } void CWriter::visitAllocaInst(AllocaInst &I) { - Out << "("; + Out << '('; printType(Out, I.getType()); Out << ") alloca(sizeof("; printType(Out, I.getType()->getElementType()); - Out << ")"; + Out << ')'; if (I.isArrayAllocation()) { Out << " * " ; writeOperand(I.getOperand(0)); } - Out << ")"; + Out << ')'; } void CWriter::visitFreeInst(FreeInst &I) { @@ -1610,7 +1610,7 @@ if (I == E) { if (!HasImplicitAddress) - Out << "*"; // Implicit zero first argument: '*x' is equivalent to 'x[0]' + Out << '*'; // Implicit zero first argument: '*x' is equivalent to 'x[0]' writeOperandInternal(Ptr); return; @@ -1623,7 +1623,7 @@ writeOperandInternal(Ptr); if (HasImplicitAddress && (!CI || !CI->isNullValue())) { - Out << ")"; + Out << ')'; HasImplicitAddress = false; // HIA is only true if we haven't addressed yet } @@ -1647,14 +1647,14 @@ if (isa(*I)) { Out << ".field" << cast(I.getOperand())->getValue(); } else { - Out << "["; + Out << '['; writeOperand(I.getOperand()); - Out << "]"; + Out << ']'; } } void CWriter::visitLoadInst(LoadInst &I) { - Out << "*"; + Out << '*'; if (I.isVolatile()) { Out << "((volatile "; printType(Out, I.getOperand(0)->getType()); @@ -1668,7 +1668,7 @@ } void CWriter::visitStoreInst(StoreInst &I) { - Out << "*"; + Out << '*'; if (I.isVolatile()) { Out << "((volatile "; printType(Out, I.getPointerOperand()->getType()); @@ -1681,7 +1681,7 @@ } void CWriter::visitGetElementPtrInst(GetElementPtrInst &I) { - Out << "&"; + Out << '&'; printIndexingExpression(I.getPointerOperand(), gep_type_begin(I), gep_type_end(I)); } @@ -1690,7 +1690,7 @@ Out << Mang->getValueName(I.getOperand(0)); Out << "; va_arg(*(va_list*)&" << Mang->getValueName(&I) << ", "; printType(Out, I.getArgType()); - Out << ")"; + Out << ')'; } void CWriter::visitVAArgInst(VAArgInst &I) { From lattner at cs.uiuc.edu Mon Feb 14 13:00:30 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 13:00:30 -0600 Subject: [llvm-commits] CVS: llvm-www/header.incl Message-ID: <200502141900.j1EJ0UnN025989@apoc.cs.uiuc.edu> Changes in directory llvm-www: header.incl updated: 1.33 -> 1.34 --- Log message: add status update --- Diffs of the changes: (+1 -0) header.incl | 1 + 1 files changed, 1 insertion(+) Index: llvm-www/header.incl diff -u llvm-www/header.incl:1.33 llvm-www/header.incl:1.34 --- llvm-www/header.incl:1.33 Fri Jan 7 17:41:15 2005 +++ llvm-www/header.incl Mon Feb 14 13:00:15 2005 @@ -53,6 +53,7 @@ Status Updates
+ February 14, 2004
December 9, 2004
October 11, 2004
August 13, 2004
From lattner at cs.uiuc.edu Mon Feb 14 13:17:44 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 13:17:44 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/CommandLine.cpp Message-ID: <200502141917.j1EJHiA0026347@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Support: CommandLine.cpp updated: 1.57 -> 1.58 --- Log message: Work around GCC PR19958: http://llvm.cs.uiuc.edu/PR19958 , which causes programs to sometimes crash after printing help output or version info. --- Diffs of the changes: (+2 -0) CommandLine.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Support/CommandLine.cpp diff -u llvm/lib/Support/CommandLine.cpp:1.57 llvm/lib/Support/CommandLine.cpp:1.58 --- llvm/lib/Support/CommandLine.cpp:1.57 Wed Nov 24 00:13:42 2004 +++ llvm/lib/Support/CommandLine.cpp Mon Feb 14 13:17:29 2005 @@ -919,6 +919,7 @@ MoreHelp().clear(); // Halt the program since help information was printed + getOpts().clear(); // Don't bother making option dtors remove from map. exit(1); } }; @@ -929,6 +930,7 @@ if (OptionWasSpecified) { std::cerr << "Low Level Virtual Machine (" << PACKAGE_NAME << ") " << PACKAGE_VERSION << " (see http://llvm.cs.uiuc.edu/)\n"; + getOpts().clear(); // Don't bother making option dtors remove from map. exit(1); } } From lattner at cs.uiuc.edu Mon Feb 14 14:12:00 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 14:12:00 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Message-ID: <200502142012.j1EKC0m9027232@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.75 -> 1.76 --- Log message: Fix the second bug attached to PR504: http://llvm.cs.uiuc.edu/PR504 . --- Diffs of the changes: (+1 -1) IndVarSimplify.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.75 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.76 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.75 Fri Feb 11 21:26:49 2005 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Mon Feb 14 14:11:45 2005 @@ -139,7 +139,7 @@ if (It != BasicBlock::iterator(CI)) { // Splice the cast immediately after the operand in question. BasicBlock::InstListType &InstList = - I->getParent()->getInstList(); + It->getParent()->getInstList(); InstList.splice(It, CI->getParent()->getInstList(), CI); } return CI; From lattner at cs.uiuc.edu Mon Feb 14 15:23:13 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 15:23:13 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/varasm.c Message-ID: <200502142123.j1ELNDPT028932@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: varasm.c updated: 1.5 -> 1.6 --- Log message: Be more generous with what we consider to be a constant. --- Diffs of the changes: (+14 -1) varasm.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletion(-) Index: llvm-gcc/gcc/varasm.c diff -u llvm-gcc/gcc/varasm.c:1.5 llvm-gcc/gcc/varasm.c:1.6 --- llvm-gcc/gcc/varasm.c:1.5 Mon Aug 9 14:38:40 2004 +++ llvm-gcc/gcc/varasm.c Mon Feb 14 15:22:56 2005 @@ -3523,7 +3523,20 @@ case ADDR_EXPR: case FDESC_EXPR: - return staticp (TREE_OPERAND (value, 0)) ? TREE_OPERAND (value, 0) : 0; + value = staticp (TREE_OPERAND (value, 0)); + /* "&(*a).f" is like unto pointer arithmetic. If "a" turns out to + be a constant, this is old-skool offsetof-like nonsense. */ + if (value + && TREE_CODE (value) == INDIRECT_REF + && TREE_CONSTANT (TREE_OPERAND (value, 0))) + return null_pointer_node; + /* Taking the address of a nested function involves a trampoline. */ + if (value + && TREE_CODE (value) == FUNCTION_DECL + && ((decl_function_context (value) && !DECL_NO_STATIC_CHAIN (value)) + || DECL_NON_ADDR_CONST_P (value))) + return NULL_TREE; + return value; case VIEW_CONVERT_EXPR: case NON_LVALUE_EXPR: From lattner at cs.uiuc.edu Mon Feb 14 15:24:23 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 15:24:23 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/langhooks.c langhooks.h Message-ID: <200502142124.j1ELONUf028956@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: langhooks.c updated: 1.3 -> 1.4 langhooks.h updated: 1.3 -> 1.4 --- Log message: staticp returns a tree now --- Diffs of the changes: (+3 -3) langhooks.c | 4 ++-- langhooks.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-gcc/gcc/langhooks.c diff -u llvm-gcc/gcc/langhooks.c:1.3 llvm-gcc/gcc/langhooks.c:1.4 --- llvm-gcc/gcc/langhooks.c:1.3 Thu Feb 5 10:05:45 2004 +++ llvm-gcc/gcc/langhooks.c Mon Feb 14 15:24:10 2005 @@ -132,10 +132,10 @@ /* Called from staticp. */ -int +tree lhd_staticp (tree exp ATTRIBUTE_UNUSED) { - return 0; + return NULL; } /* Called from check_global_declarations. */ Index: llvm-gcc/gcc/langhooks.h diff -u llvm-gcc/gcc/langhooks.h:1.3 llvm-gcc/gcc/langhooks.h:1.4 --- llvm-gcc/gcc/langhooks.h:1.3 Thu Feb 5 10:05:45 2004 +++ llvm-gcc/gcc/langhooks.h Mon Feb 14 15:24:10 2005 @@ -359,7 +359,7 @@ bool (*mark_addressable) (tree); /* Hook called by staticp for language-specific tree codes. */ - int (*staticp) (tree); + tree (*staticp) (tree); /* Replace the DECL_LANG_SPECIFIC data, which may be NULL, of the DECL_NODE with a newly GC-allocated copy. */ From lattner at cs.uiuc.edu Mon Feb 14 15:24:37 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 15:24:37 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/tree.c tree.h Message-ID: <200502142124.j1ELObmN028970@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: tree.c updated: 1.5 -> 1.6 tree.h updated: 1.3 -> 1.4 --- Log message: Modify staticp to return the static decl if true instead of just a flag. Be more generous about what is a constant, including p[x], where p is a pointer (this is an llvm extension to the GCC IR). --- Diffs of the changes: (+47 -27) tree.c | 70 +++++++++++++++++++++++++++++++++++++++++------------------------ tree.h | 4 +-- 2 files changed, 47 insertions(+), 27 deletions(-) Index: llvm-gcc/gcc/tree.c diff -u llvm-gcc/gcc/tree.c:1.5 llvm-gcc/gcc/tree.c:1.6 --- llvm-gcc/gcc/tree.c:1.5 Sun Feb 13 21:20:33 2005 +++ llvm-gcc/gcc/tree.c Mon Feb 14 15:23:54 2005 @@ -1270,10 +1270,11 @@ : fold (build (MINUS_EXPR, TREE_TYPE (max), max, min))); } -/* Return nonzero if arg is static -- a reference to an object in - static storage. This is not the same as the C meaning of `static'. */ +/* If arg is static -- a reference to an object in static storage -- then + return the object. This is not the same as the C meaning of `static'. + If arg isn't static, return NULL. */ -int +tree staticp (tree arg) { switch (TREE_CODE (arg)) @@ -1281,56 +1282,75 @@ case FUNCTION_DECL: /* Nested functions aren't static, since taking their address involves a trampoline. */ - return ((decl_function_context (arg) == 0 || DECL_NO_STATIC_CHAIN (arg)) - && ! DECL_NON_ADDR_CONST_P (arg)); + if ((decl_function_context (arg) == 0 || DECL_NO_STATIC_CHAIN (arg)) + && ! DECL_NON_ADDR_CONST_P (arg)) + return arg; + return NULL; case VAR_DECL: return ((TREE_STATIC (arg) || DECL_EXTERNAL (arg)) && ! DECL_THREAD_LOCAL (arg) - && ! DECL_NON_ADDR_CONST_P (arg)); + && ! DECL_NON_ADDR_CONST_P (arg)) + ? arg : NULL; + + case CONST_DECL: + return ((TREE_STATIC (arg) || DECL_EXTERNAL (arg)) + ? arg : NULL); case CONSTRUCTOR: - return TREE_STATIC (arg); + return TREE_STATIC (arg) ? arg : NULL; case LABEL_DECL: case STRING_CST: - return 1; + return arg; - /* If we are referencing a bitfield, we can't evaluate an - ADDR_EXPR at compile time and so it isn't a constant. */ case COMPONENT_REF: - return (! DECL_BIT_FIELD (TREE_OPERAND (arg, 1)) - && staticp (TREE_OPERAND (arg, 0))); + /* If the thing being referenced is not a field, then it is + something language specific. */ + if (TREE_CODE (TREE_OPERAND (arg, 1)) != FIELD_DECL) + return (*lang_hooks.staticp) (arg); - case BIT_FIELD_REF: - return 0; + /* If we are referencing a bitfield, we can't evaluate an + ADDR_EXPR at compile time and so it isn't a constant. */ + if (DECL_BIT_FIELD (TREE_OPERAND (arg, 1))) + return NULL; + return staticp (TREE_OPERAND (arg, 0)); - case INDIRECT_REF: - return TREE_CONSTANT (TREE_OPERAND (arg, 0)); + case BIT_FIELD_REF: + return NULL; -#if 0 - /* This case is technically correct, but results in setting - TREE_CONSTANT on ADDR_EXPRs that cannot be evaluated at - compile time. */ case INDIRECT_REF: - return TREE_CONSTANT (TREE_OPERAND (arg, 0)); -#endif + return TREE_CONSTANT (TREE_OPERAND (arg, 0)) ? arg : NULL; case ARRAY_REF: case ARRAY_RANGE_REF: if (TYPE_SIZE (TREE_TYPE (arg)) && TREE_CODE (TYPE_SIZE (TREE_TYPE (arg))) == INTEGER_CST - && TREE_CODE (TREE_OPERAND (arg, 1)) == INTEGER_CST) - return staticp (TREE_OPERAND (arg, 0)); + && TREE_CODE (TREE_OPERAND (arg, 1)) == INTEGER_CST) { + + /* As an LLVM extension, we support ARRAY_REF where the first operand is + * a pointer type (and ADDR_EXPR). Strip it off the addr_expr if it + * exists. + */ + if (TREE_CODE(TREE_OPERAND(arg, 0)) == ADDR_EXPR) + return staticp (TREE_OPERAND (TREE_OPERAND(arg, 0), 0)); + else if (TREE_CODE(TREE_OPERAND(arg, 0)) == NOP_EXPR && + TREE_CODE(TREE_OPERAND(TREE_OPERAND(arg, 0), 0)) == ADDR_EXPR) + return staticp (TREE_OPERAND (TREE_OPERAND(TREE_OPERAND(arg, + 0), 0),0)); + else + return staticp (TREE_OPERAND (arg, 0)); + } + return NULL; default: if ((unsigned int) TREE_CODE (arg) >= (unsigned int) LAST_AND_UNUSED_TREE_CODE) return (*lang_hooks.staticp) (arg); else - return 0; + return NULL; } } Index: llvm-gcc/gcc/tree.h diff -u llvm-gcc/gcc/tree.h:1.3 llvm-gcc/gcc/tree.h:1.4 --- llvm-gcc/gcc/tree.h:1.3 Thu Feb 5 10:05:45 2004 +++ llvm-gcc/gcc/tree.h Mon Feb 14 15:23:54 2005 @@ -2547,9 +2547,9 @@ extern int integer_nonzerop (tree); /* staticp (tree x) is nonzero if X is a reference to data allocated - at a fixed address in memory. */ + at a fixed address in memory. Returns the outermost data. */ -extern int staticp (tree); +extern tree staticp (tree); /* Gets an error if argument X is not an lvalue. Also returns 1 if X is an lvalue, 0 if not. */ From lattner at cs.uiuc.edu Mon Feb 14 15:24:55 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 15:24:55 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/c-typeck.c Message-ID: <200502142124.j1ELOtZu028997@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: c-typeck.c updated: 1.6 -> 1.7 --- Log message: this returns a tree. --- Diffs of the changes: (+1 -1) c-typeck.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-gcc/gcc/c-typeck.c diff -u llvm-gcc/gcc/c-typeck.c:1.6 llvm-gcc/gcc/c-typeck.c:1.7 --- llvm-gcc/gcc/c-typeck.c:1.6 Sun Feb 13 21:21:56 2005 +++ llvm-gcc/gcc/c-typeck.c Mon Feb 14 15:24:42 2005 @@ -1096,7 +1096,7 @@ adr = build1 (ADDR_EXPR, ptrtype, exp); if (!c_mark_addressable (exp)) return error_mark_node; - TREE_CONSTANT (adr) = staticp (exp); + TREE_CONSTANT (adr) = staticp (exp) != NULL; TREE_SIDE_EFFECTS (adr) = 0; /* Default would be, same as EXP. */ return adr; } From lattner at cs.uiuc.edu Mon Feb 14 15:24:45 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 15:24:45 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/langhooks-def.h c-common.c c-common.h Message-ID: <200502142124.j1ELOjFE028988@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: langhooks-def.h updated: 1.3 -> 1.4 c-common.c updated: 1.7 -> 1.8 c-common.h updated: 1.3 -> 1.4 --- Log message: staticp returns a tree now --- Diffs of the changes: (+5 -5) c-common.c | 6 +++--- c-common.h | 2 +- langhooks-def.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-gcc/gcc/langhooks-def.h diff -u llvm-gcc/gcc/langhooks-def.h:1.3 llvm-gcc/gcc/langhooks-def.h:1.4 --- llvm-gcc/gcc/langhooks-def.h:1.3 Thu Feb 5 10:05:45 2004 +++ llvm-gcc/gcc/langhooks-def.h Mon Feb 14 15:24:32 2005 @@ -55,7 +55,7 @@ extern tree lhd_return_null_tree (tree); extern tree lhd_do_nothing_iii_return_null_tree (int, int, int); extern int lhd_safe_from_p (rtx, tree); -extern int lhd_staticp (tree); +extern tree lhd_staticp (tree); extern int lhd_unsafe_for_reeval (tree); extern void lhd_clear_binding_stack (void); extern void lhd_print_tree_nothing (FILE *, tree, int); Index: llvm-gcc/gcc/c-common.c diff -u llvm-gcc/gcc/c-common.c:1.7 llvm-gcc/gcc/c-common.c:1.8 --- llvm-gcc/gcc/c-common.c:1.7 Sun Feb 13 21:22:04 2005 +++ llvm-gcc/gcc/c-common.c Mon Feb 14 15:24:32 2005 @@ -4196,13 +4196,13 @@ /* Hook used by staticp to handle language-specific tree codes. */ -int +tree c_staticp (tree exp) { if (TREE_CODE (exp) == COMPOUND_LITERAL_EXPR && TREE_STATIC (COMPOUND_LITERAL_EXPR_DECL (exp))) - return 1; - return 0; + return exp; + return NULL; } Index: llvm-gcc/gcc/c-common.h diff -u llvm-gcc/gcc/c-common.h:1.3 llvm-gcc/gcc/c-common.h:1.4 --- llvm-gcc/gcc/c-common.h:1.3 Thu Feb 5 10:05:44 2004 +++ llvm-gcc/gcc/c-common.h Mon Feb 14 15:24:32 2005 @@ -1280,7 +1280,7 @@ extern int c_safe_from_p (rtx, tree); -extern int c_staticp (tree); +extern tree c_staticp (tree); extern int c_common_unsafe_for_reeval (tree); From lattner at cs.uiuc.edu Mon Feb 14 15:25:19 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 15:25:19 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/cp/typeck.c Message-ID: <200502142125.j1ELPJNo029138@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc/cp: typeck.c updated: 1.6 -> 1.7 --- Log message: Simplify code based on transformations the middle-end is doing. --- Diffs of the changes: (+5 -10) typeck.c | 15 +++++---------- 1 files changed, 5 insertions(+), 10 deletions(-) Index: llvm-gcc/gcc/cp/typeck.c diff -u llvm-gcc/gcc/cp/typeck.c:1.6 llvm-gcc/gcc/cp/typeck.c:1.7 --- llvm-gcc/gcc/cp/typeck.c:1.6 Sun Feb 13 21:21:43 2005 +++ llvm-gcc/gcc/cp/typeck.c Mon Feb 14 15:25:06 2005 @@ -1342,16 +1342,10 @@ if (TREE_CODE (exp) == VAR_DECL) { - /* ??? This is not really quite correct - in that the type of the operand of ADDR_EXPR - is not the target type of the type of the ADDR_EXPR itself. - Question is, can this lossage be avoided? */ - adr = build1 (ADDR_EXPR, ptrtype, exp); - if (!cxx_mark_addressable (exp)) - return error_mark_node; - TREE_CONSTANT (adr) = staticp (exp); - TREE_SIDE_EFFECTS (adr) = 0; /* Default would be, same as EXP. */ - return adr; + if (!cxx_mark_addressable (exp)) + return error_mark_node; + adr = build_nop (ptrtype, build_address (exp)); + return adr; } /* This way is better for a COMPONENT_REF since it can simplify the offset for a component. */ @@ -3596,6 +3590,7 @@ return error_mark_node; addr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (t)), t); + if (staticp (t)) TREE_CONSTANT (addr) = 1; From lattner at cs.uiuc.edu Mon Feb 14 15:31:53 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 15:31:53 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2005-02-14-IllegalAssembler.ll Message-ID: <200502142131.j1ELVrwJ029823@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: 2005-02-14-IllegalAssembler.ll added (r1.1) --- Log message: A testcase that LLC produces illegal asm on for Prolangs-C/cdecl now. --- Diffs of the changes: (+5 -0) 2005-02-14-IllegalAssembler.ll | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/test/Regression/CodeGen/X86/2005-02-14-IllegalAssembler.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/2005-02-14-IllegalAssembler.ll:1.1 *** /dev/null Mon Feb 14 15:31:51 2005 --- llvm/test/Regression/CodeGen/X86/2005-02-14-IllegalAssembler.ll Mon Feb 14 15:31:41 2005 *************** *** 0 **** --- 1,5 ---- + ; RUN: llvm-as < %s | llc | not grep 18446744073709551612 + + %A = external global int + + %Y = global int* getelementptr (int* %A, int -1) From lattner at cs.uiuc.edu Mon Feb 14 15:40:41 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 15:40:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp Message-ID: <200502142140.j1ELefTQ030490@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.14 -> 1.15 --- Log message: Print GEP offsets as signed values instead of unsigned values. On X86, this prints: getelementptr (int* %A, int -1) as: "(A) - 4" instead of "(A) + 18446744073709551612", which makes the assembler much happier. This fixes test/Regression/CodeGen/X86/2005-02-14-IllegalAssembler.ll, and Benchmarks/Prolangs-C/cdecl with LLC on X86. --- Diffs of the changes: (+7 -3) AsmPrinter.cpp | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.14 llvm/lib/CodeGen/AsmPrinter.cpp:1.15 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.14 Fri Feb 4 07:47:16 2005 +++ llvm/lib/CodeGen/AsmPrinter.cpp Mon Feb 14 15:40:26 2005 @@ -78,10 +78,14 @@ // generate a symbolic expression for the byte address const Constant *ptrVal = CE->getOperand(0); std::vector idxVec(CE->op_begin()+1, CE->op_end()); - if (uint64_t Offset = TD.getIndexedOffset(ptrVal->getType(), idxVec)) { - O << "("; + if (int64_t Offset = TD.getIndexedOffset(ptrVal->getType(), idxVec)) { + if (Offset) + O << "("; emitConstantValueOnly(ptrVal); - O << ") + " << Offset; + if (Offset > 0) + O << ") + " << Offset; + else if (Offset < 0) + O << ") - " << -Offset; } else { emitConstantValueOnly(ptrVal); } From lattner at cs.uiuc.edu Mon Feb 14 15:42:23 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 15:42:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Unix.h Message-ID: <200502142142.j1ELgNQU030506@apoc.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Unix.h updated: 1.11 -> 1.12 --- Log message: Fix a bug in my previous change to this, which broke the build on sparcs. --- Diffs of the changes: (+1 -1) Unix.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/System/Unix/Unix.h diff -u llvm/lib/System/Unix/Unix.h:1.11 llvm/lib/System/Unix/Unix.h:1.12 --- llvm/lib/System/Unix/Unix.h:1.11 Sun Feb 13 16:46:37 2005 +++ llvm/lib/System/Unix/Unix.h Mon Feb 14 15:42:10 2005 @@ -77,7 +77,7 @@ // Copy the thread un-safe result of strerror into // the buffer as fast as possible to minimize impact // of collision of strerror in multiple threads. - if (Errno) + if (errno) strncpy(buffer,strerror(errno),MAXPATHLEN-1); buffer[MAXPATHLEN-1] = 0; #else From reid at x10sys.com Mon Feb 14 15:54:19 2005 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Feb 2005 15:54:19 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200502142154.PAA12704@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.296 -> 1.297 --- Log message: For PR496: http://llvm.cs.uiuc.edu/PR496 : When llvm-gcc is not available, bypass rules for Modules and Bytecode Libraries that require llvm-gcc and emit instead a warning that llvm-gcc is not available. This permits "make LLVMGCC=" to build LLVM completely without error and provides warnings about the modules and bc libs that could not be constructed. --- Diffs of the changes: (+10 -2) Makefile.rules | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.296 llvm/Makefile.rules:1.297 --- llvm/Makefile.rules:1.296 Sat Feb 12 21:41:10 2005 +++ llvm/Makefile.rules Mon Feb 14 15:54:08 2005 @@ -339,7 +339,7 @@ CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused -LD.Flags += -L$(LibDir) -L$(LLVMLibDir) $(LIBS) +LD.Flags += -L$(LibDir) -L$(LLVMLibDir) CPP.Flags += -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \ -I$(PROJ_OBJ_ROOT)/include \ -I$(PROJ_SRC_ROOT)/include \ @@ -555,6 +555,9 @@ #--------------------------------------------------------- ifdef MODULE_NAME +ifeq ($(strip $(LLVMGCC)),) +$(warning Modules require llvm-gcc but no llvm-gcc is available) +else Module := $(LibDir)/$(MODULE_NAME).bc LinkModule := $(LLVMGCCWITHPATH) -shared -nostdlib @@ -594,6 +597,7 @@ -$(Verb) $(RM) -f $(DestModule) endif +endif # if we're building a library ... ifdef LIBRARYNAME @@ -651,6 +655,9 @@ # targets for building them. #--------------------------------------------------------- ifdef BYTECODE_LIBRARY +ifeq ($(strip $(LLVMGCC)),) +$(warning Bytecode libraries require llvm-gcc which could not be found) +else # make the C and C++ compilers strip debug info out of bytecode libraries. BCCompile.C += -Wa,-strip-debug @@ -704,6 +711,7 @@ -$(Verb) $(RM) -f $(DestBytecodeLib) endif +endif #--------------------------------------------------------- # ReLinked Library Targets: @@ -881,7 +889,7 @@ $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg) $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \ - $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) + $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS) $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) $(StripWarnMsg) DestTool = $(PROJ_bindir)/$(TOOLNAME) From lattner at cs.uiuc.edu Mon Feb 14 15:54:48 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 15:54:48 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.llx Message-ID: <200502142154.j1ELsm3l030548@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/Generic: 2004-05-09-LiveVarPartialRegister.llx updated: 1.1 -> 1.2 --- Log message: execution tests shouldn't go here. This was killing the PPC nightly tester. --- Diffs of the changes: (+1 -1) 2004-05-09-LiveVarPartialRegister.llx | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.llx diff -u llvm/test/Regression/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.llx:1.1 llvm/test/Regression/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.llx:1.2 --- llvm/test/Regression/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.llx:1.1 Mon May 10 00:11:24 2004 +++ llvm/test/Regression/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.llx Mon Feb 14 15:54:32 2005 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | lli +; RUN: llvm-as < %s | llc %global_long_1 = linkonce global long 7 %global_long_2 = linkonce global long 49 From lattner at cs.uiuc.edu Mon Feb 14 16:58:54 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 16:58:54 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200502142258.j1EMwsE4031644@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.295 -> 1.296 --- Log message: wow, interesting typo :) --- Diffs of the changes: (+2 -2) ReleaseNotes.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.295 llvm/docs/ReleaseNotes.html:1.296 --- llvm/docs/ReleaseNotes.html:1.295 Mon Feb 14 10:57:55 2005 +++ llvm/docs/ReleaseNotes.html Mon Feb 14 16:58:38 2005 @@ -83,7 +83,7 @@
  • LLVM includes new experimental native code generators for SparcV8 and Alpha.
  • Support for Microsoft Visual Studio is improved, and not documented.
  • + href="GettingStartedVS.html">now documented.
    @@ -582,7 +582,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2005/02/14 16:57:55 $ + Last modified: $Date: 2005/02/14 22:58:38 $ From lattner at cs.uiuc.edu Mon Feb 14 17:09:08 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 17:09:08 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp PoolAllocate.h Message-ID: <200502142309.j1EN98xR001251@apoc.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: PoolAllocate.cpp updated: 1.102 -> 1.103 PoolAllocate.h updated: 1.39 -> 1.40 --- Log message: Change a #define used to change pool allocator behavior into something that can be selected based on AU.addRequired. --- Diffs of the changes: (+25 -8) PoolAllocate.cpp | 14 ++++++-------- PoolAllocate.h | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 8 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.102 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.103 --- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.102 Wed Feb 9 13:04:48 2005 +++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp Mon Feb 14 17:08:52 2005 @@ -34,16 +34,13 @@ using namespace llvm; using namespace PA; -// PASS_ALL_ARGUMENTS - If this is set to true, pass in pool descriptors for all -// DSNodes in a function, even if there are no allocations or frees in it. This -// is useful for SafeCode. -#define PASS_ALL_ARGUMENTS 0 - const Type *PoolAllocate::PoolDescPtrTy = 0; namespace { RegisterOpt X("poolalloc", "Pool allocate disjoint data structures"); + RegisterPass + Y("poolalloc-passing-all-pools", "Pool allocate disjoint data structures"); Statistic<> NumArgsAdded("poolalloc", "Number of function arguments added"); Statistic<> NumCloned ("poolalloc", "Number of functions cloned"); @@ -232,7 +229,8 @@ } static void MarkNodesWhichMustBePassedIn(hash_set &MarkedNodes, - Function &F, DSGraph &G) { + Function &F, DSGraph &G, + bool PassAllArguments) { // Mark globals and incomplete nodes as live... (this handles arguments) if (F.getName() != "main") { // All DSNodes reachable from arguments must be passed in. @@ -261,7 +259,7 @@ for (hash_set::iterator I = MarkedNodes.begin(), E = MarkedNodes.end(); I != E; ) { const DSNode *N = *I++; - if ((!N->isHeapNode() && !PASS_ALL_ARGUMENTS) || NodesFromGlobals.count(N)) + if ((!N->isHeapNode() && !PassAllArguments) || NodesFromGlobals.count(N)) MarkedNodes.erase(N); } } @@ -284,7 +282,7 @@ // Find DataStructure nodes which are allocated in pools non-local to the // current function. This set will contain all of the DSNodes which require // pools to be passed in from outside of the function. - MarkNodesWhichMustBePassedIn(MarkedNodes, F, G); + MarkNodesWhichMustBePassedIn(MarkedNodes, F, G, PassAllArguments); FI.ArgNodes.insert(FI.ArgNodes.end(), MarkedNodes.begin(), MarkedNodes.end()); } Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.39 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.40 --- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.39 Wed Feb 9 13:04:47 2005 +++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h Mon Feb 14 17:08:53 2005 @@ -93,6 +93,12 @@ /// PoolAllocate - The main pool allocation pass /// class PoolAllocate : public ModulePass { + /// PassAllArguments - If set to true, we should pass pool descriptor + /// arguments into any function that loads or stores to a pool, in addition to + /// those functions that allocate or deallocate. See also the + /// PoolAllocatePassAllPools pass below. + bool PassAllArguments; + Module *CurModule; PA::EquivClassGraphs *ECGraphs; @@ -112,6 +118,9 @@ std::map GlobalNodes; public: + PoolAllocate(bool passAllArguments = false) + : PassAllArguments(passAllArguments) {} + bool runOnModule(Module &M); virtual void getAnalysisUsage(AnalysisUsage &AU) const; @@ -234,6 +243,16 @@ void CalculateLivePoolFreeBlocks(std::set &LiveBlocks,Value *PD); }; + +/// PoolAllocatePassAllPools - This class is the same as the pool allocator, +/// except that it passes pool descriptors into functions that do not do +/// allocations or deallocations. This is needed by the pointer compression +/// pass, which requires a pool descriptor to be available for a pool if any +/// load or store to that pool is performed. +struct PoolAllocatePassAllPools : public PoolAllocate { + PoolAllocatePassAllPools() : PoolAllocate(true) {} +}; + } #endif From lattner at cs.uiuc.edu Mon Feb 14 23:18:21 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 23:18:21 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2005-02-14-BitFieldOffset.cpp Message-ID: <200502150518.j1F5ILkV004065@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2005-02-14-BitFieldOffset.cpp added (r1.1) --- Log message: New testcase for PR510: http://llvm.cs.uiuc.edu/PR510 . --- Diffs of the changes: (+11 -0) 2005-02-14-BitFieldOffset.cpp | 11 +++++++++++ 1 files changed, 11 insertions(+) Index: llvm/test/Regression/C++Frontend/2005-02-14-BitFieldOffset.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2005-02-14-BitFieldOffset.cpp:1.1 *** /dev/null Mon Feb 14 23:18:15 2005 --- llvm/test/Regression/C++Frontend/2005-02-14-BitFieldOffset.cpp Mon Feb 14 23:18:05 2005 *************** *** 0 **** --- 1,11 ---- + // RUN: %llvmgxx %s -S -o - | not grep 'int 6' + + struct QVectorTypedData { + int size; + unsigned int sharable : 1; + unsigned short array[1]; + }; + + void foo(QVectorTypedData *X) { + X->array[0] = 123; + } From lattner at cs.uiuc.edu Mon Feb 14 23:26:56 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 23:26:56 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200502150526.j1F5Que0004167@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.80 -> 1.81 --- Log message: When emitting bitfield offset computation code, remember that we may have already offseted to the start of the field, so we need to subtract that out. This fixes test/Regression/C++Frontend/2005-02-14-BitFieldOffset.cpp and PR510: http://llvm.cs.uiuc.edu/PR510 . --- Diffs of the changes: (+3 -2) llvm-expand.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.80 llvm-gcc/gcc/llvm-expand.c:1.81 --- llvm-gcc/gcc/llvm-expand.c:1.80 Sun Feb 13 20:53:56 2005 +++ llvm-gcc/gcc/llvm-expand.c Mon Feb 14 23:26:41 2005 @@ -5511,11 +5511,12 @@ */ llvm_type *SBPtr = llvm_type_get_pointer(SByteTy); llvm_value *Ptr = cast_if_type_not_equal(Fn, Result, SBPtr); - if (Offset) { + if (Offset-ActualOffset) { llvm_instruction *GEP = llvm_instruction_new(SBPtr, "tmp", O_GetElementPtr, 2); GEP->Operands[0] = Ptr; - GEP->Operands[1] = llvm_constant_new_integral(IntPtrTy, Offset/8); + GEP->Operands[1] = + llvm_constant_new_integral(IntPtrTy, (Offset-ActualOffset)/8); Ptr = append_inst(Fn, GEP); } Result = cast_if_type_not_equal(Fn, Ptr, Result->Ty); From lattner at cs.uiuc.edu Mon Feb 14 23:28:19 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 23:28:19 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200502150528.j1F5SJk6004191@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.296 -> 1.297 --- Log message: Bug fixed. --- Diffs of the changes: (+3 -2) ReleaseNotes.html | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.296 llvm/docs/ReleaseNotes.html:1.297 --- llvm/docs/ReleaseNotes.html:1.296 Mon Feb 14 16:58:38 2005 +++ llvm/docs/ReleaseNotes.html Mon Feb 14 23:28:06 2005 @@ -160,7 +160,8 @@ anonymous union
  • [llvm-g++] Do not use dynamic initialization where static init will do
  • -
  • +
  • [llvmgcc] Field offset + miscalculated for some structure fields following bit fields
  • @@ -582,7 +583,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2005/02/14 22:58:38 $ + Last modified: $Date: 2005/02/15 05:28:06 $ From lattner at cs.uiuc.edu Mon Feb 14 23:52:30 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Feb 2005 23:52:30 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200502150552.j1F5qUds005999@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.222 -> 1.223 --- Log message: Fix volatile load/store of pointers. Consider this testcase: void %test(int** %P) { %A = volatile load int** %P ret void } void %test2(int*** %Q) { %P = load int*** %Q volatile store int** %P, int*** %Q ret void } instead of emitting: void test(int **l1_P) { int *l2_A; l2_A = (int **((volatile int **)l1_P)); return; } void test2(int ***l2_Q) { int **l1_P; l1_P = *l2_Q; *((volatile int ***)l2_Q) = l1_P; return; } ... which is loading/storing volatile pointers, not through volatile pointers, emit this (which is right): void test(int **l1_P) { int *l3_A; l3_A = *((int * volatile*)l1_P); return; } void test2(int ***l2_Q) { int **l1_P; l1_P = *l2_Q; *((int ** volatile*)l2_Q) = l1_P; return; } --- Diffs of the changes: (+6 -6) Writer.cpp | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.222 llvm/lib/Target/CBackend/Writer.cpp:1.223 --- llvm/lib/Target/CBackend/Writer.cpp:1.222 Mon Feb 14 12:52:35 2005 +++ llvm/lib/Target/CBackend/Writer.cpp Mon Feb 14 23:52:14 2005 @@ -1656,9 +1656,9 @@ void CWriter::visitLoadInst(LoadInst &I) { Out << '*'; if (I.isVolatile()) { - Out << "((volatile "; - printType(Out, I.getOperand(0)->getType()); - Out << ")"; + Out << "(("; + printType(Out, I.getType()); + Out << " volatile*)"; } writeOperand(I.getOperand(0)); @@ -1670,9 +1670,9 @@ void CWriter::visitStoreInst(StoreInst &I) { Out << '*'; if (I.isVolatile()) { - Out << "((volatile "; - printType(Out, I.getPointerOperand()->getType()); - Out << ")"; + Out << "(("; + printType(Out, I.getOperand(0)->getType()); + Out << " volatile*)"; } writeOperand(I.getPointerOperand()); if (I.isVolatile()) Out << ")"; From lattner at cs.uiuc.edu Tue Feb 15 00:58:57 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 00:58:57 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Regression/C++/short_circuit_dtor.cpp Message-ID: <200502150658.j1F6wvxe009161@apoc.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Regression/C++: short_circuit_dtor.cpp added (r1.1) --- Log message: new testcase for PR513: http://llvm.cs.uiuc.edu/PR513 --- Diffs of the changes: (+14 -0) short_circuit_dtor.cpp | 14 ++++++++++++++ 1 files changed, 14 insertions(+) Index: llvm-test/SingleSource/Regression/C++/short_circuit_dtor.cpp diff -c /dev/null llvm-test/SingleSource/Regression/C++/short_circuit_dtor.cpp:1.1 *** /dev/null Tue Feb 15 00:58:52 2005 --- llvm-test/SingleSource/Regression/C++/short_circuit_dtor.cpp Tue Feb 15 00:58:42 2005 *************** *** 0 **** --- 1,14 ---- + #include + + struct X { + int Val; + X(int i) : Val(i) { printf("X::X(%d)\n", Val); } + ~X() { printf("X::~X(%d)\n", Val); } + }; + + bool foo(const X &) { return true; } + void bar() {} + int main() { + if ((foo(1) || foo(2))) + bar(); + } From lattner at cs.uiuc.edu Tue Feb 15 01:00:05 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 01:00:05 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200502150700.j1F705Gx009179@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.81 -> 1.82 --- Log message: Make sure to put an exception scope around the RHS of a short circuit logical operation like &&. This fixes SingleSource/Regression/C++/short_circuit_dtor.cpp PR513: http://llvm.cs.uiuc.edu/PR513 , and finally allows QT4.0's qmake program to print its help message. :) --- Diffs of the changes: (+7 -0) llvm-expand.c | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.81 llvm-gcc/gcc/llvm-expand.c:1.82 --- llvm-gcc/gcc/llvm-expand.c:1.81 Mon Feb 14 23:26:41 2005 +++ llvm-gcc/gcc/llvm-expand.c Tue Feb 15 00:59:52 2005 @@ -3312,8 +3312,15 @@ llvm_emit_label(Fn, TestBlock); + /* Start a region for the RHS expression destructors */ + llvm_expand_start_bindings(Fn); + SecondOp = llvm_expand_expr(Fn, TREE_OPERAND(exp, 1), 0); SecondOp = cast_if_type_not_equal(Fn, SecondOp, BoolTy); + + /* Stop the scope. */ + llvm_expand_end_bindings(Fn, NULL_TREE); + TestBlock = llvm_ilist_back(llvm_basicblock, Fn->BasicBlocks); llvm_emit_label(Fn, DoneBlock); From lattner at cs.uiuc.edu Tue Feb 15 01:02:27 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 01:02:27 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200502150702.j1F72R2A009215@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.297 -> 1.298 --- Log message: Bug fixed --- Diffs of the changes: (+3 -1) ReleaseNotes.html | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.297 llvm/docs/ReleaseNotes.html:1.298 --- llvm/docs/ReleaseNotes.html:1.297 Mon Feb 14 23:28:06 2005 +++ llvm/docs/ReleaseNotes.html Tue Feb 15 01:02:12 2005 @@ -162,6 +162,8 @@ initialization where static init will do
  • [llvmgcc] Field offset miscalculated for some structure fields following bit fields
  • +
  • [llvm-g++] Temporary lifetimes + incorrect for short circuit logical operations
  • @@ -583,7 +585,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2005/02/15 05:28:06 $ + Last modified: $Date: 2005/02/15 07:02:12 $ From lattner at cs.uiuc.edu Tue Feb 15 12:40:53 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 12:40:53 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/DataStructure/DSGraph.h Message-ID: <200502151840.j1FIerx4020915@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis/DataStructure: DSGraph.h updated: 1.87 -> 1.88 --- Log message: Add a new method to make it easy to update graphs. --- Diffs of the changes: (+10 -2) DSGraph.h | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Analysis/DataStructure/DSGraph.h diff -u llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.87 llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.88 --- llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.87 Fri Feb 4 13:58:06 2005 +++ llvm/include/llvm/Analysis/DataStructure/DSGraph.h Tue Feb 15 12:40:38 2005 @@ -245,8 +245,6 @@ afc_iterator afc_begin() const { return AuxFunctionCalls.begin(); } afc_iterator afc_end() const { return AuxFunctionCalls.end(); } - - /// getInlinedGlobals - Get the set of globals that are have been inlined /// (from callees in BU or from callers in TD) into the current graph. /// @@ -298,6 +296,16 @@ return Nodes.size(); } + /// addObjectToGraph - This method can be used to add global, stack, and heap + /// objects to the graph. This can be used when updating DSGraphs due to the + /// introduction of new temporary objects. The new object is not pointed to + /// and does not point to any other objects in the graph. Note that this + /// method initializes the type of the DSNode to the declared type of the + /// object if UseDeclaredType is true, otherwise it leaves the node type as + /// void. + DSNode *addObjectToGraph(Value *Ptr, bool UseDeclaredType = true); + + /// print - Print a dot graph to the specified ostream... /// void print(std::ostream &O) const; From lattner at cs.uiuc.edu Tue Feb 15 12:41:08 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 12:41:08 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp Message-ID: <200502151841.j1FIf80C021090@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.191 -> 1.192 --- Log message: Add a new method to make it easy to update graphs. --- Diffs of the changes: (+23 -1) DataStructure.cpp | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletion(-) Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.191 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.192 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.191 Tue Feb 8 21:20:43 2005 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Tue Feb 15 12:40:55 2005 @@ -147,7 +147,6 @@ std::lower_bound(Globals.begin(), Globals.end(), GV); if (I == Globals.end() || *I != GV) { - //assert(GV->getType()->getElementType() == Ty); Globals.insert(I, GV); NodeType |= GlobalNode; } @@ -1141,6 +1140,29 @@ } } +/// addObjectToGraph - This method can be used to add global, stack, and heap +/// objects to the graph. This can be used when updating DSGraphs due to the +/// introduction of new temporary objects. The new object is not pointed to +/// and does not point to any other objects in the graph. +DSNode *DSGraph::addObjectToGraph(Value *Ptr, bool UseDeclaredType) { + assert(isa(Ptr->getType()) && "Ptr is not a pointer!"); + const Type *Ty = cast(Ptr->getType())->getElementType(); + DSNode *N = new DSNode(UseDeclaredType ? Ty : 0, this); + ScalarMap[Ptr] = N; + + if (GlobalValue *GV = dyn_cast(Ptr)) { + N->addGlobal(GV); + } else if (MallocInst *MI = dyn_cast(Ptr)) { + N->setHeapNodeMarker(); + } else if (AllocaInst *AI = dyn_cast(Ptr)) { + N->setAllocaNodeMarker(); + } else { + assert(0 && "Illegal memory object input!"); + } + return N; +} + + /// cloneInto - Clone the specified DSGraph into the current graph. The /// translated ScalarMap for the old function is filled into the OldValMap /// member, and the translated ReturnNodes map is returned into ReturnNodes. From lattner at cs.uiuc.edu Tue Feb 15 12:49:01 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 12:49:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp Message-ID: <200502151849.j1FIn1Ob022284@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.192 -> 1.193 --- Log message: Add a sanity check. --- Diffs of the changes: (+1 -0) DataStructure.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.192 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.193 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.192 Tue Feb 15 12:40:55 2005 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Tue Feb 15 12:48:48 2005 @@ -1148,6 +1148,7 @@ assert(isa(Ptr->getType()) && "Ptr is not a pointer!"); const Type *Ty = cast(Ptr->getType())->getElementType(); DSNode *N = new DSNode(UseDeclaredType ? Ty : 0, this); + assert(ScalarMap[Ptr].isNull() && "Object already in this graph!"); ScalarMap[Ptr] = N; if (GlobalValue *GV = dyn_cast(Ptr)) { From lattner at cs.uiuc.edu Tue Feb 15 12:53:07 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 12:53:07 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp Message-ID: <200502151853.j1FIr7rt022754@apoc.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: PoolAllocate.cpp updated: 1.103 -> 1.104 --- Log message: Make sure that pool descriptors for global pools end up in DSGraphs. --- Diffs of the changes: (+13 -3) PoolAllocate.cpp | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.103 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.104 --- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.103 Mon Feb 14 17:08:52 2005 +++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp Tue Feb 15 12:52:51 2005 @@ -430,6 +430,9 @@ return false; } +/// CreateGlobalPool - Create a global pool descriptor object, and insert a +/// poolinit for it into main. IPHint is an instruction that we should insert +/// the poolinit before if not null. GlobalVariable *PoolAllocate::CreateGlobalPool(unsigned RecSize, unsigned Align, Instruction *IPHint) { GlobalVariable *GV = @@ -437,6 +440,10 @@ Constant::getNullValue(PoolDescType), "GlobalPool", CurModule); + // Update the global DSGraph to include this. + DSNode *GNode = ECGraphs->getGlobalsGraph().addObjectToGraph(GV); + GNode->setModifiedMarker()->setReadMarker(); + Function *MainFunc = CurModule->getMainFunction(); assert(MainFunc && "No main in program??"); @@ -491,13 +498,16 @@ PoolDesc = new AllocaInst(PoolDescType, 0, "PD", InsertPoint); // Create a node in DSG to represent the new alloca. - DSNode *NewNode = new DSNode(PoolDescType, &DSG); - NewNode->setAllocaNodeMarker(); // This is a stack object. + DSNode *NewNode = DSG.addObjectToGraph(PoolDesc); NewNode->setModifiedMarker()->setReadMarker(); // This is M/R - DSG.getNodeForValue(PoolDesc) = NewNode; } else { PoolDesc = CreateGlobalPool(Pool.PoolSize, Pool.PoolAlignment, InsertPoint); + + // Add the global node to main's graph. + DSNode *NewNode = DSG.addObjectToGraph(PoolDesc); + NewNode->setModifiedMarker()->setReadMarker(); // This is M/R + if (Pool.NodesInPool.size() == 1 && !Pool.NodesInPool[0]->isNodeCompletelyFolded()) ++NumTSPools; From lattner at cs.uiuc.edu Tue Feb 15 14:27:04 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 14:27:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Message-ID: <200502152027.j1FKR4p8023370@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrInfo.td updated: 1.49 -> 1.50 --- Log message: Fix a problem where the PPC backend lost track of the fact that it had to save and restore the LR register on entry and exit of a leaf function that needed to access globals or the constant pool. This should hopefully fix oscar from sending the PPC tester spinning out of control. --- Diffs of the changes: (+3 -1) PowerPCInstrInfo.td | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.49 llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.50 --- llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.49 Thu Dec 16 10:31:57 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Tue Feb 15 14:26:49 2005 @@ -53,7 +53,9 @@ def ADJCALLSTACKUP : Pseudo<(ops), "; ADJCALLSTACKUP">; } def IMPLICIT_DEF : Pseudo<(ops), "; IMPLICIT_DEF">; -def MovePCtoLR : Pseudo<(ops piclabel:$label), "bl $label">; + +let Defs = [LR] in + def MovePCtoLR : Pseudo<(ops piclabel:$label), "bl $label">; let isBranch = 1, isTerminator = 1 in { def COND_BRANCH : Pseudo<(ops), "; COND_BRANCH">; From alenhar2 at cs.uiuc.edu Tue Feb 15 15:14:24 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 15 Feb 2005 15:14:24 -0600 Subject: [llvm-commits] CVS: llvm/tools/llc/Makefile Message-ID: <200502152114.j1FLEO2Z025386@apoc.cs.uiuc.edu> Changes in directory llvm/tools/llc: Makefile updated: 1.66 -> 1.67 --- Log message: add Alpha to llc --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm/tools/llc/Makefile diff -u llvm/tools/llc/Makefile:1.66 llvm/tools/llc/Makefile:1.67 --- llvm/tools/llc/Makefile:1.66 Fri Jan 7 01:51:25 2005 +++ llvm/tools/llc/Makefile Tue Feb 15 15:14:09 2005 @@ -16,6 +16,7 @@ LLVMSparcV8 \ LLVMSparcV9 \ LLVMX86 \ + LLVMAlpha \ LLVMSkeleton \ LLVMSparcV9RegAlloc \ LLVMSparcV9InstrSched \ From lattner at cs.uiuc.edu Tue Feb 15 15:24:22 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 15:24:22 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Message-ID: <200502152124.j1FLOMd9027013@apoc.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: PointerCompress.cpp updated: 1.11 -> 1.12 --- Log message: Several major changes: 1. Use PoolAllocatePassAllPools instead of PoolAllocate pass so that pool arguments are passed to functions that do not allocate from the pool. 2. Change poolinit_pc to take both the compressed and uncompressed sizes of the node. This will allow us to support compressed arrays efficiently. 3. Start implementing the code required to handle function calls. Use this generic code to handle poolalloc/poolfree rewriting. Actual function cloning is not implemented yet. --- Diffs of the changes: (+69 -40) PointerCompress.cpp | 109 ++++++++++++++++++++++++++++++++-------------------- 1 files changed, 69 insertions(+), 40 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.11 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.12 --- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.11 Sun Feb 13 15:24:53 2005 +++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Tue Feb 15 15:24:07 2005 @@ -50,6 +50,11 @@ Function *PoolInitPC, *PoolDestroyPC, *PoolAllocPC, *PoolFreePC; typedef std::map PoolInfoMap; + /// ClonedFunctionMap - Every time we clone a function to compress its + /// arguments, keep track of the clone and which arguments are compressed. + std::map >, + Function *> ClonedFunctionMap; + bool runOnModule(Module &M); void getAnalysisUsage(AnalysisUsage &AU) const; @@ -158,7 +163,7 @@ void PointerCompress::getAnalysisUsage(AnalysisUsage &AU) const { // Need information about how pool allocation happened. - AU.addRequired(); + AU.addRequired(); // Need information from DSA. AU.addRequired(); @@ -211,13 +216,12 @@ Function &F, DSGraph &DSG, PA::FuncInfo *FI) { hash_set ReachableFromCalls; - + // If a data structure is passed into a call, we currently cannot handle it! for (DSGraph::fc_iterator I = DSG.fc_begin(), E = DSG.fc_end(); I != E; ++I) { //DEBUG(std::cerr << " CALLS: " << I->getCalleeFunc()->getName() << "\n"); I->markReachableNodes(ReachableFromCalls); } - DEBUG(std::cerr << "In function '" << F.getName() << "':\n"); for (unsigned i = 0, e = FI->NodesToPA.size(); i != e; ++i) { const DSNode *N = FI->NodesToPA[i]; @@ -289,7 +293,8 @@ /// getNodeIfCompressed - If the specified value is a pointer that will be /// compressed, return the DSNode corresponding to the pool it belongs to. const DSNode *getNodeIfCompressed(Value *V) { - if (!isa(V->getType()) || isa(V)) + if (!isa(V->getType()) || isa(V) || + isa(V)) return false; DSNode *N = DSG.getNodeForValue(V).getNode(); return PoolInfo.count(N) ? N : 0; @@ -336,8 +341,6 @@ void visitCallInst(CallInst &CI); void visitPoolInit(CallInst &CI); void visitPoolDestroy(CallInst &CI); - void visitPoolAlloc(CallInst &CI); - void visitPoolFree(CallInst &CI); void visitInstruction(Instruction &I) { #ifndef NDEBUG @@ -544,6 +547,8 @@ std::vector Ops; Ops.push_back(CI.getOperand(1)); + // Transform to pass in the orig and compressed sizes. + Ops.push_back(CI.getOperand(2)); Ops.push_back(ConstantUInt::get(Type::UIntTy, PI->getNewSize())); Ops.push_back(CI.getOperand(3)); // TODO: Compression could reduce the alignment restriction for the pool! @@ -563,47 +568,61 @@ CI.eraseFromParent(); } -void InstructionRewriter::visitPoolAlloc(CallInst &CI) { - // Transform to poolalloc_pc if necessary. - const CompressedPoolInfo *PI = getPoolInfo(&CI); - if (PI == 0) return; // Not a compressed pool! - - std::vector Ops; - Ops.push_back(CI.getOperand(1)); - Ops.push_back(ConstantUInt::get(Type::UIntTy, PI->getNewSize())); - Value *New = new CallInst(PtrComp.PoolAllocPC, Ops, CI.getName(), &CI); - setTransformedValue(CI, New); -} - -void InstructionRewriter::visitPoolFree(CallInst &CI) { - // Transform to poolfree_pc if the pool is compressed. - const CompressedPoolInfo *PI = getPoolInfo(CI.getOperand(2)); - if (PI == 0) return; // Not a free to a compressed pool. - - std::vector Ops; - Ops.push_back(CI.getOperand(1)); - Ops.push_back(getTransformedValue(CI.getOperand(2))); - new CallInst(PtrComp.PoolFreePC, Ops, "", &CI); - CI.eraseFromParent(); -} - void InstructionRewriter::visitCallInst(CallInst &CI) { if (Function *F = CI.getCalledFunction()) + // These functions are handled specially. if (F->getName() == "poolinit") { visitPoolInit(CI); return; } else if (F->getName() == "pooldestroy") { visitPoolDestroy(CI); return; - } else if (F->getName() == "poolalloc") { - visitPoolAlloc(CI); - return; - } else if (F->getName() == "poolfree") { - visitPoolFree(CI); - return; } - visitInstruction(CI); + // Normal function call: check to see if this call produces or uses a pointer + // into a compressed pool. If so, we will need to transform the callee or use + // a previously transformed version. For these purposes, we treat the return + // value as "operand #0". + std::vector OpsToCompress; + + // Do we need to compress the return value? + if (isa(CI.getType()) && getNodeIfCompressed(&CI)) + OpsToCompress.push_back(0); + + // Check to see if we need to compress any arguments. + for (unsigned i = 1, e = CI.getNumOperands(); i != e; ++i) + if (isa(CI.getOperand(i)->getType()) && + getNodeIfCompressed(CI.getOperand(i))) + OpsToCompress.push_back(i); + + // If this function doesn't require compression, there is nothing to do! + if (OpsToCompress.empty()) return; + Function *Callee = CI.getCalledFunction(); + assert(Callee && "Indirect calls not implemented yet!"); + + // Check to see if we have already compressed this function, if so, there is + // no need to make another clone. + Function *Clone = PtrComp.ClonedFunctionMap[std::make_pair(Callee, + OpsToCompress)]; + if (Clone == 0) { + visitInstruction(CI); + return; + } + + // Okay, we now have our clone: rewrite the call instruction. + std::vector Operands; + Operands.reserve(CI.getNumOperands()-1); + for (unsigned i = 1, e = CI.getNumOperands(); i != e; ++i) + if (isa(CI.getOperand(i)->getType()) && + getNodeIfCompressed(CI.getOperand(i))) + Operands.push_back(getTransformedValue(CI.getOperand(i))); + else + Operands.push_back(CI.getOperand(i)); + Value *NC = new CallInst(Clone, Operands, CI.getName(), &CI); + if (OpsToCompress[0] == 0) // Compressing return value? + setTransformedValue(CI, NC); + else + CI.eraseFromParent(); } @@ -673,7 +692,7 @@ PoolInitPC = M.getOrInsertFunction("poolinit_pc", Type::VoidTy, PoolDescPtrTy, Type::UIntTy, - Type::UIntTy, 0); + Type::UIntTy, Type::UIntTy, 0); PoolDestroyPC = M.getOrInsertFunction("pooldestroy_pc", Type::VoidTy, PoolDescPtrTy, 0); PoolAllocPC = M.getOrInsertFunction("poolalloc_pc", UINTTYPE, @@ -681,10 +700,19 @@ PoolFreePC = M.getOrInsertFunction("poolfree_pc", Type::VoidTy, PoolDescPtrTy, UINTTYPE, 0); // FIXME: Need bumppointer versions as well as realloc??/memalign?? -} + + // PoolAllocPC/PoolFreePC can be handled just like any other compressed + // functions. + std::vector Ops; + Ops.push_back(0); // poolalloc -> compress return value. + ClonedFunctionMap[std::make_pair(PoolAlloc->PoolAlloc, Ops)] = PoolAllocPC; + + Ops[0] = 2; // Pool free -> compress second argument. + ClonedFunctionMap[std::make_pair(PoolAlloc->PoolFree, Ops)] = PoolFreePC; +} bool PointerCompress::runOnModule(Module &M) { - PoolAlloc = &getAnalysis(); + PoolAlloc = &getAnalysis(); ECG = &getAnalysis(); if (SmallIntCompress) @@ -702,5 +730,6 @@ for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) Changed |= CompressPoolsInFunction(*I); + ClonedFunctionMap.clear(); return Changed; } From reid at x10sys.com Tue Feb 15 15:47:13 2005 From: reid at x10sys.com (Reid Spencer) Date: Tue, 15 Feb 2005 15:47:13 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200502152147.PAA22011@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.39 -> 1.40 --- Log message: Adjust DiffFilesWithTolerance to help poor cygwin's mmap facility by handling zero length files a little more intelligently. If both files are zero length then we return 0 (true) indicating a match. If only one of the files is zero length then we return 1 (false) indicating that the files differ. If the files don't agree in length then they can't match so we skip the first loop that looks for a quick match. --- Diffs of the changes: (+24 -8) FileUtilities.cpp | 32 ++++++++++++++++++++++++-------- 1 files changed, 24 insertions(+), 8 deletions(-) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.39 llvm/lib/Support/FileUtilities.cpp:1.40 --- llvm/lib/Support/FileUtilities.cpp:1.39 Sun Jan 23 00:02:40 2005 +++ llvm/lib/Support/FileUtilities.cpp Tue Feb 15 15:47:02 2005 @@ -119,7 +119,20 @@ double AbsTol, double RelTol, std::string *Error) { try { - // Map in the files into memory. + // Check for zero length files becasue some systems croak when you try to + // mmap an empty file. + size_t A_size = FileA.getSize(); + size_t B_size = FileB.getSize(); + + // If they are both zero sized then they're the same + if (A_size == 0 && B_size == 0) + return 0; + // If only one of them is zero sized then they can't be the same + if ((A_size == 0 || B_size == 0)) + return 1; + + // Now its safe to mmap the files into memory becasue both files + // have a non-zero size. sys::MappedFile F1(FileA); sys::MappedFile F2(FileB); F1.map(); @@ -133,15 +146,18 @@ char *F1P = File1Start; char *F2P = File2Start; - // Scan for the end of file or first difference. - while (F1P < File1End && F2P < File2End && *F1P == *F2P) - ++F1P, ++F2P; + if (A_size == B_size) { + // Scan for the end of file or first difference. + while (F1P < File1End && F2P < File2End && *F1P == *F2P) + ++F1P, ++F2P; - // Common case: identifical files. - if (F1P == File1End && F2P == File2End) return 0; + // Common case: identifical files. + if (F1P == File1End && F2P == File2End) + return 0; // Scanned to end, files same - if (AbsTol == 0 && RelTol == 0) - return 1; // Files different! + if (AbsTol == 0 && RelTol == 0) + return 1; // Files different! + } char *OrigFile1Start = File1Start; char *OrigFile2Start = File2Start; From brukman at cs.uiuc.edu Tue Feb 15 16:00:05 2005 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 15 Feb 2005 16:00:05 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200502152200.QAA22166@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.40 -> 1.41 --- Log message: Fix spelling --- Diffs of the changes: (+1 -1) FileUtilities.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.40 llvm/lib/Support/FileUtilities.cpp:1.41 --- llvm/lib/Support/FileUtilities.cpp:1.40 Tue Feb 15 15:47:02 2005 +++ llvm/lib/Support/FileUtilities.cpp Tue Feb 15 15:59:53 2005 @@ -119,7 +119,7 @@ double AbsTol, double RelTol, std::string *Error) { try { - // Check for zero length files becasue some systems croak when you try to + // Check for zero length files because some systems croak when you try to // mmap an empty file. size_t A_size = FileA.getSize(); size_t B_size = FileB.getSize(); From lattner at cs.uiuc.edu Tue Feb 15 16:01:58 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 16:01:58 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200502152201.j1FM1wq0028314@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.41 -> 1.42 --- Log message: Make this more efficient now that we know both files are the same length. --- Diffs of the changes: (+2 -2) FileUtilities.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.41 llvm/lib/Support/FileUtilities.cpp:1.42 --- llvm/lib/Support/FileUtilities.cpp:1.41 Tue Feb 15 15:59:53 2005 +++ llvm/lib/Support/FileUtilities.cpp Tue Feb 15 16:01:43 2005 @@ -148,11 +148,11 @@ if (A_size == B_size) { // Scan for the end of file or first difference. - while (F1P < File1End && F2P < File2End && *F1P == *F2P) + while (F1P < File1End && *F1P == *F2P) ++F1P, ++F2P; // Common case: identifical files. - if (F1P == File1End && F2P == File2End) + if (F1P == File1End) return 0; // Scanned to end, files same if (AbsTol == 0 && RelTol == 0) From lattner at cs.uiuc.edu Tue Feb 15 16:12:23 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 16:12:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200502152212.j1FMCN9l028864@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.42 -> 1.43 --- Log message: Instead of doing a manual comparison loop, just use memcmp, thanks to JohnC for the suggestion! :) --- Diffs of the changes: (+6 -9) FileUtilities.cpp | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.42 llvm/lib/Support/FileUtilities.cpp:1.43 --- llvm/lib/Support/FileUtilities.cpp:1.42 Tue Feb 15 16:01:43 2005 +++ llvm/lib/Support/FileUtilities.cpp Tue Feb 15 16:12:10 2005 @@ -17,6 +17,7 @@ #include "llvm/System/MappedFile.h" #include "llvm/ADT/StringExtras.h" #include +#include using namespace llvm; static bool isNumberChar(char C) { @@ -141,19 +142,15 @@ // Okay, now that we opened the files, scan them for the first difference. char *File1Start = F1.charBase(); char *File2Start = F2.charBase(); - char *File1End = File1Start+F1.size(); - char *File2End = File2Start+F2.size(); + char *File1End = File1Start+A_size; + char *File2End = File2Start+B_size; char *F1P = File1Start; char *F2P = File2Start; if (A_size == B_size) { - // Scan for the end of file or first difference. - while (F1P < File1End && *F1P == *F2P) - ++F1P, ++F2P; - - // Common case: identifical files. - if (F1P == File1End) - return 0; // Scanned to end, files same + // Are the buffers identical? + if (std::memcmp(File1Start, File2Start, A_size) == 0) + return 0; if (AbsTol == 0 && RelTol == 0) return 1; // Files different! From lattner at cs.uiuc.edu Tue Feb 15 16:19:31 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 16:19:31 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Message-ID: <200502152219.j1FMJViU029704@apoc.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: PointerCompress.cpp updated: 1.12 -> 1.13 --- Log message: Implement the first part of function cloning: creating the new prototype for the function. Also clean up some interfaces and enable compression of pools passed into functions. --- Diffs of the changes: (+56 -23) PointerCompress.cpp | 79 ++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 56 insertions(+), 23 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.12 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.13 --- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.12 Tue Feb 15 15:24:07 2005 +++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Tue Feb 15 16:19:18 2005 @@ -46,18 +46,22 @@ class PointerCompress : public ModulePass { PoolAllocate *PoolAlloc; PA::EquivClassGraphs *ECG; - public: - Function *PoolInitPC, *PoolDestroyPC, *PoolAllocPC, *PoolFreePC; - typedef std::map PoolInfoMap; /// ClonedFunctionMap - Every time we clone a function to compress its /// arguments, keep track of the clone and which arguments are compressed. std::map >, Function *> ClonedFunctionMap; + public: + Function *PoolInitPC, *PoolDestroyPC, *PoolAllocPC, *PoolFreePC; + typedef std::map PoolInfoMap; bool runOnModule(Module &M); + void getAnalysisUsage(AnalysisUsage &AU) const; + Function *GetFunctionClone(Function *F, + const std::vector &OpsToCompress); + private: void InitializePoolLibraryFunctions(Module &M); bool CompressPoolsInFunction(Function &F); @@ -215,20 +219,11 @@ void PointerCompress::FindPoolsToCompress(std::vector &Pools, Function &F, DSGraph &DSG, PA::FuncInfo *FI) { - hash_set ReachableFromCalls; - - // If a data structure is passed into a call, we currently cannot handle it! - for (DSGraph::fc_iterator I = DSG.fc_begin(), E = DSG.fc_end(); I != E; ++I) { - //DEBUG(std::cerr << " CALLS: " << I->getCalleeFunc()->getName() << "\n"); - I->markReachableNodes(ReachableFromCalls); - } DEBUG(std::cerr << "In function '" << F.getName() << "':\n"); for (unsigned i = 0, e = FI->NodesToPA.size(); i != e; ++i) { const DSNode *N = FI->NodesToPA[i]; - if (ReachableFromCalls.count(N)) { - DEBUG(std::cerr << "Passed into call:\nPCF: "; N->dump()); - ++NumNotCompressed; - } else if (PoolIsCompressible(N, F)) { + + if (PoolIsCompressible(N, F)) { Pools.push_back(N); ++NumCompressed; } else { @@ -600,14 +595,9 @@ Function *Callee = CI.getCalledFunction(); assert(Callee && "Indirect calls not implemented yet!"); - // Check to see if we have already compressed this function, if so, there is - // no need to make another clone. - Function *Clone = PtrComp.ClonedFunctionMap[std::make_pair(Callee, - OpsToCompress)]; - if (Clone == 0) { - visitInstruction(CI); - return; - } + // Get the clone of this function that uses compressed pointers instead of + // normal pointers. + Function *Clone = PtrComp.GetFunctionClone(Callee, OpsToCompress); // Okay, we now have our clone: rewrite the call instruction. std::vector Operands; @@ -621,8 +611,11 @@ Value *NC = new CallInst(Clone, Operands, CI.getName(), &CI); if (OpsToCompress[0] == 0) // Compressing return value? setTransformedValue(CI, NC); - else + else { + if (!CI.use_empty()) + CI.replaceAllUsesWith(NC); CI.eraseFromParent(); + } } @@ -684,6 +677,46 @@ } +/// GetFunctionClone - Lazily create clones of pool allocated functions that we +/// need in compressed form. This memoizes the functions that have been cloned +/// to allow only one clone of each function in a desired permutation. +Function *PointerCompress:: +GetFunctionClone(Function *F, const std::vector &OpsToCompress) { + assert(!OpsToCompress.empty() && "No clone needed!"); + + // Check to see if we have already compressed this function, if so, there is + // no need to make another clone. + Function *&Clone = ClonedFunctionMap[std::make_pair(F, OpsToCompress)]; + if (Clone) return Clone; + + // First step, construct the new function prototype. + const FunctionType *FTy = F->getFunctionType(); + const Type *RetTy = FTy->getReturnType(); + unsigned OTCIdx = 0; + if (OpsToCompress[0] == 0) { + RetTy = UINTTYPE; + OTCIdx++; + } + std::vector ParamTypes; + for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) + if (OTCIdx != OpsToCompress.size() && OpsToCompress[OTCIdx] == i+1) { + assert(isa(FTy->getParamType(i)) && "Not a pointer?"); + ParamTypes.push_back(UINTTYPE); + ++OTCIdx; + } else { + ParamTypes.push_back(FTy->getParamType(i)); + } + FunctionType *CFTy = FunctionType::get(RetTy, ParamTypes, FTy->isVarArg()); + + // Next, create the clone prototype and insert it into the module. + Clone = new Function(CFTy, GlobalValue::/*Internal*/ ExternalLinkage, + F->getName()+".pc"); + F->getParent()->getFunctionList().insert(F, Clone); + + return Clone; +} + + /// InitializePoolLibraryFunctions - Create the function prototypes for pointer /// compress runtime library functions. void PointerCompress::InitializePoolLibraryFunctions(Module &M) { From alkis at cs.uiuc.edu Tue Feb 15 19:22:37 2005 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Tue, 15 Feb 2005 19:22:37 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/PrivateCall.java Message-ID: <200502160122.TAA24403@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource/UnitTests: PrivateCall.java added (r1.1) --- Log message: Add test for private calls. These should be inlined and not appear in the vtable --- Diffs of the changes: (+17 -0) PrivateCall.java | 17 +++++++++++++++++ 1 files changed, 17 insertions(+) Index: llvm-java/test/Programs/SingleSource/UnitTests/PrivateCall.java diff -c /dev/null llvm-java/test/Programs/SingleSource/UnitTests/PrivateCall.java:1.1 *** /dev/null Tue Feb 15 19:22:36 2005 --- llvm-java/test/Programs/SingleSource/UnitTests/PrivateCall.java Tue Feb 15 19:22:26 2005 *************** *** 0 **** --- 1,17 ---- + public class PrivateCall + { + private int a; + + public PrivateCall(int i) { + a = i; + } + + private int foo(int i) { + return i * i / a; + } + + public static void main(String[] args) { + PrivateCall p = new PrivateCall(7); + Test.println(p.foo(123)); + } + } From alkis at cs.uiuc.edu Tue Feb 15 19:27:36 2005 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Tue, 15 Feb 2005 19:27:36 -0600 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200502160127.TAA24480@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.220 -> 1.221 --- Log message: Do not add private methods to emitted vtables as these are statically bound. --- Diffs of the changes: (+10 -6) Compiler.cpp | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.220 llvm-java/lib/Compiler/Compiler.cpp:1.221 --- llvm-java/lib/Compiler/Compiler.cpp:1.220 Sat Feb 12 14:17:48 2005 +++ llvm-java/lib/Compiler/Compiler.cpp Tue Feb 15 19:27:25 2005 @@ -411,9 +411,11 @@ // Add member functions to the vtable. for (unsigned i = 0, e = methods.size(); i != e; ++i) { Method* method = methods[i]; - // The contructor is the only non-static method that is not - // dynamically dispatched so we skip it. - if (!method->isStatic() && method->getName()->str()[0] != '<') { + // Static methods, private instance methods and the contructor + // are statically bound so we don't add them to the vtable. + if (!method->isStatic() && + !method->isPrivate() && + method->getName()->str()[0] != '<') { std::string methodDescr = method->getName()->str() + method->getDescriptor()->str(); @@ -838,9 +840,11 @@ for (unsigned i = 0, e = methods.size(); i != e; ++i) { Method* method = methods[i]; - // The contructor is the only non-static method that is not - // dynamically dispatched so we skip it. - if (!method->isStatic() && method->getName()->str()[0] != '<') { + // Static methods, private instance methods and the contructor + // are statically bound so we don't add them to the vtable. + if (!method->isStatic() && + !method->isPrivate() && + method->getName()->str()[0] != '<') { const std::string& methodDescr = method->getName()->str() + method->getDescriptor()->str(); From tbrethou at cs.uiuc.edu Tue Feb 15 22:01:15 2005 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Tue, 15 Feb 2005 22:01:15 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp ModuloScheduling.cpp Message-ID: <200502160401.j1G41FoV004248@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/ModuloScheduling: MSchedGraph.cpp updated: 1.12 -> 1.13 ModuloScheduling.cpp updated: 1.41 -> 1.42 --- Log message: Fixed node deletion bug. --- Diffs of the changes: (+13 -6) MSchedGraph.cpp | 9 +++++---- ModuloScheduling.cpp | 10 ++++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) Index: llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp diff -u llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp:1.12 llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp:1.13 --- llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp:1.12 Thu Feb 10 11:02:58 2005 +++ llvm/lib/Target/SparcV9/ModuloScheduling/MSchedGraph.cpp Tue Feb 15 22:00:59 2005 @@ -112,11 +112,12 @@ void MSchedGraph::deleteNode(MSchedGraphNode *node) { //Delete the edge to this node from all predecessors - for(MSchedGraphNode::pred_iterator P = node->pred_begin(), PE = node->pred_end(); - P != PE; ++P) { - (*P)->deleteSuccessor(node); + while(node->pred_size() > 0) { + //DEBUG(std::cerr << "Delete edge from: " << **P << " to " << *node << "\n"); + MSchedGraphNode *pred = *(node->pred_begin()); + pred->deleteSuccessor(node); } - + //Remove this node from the graph GraphMap.erase(node->getInst()); Index: llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp diff -u llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.41 llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.42 --- llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.41 Thu Feb 10 11:02:58 2005 +++ llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp Tue Feb 15 22:00:59 2005 @@ -77,6 +77,8 @@ Statistic<> MSLoops("modulosched-schedLoops", "Number of loops successfully modulo-scheduled"); Statistic<> IncreasedII("modulosched-increasedII", "Number of times we had to increase II"); Statistic<> SingleBBLoops("modulosched-singeBBLoops", "Number of single basic block loops"); + Statistic<> NoSched("modulosched-noSched", "No schedule"); + Statistic<> SameStage("modulosched-sameStage", "Max stage is 0"); template<> struct DOTGraphTraits : public DefaultDOTGraphTraits { @@ -252,9 +254,13 @@ ++MSLoops; Changed = true; } - else + else { + if(!haveSched) + ++NoSched; + else + ++SameStage; DEBUG(std::cerr << "Max stage is 0, so no change in loop or reached cap\n"); - + } //Clear out our maps for the next basic block that is processed nodeToAttributesMap.clear(); partialOrder.clear(); From jeffc at jolt-lang.org Tue Feb 15 22:43:55 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Tue, 15 Feb 2005 22:43:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Program.inc Message-ID: <200502160443.WAA26314@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Program.inc updated: 1.9 -> 1.10 --- Log message: Arg list already has program name in it. --- Diffs of the changes: (+2 -15) Program.inc | 17 ++--------------- 1 files changed, 2 insertions(+), 15 deletions(-) Index: llvm/lib/System/Win32/Program.inc diff -u llvm/lib/System/Win32/Program.inc:1.9 llvm/lib/System/Win32/Program.inc:1.10 --- llvm/lib/System/Win32/Program.inc:1.9 Sun Dec 19 21:24:56 2004 +++ llvm/lib/System/Win32/Program.inc Tue Feb 15 22:43:45 2005 @@ -81,11 +81,7 @@ // have embedded spaces. // First, determine the length of the command line. - std::string progname(path.getLast()); - unsigned len = progname.length() + 1; - if (progname.find(' ') != std::string::npos) - len += 2; - + unsigned len = 0; for (unsigned i = 0; args[i]; i++) { len += strlen(args[i]) + 1; if (strchr(args[i], ' ')) @@ -96,19 +92,10 @@ char *command = reinterpret_cast(_alloca(len)); char *p = command; - bool needsQuoting = progname.find(' ') != std::string::npos; - if (needsQuoting) - *p++ = '"'; - memcpy(p, progname.c_str(), progname.length()); - p += progname.length(); - if (needsQuoting) - *p++ = '"'; - *p++ = ' '; - for (unsigned i = 0; args[i]; i++) { const char *arg = args[i]; size_t len = strlen(arg); - needsQuoting = strchr(arg, ' ') != 0; + bool needsQuoting = strchr(arg, ' ') != 0; if (needsQuoting) *p++ = '"'; memcpy(p, arg, len); From lattner at cs.uiuc.edu Tue Feb 15 22:58:37 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 22:58:37 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h Message-ID: <200502160458.j1G4wbnY007503@apoc.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: PoolAllocate.h updated: 1.40 -> 1.41 --- Log message: Add a helper method. --- Diffs of the changes: (+8 -0) PoolAllocate.h | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.40 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.41 --- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.40 Mon Feb 14 17:08:53 2005 +++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h Tue Feb 15 22:58:22 2005 @@ -84,6 +84,14 @@ /// the values they correspond to in the old function. /// std::map NewToOldValueMap; + + /// MapValueToOriginal - Given a value in the cloned version of this + /// function, map it back to the original. + Value *MapValueToOriginal(Value *V) const { + std::map::const_iterator I =NewToOldValueMap.find(V); + assert(I != NewToOldValueMap.end() && "This is not a cloned value!"); + return const_cast(I->second); + } }; }; // end PA namespace From lattner at cs.uiuc.edu Tue Feb 15 23:01:37 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Feb 2005 23:01:37 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Message-ID: <200502160501.j1G51bkW007526@apoc.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: PointerCompress.cpp updated: 1.13 -> 1.14 --- Log message: Actually implement the first major pieces of the function cloning: 1. Copying the body of the function over 2. Setting up the mapping from the new to the old 3. Learning that this probably needs to map all of the way back to the version of the function from before the pool allocator cloned it. This is still not quite correct, as we're not compressing references to pools passed in as arguments. That is the next step. --- Diffs of the changes: (+166 -12) PointerCompress.cpp | 178 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 166 insertions(+), 12 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.13 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.14 --- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.13 Tue Feb 15 16:19:18 2005 +++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Tue Feb 15 23:01:24 2005 @@ -21,6 +21,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/InstVisitor.h" +#include "llvm/Transforms/Utils/Cloning.h" using namespace llvm; /// UINTTYPE - This is the actual type we are compressing to. This is really @@ -28,6 +29,9 @@ /// integers, when it's UShortTy. static const Type *UINTTYPE; +/// FIXME: We should keep scalars the same size as the machine word on the +/// system (e.g. 64-bits), only keeping memory objects in UINTTYPE. + namespace { cl::opt SmallIntCompress("compress-to-16-bits", @@ -38,9 +42,30 @@ "Number of pools pointer compressed"); Statistic<> NumNotCompressed("pointercompress", "Number of pools not compressible"); + Statistic<> NumCloned ("pointercompress", "Number of functions cloned"); class CompressedPoolInfo; + /// FunctionCloneRecord - One of these is kept for each function that is + /// cloned. + struct FunctionCloneRecord { + /// PAFn - The pool allocated input function that we compressed. + /// + Function *PAFn; + FunctionCloneRecord(Function *pafn) : PAFn(pafn) {} + + /// NewToOldValueMap - This is a mapping from the values in the cloned body + /// to the values in PAFn. + std::map NewToOldValueMap; + + const Value *getValueInOriginalFunction(Value *V) const { + std::map::const_iterator I = + NewToOldValueMap.find(V); + assert (I != NewToOldValueMap.end() && "Value did not come from clone!"); + return I->second; + } + }; + /// PointerCompress - This transformation hacks on type-safe pool allocated /// data structures to reduce the size of pointers in the program. class PointerCompress : public ModulePass { @@ -51,6 +76,11 @@ /// arguments, keep track of the clone and which arguments are compressed. std::map >, Function *> ClonedFunctionMap; + + /// ClonedFunctionInfoMap - This identifies the pool allocated function that + /// a clone came from. + std::map ClonedFunctionInfoMap; + public: Function *PoolInitPC, *PoolDestroyPC, *PoolAllocPC, *PoolFreePC; typedef std::map PoolInfoMap; @@ -59,12 +89,24 @@ void getAnalysisUsage(AnalysisUsage &AU) const; + /// getCloneInfo - If the specified function is a clone, return the + /// information about the cloning process for it. Otherwise, return a null + /// pointer. + const FunctionCloneRecord *getCloneInfo(Function &F) const { + std::map::const_iterator I = + ClonedFunctionInfoMap.find(&F); + return I == ClonedFunctionInfoMap.end() ? 0 : &I->second; + } + Function *GetFunctionClone(Function *F, const std::vector &OpsToCompress); private: void InitializePoolLibraryFunctions(Module &M); - bool CompressPoolsInFunction(Function &F); + bool CompressPoolsInFunction(Function &F, + std::vector > *PremappedVals = 0); + void FindPoolsToCompress(std::vector &Pools, Function &F, DSGraph &DSG, PA::FuncInfo *FI); }; @@ -247,18 +289,43 @@ const PointerCompress::PoolInfoMap &PoolInfo; + /// TD - The TargetData object for the current target. + /// const TargetData &TD; + + const DSGraph &DSG; + /// PAFuncInfo - Information about the transformation the pool allocator did + /// to the original function. + PA::FuncInfo &PAFuncInfo; + + /// FCR - If we are compressing a clone of a pool allocated function (as + /// opposed to the pool allocated function itself), this contains + /// information about the clone. + const FunctionCloneRecord *FCR; + PointerCompress &PtrComp; public: InstructionRewriter(const PointerCompress::PoolInfoMap &poolInfo, - const DSGraph &dsg, PointerCompress &ptrcomp) - : PoolInfo(poolInfo), TD(dsg.getTargetData()), DSG(dsg), PtrComp(ptrcomp){ + const DSGraph &dsg, PA::FuncInfo &pafi, + const FunctionCloneRecord *fcr, + PointerCompress &ptrcomp) + : PoolInfo(poolInfo), TD(dsg.getTargetData()), DSG(dsg), + PAFuncInfo(pafi), FCR(fcr), PtrComp(ptrcomp) { } ~InstructionRewriter(); + /// PremapValues - Seed the transformed value map with the specified values. + /// This indicates that the first value (a pointer) will map to the second + /// value (an integer). When the InstructionRewriter is complete, all of + /// the pointers in this vector are deleted. + void PremapValues(std::vector > &Vals) { + for (unsigned i = 0, e = Vals.size(); i != e; ++i) + OldToNewValueMap.insert(Vals[i]); + } + /// getTransformedValue - Return the transformed version of the specified /// value, creating a new forward ref value as needed. Value *getTransformedValue(Value *V) { @@ -291,6 +358,16 @@ if (!isa(V->getType()) || isa(V) || isa(V)) return false; + + // If this is a function clone, map the value to the original function. + if (FCR) + V = const_cast(FCR->getValueInOriginalFunction(V)); + + // If this is a pool allocator clone, map the value to the REAL original + // function. + if (!PAFuncInfo.NewToOldValueMap.empty()) + V = PAFuncInfo.MapValueToOriginal(V); + DSNode *N = DSG.getNodeForValue(V).getNode(); return PoolInfo.count(N) ? N : 0; } @@ -365,7 +442,14 @@ I->first->replaceAllUsesWith(UndefValue::get(I->first->getType())); // Finally, remove it from the program. - cast(I->first)->eraseFromParent(); + if (Instruction *Inst = dyn_cast(I->first)) + Inst->eraseFromParent(); + else if (Argument *Arg = dyn_cast(I->first)) { + assert(Arg->getParent() == 0 && "Unexpected argument type here!"); + delete Arg; // Marker node used when cloning. + } else { + assert(0 && "Unknown entry in this map!"); + } } } @@ -621,10 +705,23 @@ /// CompressPoolsInFunction - Find all pools that are compressible in this /// function and compress them. -bool PointerCompress::CompressPoolsInFunction(Function &F) { +bool PointerCompress:: +CompressPoolsInFunction(Function &F, + std::vector > *PremappedVals){ if (F.isExternal()) return false; - PA::FuncInfo *FI = PoolAlloc->getFuncInfoOrClone(F); + // If this is a pointer compressed clone of a pool allocated function, get the + // the pool allocated function. Rewriting a clone means that there are + // incoming arguments that point into compressed pools. + const FunctionCloneRecord *FCR = getCloneInfo(F); + Function *CloneSource = FCR ? FCR->PAFn : 0; + + PA::FuncInfo *FI; + if (CloneSource) + FI = PoolAlloc->getFuncInfoOrClone(*CloneSource); + else + FI = PoolAlloc->getFuncInfoOrClone(F); + if (FI == 0) { std::cerr << "DIDN'T FIND POOL INFO FOR: " << *F.getType() << F.getName() << "!\n"; @@ -637,21 +734,25 @@ if (FI->Clone && &FI->F == &F) return false; - // There are no pools in this function. - if (FI->NodesToPA.empty()) + // If there are no pools in this function, exit early. + if (FI->NodesToPA.empty() && CloneSource == 0) return false; // Get the DSGraph for this function. DSGraph &DSG = ECG->getDSGraph(FI->F); - // Compute the set of compressible pools in this function. + // Compute the set of compressible pools in this function that are hosted + // here. std::vector PoolsToCompressList; FindPoolsToCompress(PoolsToCompressList, F, DSG, FI); - if (PoolsToCompressList.empty()) return false; + // If there is nothing that we can compress, exit now. + if (PoolsToCompressList.empty() && !CloneSource) return false; // Compute the initial collection of compressed pointer infos. std::map PoolsToCompress; + + // Handle pools that are local to this function. for (unsigned i = 0, e = PoolsToCompressList.size(); i != e; ++i) { const DSNode *N = PoolsToCompressList[i]; Value *PD = FI->PoolDescriptors[N]; @@ -672,7 +773,10 @@ } // Finally, rewrite the function body to use compressed pointers! - InstructionRewriter(PoolsToCompress, DSG, *this).visit(F); + InstructionRewriter IR(PoolsToCompress, DSG, *FI, FCR, *this); + if (PremappedVals) + IR.PremapValues(*PremappedVals); + IR.visit(F); return true; } @@ -685,7 +789,8 @@ assert(!OpsToCompress.empty() && "No clone needed!"); // Check to see if we have already compressed this function, if so, there is - // no need to make another clone. + // no need to make another clone. This is also important to avoid infinite + // recursion. Function *&Clone = ClonedFunctionMap[std::make_pair(F, OpsToCompress)]; if (Clone) return Clone; @@ -713,6 +818,55 @@ F->getName()+".pc"); F->getParent()->getFunctionList().insert(F, Clone); + // Remember where this clone came from. + FunctionCloneRecord &CFI = + ClonedFunctionInfoMap.insert(std::make_pair(Clone, F)).first->second; + + ++NumCloned; + std::cerr << " CLONING FUNCTION: " << F->getName() << " -> " + << Clone->getName() << "\n"; + std::map ValueMap; + + // Create dummy Value*'s of pointer type for any arguments that are + // compressed. These are needed to satisfy typing constraints before the + // function body has been rewritten. + std::vector > RemappedArgs; + + // Process arguments, setting up the ValueMap for them. + Function::aiterator CI = Clone->abegin(); // Iterator over cloned fn args. + for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I, ++CI) { + // Transfer the argument names over. + CI->setName(I->getName()); + + // If we are compressing this argument, set up RemappedArgs. + if (CI->getType() != I->getType()) { + // Create a useless value* that is only needed to hold the uselist for the + // argument. + Value *V = new Argument(I->getType()); // dummy argument + RemappedArgs.push_back(std::make_pair(V, CI)); + ValueMap[I] = V; + } else { + // Otherwise, just remember the mapping. + ValueMap[I] = CI; + } + } + + // Clone the actual function body over. + std::vector Returns; + CloneFunctionInto(Clone, F, ValueMap, Returns); + Returns.clear(); // We don't need this. + + // Invert the ValueMap into the NewToOldValueMap + std::map &NewToOldValueMap = CFI.NewToOldValueMap; + for (std::map::iterator I = ValueMap.begin(), + E = ValueMap.end(); I != E; ++I) + NewToOldValueMap.insert(std::make_pair(I->second, I->first)); + ValueMap.clear(); + + // Recursively transform the function. + CompressPoolsInFunction(*Clone, &RemappedArgs); + + Clone->dump(); return Clone; } From jeffc at jolt-lang.org Tue Feb 15 23:05:42 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Tue, 15 Feb 2005 23:05:42 -0600 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/OptimizerDriver.cpp Message-ID: <200502160505.XAA26565@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: OptimizerDriver.cpp updated: 1.28 -> 1.29 --- Log message: Get bugpoint compiling with VC++ again, not that it works anyway. --- Diffs of the changes: (+3 -1) OptimizerDriver.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/tools/bugpoint/OptimizerDriver.cpp diff -u llvm/tools/bugpoint/OptimizerDriver.cpp:1.28 llvm/tools/bugpoint/OptimizerDriver.cpp:1.29 --- llvm/tools/bugpoint/OptimizerDriver.cpp:1.28 Sat Jan 22 11:37:13 2005 +++ llvm/tools/bugpoint/OptimizerDriver.cpp Tue Feb 15 23:05:31 2005 @@ -19,7 +19,9 @@ // independent code co-exist via conditional compilation until it is verified // that the new code works correctly on Unix. -//#define PLATFORMINDEPENDENT +#ifdef _MSC_VER +#define PLATFORMINDEPENDENT +#endif #include "BugDriver.h" #include "llvm/Module.h" From jeffc at jolt-lang.org Tue Feb 15 23:07:03 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Tue, 15 Feb 2005 23:07:03 -0600 Subject: [llvm-commits] CVS: llvm/win32/x86/x86.vcproj Message-ID: <200502160507.XAA26600@zion.cs.uiuc.edu> Changes in directory llvm/win32/x86: x86.vcproj updated: 1.9 -> 1.10 --- Log message: Somehow tablegen.exe got moved... fix up tablegen invocations to match. --- Diffs of the changes: (+16 -16) x86.vcproj | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) Index: llvm/win32/x86/x86.vcproj diff -u llvm/win32/x86/x86.vcproj:1.9 llvm/win32/x86/x86.vcproj:1.10 --- llvm/win32/x86/x86.vcproj:1.9 Sun Jan 30 11:54:12 2005 +++ llvm/win32/x86/x86.vcproj Tue Feb 15 23:06:52 2005 @@ -114,14 +114,14 @@ From reid at x10sys.com Wed Feb 16 09:54:14 2005 From: reid at x10sys.com (Reid Spencer) Date: Wed, 16 Feb 2005 09:54:14 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200502161554.JAA25997@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.297 -> 1.298 --- Log message: Don't use pax for installing header files. Use the install program instead. --- Diffs of the changes: (+8 -6) Makefile.rules | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.297 llvm/Makefile.rules:1.298 --- llvm/Makefile.rules:1.297 Mon Feb 14 15:54:08 2005 +++ llvm/Makefile.rules Wed Feb 16 09:54:03 2005 @@ -1463,14 +1463,16 @@ $(Verb) $(MKDIR) $(PROJ_includedir) $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \ cd $(PROJ_SRC_ROOT)/include && \ - find . -path '*/Internal' -prune -o '(' -type f \ - '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' -o -name '*.in' ')' \ - -print ')' | grep -v CVS | pax -rwdvpe $(PROJ_includedir) ; \ + for hdr in `find . -type f '!' '(' -name '*~' -o -name '.cvsignore' \ + -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS ` ; do \ + $(INSTALL) $$hdr $(PROJ_includedir) ; \ + done ; \ fi $(Verb) if [ -d "$(PROJ_OBJ_ROOT)/include" ] ; then \ - cd $(PROJ_OBJ_ROOT)/include && ( cd $(PROJ_SRC_ROOT)/include && \ - find . -path '*/Internal' -prune -o '(' -type f -name '*.in' -print ')' ) \ - | sed 's#.in$$##' | pax -rwdvpe $(PROJ_includedir) ; \ + cd $(PROJ_OBJ_ROOT)/include && \ + for hdr in `find . -type f -print` ; do \ + $(INSTALL) $$hdr $(PROJ_includedir) ; \ + done ; \ fi uninstall-local:: From reid at x10sys.com Wed Feb 16 10:13:13 2005 From: reid at x10sys.com (Reid Spencer) Date: Wed, 16 Feb 2005 10:13:13 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200502161613.KAA26509@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.298 -> 1.299 --- Log message: * Don't flatten the directory hierarchy when installing headers * Make it possible to have the Install program run in verbose mode when the TOOL_VERBOSE=1 option is set * Ensure non-executable installed files do not install with execute perms. --- Diffs of the changes: (+13 -8) Makefile.rules | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.298 llvm/Makefile.rules:1.299 --- llvm/Makefile.rules:1.298 Wed Feb 16 09:54:03 2005 +++ llvm/Makefile.rules Wed Feb 16 10:13:02 2005 @@ -305,6 +305,7 @@ C.Flags += -v CXX.Flags += -v LD.Flags += -v + Install.Flags += -v VERBOSE := 1 endif @@ -322,6 +323,7 @@ ifndef KEEP_SYMBOLS Strip := $(PLATFORMSTRIPOPTS) StripWarnMsg := "(without symbols)" + Install.Flags += -s endif # Adjust linker flags for building an executable @@ -359,7 +361,9 @@ $(CompileCommonOpts) $(LD.Flags) $(Strip) Relink = $(LIBTOOL) $(LibTool.Flags) --mode=link $(CXX) $(CPP.Flags) \ $(CompileCommonOpts) -LTInstall = $(LIBTOOL) $(LibTool.Flags) --mode=install $(INSTALL) +LTInstall = $(LIBTOOL) $(LibTool.Flags) --mode=install $(INSTALL) \ + $(Install.Flags) +Install = $(INSTALL) $(Install.Flags) Burg = $(BURG) -I $(PROJ_SRC_DIR) TableGen = $(TBLGEN) -I $(PROJ_SRC_DIR) Archive = $(AR) $(AR.Flags) @@ -526,9 +530,9 @@ $(Echo) Installing Configuration Files To $(PROJ_etcdir) $(Verb)for file in $(CONFIG_FILES); do \ if test -f $(PROJ_OBJ_DIR)/$${file} ; then \ - $(INSTALL) $(PROJ_OBJ_DIR)/$${file} $(PROJ_etcdir) ; \ + $(Install) -D -m 0644 $(PROJ_OBJ_DIR)/$${file} $(PROJ_etcdir) ; \ elif test -f $(PROJ_SRC_DIR)/$${file} ; then \ - $(INSTALL) $(PROJ_SRC_DIR)/$${file} $(PROJ_etcdir) ; \ + $(Install) -D -m 0644 $(PROJ_SRC_DIR)/$${file} $(PROJ_etcdir) ; \ else \ $(ECHO) Error: cannot find config file $${file}. ; \ fi \ @@ -590,7 +594,7 @@ $(DestModule): $(ModuleDestDir) $(Module) $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule) - $(Verb) $(INSTALL) $(Module) $@ + $(Verb) $(Install) -D $(Module) $@ uninstall-local:: $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule) @@ -704,7 +708,7 @@ $(DestBytecodeLib): $(BytecodeDestDir) $(LibName.BCA) $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib) - $(Verb) $(INSTALL) $(LibName.BCA) $@ + $(Verb) $(Install) -D $(LibName.BCA) $@ uninstall-local:: $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib) @@ -898,7 +902,7 @@ $(DestTool): $(PROJ_bindir) $(ToolBuildPath) $(Echo) Installing $(BuildMode) $(DestTool) - $(Verb) $(INSTALL) $(ToolBuildPath) $(DestTool) + $(Verb) $(Install) -D $(ToolBuildPath) $(DestTool) uninstall-local:: $(Echo) Uninstalling $(BuildMode) $(DestTool) @@ -1465,13 +1469,13 @@ cd $(PROJ_SRC_ROOT)/include && \ for hdr in `find . -type f '!' '(' -name '*~' -o -name '.cvsignore' \ -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS ` ; do \ - $(INSTALL) $$hdr $(PROJ_includedir) ; \ + $(Install) -D -m 0644 $$hdr $(PROJ_includedir)/$$hdr ; \ done ; \ fi $(Verb) if [ -d "$(PROJ_OBJ_ROOT)/include" ] ; then \ cd $(PROJ_OBJ_ROOT)/include && \ for hdr in `find . -type f -print` ; do \ - $(INSTALL) $$hdr $(PROJ_includedir) ; \ + $(Install) -D -m 0644 $$hdr $(PROJ_includedir)/$$hdr ; \ done ; \ fi @@ -1504,6 +1508,7 @@ $(Echo) "PROJ_bindir : " '$(PROJ_bindir)' $(Echo) "PROJ_libdir : " '$(PROJ_libdir)' $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)' + $(Echo) "PROJ_includedir : " '$(PROJ_includedir)' $(Echo) "UserTargets : " '$(UserTargets)' $(Echo) "ObjMakefiles : " '$(ObjMakefiles)' $(Echo) "SrcMakefiles : " '$(SrcMakefiles)' From reid at x10sys.com Wed Feb 16 10:17:22 2005 From: reid at x10sys.com (Reid Spencer) Date: Wed, 16 Feb 2005 10:17:22 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200502161617.KAA26550@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.299 -> 1.300 --- Log message: Fix installation of configuration files. --- Diffs of the changes: (+2 -2) Makefile.rules | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.299 llvm/Makefile.rules:1.300 --- llvm/Makefile.rules:1.299 Wed Feb 16 10:13:02 2005 +++ llvm/Makefile.rules Wed Feb 16 10:17:11 2005 @@ -530,9 +530,9 @@ $(Echo) Installing Configuration Files To $(PROJ_etcdir) $(Verb)for file in $(CONFIG_FILES); do \ if test -f $(PROJ_OBJ_DIR)/$${file} ; then \ - $(Install) -D -m 0644 $(PROJ_OBJ_DIR)/$${file} $(PROJ_etcdir) ; \ + $(Install) -m 0644 $(PROJ_OBJ_DIR)/$${file} $(PROJ_etcdir) ; \ elif test -f $(PROJ_SRC_DIR)/$${file} ; then \ - $(Install) -D -m 0644 $(PROJ_SRC_DIR)/$${file} $(PROJ_etcdir) ; \ + $(Install) -m 0644 $(PROJ_SRC_DIR)/$${file} $(PROJ_etcdir) ; \ else \ $(ECHO) Error: cannot find config file $${file}. ; \ fi \ From reid at x10sys.com Wed Feb 16 10:21:11 2005 From: reid at x10sys.com (Reid Spencer) Date: Wed, 16 Feb 2005 10:21:11 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200502161621.KAA26612@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.168 -> 1.169 --- Log message: Remove the "pax" program from the list of those needed to support LLVM. The install target in Makefile.rules no longer uses pax but just uses find and "install" instead. --- Diffs of the changes: (+0 -1) configure.ac | 1 - 1 files changed, 1 deletion(-) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.168 llvm/autoconf/configure.ac:1.169 --- llvm/autoconf/configure.ac:1.168 Thu Feb 10 22:46:58 2005 +++ llvm/autoconf/configure.ac Wed Feb 16 10:21:00 2005 @@ -267,7 +267,6 @@ AC_PATH_PROG(GREP, [grep], [grep]) AC_PATH_PROG(MKDIR,[mkdir],[mkdir]) AC_PATH_PROG(MV, [mv], [mv]) -AC_PATH_PROG(PAX, [pax], [pax]) AC_PROG_RANLIB AC_PATH_PROG(RM, [rm], [rm]) AC_PATH_PROG(SED, [sed], [sed]) From reid at x10sys.com Wed Feb 16 10:21:11 2005 From: reid at x10sys.com (Reid Spencer) Date: Wed, 16 Feb 2005 10:21:11 -0600 Subject: [llvm-commits] CVS: llvm/configure Makefile.config.in Message-ID: <200502161621.KAA26618@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.174 -> 1.175 Makefile.config.in updated: 1.48 -> 1.49 --- Log message: Remove the "pax" program from the list of those needed to support LLVM. The install target in Makefile.rules no longer uses pax but just uses find and "install" instead. --- Diffs of the changes: (+39 -81) Makefile.config.in | 1 configure | 119 +++++++++++++++++------------------------------------ 2 files changed, 39 insertions(+), 81 deletions(-) Index: llvm/configure diff -u llvm/configure:1.174 llvm/configure:1.175 --- llvm/configure:1.174 Thu Feb 10 22:46:55 2005 +++ llvm/configure Wed Feb 16 10:21:00 2005 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for llvm 1.4. +# Generated by GNU Autoconf 2.59 for llvm 1.5cvs. # # Report bugs to . # @@ -425,8 +425,8 @@ # Identity of this package. PACKAGE_NAME='llvm' PACKAGE_TARNAME='-llvm-' -PACKAGE_VERSION='1.4' -PACKAGE_STRING='llvm 1.4' +PACKAGE_VERSION='1.5cvs' +PACKAGE_STRING='llvm 1.5cvs' PACKAGE_BUGREPORT='llvmbugs at cs.uiuc.edu' ac_unique_file="lib/VMCore/Module.cpp" @@ -476,7 +476,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_COPYRIGHT subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVM_ON_UNIX LLVM_ON_WIN32 ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ENABLE_OPTIMIZED JIT ENABLE_DOXYGEN CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON ifGNUmake LN_S CMP CP DATE FIND GREP MKDIR MV PAX RANLIB ac_ct_RANLIB RM SED TAR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA BZIP2 DOT DOXYGEN ETAGS GROFF GZIP POD2HTML POD2MAN RUNTEST TCLSH ZIP EGREP INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL ECHO AR ac_ct_AR! STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ETAGSFLAGS LLVMGCC LLVMGXX ALLOCA MMAP_FILE LLVMCC1 LLVMCC1PLUS LLVMGCCDIR SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_COPYRIGHT subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVM_ON_UNIX LLVM_ON_WIN32 ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ENABLE_OPTIMIZED JIT ENABLE_DOXYGEN CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON ifGNUmake LN_S CMP CP DATE FIND GREP MKDIR MV RANLIB ac_ct_RANLIB RM SED TAR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA BZIP2 DOT DOXYGEN ETAGS GROFF GZIP POD2HTML POD2MAN RUNTEST TCLSH ZIP EGREP INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL ECHO AR ac_ct_AR STR! IP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ETAGSFLAGS LLVMGCC LLVMGXX ALLOCA MMAP_FILE LLVMCC1 LLVMCC1PLUS LLVMGCCDIR SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -965,7 +965,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures llvm 1.4 to adapt to many kinds of systems. +\`configure' configures llvm 1.5cvs to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1027,7 +1027,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of llvm 1.4:";; + short | recursive ) echo "Configuration of llvm 1.5cvs:";; esac cat <<\_ACEOF @@ -1171,7 +1171,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -llvm configure 1.4 +llvm configure 1.5cvs generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -1187,7 +1187,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by llvm $as_me 1.4, which was +It was created by llvm $as_me 1.5cvs, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -4811,46 +4811,6 @@ echo "${ECHO_T}no" >&6 fi -# Extract the first word of "pax", so it can be a program name with args. -set dummy pax; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PAX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PAX in - [\\/]* | ?:[\\/]*) - ac_cv_path_PAX="$PAX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PAX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_PAX" && ac_cv_path_PAX="pax" - ;; -esac -fi -PAX=$ac_cv_path_PAX - -if test -n "$PAX"; then - echo "$as_me:$LINENO: result: $PAX" >&5 -echo "${ECHO_T}$PAX" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 @@ -8226,7 +8186,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 10180 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -10702,7 +10662,7 @@ # Provide some information about the compiler. -echo "$as_me:10704:" \ +echo "$as_me:10665:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -11759,11 +11719,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11761: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11722: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11765: \$? = $ac_status" >&5 + echo "$as_me:11726: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -12002,11 +11962,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12004: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11965: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12008: \$? = $ac_status" >&5 + echo "$as_me:11969: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -12062,11 +12022,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12064: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12025: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12068: \$? = $ac_status" >&5 + echo "$as_me:12029: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14247,7 +14207,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:16501: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16544: \$? = $ac_status" >&5 + echo "$as_me:16505: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16598,11 +16558,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16600: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16561: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16604: \$? = $ac_status" >&5 + echo "$as_me:16565: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17959,7 +17919,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:18857: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18900: \$? = $ac_status" >&5 + echo "$as_me:18861: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -18954,11 +18914,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18956: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18917: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18960: \$? = $ac_status" >&5 + echo "$as_me:18921: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -20993,11 +20953,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:20995: $lt_compile\"" >&5) + (eval echo "\"\$as_me:20956: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:20999: \$? = $ac_status" >&5 + echo "$as_me:20960: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -21236,11 +21196,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21238: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21199: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:21242: \$? = $ac_status" >&5 + echo "$as_me:21203: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -21296,11 +21256,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21298: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21259: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:21302: \$? = $ac_status" >&5 + echo "$as_me:21263: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -23481,7 +23441,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5 cat >&5 <<_CSEOF -This file was extended by llvm $as_me 1.4, which was +This file was extended by llvm $as_me 1.5cvs, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30752,7 +30712,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -llvm config.status 1.4 +llvm config.status 1.5cvs configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -31026,7 +30986,6 @@ s, at GREP@,$GREP,;t t s, at MKDIR@,$MKDIR,;t t s, at MV@,$MV,;t t -s, at PAX@,$PAX,;t t s, at RANLIB@,$RANLIB,;t t s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s, at RM@,$RM,;t t Index: llvm/Makefile.config.in diff -u llvm/Makefile.config.in:1.48 llvm/Makefile.config.in:1.49 --- llvm/Makefile.config.in:1.48 Sun Jan 16 00:53:48 2005 +++ llvm/Makefile.config.in Wed Feb 16 10:21:00 2005 @@ -134,7 +134,6 @@ INSTALL_DATA = @INSTALL_DATA@ MKDIR := $(LLVM_SRC_ROOT)/autoconf/mkinstalldirs MV := @MV@ -PAX := @PAX@ RANLIB := @RANLIB@ RM := @RM@ SED := @SED@ From lattner at cs.uiuc.edu Wed Feb 16 11:38:19 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Feb 2005 11:38:19 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h Message-ID: <200502161738.j1GHcJGR012399@apoc.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: PoolAllocate.h updated: 1.41 -> 1.42 --- Log message: Update out-of-date and misleading comment. --- Diffs of the changes: (+4 -10) PoolAllocate.h | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.41 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.42 --- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.41 Tue Feb 15 22:58:22 2005 +++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h Wed Feb 16 11:38:03 2005 @@ -67,16 +67,10 @@ /// this function. This only includes heap nodes. std::vector NodesToPA; - /// PoolDescriptors - The Value* (either an argument or an alloca) which - /// defines the pool descriptor for this DSNode. Pools are mapped one to - /// one with nodes in the DSGraph, so this contains a pointer to the node it - /// corresponds to. In addition, the pool is initialized by calling the - /// "poolinit" library function with a chunk of memory allocated with an - /// alloca instruction. This entry contains a pointer to that alloca if the - /// pool is locally allocated or the argument it is passed in through if - /// not. - /// Note: Does not include pool arguments that are passed in because of - /// indirect function calls that are not used in the function. + /// PoolDescriptors - The Value* which defines the pool descriptor for this + /// DSNode. Note: This does not necessarily include pool arguments that are + /// passed in because of indirect function calls that are not used in the + /// function. std::map PoolDescriptors; /// NewToOldValueMap - When and if a function needs to be cloned, this map From lattner at cs.uiuc.edu Wed Feb 16 11:44:38 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Feb 2005 11:44:38 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Message-ID: <200502161744.j1GHicrT013314@apoc.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: PointerCompress.cpp updated: 1.14 -> 1.15 --- Log message: Implement compression of pools passed into or returned from functions calls. We can now pointer compress pretty general programs, though there are still sure to be bugs. --- Diffs of the changes: (+44 -9) PointerCompress.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 44 insertions(+), 9 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.14 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.15 --- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.14 Tue Feb 15 23:01:24 2005 +++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Wed Feb 16 11:44:25 2005 @@ -54,6 +54,12 @@ Function *PAFn; FunctionCloneRecord(Function *pafn) : PAFn(pafn) {} + /// PoolDescriptors - The Value* which defines the pool descriptor for this + /// DSNode. Note: Does not necessarily include pool arguments that are + /// passed in because of indirect function calls that are not used in the + /// function. + std::map PoolDescriptors; + /// NewToOldValueMap - This is a mapping from the values in the cloned body /// to the values in PAFn. std::map NewToOldValueMap; @@ -741,24 +747,46 @@ // Get the DSGraph for this function. DSGraph &DSG = ECG->getDSGraph(FI->F); + std::vector PoolsToCompressList; + // Compute the set of compressible pools in this function that are hosted // here. - std::vector PoolsToCompressList; FindPoolsToCompress(PoolsToCompressList, F, DSG, FI); + // Handle pools that are passed into the function through arguments or + // returned by the function. If this occurs, we must be dealing with a ptr + // compressed clone of the pool allocated clone of the original function. + if (FCR) { + // Compressed the return value? + if (F.getReturnType() != FCR->PAFn->getReturnType()) + PoolsToCompressList.push_back(DSG.getReturnNodeFor(FI->F).getNode()); + + for (Function::aiterator CI = F.abegin(), OI = CloneSource->abegin(), + E = F.aend(); CI != E; ++CI, ++OI) + if (CI->getType() != OI->getType()) { // Compressed this argument? + Value *OrigVal = FI->MapValueToOriginal(OI); + PoolsToCompressList.push_back(DSG.getNodeForValue(OrigVal).getNode()); + } + } + // If there is nothing that we can compress, exit now. - if (PoolsToCompressList.empty() && !CloneSource) return false; + if (PoolsToCompressList.empty()) return false; // Compute the initial collection of compressed pointer infos. std::map PoolsToCompress; - // Handle pools that are local to this function. - for (unsigned i = 0, e = PoolsToCompressList.size(); i != e; ++i) { - const DSNode *N = PoolsToCompressList[i]; - Value *PD = FI->PoolDescriptors[N]; - assert(PD && "No pool descriptor available for this pool???"); - PoolsToCompress.insert(std::make_pair(N, CompressedPoolInfo(N, PD))); - } + for (unsigned i = 0, e = PoolsToCompressList.size(); i != e; ++i) + if (PoolsToCompress.count(PoolsToCompressList[i]) == 0) { + const DSNode *N = PoolsToCompressList[i]; + Value *PD; + if (FCR) + PD = FCR->PoolDescriptors.find(N)->second; + else + PD = FI->PoolDescriptors[N]; + assert(PD && "No pool descriptor available for this pool???"); + + PoolsToCompress.insert(std::make_pair(N, CompressedPoolInfo(N, PD))); + } // Use these to compute the closure of compression information. In // particular, if one pool points to another, we need to know if the outgoing @@ -861,6 +889,13 @@ for (std::map::iterator I = ValueMap.begin(), E = ValueMap.end(); I != E; ++I) NewToOldValueMap.insert(std::make_pair(I->second, I->first)); + + // Compute the PoolDescriptors map for the cloned function. + PA::FuncInfo *FI = PoolAlloc->getFuncInfoOrClone(*F); + for (std::map::iterator I =FI->PoolDescriptors.begin(), + E = FI->PoolDescriptors.end(); I != E; ++I) + CFI.PoolDescriptors[I->first] = ValueMap[I->second]; + ValueMap.clear(); // Recursively transform the function. From lattner at cs.uiuc.edu Wed Feb 16 12:10:53 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Feb 2005 12:10:53 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h Message-ID: <200502161810.j1GIArXx016305@apoc.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: PoolAllocate.h updated: 1.42 -> 1.43 --- Log message: Handle values that have no correspondence in the original function. --- Diffs of the changes: (+4 -3) PoolAllocate.h | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.42 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.43 --- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h:1.42 Wed Feb 16 11:38:03 2005 +++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.h Wed Feb 16 12:10:40 2005 @@ -80,11 +80,12 @@ std::map NewToOldValueMap; /// MapValueToOriginal - Given a value in the cloned version of this - /// function, map it back to the original. + /// function, map it back to the original. If the specified value did not + /// exist in the original function (e.g. because it's a pool descriptor), + /// return null. Value *MapValueToOriginal(Value *V) const { std::map::const_iterator I =NewToOldValueMap.find(V); - assert(I != NewToOldValueMap.end() && "This is not a cloned value!"); - return const_cast(I->second); + return I != NewToOldValueMap.end() ? const_cast(I->second) : 0; } }; From lattner at cs.uiuc.edu Wed Feb 16 12:11:25 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Feb 2005 12:11:25 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Message-ID: <200502161811.j1GIBPQp016316@apoc.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: PointerCompress.cpp updated: 1.15 -> 1.16 --- Log message: Handle values that have no correspondence to the original function. Do not pointer compress functions that are pointer compreed clones of originals. --- Diffs of the changes: (+10 -6) PointerCompress.cpp | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.15 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.16 --- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.15 Wed Feb 16 11:44:25 2005 +++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Wed Feb 16 12:11:12 2005 @@ -80,8 +80,8 @@ /// ClonedFunctionMap - Every time we clone a function to compress its /// arguments, keep track of the clone and which arguments are compressed. - std::map >, - Function *> ClonedFunctionMap; + typedef std::pair > CloneID; + std::map ClonedFunctionMap; /// ClonedFunctionInfoMap - This identifies the pool allocated function that /// a clone came from. @@ -372,7 +372,8 @@ // If this is a pool allocator clone, map the value to the REAL original // function. if (!PAFuncInfo.NewToOldValueMap.empty()) - V = PAFuncInfo.MapValueToOriginal(V); + if ((V = PAFuncInfo.MapValueToOriginal(V)) == 0) + return 0; // Value didn't exist in the orig program (pool desc?) DSNode *N = DSG.getNodeForValue(V).getNode(); return PoolInfo.count(N) ? N : 0; @@ -901,7 +902,6 @@ // Recursively transform the function. CompressPoolsInFunction(*Clone, &RemappedArgs); - Clone->dump(); return Clone; } @@ -949,8 +949,12 @@ // Iterate over all functions in the module, looking for compressible data // structures. bool Changed = false; - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - Changed |= CompressPoolsInFunction(*I); + for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { + // If this function is not a pointer-compressed clone, compress any pools in + // it now. + if (!ClonedFunctionInfoMap.count(I)) + Changed |= CompressPoolsInFunction(*I); + } ClonedFunctionMap.clear(); return Changed; From lattner at cs.uiuc.edu Wed Feb 16 12:19:55 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Feb 2005 12:19:55 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Message-ID: <200502161819.j1GIJtHp017693@apoc.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: PointerCompress.cpp updated: 1.16 -> 1.17 --- Log message: Implement compression of return instructions. This allows us to pointer compress Olden/treeadd successfully. --- Diffs of the changes: (+10 -0) PointerCompress.cpp | 10 ++++++++++ 1 files changed, 10 insertions(+) Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.16 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.17 --- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.16 Wed Feb 16 12:11:12 2005 +++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Wed Feb 16 12:19:42 2005 @@ -410,6 +410,7 @@ // Visitation methods. These do all of the heavy lifting for the various // cases we have to handle. + void visitReturnInst(ReturnInst &RI); void visitCastInst(CastInst &CI); void visitPHINode(PHINode &PN); void visitSetCondInst(SetCondInst &SCI); @@ -460,6 +461,15 @@ } } +void InstructionRewriter::visitReturnInst(ReturnInst &RI) { + if (RI.getNumOperands() && isa(RI.getOperand(0)->getType())) + if (!isa(RI.getParent()->getParent()->getReturnType())) { + // Compressing the return value. + new ReturnInst(getTransformedValue(RI.getOperand(0)), &RI); + RI.eraseFromParent(); + } +} + void InstructionRewriter::visitCastInst(CastInst &CI) { if (!isa(CI.getType())) return; From lattner at cs.uiuc.edu Wed Feb 16 13:45:40 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Feb 2005 13:45:40 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Message-ID: <200502161945.j1GJjeWj019669@apoc.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: PointerCompress.cpp updated: 1.17 -> 1.18 --- Log message: Enhance pointer compression to decouple the type that pointers are stored in memory from the type they are stored in scalars. This allows us to keep the "compressed" pointers in 'intptr_t' sized registers, which are usually the native hardware size. --- Diffs of the changes: (+33 -20) PointerCompress.cpp | 53 ++++++++++++++++++++++++++++++++-------------------- 1 files changed, 33 insertions(+), 20 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.17 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.18 --- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.17 Wed Feb 16 12:19:42 2005 +++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Wed Feb 16 13:45:24 2005 @@ -24,13 +24,14 @@ #include "llvm/Transforms/Utils/Cloning.h" using namespace llvm; -/// UINTTYPE - This is the actual type we are compressing to. This is really +/// MEMUINTTYPE - This is the actual type we are compressing to. This is really /// only capable of being UIntTy, except when we are doing tests for 16-bit /// integers, when it's UShortTy. -static const Type *UINTTYPE; +static const Type *MEMUINTTYPE; -/// FIXME: We should keep scalars the same size as the machine word on the -/// system (e.g. 64-bits), only keeping memory objects in UINTTYPE. +/// SCALARUINTTYPE - We keep scalars the same size as the machine word on the +/// system (e.g. 64-bits), only keeping memory objects in MEMUINTTYPE. +static const Type *SCALARUINTTYPE; namespace { cl::opt @@ -184,7 +185,7 @@ std::map &Nodes) { if (const PointerType *PTY = dyn_cast(OrigTy)) { // FIXME: check to see if this pointer is actually compressed! - return UINTTYPE; + return MEMUINTTYPE; } else if (OrigTy->isFirstClassType()) return OrigTy; @@ -336,13 +337,13 @@ /// value, creating a new forward ref value as needed. Value *getTransformedValue(Value *V) { if (isa(V)) // null -> uint 0 - return Constant::getNullValue(UINTTYPE); + return Constant::getNullValue(SCALARUINTTYPE); assert(getNodeIfCompressed(V) && "Value is not compressed!"); Value *&RV = OldToNewValueMap[V]; if (RV) return RV; - RV = new Argument(UINTTYPE); + RV = new Argument(SCALARUINTTYPE); return RV; } @@ -487,7 +488,7 @@ const CompressedPoolInfo *DestPI = getPoolInfo(&PN); if (DestPI == 0) return; - PHINode *New = new PHINode(UINTTYPE, PN.getName(), &PN); + PHINode *New = new PHINode(SCALARUINTTYPE, PN.getName(), &PN); New->reserveOperandSpace(PN.getNumIncomingValues()); for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) @@ -535,7 +536,7 @@ if (Field) { const StructType *NTy = cast(PI->getNewType()); uint64_t FieldOffs = TD.getStructLayout(NTy)->MemberOffsets[Field]; - Constant *FieldOffsCst = ConstantUInt::get(UINTTYPE, FieldOffs); + Constant *FieldOffsCst = ConstantUInt::get(SCALARUINTTYPE, FieldOffs); Val = BinaryOperator::createAdd(Val, FieldOffsCst, GEPI.getName(), &GEPI); } @@ -570,13 +571,17 @@ Ops[0] = new CastInst(Ops[0], Type::UIntTy, "extend_idx", &LI); Value *SrcPtr = new GetElementPtrInst(BasePtr, Ops, LI.getOperand(0)->getName()+".pp", &LI); - const Type *DestTy = LoadingCompressedPtr ? UINTTYPE : LI.getType(); + const Type *DestTy = LoadingCompressedPtr ? MEMUINTTYPE : LI.getType(); SrcPtr = new CastInst(SrcPtr, PointerType::get(DestTy), SrcPtr->getName(), &LI); std::string OldName = LI.getName(); LI.setName(""); Value *NewLoad = new LoadInst(SrcPtr, OldName, &LI); if (LoadingCompressedPtr) { + // Convert from MEMUINTTYPE to SCALARUINTTYPE if different. + if (MEMUINTTYPE != SCALARUINTTYPE) + NewLoad = new CastInst(NewLoad, SCALARUINTTYPE, NewLoad->getName(), &LI); + setTransformedValue(LI, NewLoad); } else { LI.replaceAllUsesWith(NewLoad); @@ -602,12 +607,17 @@ // Value *SrcVal = SI.getOperand(0); if (!isa(SrcVal)) { - const CompressedPoolInfo *SrcPI = getPoolInfo(SrcVal); - if (SrcPI) // If the stored value is compressed, get the xformed version + if (const CompressedPoolInfo *SrcPI = getPoolInfo(SrcVal)) { + // If the stored value is compressed, get the xformed version SrcVal = getTransformedValue(SrcVal); + + // If SCALAR type is not the MEM type, reduce it now. + if (SrcVal->getType() != MEMUINTTYPE) + SrcVal = new CastInst(SrcVal, MEMUINTTYPE, SrcVal->getName(), &SI); + } } else { - // FIXME: This assumes that all pointers are compressed! - SrcVal = getTransformedValue(SrcVal); + // FIXME: This assumes that all null pointers are compressed! + SrcVal = Constant::getNullValue(MEMUINTTYPE); } // Get the pool base pointer. @@ -838,14 +848,14 @@ const Type *RetTy = FTy->getReturnType(); unsigned OTCIdx = 0; if (OpsToCompress[0] == 0) { - RetTy = UINTTYPE; + RetTy = SCALARUINTTYPE; OTCIdx++; } std::vector ParamTypes; for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) if (OTCIdx != OpsToCompress.size() && OpsToCompress[OTCIdx] == i+1) { assert(isa(FTy->getParamType(i)) && "Not a pointer?"); - ParamTypes.push_back(UINTTYPE); + ParamTypes.push_back(SCALARUINTTYPE); ++OTCIdx; } else { ParamTypes.push_back(FTy->getParamType(i)); @@ -927,10 +937,10 @@ Type::UIntTy, Type::UIntTy, 0); PoolDestroyPC = M.getOrInsertFunction("pooldestroy_pc", Type::VoidTy, PoolDescPtrTy, 0); - PoolAllocPC = M.getOrInsertFunction("poolalloc_pc", UINTTYPE, + PoolAllocPC = M.getOrInsertFunction("poolalloc_pc", SCALARUINTTYPE, PoolDescPtrTy, Type::UIntTy, 0); PoolFreePC = M.getOrInsertFunction("poolfree_pc", Type::VoidTy, - PoolDescPtrTy, UINTTYPE, 0); + PoolDescPtrTy, SCALARUINTTYPE, 0); // FIXME: Need bumppointer versions as well as realloc??/memalign?? // PoolAllocPC/PoolFreePC can be handled just like any other compressed @@ -948,9 +958,12 @@ ECG = &getAnalysis(); if (SmallIntCompress) - UINTTYPE = Type::UShortTy; + MEMUINTTYPE = Type::UShortTy; else - UINTTYPE = Type::UIntTy; + MEMUINTTYPE = Type::UIntTy; + + // FIXME: make this IntPtrTy. + SCALARUINTTYPE = Type::ULongTy; // Create the function prototypes for pointer compress runtime library // functions. From lattner at cs.uiuc.edu Thu Feb 17 10:53:57 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Feb 2005 10:53:57 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll Message-ID: <200502171653.j1HGrvEa026778@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/IndVarsSimplify: 2005-02-17-TruncateExprCrash.ll added (r1.1) --- Log message: new testcase for PR515: http://llvm.cs.uiuc.edu/PR515 --- Diffs of the changes: (+63 -0) 2005-02-17-TruncateExprCrash.ll | 63 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 63 insertions(+) Index: llvm/test/Regression/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll diff -c /dev/null llvm/test/Regression/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll:1.1 *** /dev/null Thu Feb 17 10:53:52 2005 --- llvm/test/Regression/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll Thu Feb 17 10:53:41 2005 *************** *** 0 **** --- 1,63 ---- + ; RUN: llvm-as < %s | opt -indvars -disable-output + + implementation ; Functions: + + declare void %q_atomic_increment() + + declare void %_Z9qt_assertPKcS0_i() + + void %_ZN13QMetaResourceC1EPKh() { + entry: + invoke void %_Z9qt_assertPKcS0_i( ) + to label %endif.1 unwind label %then.i.i551 + + then.i.i551: ; preds = %entry + ret void + + endif.1: ; preds = %entry + br bool false, label %then.2, label %then.i.i + + then.2: ; preds = %endif.1 + invoke void %q_atomic_increment( ) + to label %loopentry.0 unwind label %invoke_catch.6 + + invoke_catch.6: ; preds = %then.2 + ret void + + loopentry.0: ; preds = %then.2 + br bool false, label %shortcirc_next.i, label %endif.3 + + endif.3: ; preds = %loopentry.0 + ret void + + shortcirc_next.i: ; preds = %loopentry.0 + br bool false, label %_ZNK7QString2atEi.exit, label %then.i + + then.i: ; preds = %shortcirc_next.i + ret void + + _ZNK7QString2atEi.exit: ; preds = %shortcirc_next.i + br bool false, label %endif.4, label %then.4 + + then.4: ; preds = %_ZNK7QString2atEi.exit + ret void + + endif.4: ; preds = %_ZNK7QString2atEi.exit + %tmp.115 = load ubyte* null ; [#uses=1] + br bool false, label %loopexit.1, label %no_exit.0 + + no_exit.0: ; preds = %no_exit.0, %endif.4 + %bytes_in_len.4.5 = phi ubyte [ %dec, %no_exit.0 ], [ %tmp.115, %endif.4 ] ; [#uses=1] + %off.5.5.in = phi int [ %off.5.5, %no_exit.0 ], [ 0, %endif.4 ] ; [#uses=1] + %off.5.5 = add int %off.5.5.in, 1 ; [#uses=2] + %dec = add ubyte %bytes_in_len.4.5, 255 ; [#uses=2] + %tmp.123631 = seteq ubyte %dec, 0 ; [#uses=1] + br bool %tmp.123631, label %loopexit.1, label %no_exit.0 + + loopexit.1: ; preds = %no_exit.0, %endif.4 + %off.5.in.6 = phi int [ 0, %endif.4 ], [ %off.5.5, %no_exit.0 ] ; [#uses=0] + ret void + + then.i.i: ; preds = %endif.1 + ret void + } From lattner at cs.uiuc.edu Thu Feb 17 10:54:29 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Feb 2005 10:54:29 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp Message-ID: <200502171654.j1HGsTSj026791@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ScalarEvolution.cpp updated: 1.32 -> 1.33 --- Log message: Scary typo that fixes Regression/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll and PR515: http://llvm.cs.uiuc.edu/PR515 . --- Diffs of the changes: (+1 -1) ScalarEvolution.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.32 llvm/lib/Analysis/ScalarEvolution.cpp:1.33 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.32 Sat Feb 12 22:37:18 2005 +++ llvm/lib/Analysis/ScalarEvolution.cpp Thu Feb 17 10:54:16 2005 @@ -224,7 +224,7 @@ SCEVZeroExtendExpr*> SCEVZeroExtends; SCEVZeroExtendExpr::SCEVZeroExtendExpr(const SCEVHandle &op, const Type *ty) - : SCEV(scTruncate), Op(Op), Ty(ty) { + : SCEV(scTruncate), Op(op), Ty(ty) { assert(Op->getType()->isInteger() && Ty->isInteger() && Ty->isUnsigned() && "Cannot zero extend non-integer value!"); From alenhar2 at cs.uiuc.edu Thu Feb 17 13:05:38 2005 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 17 Feb 2005 13:05:38 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/FloatPrecision.c Message-ID: <200502171905.j1HJ5c1D027554@apoc.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests: FloatPrecision.c updated: 1.1 -> 1.2 --- Log message: broken test case --- Diffs of the changes: (+1 -1) FloatPrecision.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/SingleSource/UnitTests/FloatPrecision.c diff -u llvm-test/SingleSource/UnitTests/FloatPrecision.c:1.1 llvm-test/SingleSource/UnitTests/FloatPrecision.c:1.2 --- llvm-test/SingleSource/UnitTests/FloatPrecision.c:1.1 Thu Jan 16 16:58:09 2003 +++ llvm-test/SingleSource/UnitTests/FloatPrecision.c Thu Feb 17 13:05:22 2005 @@ -2,7 +2,7 @@ void print(float X) { printf("%f\n", X*2147483647); - printf("%x\n", X*2147483647); + printf("%x\n", (unsigned)(X*2147483647)); } int main() { From lattner at cs.uiuc.edu Thu Feb 17 13:28:00 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Feb 2005 13:28:00 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll dead-phi-edge.ll Message-ID: <200502171928.j1HJS0Mq029167@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/ADCE: 2005-02-17-PHI-Invoke-Crash.ll added (r1.1) dead-phi-edge.ll added (r1.1) --- Log message: New files, testing for a crash in ADCE compiling QT and a missed optimization. --- Diffs of the changes: (+64 -0) 2005-02-17-PHI-Invoke-Crash.ll | 49 +++++++++++++++++++++++++++++++++++++++++ dead-phi-edge.ll | 15 ++++++++++++ 2 files changed, 64 insertions(+) Index: llvm/test/Regression/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll diff -c /dev/null llvm/test/Regression/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll:1.1 *** /dev/null Thu Feb 17 13:27:54 2005 --- llvm/test/Regression/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll Thu Feb 17 13:27:44 2005 *************** *** 0 **** --- 1,49 ---- + ; RUN: llvm-as < %s | opt -adce -disable-output + + implementation ; Functions: + + declare { }* %llvm.dbg.region.end({ }*) + + declare void %strlen() + + declare void %_ZN10QByteArray6resizeEi() + + declare void %q_atomic_decrement() + + void %_ZNK10QByteArray13leftJustifiedEicb() { + entry: + invoke void %strlen( ) + to label %tmp.3.i.noexc unwind label %invoke_catch.0 + + tmp.3.i.noexc: ; preds = %entry + br bool false, label %then.0, label %else.0 + + invoke_catch.0: ; preds = %entry + invoke void %q_atomic_decrement( ) + to label %tmp.1.i.i183.noexc unwind label %terminate + + tmp.1.i.i183.noexc: ; preds = %invoke_catch.0 + unwind + + then.0: ; preds = %tmp.3.i.noexc + invoke void %_ZN10QByteArray6resizeEi( ) + to label %invoke_cont.1 unwind label %invoke_catch.1 + + invoke_catch.1: ; preds = %then.0 + invoke void %q_atomic_decrement( ) + to label %tmp.1.i.i162.noexc unwind label %terminate + + tmp.1.i.i162.noexc: ; preds = %invoke_catch.1 + ret void + + invoke_cont.1: ; preds = %then.0 + ret void + + else.0: ; preds = %tmp.3.i.noexc + ret void + + terminate: ; preds = %invoke_catch.1, %invoke_catch.0 + %dbg.0.1 = phi { }* [ null, %invoke_catch.1 ], [ null, %invoke_catch.0 ] ; <{ }*> [#uses=1] + %dbg.tmp.43 = call { }* %llvm.dbg.region.end( { }* %dbg.0.1 ) ; <{ }*> [#uses=0] + unreachable + } Index: llvm/test/Regression/Transforms/ADCE/dead-phi-edge.ll diff -c /dev/null llvm/test/Regression/Transforms/ADCE/dead-phi-edge.ll:1.1 *** /dev/null Thu Feb 17 13:28:00 2005 --- llvm/test/Regression/Transforms/ADCE/dead-phi-edge.ll Thu Feb 17 13:27:44 2005 *************** *** 0 **** --- 1,15 ---- + ; RUN: llvm-as < %s | opt -adce | llvm-dis | not grep call + + ; The call is not live just because the PHI uses the call retval! + + int %test(int %X) { + br label %Done + + DeadBlock: + %Y = call int %test(int 0) + br label %Done + + Done: + %Z = phi int [%X, %0], [%Y, %DeadBlock] + ret int %Z + } From lattner at cs.uiuc.edu Thu Feb 17 13:29:02 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Feb 2005 13:29:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp Message-ID: <200502171929.j1HJT2dI029202@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.88 -> 1.89 --- Log message: Do not mark obviously unreachable blocks live when processing PHI nodes, and handle incomplete control dependences correctly. This fixes: Regression/Transforms/ADCE/dead-phi-edge.ll -> a missed optimization Regression/Transforms/ADCE/dead-phi-edge.ll -> a compiler crash distilled from QT4 --- Diffs of the changes: (+61 -40) ADCE.cpp | 101 ++++++++++++++++++++++++++++++++++++++------------------------- 1 files changed, 61 insertions(+), 40 deletions(-) Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.88 llvm/lib/Transforms/Scalar/ADCE.cpp:1.89 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.88 Sun Dec 12 17:49:37 2004 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Thu Feb 17 13:28:49 2005 @@ -253,7 +253,7 @@ // function which unwinds, exits or has side-effects, we don't want to delete // the infinite loop or those blocks leading up to it. for (Function::iterator I = Func->begin(), E = Func->end(); I != E; ++I) - if (DT[I] == 0) + if (DT[I] == 0 && ReachableBBs.count(I)) for (pred_iterator PI = pred_begin(I), E = pred_end(I); PI != E; ++PI) markInstructionLive((*PI)->getTerminator()); @@ -281,17 +281,28 @@ // defined in the predecessor nodes of this block, meaning that the PHI // makes the predecessors alive. // - if (PHINode *PN = dyn_cast(I)) - for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) - if (AliveBlocks.insert(PN->getIncomingBlock(i)).second) - markBlockAlive(PN->getIncomingBlock(i)); // Block is newly ALIVE! - - // Loop over all of the operands of the live instruction, making sure that - // they are known to be alive as well. - // - for (unsigned op = 0, End = I->getNumOperands(); op != End; ++op) - if (Instruction *Operand = dyn_cast(I->getOperand(op))) - markInstructionLive(Operand); + if (PHINode *PN = dyn_cast(I)) { + for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) { + // If the incoming edge is clearly dead, it won't have control + // dependence information. Do not mark it live. + BasicBlock *PredBB = PN->getIncomingBlock(i); + if (ReachableBBs.count(PredBB)) { + // FIXME: This should mark the control dependent edge as live, not + // necessarily the predecessor itself! + if (AliveBlocks.insert(PredBB).second) + markBlockAlive(PN->getIncomingBlock(i)); // Block is newly ALIVE! + if (Instruction *Op = dyn_cast(PN->getIncomingValue(i))) + markInstructionLive(Op); + } + } + } else { + // Loop over all of the operands of the live instruction, making sure that + // they are known to be alive as well. + // + for (unsigned op = 0, End = I->getNumOperands(); op != End; ++op) + if (Instruction *Operand = dyn_cast(I->getOperand(op))) + markInstructionLive(Operand); + } } DEBUG( @@ -359,7 +370,7 @@ // Loop over all of the successors, looking for ones that are not alive. // We cannot save the number of successors in the terminator instruction - // here because we may remove them if we don't have a postdominator... + // here because we may remove them if we don't have a postdominator. // for (unsigned i = 0; i != TI->getNumSuccessors(); ++i) if (!AliveBlocks.count(TI->getSuccessor(i))) { @@ -368,39 +379,49 @@ // dead... // PostDominatorTree::Node *LastNode = DT[TI->getSuccessor(i)]; + PostDominatorTree::Node *NextNode = 0; + + if (LastNode) { + NextNode = LastNode->getIDom(); + while (!AliveBlocks.count(NextNode->getBlock())) { + LastNode = NextNode; + NextNode = NextNode->getIDom(); + if (NextNode == 0) { + LastNode = 0; + break; + } + } + } // There is a special case here... if there IS no post-dominator for - // the block we have no owhere to point our branch to. Instead, - // convert it to a return. This can only happen if the code branched - // into an infinite loop. Note that this may not be desirable, - // because we _are_ altering the behavior of the code. This is a well - // known drawback of ADCE, so in the future if we choose to revisit - // the decision, this is where it should be. + // the block we have nowhere to point our branch to. Instead, convert + // it to a return. This can only happen if the code branched into an + // infinite loop. Note that this may not be desirable, because we + // _are_ altering the behavior of the code. This is a well known + // drawback of ADCE, so in the future if we choose to revisit the + // decision, this is where it should be. // if (LastNode == 0) { // No postdominator! - // Call RemoveSuccessor to transmogrify the terminator instruction - // to not contain the outgoing branch, or to create a new terminator - // if the form fundamentally changes (i.e., unconditional branch to - // return). Note that this will change a branch into an infinite - // loop into a return instruction! - // - RemoveSuccessor(TI, i); - - // RemoveSuccessor may replace TI... make sure we have a fresh - // pointer... and e variable. - // - TI = BB->getTerminator(); - - // Rescan this successor... - --i; - } else { - PostDominatorTree::Node *NextNode = LastNode->getIDom(); + if (!isa(TI)) { + // Call RemoveSuccessor to transmogrify the terminator instruction + // to not contain the outgoing branch, or to create a new + // terminator if the form fundamentally changes (i.e., + // unconditional branch to return). Note that this will change a + // branch into an infinite loop into a return instruction! + // + RemoveSuccessor(TI, i); + + // RemoveSuccessor may replace TI... make sure we have a fresh + // pointer. + // + TI = BB->getTerminator(); + + // Rescan this successor... + --i; + } else { - while (!AliveBlocks.count(NextNode->getBlock())) { - LastNode = NextNode; - NextNode = NextNode->getIDom(); } - + } else { // Get the basic blocks that we need... BasicBlock *LastDead = LastNode->getBlock(); BasicBlock *NextAlive = NextNode->getBlock(); From lattner at cs.uiuc.edu Thu Feb 17 13:40:45 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Feb 2005 13:40:45 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200502171940.j1HJejH4029636@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.30 -> 1.31 --- Log message: Don't sink argument loads into loops or other bad places. This disables folding of argument loads with instructions that are not in the entry block. --- Diffs of the changes: (+8 -1) SelectionDAGISel.cpp | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.30 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.31 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.30 Sat Jan 22 22:36:26 2005 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Feb 17 13:40:32 2005 @@ -852,7 +852,14 @@ ++UI) if (isa(*UI) || cast(*UI)->getParent() != BB) return 0; // Disagreement among the users? - return BB; + + // Okay, there is a single BB user. Only permit this optimization if this is + // the entry block, otherwise, we might sink argument loads into loops and + // stuff. Later, when we have global instruction selection, this won't be an + // issue clearly. + if (BB == BB->getParent()->begin()) + return BB; + return 0; } void SelectionDAGISel:: From lattner at cs.uiuc.edu Thu Feb 17 14:17:14 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Feb 2005 14:17:14 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h Message-ID: <200502172017.j1HKHEBk013840@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.18 -> 1.19 --- Log message: Map doubles from integers, not the double itself. --- Diffs of the changes: (+1 -1) SelectionDAG.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.18 llvm/include/llvm/CodeGen/SelectionDAG.h:1.19 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.18 Sat Jan 22 22:36:06 2005 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Thu Feb 17 14:16:58 2005 @@ -199,7 +199,7 @@ std::map GlobalValues; std::map, SDNode*> Constants; - std::map, SDNode*> ConstantFPs; + std::map, SDNode*> ConstantFPs; std::map FrameIndices; std::map ConstantPoolIndices; std::map BBNodes; From lattner at cs.uiuc.edu Thu Feb 17 14:17:45 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Feb 2005 14:17:45 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200502172017.j1HKHjWk013851@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.50 -> 1.51 --- Log message: Don't rely on doubles comparing identical to each other, which doesn't work for 0.0 and -0.0. --- Diffs of the changes: (+19 -4) SelectionDAG.cpp | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.50 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.51 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.50 Sat Jan 22 22:39:44 2005 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Feb 17 14:17:32 2005 @@ -196,10 +196,15 @@ Constants.erase(std::make_pair(cast(N)->getValue(), N->getValueType(0))); break; - case ISD::ConstantFP: - ConstantFPs.erase(std::make_pair(cast(N)->getValue(), - N->getValueType(0))); + case ISD::ConstantFP: { + union { + double DV; + uint64_t IV; + }; + DV = cast(N)->getValue(); + ConstantFPs.erase(std::make_pair(IV, N->getValueType(0))); break; + } case ISD::GlobalAddress: GlobalValues.erase(cast(N)->getGlobal()); break; @@ -299,7 +304,17 @@ if (VT == MVT::f32) Val = (float)Val; // Mask out extra precision. - SDNode *&N = ConstantFPs[std::make_pair(Val, VT)]; + // Do the map lookup using the actual bit pattern for the floating point + // value, so that we don't have problems with 0.0 comparing equal to -0.0, and + // we don't have issues with SNANs. + union { + double DV; + uint64_t IV; + }; + + DV = Val; + + SDNode *&N = ConstantFPs[std::make_pair(IV, VT)]; if (N) return SDOperand(N, 0); N = new ConstantFPSDNode(Val, VT); AllNodes.push_back(N); From brukman at cs.uiuc.edu Thu Feb 17 15:39:37 2005 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 17 Feb 2005 15:39:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200502172139.PAA25012@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.31 -> 1.32 --- Log message: Fix compilation errors with VS 2005, patch by Aaron Gray. --- Diffs of the changes: (+3 -0) SelectionDAGISel.cpp | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.31 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.32 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.31 Thu Feb 17 13:40:32 2005 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Feb 17 15:39:27 2005 @@ -720,6 +720,7 @@ // out. std::cerr << "Variable arguments handling not implemented on this target!\n"; abort(); + return std::make_pair(SDOperand(), SDOperand()); } SDOperand TargetLowering::LowerVAEnd(SDOperand Chain, SDOperand L, @@ -741,6 +742,7 @@ // out. std::cerr << "Variable arguments handling not implemented on this target!\n"; abort(); + return std::make_pair(SDOperand(), SDOperand()); } @@ -789,6 +791,7 @@ SDOperand TargetLowering::LowerOperation(SDOperand Op) { assert(0 && "LowerOperation not implemented for this target!"); abort(); + return SDOperand(); } void SelectionDAGLowering::visitFrameReturnAddress(CallInst &I, bool isFrame) { From brukman at cs.uiuc.edu Thu Feb 17 15:40:37 2005 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 17 Feb 2005 15:40:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetFrameInfo.cpp Message-ID: <200502172140.PAA25047@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetFrameInfo.cpp updated: 1.3 -> 1.4 --- Log message: Fix compilation errors with VS 2005, patch contributed by Aaron Gray. --- Diffs of the changes: (+28 -8) TargetFrameInfo.cpp | 36 ++++++++++++++++++++++++++++-------- 1 files changed, 28 insertions(+), 8 deletions(-) Index: llvm/lib/Target/TargetFrameInfo.cpp diff -u llvm/lib/Target/TargetFrameInfo.cpp:1.3 llvm/lib/Target/TargetFrameInfo.cpp:1.4 --- llvm/lib/Target/TargetFrameInfo.cpp:1.3 Thu Aug 12 13:37:04 2004 +++ llvm/lib/Target/TargetFrameInfo.cpp Thu Feb 17 15:40:27 2005 @@ -24,7 +24,10 @@ // This method adjusts a stack offset to meet alignment rules of target. int TargetFrameInfo::adjustAlignment(int unalignedOffset, bool growUp, - unsigned align) const { abort(); } + unsigned align) const { + abort(); + return 0; +} // These methods compute offsets using the frame contents for a particular // function. The frame contents are obtained from the MachineFunction object @@ -33,25 +36,42 @@ // int TargetFrameInfo::getIncomingArgOffset(MachineFunction& mcInfo, unsigned argNum) - const{ abort(); } + const { + abort(); + return 0; +} int TargetFrameInfo::getOutgoingArgOffset(MachineFunction& mcInfo, - unsigned argNum) const { abort(); } + unsigned argNum) const { + abort(); + return 0; +} int TargetFrameInfo::getFirstAutomaticVarOffset(MachineFunction& mcInfo, - bool& growUp) const { abort(); } + bool& growUp) const { + abort(); + return 0; +} int TargetFrameInfo::getRegSpillAreaOffset(MachineFunction& mcInfo, bool& growUp) - const { abort(); } + const { + abort(); + return 0; +} int -TargetFrameInfo::getTmpAreaOffset(MachineFunction& mcInfo, bool& growUp) const -{ abort(); } +TargetFrameInfo::getTmpAreaOffset(MachineFunction& mcInfo, bool& growUp) const { + abort(); + return 0; +} int TargetFrameInfo::getDynamicAreaOffset(MachineFunction& mcInfo, bool& growUp) - const { abort(); } + const { + abort(); + return 0; +} From brukman at cs.uiuc.edu Thu Feb 17 16:22:35 2005 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 17 Feb 2005 16:22:35 -0600 Subject: [llvm-commits] CVS: llvm/docs/CodeGenerator.html Message-ID: <200502172222.QAA25844@zion.cs.uiuc.edu> Changes in directory llvm/docs: CodeGenerator.html updated: 1.10 -> 1.11 --- Log message: Remove colloquialisms from the documentation. --- Diffs of the changes: (+5 -6) CodeGenerator.html | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) Index: llvm/docs/CodeGenerator.html diff -u llvm/docs/CodeGenerator.html:1.10 llvm/docs/CodeGenerator.html:1.11 --- llvm/docs/CodeGenerator.html:1.10 Fri Jan 28 11:22:53 2005 +++ llvm/docs/CodeGenerator.html Thu Feb 17 16:22:24 2005 @@ -899,8 +899,7 @@
    -

    -The x86 has a very, uhm, flexible, way of accessing memory. It is capable of +

    The x86 has a very flexible way of accessing memory. It is capable of forming memory addresses of the following expression directly in integer instructions (which use ModR/M addressing):

    @@ -908,9 +907,9 @@ Base+[1,2,4,8]*IndexReg+Disp32 -

    Wow, that's crazy. In order to represent this, LLVM tracks no less than 4 -operands for each memory operand of this form. This means that the "load" form -of 'mov' has the following "Operands" in this order:

    +

    In order to represent this, LLVM tracks no less than 4 operands for each +memory operand of this form. This means that the "load" form of 'mov' has the +following MachineOperands in this order:

     Index:        0     |    1        2       3           4
    @@ -954,7 +953,7 @@
     
       Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2005/01/28 17:22:53 $ + Last modified: $Date: 2005/02/17 22:22:24 $ From alkis at cs.uiuc.edu Thu Feb 17 21:19:17 2005 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu, 17 Feb 2005 21:19:17 -0600 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200502180319.VAA29687@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.221 -> 1.222 --- Log message: Mark static final fields with a static initializer as Constants. --- Diffs of the changes: (+14 -5) Compiler.cpp | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.221 llvm-java/lib/Compiler/Compiler.cpp:1.222 --- llvm-java/lib/Compiler/Compiler.cpp:1.221 Tue Feb 15 19:27:25 2005 +++ llvm-java/lib/Compiler/Compiler.cpp Thu Feb 17 21:19:06 2005 @@ -1471,17 +1471,26 @@ Field* field = fields[i]; if (field->isStatic()) { Type* globalTy = getType(field->getDescriptor()); - ConstantValueAttribute* cv = field->getConstantValueAttribute(); - llvm::Constant* init = cv ? - ConstantExpr::getCast(getConstant(cv->getValue()), globalTy) : - llvm::Constant::getNullValue(globalTy); + // A java field can be final/constant even if it has a + // dynamic initializer. Because LLVM does not currently + // support these semantics, we consider constants only + // final fields with static initializers. + bool isConstant = field->isStatic(); + llvm::Constant* init; + if (ConstantValueAttribute* cv = field->getConstantValueAttribute()) + init = + ConstantExpr::getCast(getConstant(cv->getValue()), globalTy); + else { + init = llvm::Constant::getNullValue(globalTy); + isConstant = false; + } std::string globalName = classfile->getThisClass()->getName()->str() + '/' + field->getName()->str(); DEBUG(std::cerr << "Adding global: " << globalName << '\n'); new GlobalVariable(globalTy, - false, + isConstant, GlobalVariable::ExternalLinkage, init, globalName, From alkis at cs.uiuc.edu Thu Feb 17 22:30:03 2005 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu, 17 Feb 2005 22:30:03 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/FloatCompare.java Message-ID: <200502180430.WAA30580@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource/UnitTests: FloatCompare.java updated: 1.4 -> 1.5 --- Log message: Improve test case. --- Diffs of the changes: (+28 -7) FloatCompare.java | 35 ++++++++++++++++++++++++++++------- 1 files changed, 28 insertions(+), 7 deletions(-) Index: llvm-java/test/Programs/SingleSource/UnitTests/FloatCompare.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/FloatCompare.java:1.4 llvm-java/test/Programs/SingleSource/UnitTests/FloatCompare.java:1.5 --- llvm-java/test/Programs/SingleSource/UnitTests/FloatCompare.java:1.4 Sat Dec 11 17:31:49 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/FloatCompare.java Thu Feb 17 22:29:50 2005 @@ -1,14 +1,35 @@ public class FloatCompare { - public static void main(String[] args) { - int count = 0; + private static float[] doubles = + new float[]{ -1.0f, 0.0f, -0.0f, 1.0f, + Float.NaN, + Float.NEGATIVE_INFINITY, + Float.POSITIVE_INFINITY }; - for (float f = 0.0F; f < 10F; f += 1.1F) - ++count; + public static void main(String[] args) { + int greater = 0; + int equal = 0; + int less = 0; + int unordered = 0; - for (double d = 100; d > 0; d -= 11) - ++count; + for (int i = 0; i < doubles.length; ++i) { + double a = doubles[i]; + for (int j = 0; j < doubles.length; ++j) { + double b = doubles[j]; + if (a > b) + ++greater; + else if (a < b) + ++less; + else if (a == b) + ++equal; + else + ++unordered; + } + } - Test.println(count); + Test.println(greater); + Test.println(equal); + Test.println(less); + Test.println(unordered); } } From alkis at cs.uiuc.edu Thu Feb 17 22:36:31 2005 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu, 17 Feb 2005 22:36:31 -0600 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200502180436.WAA30675@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.222 -> 1.223 --- Log message: Make code for shifts adhere to the java vm specification (shift amounts are ended with 0x1f for ints and 0x3f for longs). Cleanup lcmp, fcmp and dcmp. --- Diffs of the changes: (+23 -19) Compiler.cpp | 42 +++++++++++++++++++++++------------------- 1 files changed, 23 insertions(+), 19 deletions(-) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.222 llvm-java/lib/Compiler/Compiler.cpp:1.223 --- llvm-java/lib/Compiler/Compiler.cpp:1.222 Thu Feb 17 21:19:06 2005 +++ llvm-java/lib/Compiler/Compiler.cpp Thu Feb 17 22:36:21 2005 @@ -52,6 +52,13 @@ const std::string TMP("tmp"); + llvm::Constant* ONE = ConstantSInt::get(Type::IntTy, 1); + llvm::Constant* ZERO = ConstantSInt::get(Type::IntTy, 0); + llvm::Constant* MINUS_ONE = ConstantSInt::get(Type::IntTy, -1); + + llvm::Constant* INT_SHIFT_MASK = ConstantUInt::get(Type::UByteTy, 0x1f); + llvm::Constant* LONG_SHIFT_MASK = ConstantUInt::get(Type::UByteTy, 0x3f); + inline bool isTwoSlotValue(const Value* v) { return isTwoSlotType(v->getType()); } @@ -1778,17 +1785,21 @@ void do_lushr() { do_shift_unsigned_common(Type::LongTy); } void do_shift_unsigned_common(const Type* type) { + llvm::Constant* mask = + type == Type::IntTy ? INT_SHIFT_MASK : LONG_SHIFT_MASK; // Cast value to be shifted into its unsigned version. Value* a = pop(Type::UByteTy); + a = BinaryOperator::create(Instruction::And, a, mask, TMP, currentBB_); Value* v = pop(type->getUnsignedVersion()); Value* r = new ShiftInst(Instruction::Shr, v, a, TMP, currentBB_); - // Cast shifted value back to its original signed version. - r = new CastInst(r, type->getSignedVersion(), TMP, currentBB_); push(r); } void do_shift_common(Instruction::OtherOps op, const Type* type) { + llvm::Constant* mask = + type == Type::IntTy ? INT_SHIFT_MASK : LONG_SHIFT_MASK; Value* a = pop(Type::UByteTy); + a = BinaryOperator::create(Instruction::And, a, mask, TMP, currentBB_); Value* v = pop(type); Value* r = new ShiftInst(op, v, a, TMP, currentBB_); push(r); @@ -1840,36 +1851,29 @@ Value* v2 = pop(Type::LongTy); Value* v1 = pop(Type::LongTy); Value* c = BinaryOperator::createSetGT(v1, v2, TMP, currentBB_); - Value* r = new SelectInst(c, ConstantSInt::get(Type::IntTy, 1), - ConstantSInt::get(Type::IntTy, 0), TMP, - currentBB_); + Value* r = new SelectInst(c, ONE, ZERO, TMP, currentBB_); c = BinaryOperator::createSetLT(v1, v2, TMP, currentBB_); - r = new SelectInst(c, ConstantSInt::get(Type::IntTy, -1), r, TMP, - currentBB_); + r = new SelectInst(c, MINUS_ONE, r, TMP, currentBB_); push(r); } - void do_fcmpl() { do_cmp_common(Type::FloatTy, -1); } - void do_dcmpl() { do_cmp_common(Type::DoubleTy, -1); } - void do_fcmpg() { do_cmp_common(Type::FloatTy, 1); } - void do_dcmpg() { do_cmp_common(Type::DoubleTy, 1); } + void do_fcmpl() { do_cmp_common(Type::FloatTy, false); } + void do_dcmpl() { do_cmp_common(Type::DoubleTy, false); } + void do_fcmpg() { do_cmp_common(Type::FloatTy, true); } + void do_dcmpg() { do_cmp_common(Type::DoubleTy, true); } - void do_cmp_common(const Type* type, int valueIfUnordered) { + void do_cmp_common(const Type* type, bool pushOne) { Value* v2 = pop(type); Value* v1 = pop(type); Value* c = BinaryOperator::createSetGT(v1, v2, TMP, currentBB_); - Value* r = new SelectInst(c, ConstantSInt::get(Type::IntTy, 1), - ConstantSInt::get(Type::IntTy, 0), TMP, - currentBB_); + Value* r = new SelectInst(c, ONE, ZERO, TMP, currentBB_); c = BinaryOperator::createSetLT(v1, v2, TMP, currentBB_); - r = new SelectInst(c, ConstantSInt::get(Type::IntTy, -1), r, TMP, - currentBB_); + r = new SelectInst(c, MINUS_ONE, r, TMP, currentBB_); c = new CallInst(module_.getOrInsertFunction ("llvm.isunordered", Type::BoolTy, v1->getType(), v2->getType(), 0), v1, v2, TMP, currentBB_); - r = new SelectInst(c, ConstantSInt::get(Type::IntTy, valueIfUnordered), - r, TMP, currentBB_); + r = new SelectInst(c, pushOne ? ONE : MINUS_ONE, r, TMP, currentBB_); push(r); } From jeffc at jolt-lang.org Fri Feb 18 01:05:28 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Fri, 18 Feb 2005 01:05:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Process.inc Message-ID: <200502180705.BAA32666@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Process.inc updated: 1.8 -> 1.9 --- Log message: Make PreventCoreFiles() do the right thing on Windows. --- Diffs of the changes: (+6 -3) Process.inc | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/System/Win32/Process.inc diff -u llvm/lib/System/Win32/Process.inc:1.8 llvm/lib/System/Win32/Process.inc:1.9 --- llvm/lib/System/Win32/Process.inc:1.8 Sat Jan 8 14:15:57 2005 +++ llvm/lib/System/Win32/Process.inc Fri Feb 18 01:05:18 2005 @@ -95,9 +95,12 @@ // their operation. To prevent the disk from filling up, this configuration item // does what's necessary to prevent their generation. void Process::PreventCoreFiles() { - // Windows doesn't do core files, so nothing to do. - // Although... it might be nice to prevent the do-you-want-to-debug - // dialog box from coming up. Or maybe not... + // Windows doesn't do core files, but it does do modal pop-up message + // boxes. As this method is used by bugpoint, preventing these pop-ups + // is the moral equivalent of suppressing core files. + SetErrorMode(SEM_FAILCRITICALERRORS | + SEM_NOGPFAULTERRORBOX | + SEM_NOOPENFILEERRORBOX); } bool Process::StandardInIsUserInput() { From lattner at cs.uiuc.edu Fri Feb 18 09:54:48 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 18 Feb 2005 09:54:48 -0600 Subject: [llvm-commits] CVS: llvm-www/header.incl Message-ID: <200502181554.j1IFsmP4017268@apoc.cs.uiuc.edu> Changes in directory llvm-www: header.incl updated: 1.34 -> 1.35 --- Log message: Welcome to 2005! Thanks to Valery Khamenya for pointing this out :) --- Diffs of the changes: (+1 -1) header.incl | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-www/header.incl diff -u llvm-www/header.incl:1.34 llvm-www/header.incl:1.35 --- llvm-www/header.incl:1.34 Mon Feb 14 13:00:15 2005 +++ llvm-www/header.incl Fri Feb 18 09:54:32 2005 @@ -53,7 +53,7 @@ Status Updates
    - February 14, 2004
    + February 14, 2005
    December 9, 2004
    October 11, 2004
    August 13, 2004
    From brukman at cs.uiuc.edu Fri Feb 18 12:01:04 2005 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri, 18 Feb 2005 12:01:04 -0600 Subject: [llvm-commits] CVS: llvm/docs/CommandGuide/llvmc.pod Message-ID: <200502181801.MAA02493@zion.cs.uiuc.edu> Changes in directory llvm/docs/CommandGuide: llvmc.pod updated: 1.6 -> 1.7 --- Log message: * llvmc does not have a -V switch * --config-file is really --config-dir, according to `llvmc --help' --- Diffs of the changes: (+3 -5) llvmc.pod | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) Index: llvm/docs/CommandGuide/llvmc.pod diff -u llvm/docs/CommandGuide/llvmc.pod:1.6 llvm/docs/CommandGuide/llvmc.pod:1.7 --- llvm/docs/CommandGuide/llvmc.pod:1.6 Mon Nov 15 14:25:08 2004 +++ llvm/docs/CommandGuide/llvmc.pod Fri Feb 18 12:00:53 2005 @@ -311,10 +311,9 @@ Print a summary of command line options. -=item B<-V> or B<--version> +=item B<--version> -This option will cause B to print out its version number -and terminate. +This option will cause B to print out its version number and terminate. =back @@ -345,7 +344,7 @@ a configuration item on the command line without resorting to changing the configuration files. -=item B<--config-file> F +=item B<--config-dir> F This option tells B to read configuration data from the I named F. Data from such directories will be read in the order @@ -361,7 +360,6 @@ B<--config-only-from> options may be given in which case the directories are read in the order given on the command line. - =item B<--emit-raw-code> No optimization is done whatsoever. The compilers invoked by B with From reid at x10sys.com Fri Feb 18 14:00:16 2005 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Feb 2005 14:00:16 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/llvmc.cpp Message-ID: <200502182000.OAA04122@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: llvmc.cpp updated: 1.22 -> 1.23 --- Log message: Adjust the help output so that it will fit cleanly within 80 columns. --- Diffs of the changes: (+17 -17) llvmc.cpp | 34 +++++++++++++++++----------------- 1 files changed, 17 insertions(+), 17 deletions(-) Index: llvm/tools/llvmc/llvmc.cpp diff -u llvm/tools/llvmc/llvmc.cpp:1.22 llvm/tools/llvmc/llvmc.cpp:1.23 --- llvm/tools/llvmc/llvmc.cpp:1.22 Wed Dec 29 23:36:08 2004 +++ llvm/tools/llvmc/llvmc.cpp Fri Feb 18 14:00:05 2005 @@ -101,50 +101,50 @@ cl::list fOpts("f", cl::ZeroOrMore, cl::Prefix, cl::desc("Pass through -f options to compiler tools"), - cl::value_desc("optimization option")); + cl::value_desc("option")); cl::list MOpts("M", cl::ZeroOrMore, cl::Prefix, cl::desc("Pass through -M options to compiler tools"), - cl::value_desc("dependency option")); + cl::value_desc("option")); cl::list WOpts("W", cl::ZeroOrMore, cl::Prefix, cl::desc("Pass through -W options to compiler tools"), - cl::value_desc("warnings category")); + cl::value_desc("option")); cl::list BOpt("B", cl::ZeroOrMore, cl::Prefix, - cl::desc("Indicate where llvmc sub-tools are installed"), - cl::value_desc("directory path containing bin and lib directories")); + cl::desc("Specify path to find llvmc sub-tools"), + cl::value_desc("dir")); //===------------------------------------------------------------------------=== //=== INPUT OPTIONS //===------------------------------------------------------------------------=== cl::list LibPaths("L", cl::Prefix, - cl::desc("Specify a library search path"), cl::value_desc("directory")); + cl::desc("Specify a library search path"), cl::value_desc("dir")); cl::list Libraries("l", cl::Prefix, - cl::desc("Specify libraries to link to"), cl::value_desc("library prefix")); + cl::desc("Specify base name of libraries to link to"), cl::value_desc("lib")); cl::list Includes("I", cl::Prefix, cl::desc("Specify location to search for included source"), - cl::value_desc("include directory")); + cl::value_desc("dir")); cl::list Defines("D", cl::Prefix, - cl::desc("Specify a symbol to define for source configuration"), - cl::value_desc("symbol definition")); + cl::desc("Specify a pre-processor symbol to define"), + cl::value_desc("symbol")); //===------------------------------------------------------------------------=== //=== OUTPUT OPTIONS //===------------------------------------------------------------------------=== cl::opt OutputFilename("o", - cl::desc("Override output filename"), cl::value_desc("filename")); + cl::desc("Override output filename"), cl::value_desc("file")); cl::opt OutputMachine("m", cl::Prefix, cl::desc("Specify a target machine"), cl::value_desc("machine")); cl::opt Native("native", cl::init(false), - cl::desc("Generative native object and executables instead of bytecode")); + cl::desc("Generative native code instead of bytecode")); cl::opt DebugOutput("g", cl::init(false), cl::desc("Generate objects that include debug symbols")); @@ -152,8 +152,8 @@ cl::opt StripOutput("strip", cl::init(false), cl::desc("Strip all symbols from linked output file")); -cl::opt PrintFileName("print-file-name", cl::Optional, - cl::value_desc("filename"), +cl::opt PrintFileName("print-fname", cl::Optional, + cl::value_desc("file"), cl::desc("Print the full path for the option's value")); //===------------------------------------------------------------------------=== @@ -189,8 +189,8 @@ //===------------------------------------------------------------------------=== static cl::opt ConfigDir("config-dir", cl::Optional, - cl::desc("Specify a configuration directory to override defaults"), - cl::value_desc("directory")); + cl::desc("Specify configuration directory to override defaults"), + cl::value_desc("dir")); static cl::opt EmitRawCode("emit-raw-code", cl::Hidden, cl::Optional, cl::desc("Emit raw, unoptimized code")); @@ -199,7 +199,7 @@ cl::desc("Invoke sub-commands by linking input/output with pipes")); static cl::opt KeepTemps("keep-temps", cl::Optional, - cl::desc("Don't delete the temporary files created during compilation")); + cl::desc("Don't delete temporary files created by llvmc")); //===------------------------------------------------------------------------=== //=== POSITIONAL OPTIONS From lattner at cs.uiuc.edu Fri Feb 18 14:17:55 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 18 Feb 2005 14:17:55 -0600 Subject: [llvm-commits] CVS: llvm/test/Makefile Message-ID: <200502182017.OAA04334@zion.cs.uiuc.edu> Changes in directory llvm/test: Makefile updated: 1.80 -> 1.81 --- Log message: Allow dejagnu tests to run on Windows/Cygwin. Quote the value of the PATH variable so that spaces don't screw it up. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Makefile diff -u llvm/test/Makefile:1.80 llvm/test/Makefile:1.81 --- llvm/test/Makefile:1.80 Sun Jan 2 22:05:32 2005 +++ llvm/test/Makefile Fri Feb 18 14:17:44 2005 @@ -28,7 +28,7 @@ endif check-local:: site.exp - PATH=$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH) \ + PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \ $(RUNTEST) $(RUNTESTFLAGS) clean:: From reid at x10sys.com Fri Feb 18 14:24:20 2005 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Feb 2005 14:24:20 -0600 Subject: [llvm-commits] CVS: llvm/test/Makefile.tests Message-ID: <200502182024.OAA04411@zion.cs.uiuc.edu> Changes in directory llvm/test: Makefile.tests updated: 1.91 -> 1.92 --- Log message: Quote the value of the PATH variable so that Cygwin and Windows can have spaces in path names and not confuse the shell. --- Diffs of the changes: (+1 -1) Makefile.tests | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Makefile.tests diff -u llvm/test/Makefile.tests:1.91 llvm/test/Makefile.tests:1.92 --- llvm/test/Makefile.tests:1.91 Thu Dec 23 21:44:24 2004 +++ llvm/test/Makefile.tests Fri Feb 18 14:24:09 2005 @@ -39,7 +39,7 @@ LLCFLAGS = FAILURE = $(LLVM_SRC_ROOT)/test/Failure.sh TESTRUNR = @echo Running test: $<; \ - PATH=$(LLVMTOOLCURRENT):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH) \ + PATH="$(LLVMTOOLCURRENT):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \ $(LLVM_SRC_ROOT)/test/TestRunner.sh LLCLIBS := $(LLCLIBS) -lm From lattner at cs.uiuc.edu Fri Feb 18 17:07:14 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 18 Feb 2005 17:07:14 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/cp/search.c Message-ID: <200502182307.j1IN7Es6020340@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc/cp: search.c updated: 1.2 -> 1.3 --- Log message: Patch to fix PR516: http://llvm.cs.uiuc.edu/PR516 , thanks to Adam Treat for figuring this one out!! --- Diffs of the changes: (+3 -2) search.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm-gcc/gcc/cp/search.c diff -u llvm-gcc/gcc/cp/search.c:1.2 llvm-gcc/gcc/cp/search.c:1.3 --- llvm-gcc/gcc/cp/search.c:1.2 Fri Jan 9 10:54:32 2004 +++ llvm-gcc/gcc/cp/search.c Fri Feb 18 17:06:58 2005 @@ -855,8 +855,9 @@ return 0; for (t = befriending_classes; t; t = TREE_CHAIN (t)) - if (protected_accessible_p (decl, TREE_VALUE (t), binfo)) - return 1; + if ( TREE_CODE (t) != FUNCTION_DECL ) + if (protected_accessible_p (decl, TREE_VALUE (t), binfo)) + return 1; /* Nested classes are implicitly friends of their enclosing types, as per core issue 45 (this is a change from the standard). */ From lattner at cs.uiuc.edu Fri Feb 18 20:22:30 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 18 Feb 2005 20:22:30 -0600 Subject: [llvm-commits] CVS: llvm/docs/LangRef.html Message-ID: <200502190222.j1J2MUuO020996@apoc.cs.uiuc.edu> Changes in directory llvm/docs: LangRef.html updated: 1.84 -> 1.85 --- Log message: Fix a bug. --- Diffs of the changes: (+2 -2) LangRef.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.84 llvm/docs/LangRef.html:1.85 --- llvm/docs/LangRef.html:1.84 Sat Feb 12 13:30:21 2005 +++ llvm/docs/LangRef.html Fri Feb 18 20:22:14 2005 @@ -738,7 +738,7 @@ A pointer to array of four int values
    A pointer to a function that takes an int, returning an + href="#t_function">function that takes an int*, returning an int.
    @@ -2924,7 +2924,7 @@ Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2005/02/12 19:30:21 $ + Last modified: $Date: 2005/02/19 02:22:14 $ From jeffc at jolt-lang.org Fri Feb 18 21:01:25 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Fri, 18 Feb 2005 21:01:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/DynamicLibrary.inc Process.inc Signals.inc TimeValue.inc Message-ID: <200502190301.VAA13493@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: DynamicLibrary.inc updated: 1.9 -> 1.10 Process.inc updated: 1.9 -> 1.10 Signals.inc updated: 1.12 -> 1.13 TimeValue.inc updated: 1.7 -> 1.8 --- Log message: Change __MINGW to __MINGW32__. Patch submitted by Henrik Bach. --- Diffs of the changes: (+4 -4) DynamicLibrary.inc | 2 +- Process.inc | 2 +- Signals.inc | 2 +- TimeValue.inc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/System/Win32/DynamicLibrary.inc diff -u llvm/lib/System/Win32/DynamicLibrary.inc:1.9 llvm/lib/System/Win32/DynamicLibrary.inc:1.10 --- llvm/lib/System/Win32/DynamicLibrary.inc:1.9 Wed Dec 29 21:02:31 2004 +++ llvm/lib/System/Win32/DynamicLibrary.inc Fri Feb 18 21:01:13 2005 @@ -13,7 +13,7 @@ #include "Win32.h" -#ifdef __MINGW +#ifdef __MINGW32__ #include #else #include Index: llvm/lib/System/Win32/Process.inc diff -u llvm/lib/System/Win32/Process.inc:1.9 llvm/lib/System/Win32/Process.inc:1.10 --- llvm/lib/System/Win32/Process.inc:1.9 Fri Feb 18 01:05:18 2005 +++ llvm/lib/System/Win32/Process.inc Fri Feb 18 21:01:13 2005 @@ -23,7 +23,7 @@ //=== and must not be UNIX code //===----------------------------------------------------------------------===// -#ifdef __MINGW +#ifdef __MINGW32__ // This ban should be lifted when MinGW 1.0+ has defined this value. # define _HEAPOK (-2) #endif Index: llvm/lib/System/Win32/Signals.inc diff -u llvm/lib/System/Win32/Signals.inc:1.12 llvm/lib/System/Win32/Signals.inc:1.13 --- llvm/lib/System/Win32/Signals.inc:1.12 Tue Nov 16 00:59:53 2004 +++ llvm/lib/System/Win32/Signals.inc Fri Feb 18 21:01:13 2005 @@ -15,7 +15,7 @@ #include #include -#ifdef __MINGW +#ifdef __MINGW32__ #include #else #include Index: llvm/lib/System/Win32/TimeValue.inc diff -u llvm/lib/System/Win32/TimeValue.inc:1.7 llvm/lib/System/Win32/TimeValue.inc:1.8 --- llvm/lib/System/Win32/TimeValue.inc:1.7 Wed Dec 15 22:06:56 2004 +++ llvm/lib/System/Win32/TimeValue.inc Fri Feb 18 21:01:13 2005 @@ -31,7 +31,7 @@ } std::string TimeValue::toString() const { -#ifdef __MINGW +#ifdef __MINGW32__ // This ban may be lifted by either: // (i) a future MinGW version other than 1.0 inherents the __time64_t type, or // (ii) configure tests for either the time_t or __time64_t type. From jeffc at jolt-lang.org Fri Feb 18 21:01:25 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Fri, 18 Feb 2005 21:01:25 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/alloca.h Message-ID: <200502190301.VAA13483@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: alloca.h updated: 1.8 -> 1.9 --- Log message: Change __MINGW to __MINGW32__. Patch submitted by Henrik Bach. --- Diffs of the changes: (+1 -1) alloca.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Config/alloca.h diff -u llvm/include/llvm/Config/alloca.h:1.8 llvm/include/llvm/Config/alloca.h:1.9 --- llvm/include/llvm/Config/alloca.h:1.8 Tue Nov 2 11:31:02 2004 +++ llvm/include/llvm/Config/alloca.h Fri Feb 18 21:01:13 2005 @@ -28,7 +28,7 @@ #define alloca _alloca #elif defined(HAVE_ALLOCA_H) #include -#elif defined(__MINGW) && defined(HAVE_MALLOC_H) +#elif defined(__MINGW32__) && defined(HAVE_MALLOC_H) #include #elif !defined(__GNUC__) # ifdef _AIX From lattner at cs.uiuc.edu Sat Feb 19 00:54:59 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 19 Feb 2005 00:54:59 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2005-02-19-BitfieldStructCrash.cpp Message-ID: <200502190654.j1J6sx2F024386@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2005-02-19-BitfieldStructCrash.cpp added (r1.1) --- Log message: new testcase. --- Diffs of the changes: (+11 -0) 2005-02-19-BitfieldStructCrash.cpp | 11 +++++++++++ 1 files changed, 11 insertions(+) Index: llvm/test/Regression/C++Frontend/2005-02-19-BitfieldStructCrash.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2005-02-19-BitfieldStructCrash.cpp:1.1 *** /dev/null Sat Feb 19 00:54:54 2005 --- llvm/test/Regression/C++Frontend/2005-02-19-BitfieldStructCrash.cpp Sat Feb 19 00:54:44 2005 *************** *** 0 **** --- 1,11 ---- + // RUN: %llvmgxx -S %s -o - + + struct QChar {unsigned short X; QChar(unsigned short); } ; + + struct Command { + Command(QChar c) : c(c) {} + unsigned int type : 4; + QChar c; + }; + + Command X(QChar('c')); From lattner at cs.uiuc.edu Sat Feb 19 00:56:59 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 19 Feb 2005 00:56:59 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2005-02-19-BitfieldStructCrash.cpp Message-ID: <200502190656.j1J6ux8E024431@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2005-02-19-BitfieldStructCrash.cpp updated: 1.1 -> 1.2 --- Log message: Make this testcase harder, to test the read case as well. --- Diffs of the changes: (+3 -0) 2005-02-19-BitfieldStructCrash.cpp | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/test/Regression/C++Frontend/2005-02-19-BitfieldStructCrash.cpp diff -u llvm/test/Regression/C++Frontend/2005-02-19-BitfieldStructCrash.cpp:1.1 llvm/test/Regression/C++Frontend/2005-02-19-BitfieldStructCrash.cpp:1.2 --- llvm/test/Regression/C++Frontend/2005-02-19-BitfieldStructCrash.cpp:1.1 Sat Feb 19 00:54:44 2005 +++ llvm/test/Regression/C++Frontend/2005-02-19-BitfieldStructCrash.cpp Sat Feb 19 00:56:46 2005 @@ -9,3 +9,6 @@ }; Command X(QChar('c')); + +void Foo(QChar ); +void bar() { Foo(X.c); } From lattner at cs.uiuc.edu Sat Feb 19 01:27:00 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 19 Feb 2005 01:27:00 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200502190727.j1J7R0lD025649@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.82 -> 1.83 --- Log message: Fix PR517: http://llvm.cs.uiuc.edu/PR517 and Regression/C++Frontend/2005-02-19-BitfieldStructCrash.cpp Apparently the GCC IR allows 'X = Y' where X can be an aggregate, and Y is a bitfield reference. It also allows X to be a bitfield and Y to be an aggregate. No, there is no such thing in C as a aggregate bitfield. --- Diffs of the changes: (+81 -18) llvm-expand.c | 99 +++++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 81 insertions(+), 18 deletions(-) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.82 llvm-gcc/gcc/llvm-expand.c:1.83 --- llvm-gcc/gcc/llvm-expand.c:1.82 Tue Feb 15 00:59:52 2005 +++ llvm-gcc/gcc/llvm-expand.c Sat Feb 19 01:26:44 2005 @@ -2906,29 +2906,62 @@ static void llvm_store_expr(llvm_function *Fn, tree From, llvm_value *Dest, llvm_value **CompVal, unsigned BitStart, unsigned BitSize, int isVolatile) { + llvm_type *SrcType = llvm_type_get_from_tree(TREE_TYPE(From)); llvm_type *ResultType = GET_POINTER_TYPE_ELEMENT(Dest->Ty); - if (!llvm_type_is_composite(ResultType)) { - llvm_value *Val = llvm_expand_expr(Fn, From, 0); - - /* If expand was not able to provide the correct type, cast now */ - Val = cast_if_type_not_equal(Fn, Val, ResultType); - if (CompVal) *CompVal = Val; - - /* Copy the value computed into the destination. If this is not a bitfield, - * this is just a store, otherwise we need to emit a load, some masking, - * then a store. + llvm_value *Val = 0; + + if (llvm_type_is_composite(SrcType)) { + llvm_value *TmpLoc; + + /* If this isn't a bitfield reference, expand the value directly into the + * destination. */ - Val = WriteBitField(Fn, Val, Dest, BitStart, BitSize, isVolatile); + if (BitSize == 0) { + /* Expand the RHS into the appropriate location directly. */ + llvm_value *Val = llvm_expand_expr(Fn, From, Dest); + if (CompVal) *CompVal = 0; + assert(Val == 0 && "Structure value returned a value??"); + return; + } + + /* Otherwise, expand into a temporary location. This must be an aggregate + * with one element. + */ + TmpLoc = D2V(make_temporary_alloca(Fn, SrcType)); + Val = llvm_expand_expr(Fn, From, TmpLoc); + assert(Val == 0 && "Structure value returned a value??"); - append_inst(Fn, create_store_inst(Val, Dest, isVolatile)); + /* This may be something like {{{{int}}}}, unwrap it. */ + while (llvm_type_is_composite(SrcType)) { + assert(SrcType->ID == StructTyID && SrcType->NumElements == 1 && + "Not a single element!?"); + TmpLoc = append_inst(Fn, create_gep3(TmpLoc, llvm_constant_uint_0, + llvm_constant_uint_0)); + SrcType = SrcType->Elements[0]; + } + Val = append_inst(Fn, create_load_inst("aggel", TmpLoc, 0)); + /* If the element is not exactly the right type, convert it now. */ + Val = cast_if_type_not_equal(Fn, Val, ResultType); } else { - /* Expand the RHS into the appropriate location directly. */ - llvm_value *Val = llvm_expand_expr(Fn, From, Dest); - if (CompVal) *CompVal = 0; - assert(Val == 0 && "Structure value returned a value??"); - assert(!BitSize && "Store of aggregate into a bitfield??"); + /* Simple scalar value, common case. */ + Val = llvm_expand_expr(Fn, From, 0); + + /* If expand was not able to provide the correct type, cast now */ + Val = cast_if_type_not_equal(Fn, Val, ResultType); + if (CompVal) *CompVal = Val; } + + assert(!llvm_type_is_composite(ResultType) && + "Storing a scalar or bitfield value into a composite value?"); + + /* Copy the value computed into the destination. If this is not a bitfield, + * this is just a store, otherwise we need to emit a load, some masking, + * then a store. + */ + Val = WriteBitField(Fn, Val, Dest, BitStart, BitSize, isVolatile); + + append_inst(Fn, create_store_inst(Val, Dest, isVolatile)); } @@ -5933,7 +5966,8 @@ unsigned BitStart = 0, BitSize = 0; op0 = llvm_expand_lvalue_expr(Fn, exp, &BitStart, &BitSize); - if (!isDestTyComposite) { /* Return a normal scalar by loading it */ + /* Return a normal scalar by loading it. */ + if (!llvm_type_is_composite(GET_POINTER_TYPE_ELEMENT(op0->Ty))) { unsigned ResultBitSize; Result = append_inst(Fn, create_load_inst("tmp", op0, expVolatile)); @@ -5953,6 +5987,35 @@ */ Result = ReadBitField(Fn, Result, BitStart, BitSize); + /* WIERDNESS: G++ allows loading from a bitfield and storing into an + * aggregate. For example, the aggregate may have type "{ushort}", and + * the lvalue might be of type "int*" with some bit offset/size. The + * bitfieldness has already been taken care of, we just check to see if + * we need to store to the aggregate location now. + */ + if (isDestTyComposite) { + /* The destination can only be a single element structure. We handle + * {{{uint}}} for generality. + */ + while (llvm_type_is_composite(GET_POINTER_TYPE_ELEMENT(DestLoc->Ty))){ + llvm_type *ElTy = GET_POINTER_TYPE_ELEMENT(DestLoc->Ty); + assert(ElTy->ID == StructTyID && ElTy->NumElements == 1 && + "Bitfield store to non-single-element aggregate!"); + DestLoc = append_inst(Fn, create_gep3(DestLoc, + llvm_constant_intptr_0, + llvm_constant_uint_0)); + } + + /* If the source isn't the exact type needed for the store, make it so + * now. + */ + Result =cast_if_type_not_equal(Fn, Result, + GET_POINTER_TYPE_ELEMENT(DestLoc->Ty)); + /* Finally, do the store into the aggregate. */ + append_inst(Fn, create_store_inst(Result, DestLoc, 0)); + Result = 0; + } + } else if (DestLoc) { /* Generating structure, using value */ unsigned Align = TYPE_ALIGN(TREE_TYPE(exp))/8; assert(BitSize == 0 && "Invalid bitfield read of composite value!"); From lattner at cs.uiuc.edu Sat Feb 19 01:29:41 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 19 Feb 2005 01:29:41 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200502190729.j1J7TflK025683@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.298 -> 1.299 --- Log message: Bug fixed. --- Diffs of the changes: (+3 -1) ReleaseNotes.html | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.298 llvm/docs/ReleaseNotes.html:1.299 --- llvm/docs/ReleaseNotes.html:1.298 Tue Feb 15 01:02:12 2005 +++ llvm/docs/ReleaseNotes.html Sat Feb 19 01:29:25 2005 @@ -164,6 +164,8 @@ miscalculated for some structure fields following bit fields
  • [llvm-g++] Temporary lifetimes incorrect for short circuit logical operations
  • +
  • [llvm-gcc] Crash compiling + bitfield <-> aggregate assignment
  • @@ -585,7 +587,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2005/02/15 07:02:12 $ + Last modified: $Date: 2005/02/19 07:29:25 $ From lattner at cs.uiuc.edu Sat Feb 19 01:32:08 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 19 Feb 2005 01:32:08 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2005-01-03-StaticInitializers.cpp Message-ID: <200502190732.j1J7W8KS025739@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2005-01-03-StaticInitializers.cpp updated: 1.1 -> 1.2 --- Log message: Adjust this test to pass after recent CFE changes. We now generate: %XX = global int cast (int* getelementptr ([2 x int]* getelementptr (%struct.S* null, int 0, uint 0), int 0, int 1) to int) which is the literal translation of the testcase :) --- Diffs of the changes: (+1 -1) 2005-01-03-StaticInitializers.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/C++Frontend/2005-01-03-StaticInitializers.cpp diff -u llvm/test/Regression/C++Frontend/2005-01-03-StaticInitializers.cpp:1.1 llvm/test/Regression/C++Frontend/2005-01-03-StaticInitializers.cpp:1.2 --- llvm/test/Regression/C++Frontend/2005-01-03-StaticInitializers.cpp:1.1 Mon Jan 3 16:27:58 2005 +++ llvm/test/Regression/C++Frontend/2005-01-03-StaticInitializers.cpp Sat Feb 19 01:31:54 2005 @@ -1,4 +1,4 @@ -// RUN: %llvmgxx %s -S -o - | grep '%XX = global int 4' +// RUN: %llvmgxx %s -S -o - | not grep 'llvm.global_ctor' struct S { int A[2]; From lattner at cs.uiuc.edu Sat Feb 19 11:08:05 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 19 Feb 2005 11:08:05 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2005-02-19-UnnamedVirtualThunkArgument.cpp Message-ID: <200502191708.j1JH84Lt007055@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2005-02-19-UnnamedVirtualThunkArgument.cpp added (r1.1) --- Log message: Testcase for PR520: http://llvm.cs.uiuc.edu/PR520 --- Diffs of the changes: (+22 -0) 2005-02-19-UnnamedVirtualThunkArgument.cpp | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+) Index: llvm/test/Regression/C++Frontend/2005-02-19-UnnamedVirtualThunkArgument.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2005-02-19-UnnamedVirtualThunkArgument.cpp:1.1 *** /dev/null Sat Feb 19 11:07:59 2005 --- llvm/test/Regression/C++Frontend/2005-02-19-UnnamedVirtualThunkArgument.cpp Sat Feb 19 11:07:48 2005 *************** *** 0 **** --- 1,22 ---- + // RUN: %llvmgxx -S %s -o /dev/null + + struct Foo { + Foo(); + virtual ~Foo(); + }; + + struct Bar { + Bar(); + virtual ~Bar(); + virtual bool test(bool) const; + }; + + struct Baz : public Foo, public Bar { + Baz(); + virtual ~Baz(); + virtual bool test(bool) const; + }; + + bool Baz::test(bool) const { + return true; + } From lattner at cs.uiuc.edu Sat Feb 19 11:10:33 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 19 Feb 2005 11:10:33 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200502191710.j1JHAXmS007072@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.83 -> 1.84 --- Log message: Make sure to give all arguments DECL_LLVM values even if they are unnamed. Unnamed arguments cannot be referenced by the programmer, but they can be referenced by compiler generated methods, like virtual function thunks. Many MANY thanks to Adam Treat for coming up with 90% of this patch! This fixes PR520: http://llvm.cs.uiuc.edu/PR520 and test/Regression/CC++Frontend/2005-02-19-UnnamedVirtualThunkArgument.cpp --- Diffs of the changes: (+14 -8) llvm-expand.c | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.83 llvm-gcc/gcc/llvm-expand.c:1.84 --- llvm-gcc/gcc/llvm-expand.c:1.83 Sat Feb 19 01:26:44 2005 +++ llvm-gcc/gcc/llvm-expand.c Sat Feb 19 11:10:19 2005 @@ -5346,7 +5346,7 @@ case PARM_DECL: if (!DECL_LLVM_SET_P (exp)) { error ("%Hprior parameter's size depends on '%D'", - &DECL_SOURCE_LOCATION (exp), exp); + &DECL_SOURCE_LOCATION (exp), exp); return llvm_constant_VoidPtr_null; } /* ... fall through ... */ @@ -7009,17 +7009,21 @@ llvm_type *Ty = llvm_type_get_from_tree(TREE_TYPE(Args)); int isLValue = 0; + if (DECL_NAME(Args)) Name = IDENTIFIER_POINTER(DECL_NAME(Args)); + if (isPassedByInvisibleReference(TREE_TYPE(Args))) { Ty = llvm_type_get_pointer(Ty); isLValue = 1; - } - - if (DECL_NAME(Args)) Name = IDENTIFIER_POINTER(DECL_NAME(Args)); - if (Name[0] && !isLValue) { /* Only create values for named arguments */ + } else { /* Add a suffix for the stack slot */ char NameBuffer[100]; char *ArgName = strlen(Name) > 90 ?xmalloc(strlen(Name)+10) :NameBuffer; - strcpy(ArgName, Name); + if (Name[0] != 0) /* Not an empty name? */ + strcpy(ArgName, Name); + else { + Name = "unnamed_arg"; + strcpy(ArgName, "unnamed_arg"); + } strcat(ArgName, "_addr"); A = create_alloca_inst(ArgName, Ty, llvm_constant_uint_1); if (ArgName != NameBuffer) @@ -7027,9 +7031,11 @@ insert_alloca_into_entry_block(Fn, A); SET_DECL_LLVM(Args, D2V(A)); /* Remember lvalue address */ - } else { - Name = "unnamed_arg"; /* we want llvm_value's to have names! */ } + /* Add arguments to the function. If there is a struct passed by value, * + * this could cause multiple LLVM arguments to be added for this one C + * argument. + */ AddArguments(Fn, Ty, Name, D2V(A), &ArgNo); /* If the value is passed by "invisible reference", the l-value for the From lattner at cs.uiuc.edu Sat Feb 19 11:13:35 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 19 Feb 2005 11:13:35 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200502191713.j1JHDZ2F007104@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.299 -> 1.300 --- Log message: Bug fixed. --- Diffs of the changes: (+3 -1) ReleaseNotes.html | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.299 llvm/docs/ReleaseNotes.html:1.300 --- llvm/docs/ReleaseNotes.html:1.299 Sat Feb 19 01:29:25 2005 +++ llvm/docs/ReleaseNotes.html Sat Feb 19 11:13:20 2005 @@ -166,6 +166,8 @@ incorrect for short circuit logical operations
  • [llvm-gcc] Crash compiling bitfield <-> aggregate assignment
  • +
  • [llvm-g++] Error compiling + virtrual function thunk with an unnamed argument
  • @@ -587,7 +589,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2005/02/19 07:29:25 $ + Last modified: $Date: 2005/02/19 17:13:20 $ From lattner at cs.uiuc.edu Sat Feb 19 11:14:37 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 19 Feb 2005 11:14:37 -0600 Subject: [llvm-commits] CVS: llvm/CREDITS.TXT Message-ID: <200502191714.j1JHEbMS007117@apoc.cs.uiuc.edu> Changes in directory llvm: CREDITS.TXT updated: 1.36 -> 1.37 --- Log message: New entry. --- Diffs of the changes: (+4 -0) CREDITS.TXT | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/CREDITS.TXT diff -u llvm/CREDITS.TXT:1.36 llvm/CREDITS.TXT:1.37 --- llvm/CREDITS.TXT:1.36 Mon Feb 14 03:07:23 2005 +++ llvm/CREDITS.TXT Sat Feb 19 11:14:24 2005 @@ -110,6 +110,10 @@ W: http://llvm.x10sys.com/rspencer D: Stacker, llvmc, bytecode, other. See web page for current notes. +N: Adam Treat +E: manyoso at yahoo.com +D: C++ bugs filed, and C++ front-end bug fixes. + N: Bill Wendling E: wendling at isanbard.org D: The `Lower Setjmp/Longjmp' pass, improvements to the -lowerswitch pass. From lattner at cs.uiuc.edu Sat Feb 19 11:17:48 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 19 Feb 2005 11:17:48 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200502191717.j1JHHmGB007150@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.300 -> 1.301 --- Log message: typeo --- Diffs of the changes: (+2 -2) ReleaseNotes.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.300 llvm/docs/ReleaseNotes.html:1.301 --- llvm/docs/ReleaseNotes.html:1.300 Sat Feb 19 11:13:20 2005 +++ llvm/docs/ReleaseNotes.html Sat Feb 19 11:17:32 2005 @@ -167,7 +167,7 @@
  • [llvm-gcc] Crash compiling bitfield <-> aggregate assignment
  • [llvm-g++] Error compiling - virtrual function thunk with an unnamed argument
  • + virtual function thunk with an unnamed argument @@ -589,7 +589,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2005/02/19 17:13:20 $ + Last modified: $Date: 2005/02/19 17:17:32 $ From lattner at cs.uiuc.edu Sat Feb 19 11:52:52 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 19 Feb 2005 11:52:52 -0600 Subject: [llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp Message-ID: <200502191752.j1JHqqNX009732@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Linker: LinkModules.cpp updated: 1.102 -> 1.103 --- Log message: Eliminate silly warnings from the linker of the form: WARNING: Type conflict between types named 'union.._604.'. Src=' %union.._604.'. Dest=' %union.._604.' --- Diffs of the changes: (+0 -12) LinkModules.cpp | 12 ------------ 1 files changed, 12 deletions(-) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.102 llvm/lib/Linker/LinkModules.cpp:1.103 --- llvm/lib/Linker/LinkModules.cpp:1.102 Sat Feb 12 13:20:28 2005 +++ llvm/lib/Linker/LinkModules.cpp Sat Feb 19 11:52:37 2005 @@ -237,19 +237,7 @@ } // If we STILL cannot resolve the types, then there is something wrong. - // Report the warning and delete one of the names. if (DelayedTypesToResolve.size() == OldSize) { - const std::string &Name = DelayedTypesToResolve.back(); - - const Type *T1 = SrcST->lookupType(Name); - const Type *T2 = DestST->lookupType(Name); - std::cerr << "WARNING: Type conflict between types named '" << Name - << "'.\n Src='"; - WriteTypeSymbolic(std::cerr, T1, Src); - std::cerr << "'.\n Dest='"; - WriteTypeSymbolic(std::cerr, T2, Dest); - std::cerr << "'\n"; - // Remove the symbol name from the destination. DelayedTypesToResolve.pop_back(); } From lattner at cs.uiuc.edu Sat Feb 19 12:30:45 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 19 Feb 2005 12:30:45 -0600 Subject: [llvm-commits] CVS: llvm/lib/Linker/LinkLibraries.cpp Linker.cpp Message-ID: <200502191830.j1JIUjJi011564@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Linker: LinkLibraries.cpp updated: 1.2 -> 1.3 Linker.cpp updated: 1.3 -> 1.4 --- Log message: Add support for ".so" files compiled with LLVM which contain LLVM bytecode. --- Diffs of the changes: (+11 -3) LinkLibraries.cpp | 10 ++++++++-- Linker.cpp | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) Index: llvm/lib/Linker/LinkLibraries.cpp diff -u llvm/lib/Linker/LinkLibraries.cpp:1.2 llvm/lib/Linker/LinkLibraries.cpp:1.3 --- llvm/lib/Linker/LinkLibraries.cpp:1.2 Sun Dec 12 21:23:13 2004 +++ llvm/lib/Linker/LinkLibraries.cpp Sat Feb 19 12:30:29 2005 @@ -27,9 +27,15 @@ // If its an archive, try to link it in if (Pathname.isArchive()) { - if (LinkInArchive(Pathname)) { + if (LinkInArchive(Pathname)) return error("Cannot link archive '" + Pathname.toString() + "'"); - } + } else if (Pathname.isBytecodeFile()) { + // LLVM ".so" file. + if (LinkInFile(Pathname)) + return error("Cannot link file '" + Pathname.toString() + "'"); + + } else if (Pathname.isDynamicLibrary()) { + return warning("Library '" + Lib + "' is a native dynamic library."); } else { return warning("Supposed library '" + Lib + "' isn't a library."); } Index: llvm/lib/Linker/Linker.cpp diff -u llvm/lib/Linker/Linker.cpp:1.3 llvm/lib/Linker/Linker.cpp:1.4 --- llvm/lib/Linker/Linker.cpp:1.3 Thu Dec 16 13:19:24 2004 +++ llvm/lib/Linker/Linker.cpp Sat Feb 19 12:30:29 2005 @@ -133,7 +133,9 @@ FullPath.elideSuffix(); FullPath.appendSuffix(&(LTDL_SHLIB_EXT[1])); - if (FullPath.isDynamicLibrary()) + if (FullPath.isDynamicLibrary()) // Native shared library? + return FullPath; + if (FullPath.isBytecodeFile()) // .so file containing bytecode? return FullPath; FullPath.clear(); From alkis at cs.uiuc.edu Sat Feb 19 12:55:45 2005 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Sat, 19 Feb 2005 12:55:45 -0600 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200502191855.MAA16467@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.223 -> 1.224 --- Log message: Simplify *aload and iushr bytecode generation. --- Diffs of the changes: (+17 -24) Compiler.cpp | 41 +++++++++++++++++------------------------ 1 files changed, 17 insertions(+), 24 deletions(-) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.223 llvm-java/lib/Compiler/Compiler.cpp:1.224 --- llvm-java/lib/Compiler/Compiler.cpp:1.223 Thu Feb 17 22:36:21 2005 +++ llvm-java/lib/Compiler/Compiler.cpp Sat Feb 19 12:55:34 2005 @@ -1360,6 +1360,7 @@ classMethodDesc.find("java/lang/Math") != 0 && classMethodDesc.find("java/lang/Number") != 0 && classMethodDesc.find("java/lang/Byte") != 0 && + classMethodDesc.find("java/lang/Float") != 0 && classMethodDesc.find("java/lang/Integer") != 0 && classMethodDesc.find("java/lang/Long") != 0 && classMethodDesc.find("java/lang/Short") != 0 && @@ -1643,18 +1644,20 @@ push(val); } - void do_iaload() { do_aload_common(getPrimitiveArrayInfo(INT).getType()); } - void do_laload() { do_aload_common(getPrimitiveArrayInfo(LONG).getType()); } - void do_faload() { do_aload_common(getPrimitiveArrayInfo(FLOAT).getType()); } - void do_daload() { do_aload_common(getPrimitiveArrayInfo(DOUBLE).getType()); } - void do_aaload() { do_aload_common(getObjectArrayInfo().getType()); } - void do_baload() { do_aload_common(getPrimitiveArrayInfo(BYTE).getType()); } - void do_caload() { do_aload_common(getPrimitiveArrayInfo(CHAR).getType()); } - void do_saload() { do_aload_common(getPrimitiveArrayInfo(SHORT).getType()); } + void do_iaload() { do_aload_common(Type::IntTy); } + void do_laload() { do_aload_common(Type::LongTy); } + void do_faload() { do_aload_common(Type::FloatTy); } + void do_daload() { do_aload_common(Type::DoubleTy); } + void do_aaload() { do_aload_common(ObjectBaseRefTy); } + void do_baload() { do_aload_common(Type::SByteTy); } + void do_caload() { do_aload_common(Type::UShortTy); } + void do_saload() { do_aload_common(Type::ShortTy); } - void do_aload_common(const Type* arrayTy) { + void do_aload_common(const Type* elementTy) { Value* index = pop(Type::IntTy); - Value* arrayRef = pop(PointerType::get(arrayTy)); + const Type* arrayTy = getArrayInfo(elementTy).getType(); + const Type* arrayRefTy = PointerType::get(arrayTy); + Value* arrayRef = pop(arrayRefTy); std::vector indices; indices.reserve(3); @@ -1690,7 +1693,8 @@ void do_astore_common(const Type* elementTy) { Value* value = pop(elementTy); Value* index = pop(Type::IntTy); - const Type* arrayRefTy = PointerType::get(getArrayInfo(elementTy).getType()); + const Type* arrayTy = getArrayInfo(elementTy).getType(); + const Type* arrayRefTy = PointerType::get(arrayTy); Value* arrayRef = pop(arrayRefTy); std::vector indices; @@ -1781,19 +1785,8 @@ void do_ishr() { do_shift_common(Instruction::Shr, Type::IntTy); } void do_lshr() { do_shift_common(Instruction::Shr, Type::LongTy); } - void do_iushr() { do_shift_unsigned_common(Type::IntTy); } - void do_lushr() { do_shift_unsigned_common(Type::LongTy); } - - void do_shift_unsigned_common(const Type* type) { - llvm::Constant* mask = - type == Type::IntTy ? INT_SHIFT_MASK : LONG_SHIFT_MASK; - // Cast value to be shifted into its unsigned version. - Value* a = pop(Type::UByteTy); - a = BinaryOperator::create(Instruction::And, a, mask, TMP, currentBB_); - Value* v = pop(type->getUnsignedVersion()); - Value* r = new ShiftInst(Instruction::Shr, v, a, TMP, currentBB_); - push(r); - } + void do_iushr() { do_shift_common(Instruction::Shr, Type::UIntTy); } + void do_lushr() { do_shift_common(Instruction::Shr, Type::ULongTy); } void do_shift_common(Instruction::OtherOps op, const Type* type) { llvm::Constant* mask = From jeffc at jolt-lang.org Sat Feb 19 20:43:15 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 19 Feb 2005 20:43:15 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Program.inc Message-ID: <200502200243.UAA21085@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Program.inc updated: 1.10 -> 1.11 --- Log message: Implement standard I/O redirection in ExecuteAndWait(). --- Diffs of the changes: (+73 -7) Program.inc | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 73 insertions(+), 7 deletions(-) Index: llvm/lib/System/Win32/Program.inc diff -u llvm/lib/System/Win32/Program.inc:1.10 llvm/lib/System/Win32/Program.inc:1.11 --- llvm/lib/System/Win32/Program.inc:1.10 Tue Feb 15 22:43:45 2005 +++ llvm/lib/System/Win32/Program.inc Sat Feb 19 20:43:04 2005 @@ -13,6 +13,7 @@ #include "Win32.h" #include +#include //===----------------------------------------------------------------------===// //=== WARNING: Implementation here must contain only Win32 specific code @@ -66,7 +67,34 @@ } } -// +static HANDLE RedirectIO(const Path *path, int fd) { + HANDLE h; + if (path == 0) { + DuplicateHandle(GetCurrentProcess(), (HANDLE)_get_osfhandle(fd), + GetCurrentProcess(), &h, + 0, TRUE, DUPLICATE_SAME_ACCESS); + return h; + } + + const char *fname = path->toString().c_str(); + if (*fname == 0) + fname = "NUL"; + + SECURITY_ATTRIBUTES sa; + sa.nLength = sizeof(sa); + sa.lpSecurityDescriptor = 0; + sa.bInheritHandle = TRUE; + + h = CreateFile(fname, fd ? GENERIC_WRITE : GENERIC_READ, FILE_SHARE_READ, + &sa, fd ? OPEN_EXISTING : CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); + if (h == INVALID_HANDLE_VALUE) { + ThrowError(std::string(fname) + ": Can't open file for " + + (fd ? "input: " : "output: ")); + } + return h; +} + int Program::ExecuteAndWait(const Path& path, const char** args, @@ -111,15 +139,50 @@ STARTUPINFO si; memset(&si, 0, sizeof(si)); si.cb = sizeof(si); - - // TODO: do replacement of standard input/output/error handles. + si.hStdInput = INVALID_HANDLE_VALUE; + si.hStdOutput = INVALID_HANDLE_VALUE; + si.hStdError = INVALID_HANDLE_VALUE; + + if (redirects) { + si.dwFlags = STARTF_USESTDHANDLES; + + try { + si.hStdInput = RedirectIO(redirects[0], 0); + si.hStdOutput = RedirectIO(redirects[1], 1); + if (redirects[1] && redirects[2] && *(redirects[1]) != *(redirects[2])) { + si.hStdError = RedirectIO(redirects[2], 2); + } else { + DuplicateHandle(GetCurrentProcess(), si.hStdOutput, + GetCurrentProcess(), &si.hStdError, + 0, TRUE, DUPLICATE_SAME_ACCESS); + } + } catch (...) { + CloseHandle(si.hStdInput); + CloseHandle(si.hStdOutput); + CloseHandle(si.hStdError); + throw; + } + } PROCESS_INFORMATION pi; memset(&pi, 0, sizeof(pi)); - if (!CreateProcess(path.c_str(), command, NULL, NULL, FALSE, 0, - envp, NULL, &si, &pi)) + fflush(stdout); + fflush(stderr); + BOOL rc = CreateProcess(path.c_str(), command, NULL, NULL, FALSE, 0, + envp, NULL, &si, &pi); + DWORD err = GetLastError(); + + // Regardless of whether the process got created or not, we are done with + // the handles we created for it to inherit. + CloseHandle(si.hStdInput); + CloseHandle(si.hStdOutput); + CloseHandle(si.hStdError); + + // Now throw an error if the process didn't get created. + if (!rc) { + SetLastError(err); ThrowError(std::string("Couldn't execute program '") + path.toString() + "'"); } @@ -139,15 +202,18 @@ // Get its exit status. DWORD status; - BOOL rc = GetExitCodeProcess(pi.hProcess, &status); + rc = GetExitCodeProcess(pi.hProcess, &status); + err = GetLastError(); // Done with the handles; go close them. CloseHandle(pi.hProcess); CloseHandle(pi.hThread); - if (!rc) + if (!rc) { + SetLastError(err); ThrowError(std::string("Failed getting status for program '") + path.toString() + "'"); + } return status; } From jeffc at jolt-lang.org Sat Feb 19 20:49:02 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 19 Feb 2005 20:49:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Program.inc Message-ID: <200502200249.UAA21135@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Program.inc updated: 1.11 -> 1.12 --- Log message: Fix silly mistake. --- Diffs of the changes: (+1 -1) Program.inc | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/System/Win32/Program.inc diff -u llvm/lib/System/Win32/Program.inc:1.11 llvm/lib/System/Win32/Program.inc:1.12 --- llvm/lib/System/Win32/Program.inc:1.11 Sat Feb 19 20:43:04 2005 +++ llvm/lib/System/Win32/Program.inc Sat Feb 19 20:48:51 2005 @@ -86,7 +86,7 @@ sa.bInheritHandle = TRUE; h = CreateFile(fname, fd ? GENERIC_WRITE : GENERIC_READ, FILE_SHARE_READ, - &sa, fd ? OPEN_EXISTING : CREATE_ALWAYS, + &sa, fd == 0 ? OPEN_EXISTING : CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (h == INVALID_HANDLE_VALUE) { ThrowError(std::string(fname) + ": Can't open file for " + From alkis at cs.uiuc.edu Sun Feb 20 11:04:00 2005 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Sun, 20 Feb 2005 11:04:00 -0600 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200502201704.LAA30267@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.224 -> 1.225 --- Log message: Remove unused functions. --- Diffs of the changes: (+0 -8) Compiler.cpp | 8 -------- 1 files changed, 8 deletions(-) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.224 llvm-java/lib/Compiler/Compiler.cpp:1.225 --- llvm-java/lib/Compiler/Compiler.cpp:1.224 Sat Feb 19 12:55:34 2005 +++ llvm-java/lib/Compiler/Compiler.cpp Sun Feb 20 11:03:49 2005 @@ -59,14 +59,6 @@ llvm::Constant* INT_SHIFT_MASK = ConstantUInt::get(Type::UByteTy, 0x1f); llvm::Constant* LONG_SHIFT_MASK = ConstantUInt::get(Type::UByteTy, 0x3f); - inline bool isTwoSlotValue(const Value* v) { - return isTwoSlotType(v->getType()); - } - - inline bool isOneSlotValue(const Value* v) { - return isOneSlotType(v->getType()); - } - class Compiler : public BytecodeParser { Module& module_; GlobalVariable* JNIEnvPtr_; From lattner at persephone.cs.uiuc.edu Sun Feb 20 12:44:03 2005 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Sun, 20 Feb 2005 12:44:03 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Message-ID: <20050220184403.6419EA8038D@persephone.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: JITEmitter.cpp updated: 1.62 -> 1.63 --- Log message: Fix problems running the HowToUseJIT on powerpc, and probably problems with ANY program that does not have all functions internalized. --- Diffs of the changes: (+2 -2) JITEmitter.cpp | 4 ++-- 1 files changed, 2 insertions, 2 deletions Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.62 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.63 --- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.62 Mon Jan 10 12:23:22 2005 +++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Sun Feb 20 12:43:35 2005 @@ -180,14 +180,14 @@ // Call the lazy resolver function unless we already KNOW it is an external // function, in which case we just skip the lazy resolution step. void *Actual = (void*)LazyResolverFn; - if (F->hasExternalLinkage()) + if (F->isExternal() && F->hasExternalLinkage()) Actual = TheJIT->getPointerToFunction(F); // Otherwise, codegen a new stub. For now, the stub will call the lazy // resolver function. Stub = TheJIT->getJITInfo().emitFunctionStub(Actual, MCE); - if (F->hasExternalLinkage()) { + if (Actual != (void*)LazyResolverFn) { // If we are getting the stub for an external function, we really want the // address of the stub in the GlobalAddressMap for the JIT, not the address // of the external function. From lattner at cs.uiuc.edu Sun Feb 20 17:29:39 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 20 Feb 2005 17:29:39 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2005-02-20-AggregateSAVEEXPR.c Message-ID: <200502202329.j1KNTdRm021308@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2005-02-20-AggregateSAVEEXPR.c added (r1.1) --- Log message: New testcase for PR522: http://llvm.cs.uiuc.edu/PR522 . --- Diffs of the changes: (+7 -0) 2005-02-20-AggregateSAVEEXPR.c | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/test/Regression/CFrontend/2005-02-20-AggregateSAVEEXPR.c diff -c /dev/null llvm/test/Regression/CFrontend/2005-02-20-AggregateSAVEEXPR.c:1.1 *** /dev/null Sun Feb 20 17:29:33 2005 --- llvm/test/Regression/CFrontend/2005-02-20-AggregateSAVEEXPR.c Sun Feb 20 17:29:23 2005 *************** *** 0 **** --- 1,7 ---- + // RUN: %llvmgcc %s -o /dev/null -S + + #include + + int foo(complex float c) { + return creal(c); + } From lattner at cs.uiuc.edu Sun Feb 20 17:30:42 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 20 Feb 2005 17:30:42 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200502202330.j1KNUg2k021336@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.84 -> 1.85 --- Log message: Implement SAVE_EXPR for aggregate types correctly. This fixes PR522: http://llvm.cs.uiuc.edu/PR522 and test/Regression/CFrontend/2005-02-20-AggregateSAVEEXPR.c --- Diffs of the changes: (+15 -5) llvm-expand.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.84 llvm-gcc/gcc/llvm-expand.c:1.85 --- llvm-gcc/gcc/llvm-expand.c:1.84 Sat Feb 19 11:10:19 2005 +++ llvm-gcc/gcc/llvm-expand.c Sun Feb 20 17:30:29 2005 @@ -6221,11 +6221,13 @@ SAVE_EXPR_LLVM(exp) = Val; /* Expand the saved expression */ - SEVal = llvm_expand_expr(Fn, TREE_OPERAND(exp, 0), DestLoc); + SEVal = llvm_expand_expr(Fn, TREE_OPERAND(exp, 0), Val); TREE_USED(exp) = 1; - if (DestTy != VoidTy) { + if (DestTy == VoidTy) { + /* noop */ + } else if (SEVal) { /* Scalar Value */ /* If the value expanded does not match the required type, we must need to promote it. Insert a cast now. */ @@ -6238,10 +6240,15 @@ from the stored value. */ Result = SEVal; break; + } else { /* Aggregate value */ + unsigned Align = TYPE_ALIGN(TREE_TYPE(exp))/8; + llvm_copy_aggregate(Fn, DestLoc, Val, 0, 0, Align); } } - if (DestTy != VoidTy) { + if (DestTy == VoidTy) { + return 0; /* If it is a void expression, return null */ + } else if (!DestLoc) { /* Scalar value */ llvm_value *V = SAVE_EXPR_LLVM(exp); /* If this assert fires, we need to insert a cast here */ assert(GET_POINTER_TYPE_ELEMENT(V->Ty) == DestTy && @@ -6249,9 +6256,12 @@ /* Emit a load of the saved value */ Result = append_inst(Fn, create_load_inst("se_val", V, 0)); - break; + } else { /* Aggregate value */ + llvm_value *Val = SAVE_EXPR_LLVM(exp); + unsigned Align = TYPE_ALIGN(TREE_TYPE(exp))/8; + llvm_copy_aggregate(Fn, DestLoc, Val, 0, 0, Align); } - return 0; /* If it is a void expression, return null */ + break; case UNSAVE_EXPR: Result = llvm_expand_expr(Fn, TREE_OPERAND(exp, 0), DestLoc); From lattner at cs.uiuc.edu Sun Feb 20 17:32:02 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 20 Feb 2005 17:32:02 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200502202332.j1KNW2Xg021360@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.301 -> 1.302 --- Log message: Bug fixed. --- Diffs of the changes: (+3 -1) ReleaseNotes.html | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.301 llvm/docs/ReleaseNotes.html:1.302 --- llvm/docs/ReleaseNotes.html:1.301 Sat Feb 19 11:17:32 2005 +++ llvm/docs/ReleaseNotes.html Sun Feb 20 17:31:49 2005 @@ -168,6 +168,8 @@ bitfield <-> aggregate assignment
  • [llvm-g++] Error compiling virtual function thunk with an unnamed argument
  • +
  • [llvm-gcc] Crash on certain + C99 complex number routines
  • @@ -589,7 +591,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2005/02/19 17:17:32 $ + Last modified: $Date: 2005/02/20 23:31:49 $ From lattner at cs.uiuc.edu Sun Feb 20 22:03:49 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 20 Feb 2005 22:03:49 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/C++Frontend/2005-02-20-BrokenReferenceTest.cpp Message-ID: <200502210403.j1L43n3C029638@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/C++Frontend: 2005-02-20-BrokenReferenceTest.cpp added (r1.1) --- Log message: new testcase for PR523: http://llvm.cs.uiuc.edu/PR523 --- Diffs of the changes: (+11 -0) 2005-02-20-BrokenReferenceTest.cpp | 11 +++++++++++ 1 files changed, 11 insertions(+) Index: llvm/test/Regression/C++Frontend/2005-02-20-BrokenReferenceTest.cpp diff -c /dev/null llvm/test/Regression/C++Frontend/2005-02-20-BrokenReferenceTest.cpp:1.1 *** /dev/null Sun Feb 20 22:03:43 2005 --- llvm/test/Regression/C++Frontend/2005-02-20-BrokenReferenceTest.cpp Sun Feb 20 22:03:32 2005 *************** *** 0 **** --- 1,11 ---- + // RUN: %llvmgxx %s -S -o /dev/null + + void test(unsigned char *b, int rb) { + typedef unsigned char imgfoo[10][rb]; + imgfoo &br = *(imgfoo *)b; + + br[0][0] = 1; + + rb = br[0][0]; + } + From lattner at cs.uiuc.edu Sun Feb 20 22:04:27 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 20 Feb 2005 22:04:27 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200502210404.j1L44RKu029941@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.85 -> 1.86 --- Log message: Fix a regression in my previous checkin. This fixes PR523: http://llvm.cs.uiuc.edu/PR523 and test/Regression/C++Frontend/2005-02-20-BrokenReferenceTest.cpp --- Diffs of the changes: (+2 -2) llvm-expand.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.85 llvm-gcc/gcc/llvm-expand.c:1.86 --- llvm-gcc/gcc/llvm-expand.c:1.85 Sun Feb 20 17:30:29 2005 +++ llvm-gcc/gcc/llvm-expand.c Sun Feb 20 22:04:14 2005 @@ -6221,7 +6221,7 @@ SAVE_EXPR_LLVM(exp) = Val; /* Expand the saved expression */ - SEVal = llvm_expand_expr(Fn, TREE_OPERAND(exp, 0), Val); + SEVal = llvm_expand_expr(Fn, TREE_OPERAND(exp, 0), DestLoc); TREE_USED(exp) = 1; @@ -6242,7 +6242,7 @@ break; } else { /* Aggregate value */ unsigned Align = TYPE_ALIGN(TREE_TYPE(exp))/8; - llvm_copy_aggregate(Fn, DestLoc, Val, 0, 0, Align); + llvm_copy_aggregate(Fn, Val, DestLoc, 0, 0, Align); } }