From lattner at cs.uiuc.edu Mon Oct 11 00:00:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 00:00:43 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/GlobalOpt/globalsra-partial.llx Message-ID: <200410110500.AAA13765@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/GlobalOpt: globalsra-partial.llx added (r1.1) --- Log message: This testcase ensures that we can SRA a global even if part of the global cannot be SRA'd --- Diffs of the changes: (+23 -0) Index: llvm/test/Regression/Transforms/GlobalOpt/globalsra-partial.llx diff -c /dev/null llvm/test/Regression/Transforms/GlobalOpt/globalsra-partial.llx:1.1 *** /dev/null Mon Oct 11 00:00:40 2004 --- llvm/test/Regression/Transforms/GlobalOpt/globalsra-partial.llx Mon Oct 11 00:00:30 2004 *************** *** 0 **** --- 1,23 ---- + ; In this case, the global can only be broken up by one level. + + ; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep 12345 + + %G = internal global { int, [4 x float] } zeroinitializer + + void %onlystore() { + store int 12345, int* getelementptr ({ int, [4 x float] }* %G, int 0, uint 0) + ret void + } + + void %storeinit(int %i) { + %Ptr = getelementptr { int, [4 x float] }* %G, int 0, uint 1, int %i + store float 1.0, float* %Ptr + ret void + } + + float %readval(int %i) { + %Ptr = getelementptr { int, [4 x float] }* %G, int 0, uint 1, int %i + %V = load float* %Ptr + ret float %V + } + From lattner at cs.uiuc.edu Mon Oct 11 00:00:53 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 00:00:53 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/GlobalOpt/malloc-promote-1.llx malloc-promote-2.llx Message-ID: <200410110500.AAA13771@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/GlobalOpt: malloc-promote-1.llx added (r1.1) malloc-promote-2.llx added (r1.1) --- Log message: These testcases check to see if we can promote malloc's to globals in some cases. --- Diffs of the changes: (+38 -0) Index: llvm/test/Regression/Transforms/GlobalOpt/malloc-promote-1.llx diff -c /dev/null llvm/test/Regression/Transforms/GlobalOpt/malloc-promote-1.llx:1.1 *** /dev/null Mon Oct 11 00:00:53 2004 --- llvm/test/Regression/Transforms/GlobalOpt/malloc-promote-1.llx Mon Oct 11 00:00:12 2004 *************** *** 0 **** --- 1,18 ---- + ; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep global + + %G = internal global int* null + + void %init() { + %P = malloc int + store int* %P, int** %G + + %GV = load int** %G + store int 0, int* %GV + ret void + } + + int %get() { + %GV = load int** %G + %V = load int* %GV + ret int %V + } Index: llvm/test/Regression/Transforms/GlobalOpt/malloc-promote-2.llx diff -c /dev/null llvm/test/Regression/Transforms/GlobalOpt/malloc-promote-2.llx:1.1 *** /dev/null Mon Oct 11 00:00:53 2004 --- llvm/test/Regression/Transforms/GlobalOpt/malloc-promote-2.llx Mon Oct 11 00:00:12 2004 *************** *** 0 **** --- 1,20 ---- + ; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep malloc + + %G = internal global int* null + + void %init() { + %P = malloc int, uint 100 + store int* %P, int** %G + + %GV = load int** %G + %GVe = getelementptr int* %GV, int 40 + store int 20, int* %GVe + ret void + } + + int %get() { + %GV = load int** %G + %GVe = getelementptr int* %GV, int 40 + %V = load int* %GVe + ret int %V + } From lattner at cs.uiuc.edu Mon Oct 11 00:54:53 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 00:54:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200410110554.AAA20244@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.22 -> 1.23 --- Log message: This patch implements two things (sorry). First, it allows SRA of globals that have embedded arrays, implementing GlobalOpt/globalsra-partial.llx. This comes up infrequently, but does allow, for example, deleting several stores to dead parts of globals in dhrystone. Second, this implements GlobalOpt/malloc-promote-*.llx, which is the following nifty transformation: Basically if a global pointer is initialized with malloc, and we can tell that the program won't notice, we transform this: struct foo *FooPtr; ... FooPtr = malloc(sizeof(struct foo)); ... FooPtr->A FooPtr->B Into: struct foo FooPtrBody; ... FooPtrBody.A FooPtrBody.B This comes up occasionally, for example, the 'disp' global in 183.equake (where the xform speeds the CBE version of the program up from 56.16s to 52.40s (7%) on apoc), and the 'desired_accept', 'fixLRBT', 'macroArray', & 'key_queue' globals in 300.twolf (speeding it up from 22.29s to 21.55s (3.4%)). The nice thing about this xform is that it exposes the resulting global to global variable optimization and makes alias analysis easier in addition to eliminating a few loads. --- Diffs of the changes: (+182 -25) Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.22 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.23 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.22 Sun Oct 10 18:14:11 2004 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Mon Oct 11 00:54:41 2004 @@ -21,6 +21,8 @@ #include "llvm/Module.h" #include "llvm/Pass.h" #include "llvm/Support/Debug.h" +#include "llvm/Target/TargetData.h" +#include "llvm/Transforms/Utils/Local.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringExtras.h" #include @@ -36,7 +38,14 @@ Statistic<> NumGlobUses ("globalopt", "Number of global uses devirtualized"); struct GlobalOpt : public ModulePass { + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); + } + bool runOnModule(Module &M); + + private: + bool ProcessInternalGlobal(GlobalVariable *GV, Module::giterator &GVI); }; RegisterOpt X("globalopt", "Global Variable Optimizer"); @@ -161,10 +170,22 @@ } } else if (I->getOpcode() == Instruction::GetElementPtr) { if (AnalyzeGlobal(I, GS, PHIUsers)) return true; - // Theoretically we could SRA globals with GEP insts if all indexes are - // constants. In practice, these GEPs would already be constant exprs - // if that was the case though. - GS.isNotSuitableForSRA = true; + + // If the first two indices are constants, this can be SRA'd. + if (isa(I->getOperand(0))) { + if (I->getNumOperands() < 3 || !isa(I->getOperand(1)) || + !cast(I->getOperand(1))->isNullValue() || + !isa(I->getOperand(2))) + GS.isNotSuitableForSRA = true; + } else if (ConstantExpr *CE = dyn_cast(I->getOperand(0))){ + if (CE->getOpcode() != Instruction::GetElementPtr || + CE->getNumOperands() < 3 || I->getNumOperands() < 2 || + !isa(I->getOperand(0)) || + !cast(I->getOperand(0))->isNullValue()) + GS.isNotSuitableForSRA = true; + } else { + GS.isNotSuitableForSRA = true; + } } else if (I->getOpcode() == Instruction::Select) { if (AnalyzeGlobal(I, GS, PHIUsers)) return true; GS.isNotSuitableForSRA = true; @@ -323,7 +344,7 @@ else assert(0 && "Unknown aggregate sequential type!"); - if (NumElements > 16) return 0; // It's not worth it. + if (NumElements > 16 && GV->use_size() > 16) return 0; // It's not worth it. NewGlobals.reserve(NumElements); for (unsigned i = 0, e = NumElements; i != e; ++i) { Constant *In = getAggregateConstantElement(Init, @@ -341,38 +362,66 @@ if (NewGlobals.empty()) return 0; + DEBUG(std::cerr << "PERFORMING GLOBAL SRA ON: " << *GV); + Constant *NullInt = Constant::getNullValue(Type::IntTy); // Loop over all of the uses of the global, replacing the constantexpr geps, // with smaller constantexpr geps or direct references. while (!GV->use_empty()) { - ConstantExpr *CE = cast(GV->use_back()); - assert(CE->getOpcode() == Instruction::GetElementPtr && - "NonGEP CE's are not SRAable!"); + User *GEP = GV->use_back(); + assert(((isa(GEP) && + cast(GEP)->getOpcode()==Instruction::GetElementPtr)|| + isa(GEP)) && "NonGEP CE's are not SRAable!"); + // Ignore the 1th operand, which has to be zero or else the program is quite // broken (undefined). Get the 2nd operand, which is the structure or array // index. - unsigned Val = cast(CE->getOperand(2))->getRawValue(); + unsigned Val = cast(GEP->getOperand(2))->getRawValue(); if (Val >= NewGlobals.size()) Val = 0; // Out of bound array access. - Constant *NewPtr = NewGlobals[Val]; + Value *NewPtr = NewGlobals[Val]; // Form a shorter GEP if needed. - if (CE->getNumOperands() > 3) { - std::vector Idxs; - Idxs.push_back(NullInt); - for (unsigned i = 3, e = CE->getNumOperands(); i != e; ++i) - Idxs.push_back(CE->getOperand(i)); - NewPtr = ConstantExpr::getGetElementPtr(NewPtr, Idxs); - } - CE->replaceAllUsesWith(NewPtr); - CE->destroyConstant(); + if (GEP->getNumOperands() > 3) + if (ConstantExpr *CE = dyn_cast(GEP)) { + std::vector Idxs; + Idxs.push_back(NullInt); + for (unsigned i = 3, e = CE->getNumOperands(); i != e; ++i) + Idxs.push_back(CE->getOperand(i)); + NewPtr = ConstantExpr::getGetElementPtr(cast(NewPtr), Idxs); + } else { + GetElementPtrInst *GEPI = cast(GEP); + std::vector Idxs; + Idxs.push_back(NullInt); + for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i) + Idxs.push_back(GEPI->getOperand(i)); + NewPtr = new GetElementPtrInst(NewPtr, Idxs, + GEPI->getName()+"."+utostr(Val), GEPI); + } + GEP->replaceAllUsesWith(NewPtr); + + if (GetElementPtrInst *GEPI = dyn_cast(GEP)) + GEPI->getParent()->getInstList().erase(GEPI); + else + cast(GEP)->destroyConstant(); } // Delete the old global, now that it is dead. Globals.erase(GV); ++NumSRA; - return NewGlobals[0]; + + // Loop over the new globals array deleting any globals that are obviously + // dead. This can arise due to scalarization of a structure or an array that + // has elements that are dead. + unsigned FirstGlobal = 0; + for (unsigned i = 0, e = NewGlobals.size(); i != e; ++i) + if (NewGlobals[i]->use_empty()) { + Globals.erase(NewGlobals[i]); + if (FirstGlobal == i) ++FirstGlobal; + } + + return FirstGlobal != NewGlobals.size() ? NewGlobals[FirstGlobal] : 0; } /// AllUsesOfValueWillTrapIfNull - Return true if all users of the specified @@ -535,10 +584,98 @@ return Changed; } +/// ConstantPropUsersOf - Walk the use list of V, constant folding all of the +/// instructions that are foldable. +static void ConstantPropUsersOf(Value *V) { + for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ) + if (Instruction *I = dyn_cast(*UI++)) + if (Constant *NewC = ConstantFoldInstruction(I)) { + I->replaceAllUsesWith(NewC); + + // Back up UI to avoid invalidating it! + bool AtBegin = false; + if (UI == V->use_begin()) + AtBegin = true; + else + --UI; + I->getParent()->getInstList().erase(I); + if (AtBegin) + UI = V->use_begin(); + else + ++UI; + } +} + +/// OptimizeGlobalAddressOfMalloc - This function takes the specified global +/// variable, and transforms the program as if it always contained the result of +/// the specified malloc. Because it is always the result of the specified +/// malloc, there is no reason to actually DO the malloc. Instead, turn the +/// malloc into a global, and any laods of GV as uses of the new global. +static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV, + MallocInst *MI) { + DEBUG(std::cerr << "PROMOTING MALLOC GLOBAL: " << *GV << " MALLOC = " <<*MI); + ConstantInt *NElements = cast(MI->getArraySize()); + + if (NElements->getRawValue() != 1) { + // If we have an array allocation, transform it to a single element + // allocation to make the code below simpler. + Type *NewTy = ArrayType::get(MI->getAllocatedType(), + NElements->getRawValue()); + MallocInst *NewMI = + new MallocInst(NewTy, Constant::getNullValue(Type::UIntTy), + MI->getName(), MI); + std::vector Indices; + Indices.push_back(Constant::getNullValue(Type::IntTy)); + Indices.push_back(Indices[0]); + Value *NewGEP = new GetElementPtrInst(NewMI, Indices, + NewMI->getName()+".el0", MI); + MI->replaceAllUsesWith(NewGEP); + MI->getParent()->getInstList().erase(MI); + MI = NewMI; + } + + // Create the new global variable. + Constant *Init = Constant::getNullValue(MI->getAllocatedType()); + GlobalVariable *NewGV = new GlobalVariable(MI->getAllocatedType(), false, + GlobalValue::InternalLinkage, Init, + GV->getName()+".body"); + GV->getParent()->getGlobalList().insert(GV, NewGV); + + // Anything that used the malloc now uses the global directly. + MI->replaceAllUsesWith(NewGV); + MI->getParent()->getInstList().erase(MI); + + Constant *RepValue = NewGV; + if (NewGV->getType() != GV->getType()->getElementType()) + RepValue = ConstantExpr::getCast(RepValue, GV->getType()->getElementType()); + + // Loop over all uses of GV, processing them in turn. + while (!GV->use_empty()) + if (LoadInst *LI = dyn_cast(GV->use_back())) { + LI->replaceAllUsesWith(RepValue); + LI->getParent()->getInstList().erase(LI); + } else { + StoreInst *SI = cast(GV->use_back()); + SI->getParent()->getInstList().erase(SI); + } + + // Now the GV is dead, nuke it. + GV->getParent()->getGlobalList().erase(GV); + + // To further other optimizations, loop over all users of NewGV and try to + // constant prop them. This will promote GEP instructions with constant + // indices into GEP constant-exprs, which will allow global-opt to hack on it. + ConstantPropUsersOf(NewGV); + if (RepValue != NewGV) + ConstantPropUsersOf(RepValue); + + return NewGV; +} // OptimizeOnceStoredGlobal - Try to optimize globals based on the knowledge // that only one value (besides its initializer) is ever stored to the global. -static bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal) { +static bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal, + Module::giterator &GVI, TargetData &TD) { if (CastInst *CI = dyn_cast(StoredOnceVal)) StoredOnceVal = CI->getOperand(0); else if (GetElementPtrInst *GEPI =dyn_cast(StoredOnceVal)){ @@ -567,15 +704,35 @@ // Optimize away any trapping uses of the loaded value. if (OptimizeAwayTrappingUsesOfLoads(GV, SOVC)) return true; + } else if (MallocInst *MI = dyn_cast(StoredOnceVal)) { + // If we have a global that is only initialized with a fixed size malloc, + // and if all users of the malloc trap, and if the malloc'd address is not + // put anywhere else, transform the program to use global memory instead + // of malloc'd memory. This eliminates dynamic allocation (good) and + // exposes the resultant global to further GlobalOpt (even better). Note + // that we restrict this transformation to only working on small + // allocations (2048 bytes currently), as we don't want to introduce a 16M + // global or something. + if (ConstantInt *NElements = dyn_cast(MI->getArraySize())) + if (MI->getAllocatedType()->isSized() && + NElements->getRawValue()* + TD.getTypeSize(MI->getAllocatedType()) < 2048 && + AllUsesOfLoadedValueWillTrapIfNull(GV)) { + // FIXME: do more correctness checking to make sure the result of the + // malloc isn't squirrelled away somewhere. + GVI = OptimizeGlobalAddressOfMalloc(GV, MI); + return true; + } } - //if (isa(StoredOnceValue)) } + return false; } /// ProcessInternalGlobal - Analyze the specified global variable and optimize /// it if possible. If we make a change, return true. -static bool ProcessInternalGlobal(GlobalVariable *GV, Module::giterator &GVI) { +bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV, + Module::giterator &GVI) { std::set PHIUsers; GlobalStatus GS; PHIUsers.clear(); @@ -625,7 +782,6 @@ return true; } else if (!GS.isNotSuitableForSRA && !GV->getInitializer()->getType()->isFirstClassType()) { - DEBUG(std::cerr << "PERFORMING GLOBAL SRA ON: " << *GV); if (GlobalVariable *FirstNewGV = SRAGlobal(GV)) { GVI = FirstNewGV; // Don't skip the newly produced globals! return true; @@ -633,7 +789,8 @@ } else if (GS.StoredType == GlobalStatus::isStoredOnce) { // Try to optimize globals based on the knowledge that only one value // (besides its initializer) is ever stored to the global. - if (OptimizeOnceStoredGlobal(GV, GS.StoredOnceValue)) + if (OptimizeOnceStoredGlobal(GV, GS.StoredOnceValue, GVI, + getAnalysis())) return true; } } From lattner at cs.uiuc.edu Mon Oct 11 10:24:39 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 10:24:39 -0500 Subject: [llvm-commits] CVS: llvm-www/header.incl Message-ID: <200410111524.KAA21691@apoc.cs.uiuc.edu> Changes in directory llvm-www: header.incl updated: 1.26 -> 1.27 --- Log message: Add link to new status update --- Diffs of the changes: (+1 -0) Index: llvm-www/header.incl diff -u llvm-www/header.incl:1.26 llvm-www/header.incl:1.27 --- llvm-www/header.incl:1.26 Wed Aug 18 12:41:18 2004 +++ llvm-www/header.incl Mon Oct 11 10:24:25 2004 @@ -51,6 +51,7 @@ Status Updates
+ October 11, 2004
August 13, 2004
July 12, 2004
June 9, 2004
From lattner at cs.uiuc.edu Mon Oct 11 10:51:08 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 10:51:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200410111551.KAA22069@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.200 -> 1.201 --- Log message: Fix a warning that is emitted on the suns --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.200 llvm/lib/Target/CBackend/Writer.cpp:1.201 --- llvm/lib/Target/CBackend/Writer.cpp:1.200 Tue Oct 5 23:21:52 2004 +++ llvm/lib/Target/CBackend/Writer.cpp Mon Oct 11 10:50:40 2004 @@ -573,7 +573,7 @@ char Buffer[100]; DHex.d = FPC->getValue(); - sprintf(Buffer, "0x%llx", DHex.ll); + sprintf(Buffer, "0x%llx", (unsigned long long)DHex.ll); std::string Num(&Buffer[0], &Buffer[6]); unsigned long Val = strtoul(Num.c_str(), 0, 16); From lattner at cs.uiuc.edu Mon Oct 11 14:40:18 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 14:40:18 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200410111940.OAA23663@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.265 -> 1.266 --- Log message: Reenable the transform, turning X/-10 < 1 into X > -10 --- Diffs of the changes: (+5 -5) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.265 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.266 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.265 Fri Oct 8 21:50:40 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Oct 11 14:40:04 2004 @@ -2116,6 +2116,8 @@ ConstantInt *Prod; bool ProdOV = MulWithOverflow(Prod, CI, DivRHS); + Instruction::BinaryOps Opcode = I.getOpcode(); + if (DivRHS->isNullValue()) { // Don't hack on divide by zeros. } else if (LHSI->getType()->isUnsigned()) { // udiv LoBound = Prod; @@ -2152,15 +2154,13 @@ HiBound = cast(ConstantExpr::getSub(Prod, DivRHS)); } - /// FIXME: This code is disabled, because we do not compile the - /// divisor case < 0 correctly. For example, this code is incorrect - /// in the case of "X/-10 < 1". - LoBound = 0; + // Dividing by a negate swaps the condition. + Opcode = SetCondInst::getSwappedCondition(Opcode); } if (LoBound) { Value *X = LHSI->getOperand(0); - switch (I.getOpcode()) { + switch (Opcode) { default: assert(0 && "Unhandled setcc opcode!"); case Instruction::SetEQ: if (LoOverflow && HiOverflow) From lattner at cs.uiuc.edu Mon Oct 11 15:53:38 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 15:53:38 -0500 Subject: [llvm-commits] CVS: poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp Message-ID: <200410112053.PAA27108@apoc.cs.uiuc.edu> Changes in directory poolalloc/lib/PoolAllocate: EquivClassGraphs.cpp updated: 1.2 -> 1.3 --- Log message: Make this build --- Diffs of the changes: (+5 -5) Index: poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp diff -u poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.2 poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.3 --- poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.2 Wed Jul 7 01:22:54 2004 +++ poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp Mon Oct 11 15:53:28 2004 @@ -21,11 +21,11 @@ #include "llvm/Analysis/DataStructure/DSGraph.h" #include "llvm/Analysis/DataStructure/DataStructure.h" #include "llvm/Support/CallSite.h" -#include "Support/Debug.h" -#include "Support/SCCIterator.h" -#include "Support/Statistic.h" -#include "Support/EquivalenceClasses.h" -#include "Support/STLExtras.h" +#include "llvm/Support/Debug.h" +#include "llvm/ADT/SCCIterator.h" +#include "llvm/ADT/Statistic.h" +#include "llvm/ADT/EquivalenceClasses.h" +#include "llvm/ADT/STLExtras.h" using namespace llvm; namespace llvm { From alkis at cs.uiuc.edu Mon Oct 11 16:51:35 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 11 Oct 2004 16:51:35 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200410112151.QAA08705@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.119 -> 1.120 --- Log message: * Make BytecodeParser a bit more primitive. Now less bytecodes are groupped in the same calls. This allows for more information to be passed to the callsites. * Changes in compiler/bytecodemapper. * Remove SetCC enum from Bytecode.h --- Diffs of the changes: (+202 -391) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.119 llvm-java/lib/Compiler/Compiler.cpp:1.120 --- llvm-java/lib/Compiler/Compiler.cpp:1.119 Wed Sep 29 17:40:41 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Mon Oct 11 16:51:24 2004 @@ -75,6 +75,11 @@ typedef std::map FallThroughMap; FallThroughMap ftMap_; + void createBasicBlockAt(unsigned bcI) { + if (!bc2bbMap_[bcI]) + bc2bbMap_[bcI] = new BasicBlock("bc" + utostr(bcI), function_); + } + public: Bytecode2BasicBlockMapper(Function* f, CodeAttribute* c) : function_(f), bc2bbMap_(c->getCodeSize()) { @@ -104,29 +109,82 @@ return ftMap_.find(bb)->second; } - void do_if(JSetCC cc, JType type, unsigned t, unsigned f) { - if (!bc2bbMap_[t]) - bc2bbMap_[t] = new BasicBlock("bc" + utostr(t), function_); - if (!bc2bbMap_[f]) - bc2bbMap_[f] = new BasicBlock("bc" + utostr(f), function_); + void do_ifeq(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); + } + + void do_ifne(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); + } + + void do_iflt(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); + } + + void do_ifge(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); + } + + void do_ifgt(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); + } + + void do_ifle(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); + } + + void do_if_icmpeq(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); + } + + void do_if_icmpne(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); + } + + void do_if_icmplt(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); } - void do_ifcmp(JSetCC cc, unsigned t, unsigned f) { - if (!bc2bbMap_[t]) - bc2bbMap_[t] = new BasicBlock("bc" + utostr(t), function_); - if (!bc2bbMap_[f]) - bc2bbMap_[f] = new BasicBlock("bc" + utostr(f), function_); + void do_if_icmpgt(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); + } + + void do_if_icmpge(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); + } + + void do_if_icmple(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); } void do_switch(unsigned defTarget, const SwitchCases& sw) { for (unsigned i = 0, e = sw.size(); i != e; ++i) { unsigned target = sw[i].second; - if (!bc2bbMap_[target]) - bc2bbMap_[target] = new BasicBlock("bc" + utostr(target), function_); + createBasicBlockAt(target); } - if (!bc2bbMap_[defTarget]) - bc2bbMap_[defTarget] = - new BasicBlock("bc" + utostr(defTarget), function_); + createBasicBlockAt(defTarget); + } + + void do_ifnull(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); + } + + void do_ifnotnull(unsigned t, unsigned f) { + createBasicBlockAt(t); + createBasicBlockAt(f); } }; @@ -195,9 +253,6 @@ Type* getType(JType type) { switch (type) { - case REFERENCE: - return PointerType::get( - getClassInfo(ClassFile::get("java/lang/Object")).type); case BOOLEAN: return Type::BoolTy; case CHAR: return Type::UShortTy; case FLOAT: return Type::FloatTy; @@ -212,19 +267,6 @@ return NULL; } - Instruction::BinaryOps getSetCC(JSetCC cc) { - switch (cc) { - case EQ: return Instruction::SetEQ; - case NE: return Instruction::SetNE; - case LT: return Instruction::SetLT; - case GE: return Instruction::SetGE; - case GT: return Instruction::SetGT; - case LE: return Instruction::SetLE; - default: assert(0 && "Invalid JSetCC to BinaryOps conversion!"); - } - return static_cast(-1); - } - /// Returns the type of the Java string descriptor. If the /// Type* self is not NULL then that type is used as the first /// type in function types @@ -906,7 +948,9 @@ } void do_aconst_null() { - opStack_.push(llvm::Constant::getNullValue(getType(REFERENCE))); + ClassFile* root = ClassFile::get("java/lang/Object"); + opStack_.push(llvm::Constant::getNullValue( + PointerType::get(getClassInfo(root).type))); } void do_iconst(int value) { @@ -931,26 +975,71 @@ opStack_.push(getConstant(c)); } - void do_load(JType type, unsigned index) { - opStack_.push(new LoadInst(getOrCreateLocal(index, getType(type)), - TMP, current_)); + void do_ldc2(unsigned index) { + do_ldc(index); + } + + void do_iload(unsigned index) { do_load_common(Type::IntTy, index); } + void do_lload(unsigned index) { do_load_common(Type::LongTy, index); } + void do_fload(unsigned index) { do_load_common(Type::FloatTy, index); } + void do_dload(unsigned index) { do_load_common(Type::DoubleTy, index); } + void do_aload(unsigned index) { + ClassFile* root = ClassFile::get("java/lang/Object"); + do_load_common(PointerType::get(getClassInfo(root).type), index); + } + + void do_load_common(Type* type, unsigned index) { + opStack_.push(new LoadInst(getOrCreateLocal(index, type), TMP, current_)); + } + + 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() { + ClassFile* root = ClassFile::get("java/lang/Object"); + do_aload_common(PointerType::get(getClassInfo(root).type)); } + 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(JType type) { + void do_aload_common(Type* type) { assert(0 && "not implemented"); } - void do_store(JType type, unsigned index) { + void do_istore(unsigned index) { do_store_common(Type::IntTy, index); } + void do_lstore(unsigned index) { do_store_common(Type::LongTy, index); } + void do_fstore(unsigned index) { do_store_common(Type::FloatTy, index); } + void do_dstore(unsigned index) { do_store_common(Type::DoubleTy, index); } + void do_astore(unsigned index) { + ClassFile* root = ClassFile::get("java/lang/Object"); + do_store_common(PointerType::get(getClassInfo(root).type), index); + } + + void do_store_common(Type* type, unsigned index) { Value* val = opStack_.top(); opStack_.pop(); const Type* valTy = val->getType(); - Value* ptr = getOrCreateLocal(index, getType(type)); + Value* ptr = getOrCreateLocal(index, type); if (!valTy->isPrimitiveType() && valTy != cast(ptr->getType())->getElementType()) ptr = new CastInst(ptr, PointerType::get(valTy), TMP, current_); opStack_.push(new StoreInst(val, ptr, current_)); } - void do_astore(JType type) { + void do_iastore() { do_astore_common(Type::IntTy); } + void do_lastore() { do_astore_common(Type::LongTy); } + void do_fastore() { do_astore_common(Type::FloatTy); } + void do_dastore() { do_astore_common(Type::DoubleTy); } + void do_aastore() { + ClassFile* root = ClassFile::get("java/lang/Object"); + do_astore_common(PointerType::get(getClassInfo(root).type)); + } + void do_bastore() { do_astore_common(Type::SByteTy); } + void do_castore() { do_astore_common(Type::UShortTy); } + void do_sastore() { do_astore_common(Type::ShortTy); } + + void do_astore_common(Type* type) { assert(0 && "not implemented"); } @@ -1071,40 +1160,50 @@ opStack_.push(v2); } - void do_add() { - do_binary_op_common(Instruction::Add); - } - - void do_sub() { - do_binary_op_common(Instruction::Sub); - } - - void do_mul() { - do_binary_op_common(Instruction::Mul); - } - - void do_div() { - do_binary_op_common(Instruction::Div); - } + void do_iadd() { do_binary_op_common(Instruction::Add); } + void do_ladd() { do_binary_op_common(Instruction::Add); } + void do_fadd() { do_binary_op_common(Instruction::Add); } + void do_dadd() { do_binary_op_common(Instruction::Add); } + + void do_isub() { do_binary_op_common(Instruction::Sub); } + void do_lsub() { do_binary_op_common(Instruction::Sub); } + void do_fsub() { do_binary_op_common(Instruction::Sub); } + void do_dsub() { do_binary_op_common(Instruction::Sub); } + + void do_imul() { do_binary_op_common(Instruction::Mul); } + void do_lmul() { do_binary_op_common(Instruction::Mul); } + void do_fmul() { do_binary_op_common(Instruction::Mul); } + void do_dmul() { do_binary_op_common(Instruction::Mul); } + + void do_idiv() { do_binary_op_common(Instruction::Div); } + void do_ldiv() { do_binary_op_common(Instruction::Div); } + void do_fdiv() { do_binary_op_common(Instruction::Div); } + void do_ddiv() { do_binary_op_common(Instruction::Div); } + + void do_irem() { do_binary_op_common(Instruction::Rem); } + void do_lrem() { do_binary_op_common(Instruction::Rem); } + void do_frem() { do_binary_op_common(Instruction::Rem); } + void do_drem() { do_binary_op_common(Instruction::Rem); } + + void do_ineg() { do_neg_common(); } + void do_lneg() { do_neg_common(); } + void do_fneg() { do_neg_common(); } + void do_dneg() { do_neg_common(); } - void do_rem() { - do_binary_op_common(Instruction::Rem); - } - - void do_neg() { + void do_neg_common() { Value* v1 = opStack_.top(); opStack_.pop(); opStack_.push(BinaryOperator::createNeg(v1, TMP, current_)); } - void do_shl() { - do_shift_common(Instruction::Shl); - } + void do_ishl() { do_shift_common(Instruction::Shl); } + void do_lshl() { do_shift_common(Instruction::Shl); } + void do_ishr() { do_shift_common(Instruction::Shr); } + void do_lshr() { do_shift_common(Instruction::Shr); } - void do_shr() { - do_shift_common(Instruction::Shr); - } + void do_iushr() { do_shift_unsigned_common(); } + void do_lushr() { do_shift_unsigned_common(); } - void do_ushr() { + void do_shift_unsigned_common() { // cast value to be shifted into its unsigned version do_swap(); Value* value = opStack_.top(); opStack_.pop(); @@ -1128,17 +1227,12 @@ opStack_.push(new ShiftInst(op, value, amount, TMP, current_)); } - void do_and() { - do_binary_op_common(Instruction::And); - } - - void do_or() { - do_binary_op_common(Instruction::Or); - } - - void do_xor() { - do_binary_op_common(Instruction::Xor); - } + void do_iand() { do_binary_op_common(Instruction::And); } + void do_land() { do_binary_op_common(Instruction::And); } + void do_ior() { do_binary_op_common(Instruction::Or); } + void do_lor() { do_binary_op_common(Instruction::Or); } + void do_ixor() { do_binary_op_common(Instruction::Xor); } + void do_lxor() { do_binary_op_common(Instruction::Xor); } void do_binary_op_common(Instruction::BinaryOps op) { Value* v2 = opStack_.top(); opStack_.pop(); @@ -1155,9 +1249,25 @@ new StoreInst(v, getOrCreateLocal(index, Type::IntTy), current_); } - void do_convert(JType to) { + void do_i2l() { do_cast_common(Type::LongTy); } + void do_i2f() { do_cast_common(Type::FloatTy); } + void do_i2d() { do_cast_common(Type::DoubleTy); } + void do_l2i() { do_cast_common(Type::IntTy); } + void do_l2f() { do_cast_common(Type::FloatTy); } + void do_l2d() { do_cast_common(Type::DoubleTy); } + void do_f2i() { do_cast_common(Type::IntTy); } + void do_f2l() { do_cast_common(Type::LongTy); } + void do_f2d() { do_cast_common(Type::DoubleTy); } + void do_d2i() { do_cast_common(Type::IntTy); } + void do_d2l() { do_cast_common(Type::LongTy); } + void do_d2f() { do_cast_common(Type::FloatTy); } + void do_i2b() { do_cast_common(Type::SByteTy); } + void do_i2c() { do_cast_common(Type::UShortTy); } + void do_i2s() { do_cast_common(Type::ShortTy); } + + void do_cast_common(Type* type) { Value* v1 = opStack_.top(); opStack_.pop(); - opStack_.push(new CastInst(v1, getType(to), TMP, current_)); + opStack_.push(new CastInst(v1, type, TMP, current_)); } void do_lcmp() { @@ -1173,13 +1283,10 @@ opStack_.push(r); } - void do_cmpl() { - do_cmp_common(-1); - } - - void do_cmpg() { - do_cmp_common(1); - } + void do_fcmpl() { do_cmp_common(-1); } + void do_dcmpl() { do_cmp_common(-1); } + void do_fcmpg() { do_cmp_common(1); } + void do_dcmpg() { do_cmp_common(1); } void do_cmp_common(int valueIfUnordered) { Value* v2 = opStack_.top(); opStack_.pop(); @@ -1200,316 +1307,20 @@ opStack_.push(r); } - void do_if(JSetCC cc, JType type, - unsigned t, unsigned f) { - Value* v1 = opStack_.top(); opStack_.pop(); - Value* v2 = llvm::Constant::getNullValue(v1->getType()); - Value* c = new SetCondInst(getSetCC(cc), v1, v2, TMP, current_); - new BranchInst(mapper_->getBBAt(t), mapper_->getBBAt(f), c, current_); - } + void do_ifeq(unsigned t, unsigned f) { do_if_common(Instruction::SetEQ, t, f); } + void do_ifne(unsigned t, unsigned f) { do_if_common(Instruction::SetNE, t, f); } + void do_iflt(unsigned t, unsigned f) { do_if_common(Instruction::SetLT, t, f); } + void do_ifge(unsigned t, unsigned f) { do_if_common(Instruction::SetGE, t, f); } + void do_ifgt(unsigned t, unsigned f) { do_if_common(Instruction::SetGT, t, f); } + void do_ifle(unsigned t, unsigned f) { do_if_common(Instruction::SetLE, t, f); } - void do_ifcmp(JSetCC cc, - unsigned t, unsigned f) { - Value* v2 = opStack_.top(); opStack_.pop(); + void do_if_common(Instruction::BinaryOps cc, unsigned t, unsigned f) { Value* v1 = opStack_.top(); opStack_.pop(); - Value* c = new SetCondInst(getSetCC(cc), v1, v2, TMP, current_); + Value* v2 = llvm::Constant::getNullValue(Type::IntTy); + Value* c = new SetCondInst(cc, v1, v2, TMP, current_); new BranchInst(mapper_->getBBAt(t), mapper_->getBBAt(f), c, current_); } - void do_goto(unsigned target) { - new BranchInst(mapper_->getBBAt(target), current_); - } - - void do_jsr(unsigned target) { - assert(0 && "not implemented"); - } - - void do_ret(unsigned index) { - assert(0 && "not implemented"); - } - - void do_switch(unsigned defTarget, const SwitchCases& sw) { - Value* v = opStack_.top(); opStack_.pop(); - SwitchInst* in = new SwitchInst(v, mapper_->getBBAt(defTarget), current_); - for (unsigned i = 0, e = sw.size(); i != e; ++i) - in->addCase(ConstantSInt::get(Type::IntTy, sw[i].first), - mapper_->getBBAt(sw[i].second)); - } - - void do_return() { - Value* v1 = opStack_.top(); opStack_.pop(); - new ReturnInst(v1, current_); - } - - void do_return_void() { - new ReturnInst(NULL, current_); - } - - void do_getstatic(unsigned index) { - Value* v = new LoadInst(getStaticField(index), TMP, current_); - opStack_.push(v); - } - - void do_putstatic(unsigned index) { - Value* v = opStack_.top(); opStack_.pop(); - Value* ptr = getStaticField(index); - const Type* fieldTy = cast(ptr->getType())->getElementType(); - if (v->getType() != fieldTy) - v = new CastInst(v, fieldTy, TMP, current_); - new StoreInst(v, ptr, current_); - } - - void do_getfield(unsigned index) { - Value* p = opStack_.top(); opStack_.pop(); - Value* v = new LoadInst(getField(index, p), TMP, current_); - opStack_.push(v); - } - - void do_putfield(unsigned index) { - Value* v = opStack_.top(); opStack_.pop(); - Value* p = opStack_.top(); opStack_.pop(); - new StoreInst(v, getField(index, p), current_); - } - - void makeCall(Value* fun, const std::vector params) { - const PointerType* funPtrTy = cast(fun->getType()); - const FunctionType* funTy = - cast(funPtrTy->getElementType()); - - if (funTy->getReturnType() == Type::VoidTy) - new CallInst(fun, params, "", current_); - else { - Value* r = new CallInst(fun, params, TMP, current_); - opStack_.push(r); - } - } - - std::vector getParams(FunctionType* funTy) { - unsigned numParams = funTy->getNumParams(); - std::vector params(numParams); - while (numParams--) { - Value* p = opStack_.top(); opStack_.pop(); - params[numParams] = - p->getType() == funTy->getParamType(numParams) ? - p : - new CastInst(p, funTy->getParamType(numParams), TMP, current_); - } - - return params; - } - - void do_invokevirtual(unsigned index) { - ConstantMethodRef* methodRef = cf_->getConstantMethodRef(index); - ConstantNameAndType* nameAndType = methodRef->getNameAndType(); - - ClassFile* cf = ClassFile::get(methodRef->getClass()->getName()->str()); - const ClassInfo& ci = getClassInfo(cf); - const VTableInfo& vi = getVTableInfo(cf); - - const std::string& className = cf->getThisClass()->getName()->str(); - const std::string& methodDescr = - nameAndType->getName()->str() + - nameAndType->getDescriptor()->str(); - - FunctionType* funTy = - cast(getType(nameAndType->getDescriptor(), ci.type)); - - std::vector params(getParams(funTy)); - - Value* objRef = params.front(); - objRef = new CastInst(objRef, PointerType::get(ci.type), - "this", current_); - Value* objBase = getField(cf, LLVM_JAVA_OBJECT_BASE, objRef); - Function* f = module_.getOrInsertFunction( - LLVM_JAVA_GETOBJECTCLASS, PointerType::get(VTableInfo::VTableTy), - objBase->getType(), NULL); - Value* vtable = new CallInst(f, objBase, TMP, current_); - vtable = new CastInst(vtable, PointerType::get(vi.vtable->getType()), - TMP, current_); - vtable = new LoadInst(vtable, className + "", current_); - std::vector indices(1, ConstantUInt::get(Type::UIntTy, 0)); - assert(vi.m2iMap.find(methodDescr) != vi.m2iMap.end() && - "could not find slot for virtual function!"); - unsigned vSlot = vi.m2iMap.find(methodDescr)->second; - indices.push_back(ConstantUInt::get(Type::UIntTy, vSlot)); - Value* vfunPtr = - new GetElementPtrInst(vtable, indices, TMP, current_); - Value* vfun = new LoadInst(vfunPtr, methodDescr, current_); - - makeCall(vfun, params); - } - - void do_invokespecial(unsigned index) { - ConstantMethodRef* methodRef = cf_->getConstantMethodRef(index); - ConstantNameAndType* nameAndType = methodRef->getNameAndType(); - - const std::string& className = methodRef->getClass()->getName()->str(); - const std::string& methodName = nameAndType->getName()->str(); - const std::string& methodDescr = - methodName + nameAndType->getDescriptor()->str(); - std::string funcName = className + '/' + methodDescr; - const ClassInfo& ci = getClassInfo(ClassFile::get(className)); - - // constructor calls are statically bound - if (methodName == "") { - FunctionType* funcTy = - cast(getType(nameAndType->getDescriptor(), ci.type)); - Function* function = module_.getOrInsertFunction(funcName, funcTy); - toCompileFunctions_.insert(function); - makeCall(function, getParams(funcTy)); - } - // otherwise we call the superclass' implementation of the method - else { - assert(0 && "not implemented"); - } - } - - void do_invokestatic(unsigned index) { - ConstantMethodRef* methodRef = cf_->getConstantMethodRef(index); - ConstantNameAndType* nameAndType = methodRef->getNameAndType(); - - std::string funcName = - methodRef->getClass()->getName()->str() + '/' + - nameAndType->getName()->str() + - nameAndType->getDescriptor()->str(); - - FunctionType* funcTy = - cast(getType(nameAndType->getDescriptor())); - Function* function = module_.getOrInsertFunction(funcName, funcTy); - toCompileFunctions_.insert(function); - makeCall(function, getParams(funcTy)); - } - - void do_invokeinterface(unsigned index) { - ConstantInterfaceMethodRef* methodRef = - cf_->getConstantInterfaceMethodRef(index); - ConstantNameAndType* nameAndType = methodRef->getNameAndType(); - - ClassFile* cf = ClassFile::get(methodRef->getClass()->getName()->str()); - const ClassInfo& ci = getClassInfo(cf); - const VTableInfo& vi = getVTableInfo(cf); - - const std::string& className = cf->getThisClass()->getName()->str(); - const std::string& methodDescr = - nameAndType->getName()->str() + - nameAndType->getDescriptor()->str(); - - FunctionType* funTy = - cast(getType(nameAndType->getDescriptor(), ci.type)); - - std::vector params(getParams(funTy)); - - Value* objRef = params.front(); - objRef = new CastInst(objRef, PointerType::get(ci.type), - "this", current_); - Value* objBase = getField(cf, LLVM_JAVA_OBJECT_BASE, objRef); - Function* f = module_.getOrInsertFunction( - LLVM_JAVA_GETOBJECTCLASS, PointerType::get(VTableInfo::VTableTy), - objBase->getType(), NULL); - Value* vtable = new CallInst(f, objBase, TMP, current_); - // get the interfaces array of vtables - std::vector indices(2, ConstantUInt::get(Type::UIntTy, 0)); - indices.push_back(ConstantUInt::get(Type::UIntTy, 3)); - Value* interfaceVTables = - new GetElementPtrInst(vtable, indices, TMP, current_); - interfaceVTables = new LoadInst(interfaceVTables, TMP, current_); - // get the actual interface vtable - indices.clear(); - indices.push_back(ConstantUInt::get(Type::UIntTy, ci.interfaceIdx)); - Value* interfaceVTable = - new GetElementPtrInst(interfaceVTables, indices, TMP, current_); - interfaceVTable = - new LoadInst(interfaceVTable, className + "", current_); - interfaceVTable = - new CastInst(interfaceVTable, vi.vtable->getType(), TMP, current_); - // get the function pointer - indices.resize(1); - assert(vi.m2iMap.find(methodDescr) != vi.m2iMap.end() && - "could not find slot for virtual function!"); - unsigned vSlot = vi.m2iMap.find(methodDescr)->second; - indices.push_back(ConstantUInt::get(Type::UIntTy, vSlot)); - Value* vfunPtr = - new GetElementPtrInst(interfaceVTable, indices, TMP, current_); - Value* vfun = new LoadInst(vfunPtr, methodDescr, current_); - - makeCall(vfun, params); - } - - void do_new(unsigned index) { - ConstantClass* classRef = cf_->getConstantClass(index); - ClassFile* cf = ClassFile::get(classRef->getName()->str()); - const ClassInfo& ci = getClassInfo(cf); - const VTableInfo& vi = getVTableInfo(cf); - - Value* objRef = new MallocInst(ci.type, - ConstantUInt::get(Type::UIntTy, 0), - TMP, current_); - Value* vtable = getField(cf, LLVM_JAVA_OBJECT_BASE, objRef); - vtable = new CastInst(vtable, PointerType::get(vi.vtable->getType()), - TMP, current_); - vtable = new StoreInst(vi.vtable, vtable, current_); - opStack_.push(objRef); - } - - void do_newarray(JType type) { - assert(0 && "not implemented"); - } - - void do_anewarray(unsigned index) { - assert(0 && "not implemented"); - } - - void do_arraylength() { - assert(0 && "not implemented"); - } - - void do_athrow() { - Value* objRef = opStack_.top(); opStack_.pop(); - objRef = new CastInst(objRef, PointerType::get(ClassInfo::ObjectBaseTy), - TMP, current_); - Function* f = module_.getOrInsertFunction( - LLVM_JAVA_THROW, Type::IntTy, objRef->getType(), NULL); - new CallInst(f, objRef, TMP, current_); - } - - void do_checkcast(unsigned index) { - do_dup(); - do_instanceof(index); - Value* r = opStack_.top(); opStack_.pop(); - Value* b = new SetCondInst(Instruction::SetEQ, - r, ConstantSInt::get(Type::IntTy, 1), - TMP, current_); - // FIXME: if b is false we must throw a ClassCast exception - } - - void do_instanceof(unsigned index) { - ConstantClass* classRef = cf_->getConstantClass(index); - ClassFile* cf = ClassFile::get(classRef->getName()->str()); - const VTableInfo& vi = getVTableInfo(cf); - - Value* objRef = opStack_.top(); opStack_.pop(); - Value* objBase = getField(cf, LLVM_JAVA_OBJECT_BASE, objRef); - Function* f = module_.getOrInsertFunction( - LLVM_JAVA_ISINSTANCEOF, Type::IntTy, - objBase->getType(), PointerType::get(VTableInfo::VTableTy), NULL); - Value* vtable = new CastInst(vi.vtable, - PointerType::get(VTableInfo::VTableTy), - TMP, current_); - Value* r = new CallInst(f, objBase, vtable, TMP, current_); - opStack_.push(r); - } - - void do_monitorenter() { - assert(0 && "not implemented"); - } - - void do_monitorexit() { - assert(0 && "not implemented"); - } - - void do_multianewarray(unsigned index, unsigned dims) { - assert(0 && "not implemented"); - } }; unsigned Compiler::ClassInfo::InterfaceCount = 0; From alkis at cs.uiuc.edu Mon Oct 11 16:51:35 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 11 Oct 2004 16:51:35 -0500 Subject: [llvm-commits] CVS: llvm-java/include/llvm/Java/BytecodeParser.h Bytecode.h Message-ID: <200410112151.QAA08710@zion.cs.uiuc.edu> Changes in directory llvm-java/include/llvm/Java: BytecodeParser.h updated: 1.9 -> 1.10 Bytecode.h updated: 1.11 -> 1.12 --- Log message: * Make BytecodeParser a bit more primitive. Now less bytecodes are groupped in the same calls. This allows for more information to be passed to the callsites. * Changes in compiler/bytecodemapper. * Remove SetCC enum from Bytecode.h --- Diffs of the changes: (+361 -169) Index: llvm-java/include/llvm/Java/BytecodeParser.h diff -u llvm-java/include/llvm/Java/BytecodeParser.h:1.9 llvm-java/include/llvm/Java/BytecodeParser.h:1.10 --- llvm-java/include/llvm/Java/BytecodeParser.h:1.9 Wed Sep 29 13:08:56 2004 +++ llvm-java/include/llvm/Java/BytecodeParser.h Mon Oct 11 16:51:24 2004 @@ -1,4 +1,4 @@ -//===-- BytecodeParser.h - Java bytecode parser ---------------*- C++ -*-===// +//===-- BytecodeParser.h - Java bytecode parser -----------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -29,8 +29,6 @@ protected: typedef std::vector > SwitchCases; - enum JSetCC { EQ, NE, LT, GE, GT, LE }; - private: SwitchCases switchCases_; @@ -44,8 +42,6 @@ /// appropriately. When this function returns all code up to /// \c size is parsed. void parse(const uint8_t* code, unsigned size) { - using namespace Opcode; - for (unsigned i = 0; i < size; ++i) { unsigned curBC = i; bool wide = code[i] == WIDE; @@ -90,155 +86,145 @@ THIS->do_ldc(readUShort(code, i)); break; case LDC2_W: - THIS->do_ldc(readUShort(code, i)); + THIS->do_ldc2(readUShort(code, i)); break; case ILOAD: - THIS->do_load( - INT, wide ? readUShort(code, i) : readUByte(code, i)); + THIS->do_iload(wide ? readUShort(code, i) : readUByte(code, i)); break; case LLOAD: - THIS->do_load( - LONG, wide ? readUShort(code, i) : readUByte(code, i)); + THIS->do_lload(wide ? readUShort(code, i) : readUByte(code, i)); break; case FLOAD: - THIS->do_load( - FLOAT, wide ? readUShort(code, i) : readUByte(code, i)); + THIS->do_fload(wide ? readUShort(code, i) : readUByte(code, i)); break; case DLOAD: - THIS->do_load( - DOUBLE, wide ? readUShort(code, i) : readUByte(code, i)); + THIS->do_dload(wide ? readUShort(code, i) : readUByte(code, i)); break; case ALOAD: - THIS->do_load( - REFERENCE, wide ? readUShort(code, i) : readUByte(code, i)); + THIS->do_aload(wide ? readUShort(code, i) : readUByte(code, i)); break; case ILOAD_0: case ILOAD_1: case ILOAD_2: case ILOAD_3: - THIS->do_load(INT, code[i]-ILOAD_0); + THIS->do_iload(code[i]-ILOAD_0); break; case LLOAD_0: case LLOAD_1: case LLOAD_2: case LLOAD_3: - THIS->do_load(LONG, code[i]-LLOAD_0); + THIS->do_lload(code[i]-LLOAD_0); break; case FLOAD_0: case FLOAD_1: case FLOAD_2: case FLOAD_3: - THIS->do_load(FLOAT, code[i]-FLOAD_0); + THIS->do_fload(code[i]-FLOAD_0); break; case DLOAD_0: case DLOAD_1: case DLOAD_2: case DLOAD_3: - THIS->do_load(DOUBLE, code[i]-DLOAD_0); + THIS->do_dload(code[i]-DLOAD_0); break; case ALOAD_0: case ALOAD_1: case ALOAD_2: case ALOAD_3: - THIS->do_load(REFERENCE, code[i]-ALOAD_0); + THIS->do_aload(code[i]-ALOAD_0); break; case IALOAD: - THIS->do_aload(INT); + THIS->do_iaload(); break; case LALOAD: - THIS->do_aload(LONG); + THIS->do_laload(); break; case FALOAD: - THIS->do_aload(FLOAT); + THIS->do_faload(); break; case DALOAD: - THIS->do_aload(DOUBLE); + THIS->do_daload(); break; case AALOAD: - THIS->do_aload(REFERENCE); + THIS->do_aaload(); break; case BALOAD: - THIS->do_aload(BYTE); + THIS->do_baload(); break; case CALOAD: - THIS->do_aload(CHAR); + THIS->do_caload(); break; case SALOAD: - THIS->do_aload(SHORT); + THIS->do_saload(); break; case ISTORE: - THIS->do_store( - INT, wide ? readUShort(code, i) : readUByte(code, i)); + THIS->do_istore(wide ? readUShort(code, i) : readUByte(code, i)); break; case LSTORE: - THIS->do_store( - LONG, wide ? readUShort(code, i) : readUByte(code, i)); + THIS->do_lstore(wide ? readUShort(code, i) : readUByte(code, i)); break; case FSTORE: - THIS->do_store( - FLOAT, wide ? readUShort(code, i) : readUByte(code, i)); + THIS->do_fstore(wide ? readUShort(code, i) : readUByte(code, i)); break; case DSTORE: - THIS->do_store( - DOUBLE, wide ? readUShort(code, i) : readUByte(code, i)); + THIS->do_dstore(wide ? readUShort(code, i) : readUByte(code, i)); break; case ASTORE: - THIS->do_store( - REFERENCE, wide ? readUShort(code, i) : readUByte(code, i)); + THIS->do_astore(wide ? readUShort(code, i) : readUByte(code, i)); break; case ISTORE_0: case ISTORE_1: case ISTORE_2: case ISTORE_3: - THIS->do_store(INT, code[i]-ISTORE_0); + THIS->do_istore(code[i]-ISTORE_0); break; case LSTORE_0: case LSTORE_1: case LSTORE_2: case LSTORE_3: - THIS->do_store(LONG, code[i]-LSTORE_0); + THIS->do_lstore(code[i]-LSTORE_0); break; case FSTORE_0: case FSTORE_1: case FSTORE_2: case FSTORE_3: - THIS->do_store(FLOAT, code[i]-FSTORE_0); + THIS->do_fstore(code[i]-FSTORE_0); break; case DSTORE_0: case DSTORE_1: case DSTORE_2: case DSTORE_3: - THIS->do_store(DOUBLE, code[i]-DSTORE_0); + THIS->do_dstore(code[i]-DSTORE_0); break; case ASTORE_0: case ASTORE_1: case ASTORE_2: case ASTORE_3: - THIS->do_store(REFERENCE, code[i]-ASTORE_0); + THIS->do_astore(code[i]-ASTORE_0); break; case IASTORE: - THIS->do_astore(INT); + THIS->do_iastore(); break; case LASTORE: - THIS->do_astore(LONG); + THIS->do_lastore(); break; case FASTORE: - THIS->do_astore(FLOAT); + THIS->do_fastore(); break; case DASTORE: - THIS->do_astore(DOUBLE); + THIS->do_dastore(); break; case AASTORE: - THIS->do_astore(REFERENCE); + THIS->do_aastore(); break; case BASTORE: - THIS->do_astore(BYTE); + THIS->do_bastore(); break; case CASTORE: - THIS->do_astore(CHAR); + THIS->do_castore(); break; case SASTORE: - THIS->do_astore(SHORT); + THIS->do_sastore(); break; case POP: THIS->do_pop(); @@ -268,196 +254,244 @@ THIS->do_swap(); break; case IADD: + THIS->do_iadd(); + break; case LADD: + THIS->do_ladd(); + break; case FADD: + THIS->do_fadd(); + break; case DADD: - THIS->do_add(); + THIS->do_dadd(); break; case ISUB: + THIS->do_isub(); + break; case LSUB: + THIS->do_lsub(); + break; case FSUB: + THIS->do_fsub(); + break; case DSUB: - THIS->do_sub(); + THIS->do_dsub(); break; case IMUL: + THIS->do_imul(); + break; case LMUL: + THIS->do_lmul(); + break; case FMUL: + THIS->do_fmul(); + break; case DMUL: - THIS->do_mul(); + THIS->do_dmul(); break; case IDIV: + THIS->do_idiv(); + break; case LDIV: + THIS->do_ldiv(); + break; case FDIV: + THIS->do_fdiv(); + break; case DDIV: - THIS->do_div(); + THIS->do_ddiv(); break; case IREM: + THIS->do_irem(); + break; case LREM: + THIS->do_lrem(); + break; case FREM: + THIS->do_frem(); + break; case DREM: - THIS->do_rem(); + THIS->do_drem(); break; case INEG: + THIS->do_ineg(); + break; case LNEG: + THIS->do_lneg(); + break; case FNEG: + THIS->do_fneg(); + break; case DNEG: - THIS->do_neg(); + THIS->do_dneg(); break; case ISHL: + THIS->do_ishl(); + break; case LSHL: - THIS->do_shl(); + THIS->do_lshl(); break; case ISHR: + THIS->do_ishr(); + break; case LSHR: - THIS->do_shr(); + THIS->do_lshr(); break; case IUSHR: + THIS->do_iushr(); + break; case LUSHR: - THIS->do_ushr(); + THIS->do_lushr(); break; case IAND: + THIS->do_iand(); + break; case LAND: - THIS->do_and(); + THIS->do_land(); break; case IOR: + THIS->do_ior(); + break; case LOR: - THIS->do_or(); + THIS->do_lor(); break; case IXOR: + THIS->do_ixor(); + break; case LXOR: - THIS->do_xor(); + THIS->do_lxor(); break; case IINC: THIS->do_iinc(readUByte(code, i), readSByte(code, i)); break; case I2L: - THIS->do_convert(LONG); + THIS->do_i2l(); break; case I2F: - THIS->do_convert(FLOAT); + THIS->do_i2f(); break; case I2D: - THIS->do_convert(DOUBLE); + THIS->do_i2d(); break; case L2I: - THIS->do_convert(INT); + THIS->do_l2i(); break; case L2F: - THIS->do_convert(FLOAT); + THIS->do_l2f(); break; case L2D: - THIS->do_convert(DOUBLE); + THIS->do_l2d(); break; case F2I: - THIS->do_convert(INT); + THIS->do_f2i(); break; case F2L: - THIS->do_convert(LONG); + THIS->do_f2l(); break; case F2D: - THIS->do_convert(DOUBLE); + THIS->do_f2d(); break; case D2I: - THIS->do_convert(INT); + THIS->do_d2i(); break; case D2L: - THIS->do_convert(LONG); + THIS->do_d2l(); break; case D2F: - THIS->do_convert(FLOAT); + THIS->do_d2f(); break; case I2B: - THIS->do_convert(BYTE); + THIS->do_i2b(); break; case I2C: - THIS->do_convert(CHAR); + THIS->do_i2c(); break; case I2S: - THIS->do_convert(SHORT); + THIS->do_i2s(); break; case LCMP: THIS->do_lcmp(); break; case FCMPL: - THIS->do_cmpl(); + THIS->do_fcmpl(); break; case FCMPG: - THIS->do_cmpg(); + THIS->do_fcmpg(); break; case DCMPL: - THIS->do_cmpl(); + THIS->do_dcmpl(); break; case DCMPG: - THIS->do_cmpg(); + THIS->do_dcmpg(); break; case IFEQ: { unsigned t = curBC + readSShort(code, i); - THIS->do_if(EQ, INT, t, i + 1); + THIS->do_ifeq(t, i + 1); break; } case IFNE: { unsigned t = curBC + readSShort(code, i); - THIS->do_if(NE, INT, t, i + 1); + THIS->do_ifne(t, i + 1); break; } case IFLT: { unsigned t = curBC + readSShort(code, i); - THIS->do_if(LT, INT, t, i + 1); + THIS->do_iflt(t, i + 1); break; } case IFGE: { unsigned t = curBC + readSShort(code, i); - THIS->do_if(GE, INT, t, i + 1); + THIS->do_ifge(t, i + 1); break; } case IFGT: { unsigned t = curBC + readSShort(code, i); - THIS->do_if(GT, INT, t, i + 1); + THIS->do_ifgt(t, i + 1); break; } case IFLE: { unsigned t = curBC + readSShort(code, i); - THIS->do_if(LE, INT, t, i + 1); + THIS->do_ifle(t, i + 1); break; } case IF_ICMPEQ: { unsigned t = curBC + readSShort(code, i); - THIS->do_ifcmp(EQ, t, i + 1); + THIS->do_if_icmpeq(t, i + 1); break; } case IF_ICMPNE: { unsigned t = curBC + readSShort(code, i); - THIS->do_ifcmp(NE, t, i + 1); + THIS->do_if_icmpne(t, i + 1); break; } case IF_ICMPLT: { unsigned t = curBC + readSShort(code, i); - THIS->do_ifcmp(LT, t, i + 1); + THIS->do_if_icmplt(t, i + 1); break; } case IF_ICMPGE: { unsigned t = curBC + readSShort(code, i); - THIS->do_ifcmp(GE, t, i + 1); + THIS->do_if_icmpge(t, i + 1); break; } case IF_ICMPGT: { unsigned t = curBC + readSShort(code, i); - THIS->do_ifcmp(GT, t, i + 1); + THIS->do_if_icmpgt(t, i + 1); break; } case IF_ICMPLE: { unsigned t = curBC + readSShort(code, i); - THIS->do_ifcmp(LE, t, i + 1); + THIS->do_if_icmple(t, i + 1); break; } case IF_IACMPEQ: { unsigned t = curBC + readSShort(code, i); - THIS->do_ifcmp(EQ, t, i + 1); + THIS->do_if_acmpeq(t, i + 1); break; } case IF_IACMPNE: { unsigned t = curBC + readSShort(code, i); - THIS->do_ifcmp(NE, t, i + 1); + THIS->do_if_acmpne(t, i + 1); break; } case GOTO: @@ -497,14 +531,22 @@ break; } case IRETURN: + THIS->do_ireturn(); + break; case LRETURN: + THIS->do_lreturn(); + break; case FRETURN: + THIS->do_freturn(); + break; case DRETURN: + THIS->do_dreturn(); + break; case ARETURN: THIS->do_return(); break; case RETURN: - THIS->do_return_void(); + THIS->do_return(); break; case GETSTATIC: THIS->do_getstatic(readUShort(code, i)); @@ -571,12 +613,12 @@ break; case IFNULL: { unsigned t = curBC + readUShort(code, i); - THIS->do_if(EQ, REFERENCE, t, i + 1); + THIS->do_ifnull(t, i + 1); break; } case IFNONNULL: { unsigned t = curBC + readUShort(code, i); - THIS->do_if(NE, REFERENCE, t, i + 1); + THIS->do_ifnonnull(t, i + 1); break; } case GOTO_W: @@ -611,21 +653,62 @@ void do_fconst(float value) { } /// @brief called on DCONST_ void do_dconst(double value) { } - /// @brief called on LDC, LDC_W and LDC2_W + /// @brief called on LDC and LDC_W void do_ldc(unsigned index) { } - /// @brief called on ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, - /// ILOAD_, LLOAD_, FLOAD_, DLOAD_, and ALOAD_ - void do_load(JType type, unsigned index) { } - /// @brief called on IALOAD, LALOAD, FALOAD, DALOAD, AALOAD, - /// BALOAD, CALOAD, and SALOAD - void do_aload(JType type) { } - /// @brief called on ISTORE, LSTORE, FSTORE, DSTORE, ASTORE, - /// ISTORE_, LSTORE_, FSTORE_, DSTORE_, and - /// ASTORE_ - void do_store(JType type, unsigned index) { } - /// @brief called on IASTORE, LASTORE, FASTORE, DASTORE, AASTORE, - /// BASTORE, CASTORE, and SASTORE - void do_astore(JType type) { } + /// @brief called on LDC2_W + void do_ldc2(unsigned index) { } + /// @brief called on ILOAD and ILOAD_ + void do_iload(unsigned index) { } + /// @brief called on LLOAD and LLOAD_ + void do_lload(unsigned index) { } + /// @brief called on FLOAD and FLOAD_ + void do_fload(unsigned index) { } + /// @brief called on DLOAD and DLOAD_ + void do_dload(unsigned index) { } + /// @brief called on ALOAD and ALOAD_ + void do_aload(unsigned index) { } + /// @brief called on IALOAD + void do_iaload() { } + /// @brief called on LALOAD + void do_laload() { } + /// @brief called on FALOAD + void do_faload() { } + /// @brief called on DALOAD + void do_daload() { } + /// @brief called on AALOAD + void do_aaload() { } + /// @brief called on BALOAD + void do_baload() { } + /// @brief called on CALOAD + void do_caload() { } + /// @brief called on SALOAD + void do_saload() { } + /// @brief called on ISTORE and ISTORE_ + void do_istore(unsigned index) { } + /// @brief called on LSTORE and LSTORE_ + void do_lstore(unsigned index) { } + /// @brief called on FSTORE and FSTORE_ + void do_fstore(unsigned index) { } + /// @brief called on DSTORE and DSTORE_ + void do_dstore(unsigned index) { } + /// @brief called on ASTORE and ASTORE_ + void do_astore(unsigned index) { } + /// @brief called on IASTORE + void do_iastore() { } + /// @brief called on LASTORE + void do_lastore() { } + /// @brief called on FASTORE + void do_fastore() { } + /// @brief called on DASTORE + void do_dastore() { } + /// @brief called on AASTORE + void do_aastore() { } + /// @brief called on BASTORE + void do_bastore() { } + /// @brief called on CASTORE + void do_castore() { } + /// @brief called on SASTORE + void do_sastore() { } /// @brief called on POP void do_pop() { } /// @brief called on POP2 @@ -644,45 +727,148 @@ void do_dup2_x2() { } /// @brief called on SWAP void do_swap() { } - /// @brief called on IADD, LADD, FADD, and DADD - void do_add() { } - /// @brief called on ISUB, LSUB, FSUB, and DSUB - void do_sub() { } - /// @brief called on IMUL, LMUL, FMUL, and DMUL - void do_mul() { } - /// @brief called on IDIV, LDIV, FDIV, and DDIV - void do_div() { } - /// @brief called on IREM, LREM, FREM, and DREM - void do_rem() { } - /// @brief called on INEG, LNEG, FNEG, and DNEG - void do_neg() { } - /// @brief called on ISHL and LSHL - void do_shl() { } - /// @brief called on ISHR and LSHR - void do_shr() { } - /// @brief called on IUSHR and LUSHR - void do_ushr() { } - /// @brief called on IAND and LAND - void do_and() { } - /// @brief called on IOR or LOR - void do_or() { } - /// @brief called on IXOR and LXOR - void do_xor() { } + /// @brief called on IADD + void do_iadd() { } + /// @brief called on LADD + void do_ladd() { } + /// @brief called on FADD + void do_fadd() { } + /// @brief called on DADD + void do_dadd() { } + /// @brief called on ISUB + void do_isub() { } + /// @brief called on LSUB + void do_lsub() { } + /// @brief called on FSUB + void do_fsub() { } + /// @brief called on DSUB + void do_dsub() { } + /// @brief called on IMUL + void do_imul() { } + /// @brief called on LMUL + void do_lmul() { } + /// @brief called on FMUL + void do_fmul() { } + /// @brief called on DMUL + void do_dmul() { } + /// @brief called on IDIV + void do_idiv() { } + /// @brief called on LDIV + void do_ldiv() { } + /// @brief called on FDIV + void do_fdiv() { } + /// @brief called on DDIV + void do_ddiv() { } + /// @brief called on IREM + void do_irem() { } + /// @brief called on LREM + void do_lrem() { } + /// @brief called on FREM + void do_frem() { } + /// @brief called on DREM + void do_drem() { } + /// @brief called on INEG + void do_ineg() { } + /// @brief called on LNEG + void do_lneg() { } + /// @brief called on FNEG + void do_fneg() { } + /// @brief called on DNEG + void do_dneg() { } + /// @brief called on ISHL + void do_ishl() { } + /// @brief called on LSHL + void do_lshl() { } + /// @brief called on ISHR + void do_ishr() { } + /// @brief called on LSHR + void do_lshr() { } + /// @brief called on IUSHR + void do_iushr() { } + /// @brief called on LUSHR + void do_lushr() { } + /// @brief called on IAND + void do_iand() { } + /// @brief called on LAND + void do_land() { } + /// @brief called on IOR + void do_ior() { } + /// @brief called on LOR + void do_lor() { } + /// @brief called on IXOR + void do_ixor() { } + /// @brief called on LXOR + void do_lxor() { } /// @brief called on IINC void do_iinc(unsigned index, int amount) { } - /// @brief called on I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, - /// F2D, D2I, D2L, D2F, I2B, I2C, and I2S - void do_convert(JType to) { } + /// @brief called on I2L + void do_i2l() { } + /// @brief called on I2F + void do_i2f() { } + /// @brief called on I2D + void do_i2d() { } + /// @brief called on L2I + void do_l2i() { } + /// @brief called on L2F + void do_l2f() { } + /// @brief called on L2D + void do_l2d() { } + /// @brief called on F2I + void do_f2i() { } + /// @brief called on F2L + void do_f2l() { } + /// @brief called on F2D + void do_f2d() { } + /// @brief called on D2I + void do_d2i() { } + /// @brief called on D2L + void do_d2l() { } + /// @brief called on D2F + void do_d2f() { } + /// @brief called on I2B + void do_i2b() { } + /// @brief called on I2C + void do_i2c() { } + /// @brief called on I2S + void do_i2s() { } /// @brief called on LCMP void do_lcmp() { } - /// @brief called on FCMPL and DCMPL - void do_cmpl() { } - /// @brief called on FCMPG and DCMPG - void do_cmpg() { } - /// @brief called on IF, IFNULL, and IFNONNULL - void do_if(JSetCC cc, JType type, unsigned t, unsigned f) { } - /// @brief called on IFCMP and IFACMP - void do_ifcmp(JSetCC cc, unsigned t, unsigned f) { } + /// @brief called on FCMPL + void do_fcmpl() { } + /// @brief called on DCMPL + void do_dcmpl() { } + /// @brief called on FCMPG + void do_fcmpg() { } + /// @brief called on DCMPG + void do_dcmpg() { } + /// @brief called on IFEQ + void do_ifeq(unsigned t, unsigned f) { } + /// @brief called on IFNE + void do_ifne(unsigned t, unsigned f) { } + /// @brief called on IFLT + void do_iflt(unsigned t, unsigned f) { } + /// @brief called on IFGE + void do_ifge(unsigned t, unsigned f) { } + /// @brief called on IFGT + void do_ifgt(unsigned t, unsigned f) { } + /// @brief called on IFLE + void do_ifle(unsigned t, unsigned f) { } + /// @brief called on IF_ICMPEQ + void do_if_icmpeq(unsigned t, unsigned f) { } + /// @brief called on IF_ICMPNE + void do_if_icmpne(unsigned t, unsigned f) { } + /// @brief called on IF_ICMPLT + void do_if_icmplt(unsigned t, unsigned f) { } + /// @brief called on IF_ICMPGE + void do_if_icmpge(unsigned t, unsigned f) { } + /// @brief called on IF_ICMPGT + void do_if_icmpgt(unsigned t, unsigned f) { } + /// @brief called on IF_ICMPLE + void do_if_icmple(unsigned t, unsigned f) { } + /// @brief called on IF_ACMPEQ + void do_if_acmpeq(unsigned t, unsigned f) { } + /// @brief called on IF_ACMPNE + void do_if_acmpne(unsigned t, unsigned f) { } /// @brief called on GOTO and GOTO_W void do_goto(unsigned target) { } /// @brief called on JSR and JSR_W @@ -691,11 +877,18 @@ void do_ret(unsigned index) { } /// @brief called on TABLESWITCH and LOOKUPSWITCH void do_switch(unsigned defTarget, const SwitchCases& sw) { } - /// @brief called on IRETURN, LRETURN, FRETURN, DRETURN and - /// ARETURN - void do_return() { } + /// @brief called on IRETURN + void do_ireturn() { } + /// @brief called on LRETURN + void do_lreturn() { } + /// @brief called on FRETURN + void do_freturn() { } + /// @brief called on DRETURN + void do_dreturn() { } + /// @brief called on ARETURN + void do_areturn() { } /// @brief called on RETURN - void do_return_void() { } + void do_return() { } /// @brief called on GETSTATIC void do_getstatic(unsigned index) { } /// @brief called on PUTSTATIC @@ -732,6 +925,10 @@ void do_monitorexit() { } /// @brief called on MULTIANEWARRAY void do_multianewarray(unsigned index, unsigned dims) { } + /// @brief called on IFNULL + void do_ifnull(unsigned t, unsigned f) { } + /// @brief called on IFNONNULL + void do_ifnonnull(unsigned t, unsigned f) { } }; } } // namespace llvm::Java Index: llvm-java/include/llvm/Java/Bytecode.h diff -u llvm-java/include/llvm/Java/Bytecode.h:1.11 llvm-java/include/llvm/Java/Bytecode.h:1.12 --- llvm-java/include/llvm/Java/Bytecode.h:1.11 Wed Sep 29 13:08:56 2004 +++ llvm-java/include/llvm/Java/Bytecode.h Mon Oct 11 16:51:24 2004 @@ -21,21 +21,18 @@ namespace llvm { namespace Java { - enum JType { - REFERENCE = 0, // this is not defined in the java spec - BOOLEAN = 4, - CHAR = 5, - FLOAT = 6, - DOUBLE = 7, - BYTE = 8, - SHORT = 9, - INT = 10, - LONG = 11, - }; - - namespace Opcode { + enum JType { + BOOLEAN = 4, + CHAR = 5, + FLOAT = 6, + DOUBLE = 7, + BYTE = 8, + SHORT = 9, + INT = 10, + LONG = 11, + }; - enum { + enum Opcode { NOP = 0x00, ACONST_NULL = 0x01, ICONST_M1 = 0x02, @@ -243,8 +240,6 @@ IMPDEP2 = 0xFF, }; - } // namespace Opcode - inline int readSByte(const uint8_t* code, unsigned& i) { return ((int8_t*)code)[++i]; } From lattner at cs.uiuc.edu Mon Oct 11 17:21:27 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 17:21:27 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/BasicBlock.h Function.h GlobalVariable.h Instruction.h Message-ID: <200410112221.RAA08583@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: BasicBlock.h updated: 1.42 -> 1.43 Function.h updated: 1.52 -> 1.53 GlobalVariable.h updated: 1.28 -> 1.29 Instruction.h updated: 1.60 -> 1.61 --- Log message: Add long overdue methods --- Diffs of the changes: (+45 -2) Index: llvm/include/llvm/BasicBlock.h diff -u llvm/include/llvm/BasicBlock.h:1.42 llvm/include/llvm/BasicBlock.h:1.43 --- llvm/include/llvm/BasicBlock.h:1.42 Wed Sep 1 17:55:34 2004 +++ llvm/include/llvm/BasicBlock.h Mon Oct 11 17:21:13 2004 @@ -95,6 +95,18 @@ TerminatorInst *getTerminator(); const TerminatorInst *const getTerminator() const; + /// removeFromParent - This method unlinks 'this' from the containing + /// function, but does not delete it. + /// + void removeFromParent(); + + /// eraseFromParent - This method unlinks 'this' from the containing function + /// and deletes it. + /// + void eraseFromParent(); + + + //===--------------------------------------------------------------------===// /// Instruction iterator methods /// Index: llvm/include/llvm/Function.h diff -u llvm/include/llvm/Function.h:1.52 llvm/include/llvm/Function.h:1.53 --- llvm/include/llvm/Function.h:1.52 Wed Sep 1 17:55:34 2004 +++ llvm/include/llvm/Function.h Mon Oct 11 17:21:13 2004 @@ -114,6 +114,17 @@ setLinkage(ExternalLinkage); } + /// removeFromParent - This method unlinks 'this' from the containing module, + /// but does not delete it. + /// + void removeFromParent(); + + /// eraseFromParent - This method unlinks 'this' from the containing module + /// and deletes it. + /// + void eraseFromParent(); + + // getNext/Prev - Return the next or previous function in the list. These // methods should never be used directly, and are only used to implement the // function list as part of the module. Index: llvm/include/llvm/GlobalVariable.h diff -u llvm/include/llvm/GlobalVariable.h:1.28 llvm/include/llvm/GlobalVariable.h:1.29 --- llvm/include/llvm/GlobalVariable.h:1.28 Sat Jul 17 18:29:46 2004 +++ llvm/include/llvm/GlobalVariable.h Mon Oct 11 17:21:13 2004 @@ -97,6 +97,16 @@ /// bool isConstant() const { return isConstantGlobal; } void setConstant(bool Value) { isConstantGlobal = Value; } + + /// removeFromParent - This method unlinks 'this' from the containing module, + /// but does not delete it. + /// + void removeFromParent(); + + /// eraseFromParent - This method unlinks 'this' from the containing module + /// and deletes it. + /// + void eraseFromParent(); /// Override Constant's implementation of this method so we can /// replace constant initializers. Index: llvm/include/llvm/Instruction.h diff -u llvm/include/llvm/Instruction.h:1.60 llvm/include/llvm/Instruction.h:1.61 --- llvm/include/llvm/Instruction.h:1.60 Sun Jun 27 13:57:34 2004 +++ llvm/include/llvm/Instruction.h Mon Oct 11 17:21:13 2004 @@ -57,6 +57,10 @@ // Specialize setName to handle symbol table majik... virtual void setName(const std::string &name, SymbolTable *ST = 0); + /// mayWriteToMemory - Return true if this instruction may modify memory. + /// + virtual bool mayWriteToMemory() const { return false; } + /// clone() - Create a copy of 'this' instruction that is identical in all /// ways except the following: /// * The instruction has no parent @@ -76,9 +80,15 @@ Instruction *getPrev() { return Prev; } const Instruction *getPrev() const { return Prev; } - /// mayWriteToMemory - Return true if this instruction may modify memory. + /// removeFromParent - This method unlinks 'this' from the containing basic + /// block, but does not delete it. /// - virtual bool mayWriteToMemory() const { return false; } + void removeFromParent(); + + /// eraseFromParent - This method unlinks 'this' from the containing basic + /// block and deletes it. + /// + void eraseFromParent(); // --------------------------------------------------------------------------- /// Subclass classification... getOpcode() returns a member of From lattner at cs.uiuc.edu Mon Oct 11 17:21:50 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 17:21:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/BasicBlock.cpp Function.cpp Globals.cpp Instruction.cpp Message-ID: <200410112221.RAA08599@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: BasicBlock.cpp updated: 1.49 -> 1.50 Function.cpp updated: 1.78 -> 1.79 Globals.cpp updated: 1.6 -> 1.7 Instruction.cpp updated: 1.38 -> 1.39 --- Log message: Implement remove/eraseFromParent methods --- Diffs of the changes: (+33 -2) Index: llvm/lib/VMCore/BasicBlock.cpp diff -u llvm/lib/VMCore/BasicBlock.cpp:1.49 llvm/lib/VMCore/BasicBlock.cpp:1.50 --- llvm/lib/VMCore/BasicBlock.cpp:1.49 Wed Sep 1 17:55:36 2004 +++ llvm/lib/VMCore/BasicBlock.cpp Mon Oct 11 17:21:39 2004 @@ -105,6 +105,15 @@ if (P && hasName()) P->getSymbolTable().insert(this); } +void BasicBlock::removeFromParent() { + getParent()->getBasicBlockList().remove(this); +} + +void BasicBlock::eraseFromParent() { + getParent()->getBasicBlockList().erase(this); +} + + TerminatorInst *BasicBlock::getTerminator() { if (InstList.empty()) return 0; return dyn_cast(&InstList.back()); Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.78 llvm/lib/VMCore/Function.cpp:1.79 --- llvm/lib/VMCore/Function.cpp:1.78 Wed Sep 1 17:55:37 2004 +++ llvm/lib/VMCore/Function.cpp Mon Oct 11 17:21:39 2004 @@ -147,6 +147,14 @@ return getFunctionType()->getReturnType(); } +void Function::removeFromParent() { + getParent()->getFunctionList().remove(this); +} + +void Function::eraseFromParent() { + getParent()->getFunctionList().erase(this); +} + // dropAllReferences() - This function causes all the subinstructions to "let // go" of all references that they are maintaining. This allows one to // 'delete' a whole class at a time, even though there may be circular Index: llvm/lib/VMCore/Globals.cpp diff -u llvm/lib/VMCore/Globals.cpp:1.6 llvm/lib/VMCore/Globals.cpp:1.7 --- llvm/lib/VMCore/Globals.cpp:1.6 Wed Sep 1 17:55:37 2004 +++ llvm/lib/VMCore/Globals.cpp Mon Oct 11 17:21:39 2004 @@ -106,9 +106,16 @@ if (P && hasName()) P->getSymbolTable().insert(this); } +void GlobalVariable::removeFromParent() { + getParent()->getGlobalList().remove(this); +} + +void GlobalVariable::eraseFromParent() { + getParent()->getGlobalList().erase(this); +} + void GlobalVariable::replaceUsesOfWithOnConstant(Value *From, Value *To, - bool DisableChecking ) -{ + bool DisableChecking) { // If you call this, then you better know this GVar has a constant // initializer worth replacing. Enforce that here. assert(getNumOperands() == 1 && Index: llvm/lib/VMCore/Instruction.cpp diff -u llvm/lib/VMCore/Instruction.cpp:1.38 llvm/lib/VMCore/Instruction.cpp:1.39 --- llvm/lib/VMCore/Instruction.cpp:1.38 Wed Sep 1 17:55:37 2004 +++ llvm/lib/VMCore/Instruction.cpp Mon Oct 11 17:21:39 2004 @@ -72,6 +72,13 @@ if (PP && hasName()) PP->getSymbolTable().insert(this); } +void Instruction::removeFromParent() { + getParent()->getInstList().remove(this); +} + +void Instruction::eraseFromParent() { + getParent()->getInstList().erase(this); +} const char *Instruction::getOpcodeName(unsigned OpCode) { switch (OpCode) { From lattner at cs.uiuc.edu Mon Oct 11 17:52:18 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 17:52:18 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Constants.h Message-ID: <200410112252.RAA09817@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.57 -> 1.58 --- Log message: Allow creation of GEP constantexprs with a vector of value* operands as well as a vector of constant*'s. It turns out that this is more efficient and all of the clients want to do that, so we should cater to them. --- Diffs of the changes: (+5 -2) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.57 llvm/include/llvm/Constants.h:1.58 --- llvm/include/llvm/Constants.h:1.57 Wed Sep 1 17:55:34 2004 +++ llvm/include/llvm/Constants.h Mon Oct 11 17:52:01 2004 @@ -533,7 +533,7 @@ static Constant *getSelectTy(const Type *Ty, Constant *C1, Constant *C2, Constant *C3); static Constant *getGetElementPtrTy(const Type *Ty, Constant *C, - const std::vector &IdxList); + const std::vector &IdxList); public: // Static methods to construct a ConstantExpr of different kinds. Note that @@ -584,10 +584,13 @@ static Constant *getUShr(Constant *C1, Constant *C2); // unsigned shr static Constant *getSShr(Constant *C1, Constant *C2); // signed shr - /// Getelementptr form... + /// Getelementptr form. std::vector is only accepted for convenience: + /// all elements must be Constant's. /// static Constant *getGetElementPtr(Constant *C, const std::vector &IdxList); + static Constant *getGetElementPtr(Constant *C, + const std::vector &IdxList); /// isNullValue - Return true if this is the value that would be returned by /// getNullValue. From lattner at cs.uiuc.edu Mon Oct 11 17:52:37 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 17:52:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp ConstantFolding.h Constants.cpp Message-ID: <200410112252.RAA10337@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.63 -> 1.64 ConstantFolding.h updated: 1.42 -> 1.43 Constants.cpp updated: 1.106 -> 1.107 --- Log message: Allow creation of GEP constantexprs with a vector of value* operands as well as a vector of constant*'s. It turns out that this is more efficient and all of the clients want to do that, so we should cater to them. --- Diffs of the changes: (+37 -26) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.63 llvm/lib/VMCore/ConstantFolding.cpp:1.64 --- llvm/lib/VMCore/ConstantFolding.cpp:1.63 Sun Oct 10 22:57:30 2004 +++ llvm/lib/VMCore/ConstantFolding.cpp Mon Oct 11 17:52:25 2004 @@ -905,7 +905,7 @@ if (V2->isNullValue()) return const_cast(V2); // X & 0 == 0 if (CE1->getOpcode() == Instruction::Cast && isa(CE1->getOperand(0))) { - GlobalValue *CPR =cast(CE1->getOperand(0)); + GlobalValue *CPR = cast(CE1->getOperand(0)); // Functions are at least 4-byte aligned. If and'ing the address of a // function with a constant < 4, fold it to zero. @@ -960,21 +960,21 @@ } Constant *llvm::ConstantFoldGetElementPtr(const Constant *C, - const std::vector &IdxList) { + const std::vector &IdxList) { if (IdxList.size() == 0 || - (IdxList.size() == 1 && IdxList[0]->isNullValue())) + (IdxList.size() == 1 && cast(IdxList[0])->isNullValue())) return const_cast(C); + Constant *Idx0 = cast(IdxList[0]); if (C->isNullValue()) { bool isNull = true; for (unsigned i = 0, e = IdxList.size(); i != e; ++i) - if (!IdxList[i]->isNullValue()) { + if (!cast(IdxList[i])->isNullValue()) { isNull = false; break; } if (isNull) { - std::vector VIdxList(IdxList.begin(), IdxList.end()); - const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), VIdxList, + const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), IdxList, true); assert(Ty != 0 && "Invalid indices for GEP!"); return ConstantPointerNull::get(PointerType::get(Ty)); @@ -986,8 +986,8 @@ // gep null, C is equal to C*sizeof(nullty). If nullty is a known llvm // type, we can statically fold this. Constant *R = ConstantUInt::get(Type::UIntTy, ElSize); - R = ConstantExpr::getCast(R, IdxList[0]->getType()); - R = ConstantExpr::getMul(R, IdxList[0]); + R = ConstantExpr::getCast(R, Idx0->getType()); + R = ConstantExpr::getMul(R, Idx0); return ConstantExpr::getCast(R, C->getType()); } } @@ -1004,21 +1004,22 @@ I != E; ++I) LastTy = *I; - if ((LastTy && isa(LastTy)) || IdxList[0]->isNullValue()) { - std::vector NewIndices; + if ((LastTy && isa(LastTy)) || Idx0->isNullValue()) { + std::vector NewIndices; NewIndices.reserve(IdxList.size() + CE->getNumOperands()); for (unsigned i = 1, e = CE->getNumOperands()-1; i != e; ++i) - NewIndices.push_back(cast(CE->getOperand(i))); + NewIndices.push_back(CE->getOperand(i)); // Add the last index of the source with the first index of the new GEP. // Make sure to handle the case when they are actually different types. Constant *Combined = CE->getOperand(CE->getNumOperands()-1); - if (!IdxList[0]->isNullValue()) { // Otherwise it must be an array + // Otherwise it must be an array. + if (!Idx0->isNullValue()) { const Type *IdxTy = Combined->getType(); - if (IdxTy != IdxList[0]->getType()) IdxTy = Type::LongTy; + if (IdxTy != Idx0->getType()) IdxTy = Type::LongTy; Combined = ConstantExpr::get(Instruction::Add, - ConstantExpr::getCast(IdxList[0], IdxTy), + ConstantExpr::getCast(Idx0, IdxTy), ConstantExpr::getCast(Combined, IdxTy)); } @@ -1034,7 +1035,7 @@ // To: int* getelementptr ([3 x int]* %X, long 0, long 0) // if (CE->getOpcode() == Instruction::Cast && IdxList.size() > 1 && - IdxList[0]->isNullValue()) + Idx0->isNullValue()) if (const PointerType *SPT = dyn_cast(CE->getOperand(0)->getType())) if (const ArrayType *SAT = dyn_cast(SPT->getElementType())) Index: llvm/lib/VMCore/ConstantFolding.h diff -u llvm/lib/VMCore/ConstantFolding.h:1.42 llvm/lib/VMCore/ConstantFolding.h:1.43 --- llvm/lib/VMCore/ConstantFolding.h:1.42 Tue Jun 8 12:53:24 2004 +++ llvm/lib/VMCore/ConstantFolding.h Mon Oct 11 17:52:25 2004 @@ -22,6 +22,7 @@ #include namespace llvm { + class Value; class Constant; struct Type; @@ -33,7 +34,7 @@ Constant *ConstantFoldBinaryInstruction(unsigned Opcode, const Constant *V1, const Constant *V2); Constant *ConstantFoldGetElementPtr(const Constant *C, - const std::vector &IdxList); + const std::vector &IdxList); } // End llvm namespace #endif Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.106 llvm/lib/VMCore/Constants.cpp:1.107 --- llvm/lib/VMCore/Constants.cpp:1.106 Tue Sep 14 21:32:15 2004 +++ llvm/lib/VMCore/Constants.cpp Mon Oct 11 17:52:25 2004 @@ -1148,10 +1148,8 @@ break; case Instruction::GetElementPtr: // Make everyone now use a constant of the new type... - std::vector C; - for (unsigned i = 1, e = OldC->getNumOperands(); i != e; ++i) - C.push_back(cast(OldC->getOperand(i))); - New = ConstantExpr::getGetElementPtrTy(NewTy, OldC->getOperand(0), C); + std::vector Idx(OldC->op_begin()+1, OldC->op_end()); + New = ConstantExpr::getGetElementPtrTy(NewTy, OldC->getOperand(0), Idx); break; } @@ -1298,9 +1296,8 @@ Constant *ConstantExpr::getGetElementPtrTy(const Type *ReqTy, Constant *C, - const std::vector &IdxList) { - assert(GetElementPtrInst::getIndexedType(C->getType(), - std::vector(IdxList.begin(), IdxList.end()), true) && + const std::vector &IdxList) { + assert(GetElementPtrInst::getIndexedType(C->getType(), IdxList, true) && "GEP indices invalid!"); if (Constant *FC = ConstantFoldGetElementPtr(C, IdxList)) @@ -1309,9 +1306,12 @@ assert(isa(C->getType()) && "Non-pointer type for constant GetElementPtr expression"); // Look up the constant in the table first to ensure uniqueness - std::vector argVec(1, C); - argVec.insert(argVec.end(), IdxList.begin(), IdxList.end()); - const ExprMapKeyType &Key = std::make_pair(Instruction::GetElementPtr,argVec); + std::vector ArgVec; + ArgVec.reserve(IdxList.size()+1); + ArgVec.push_back(C); + for (unsigned i = 0, e = IdxList.size(); i != e; ++i) + ArgVec.push_back(cast(IdxList[i])); + const ExprMapKeyType &Key = std::make_pair(Instruction::GetElementPtr,ArgVec); return ExprConstants.getOrCreate(ReqTy, Key); } @@ -1323,6 +1323,15 @@ const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), VIdxList, true); assert(Ty && "GEP indices invalid!"); + return getGetElementPtrTy(PointerType::get(Ty), C, VIdxList); +} + +Constant *ConstantExpr::getGetElementPtr(Constant *C, + const std::vector &IdxList) { + // Get the result type of the getelementptr! + const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), IdxList, + true); + assert(Ty && "GEP indices invalid!"); return getGetElementPtrTy(PointerType::get(Ty), C, IdxList); } From lattner at cs.uiuc.edu Mon Oct 11 18:07:03 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 18:07:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Message-ID: <200410112307.SAA16294@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.71 -> 1.72 --- Log message: Handle a common case more carefully. In particular, instead of transforming pointer recurrences into expressions from this: %P_addr.0.i.0 = phi sbyte* [ getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), %entry ], [ %inc.0.i, %no_exit.i ] %inc.0.i = getelementptr sbyte* %P_addr.0.i.0, int 1 ; [#uses=2] into this: %inc.0.i = getelementptr sbyte* getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), int %inc.0.i.rec Actually create something nice, like this: %inc.0.i = getelementptr [8 x sbyte]* %.str_1, int 0, int %inc.0.i.rec --- Diffs of the changes: (+33 -4) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.71 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.72 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.71 Sun Sep 19 23:43:14 2004 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Mon Oct 11 18:06:50 2004 @@ -45,6 +45,7 @@ #include "llvm/Analysis/ScalarEvolutionExpressions.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Transforms/Utils/Local.h" #include "llvm/Support/CommandLine.h" #include "llvm/ADT/Statistic.h" @@ -135,9 +136,9 @@ while (isa(It)) ++It; if (It != BasicBlock::iterator(CI)) { // Splice the cast immediately after the operand in question. - I->getParent()->getInstList().splice(It, - CI->getParent()->getInstList(), - CI); + BasicBlock::InstListType &InstList = + I->getParent()->getInstList(); + InstList.splice(It, InstList, CI); } return CI; } @@ -345,7 +346,7 @@ if (Instruction *U = dyn_cast(I->getOperand(i))) Insts.insert(U); SE->deleteInstructionFromRecords(I); - I->getParent()->getInstList().erase(I); + I->eraseFromParent(); Changed = true; } } @@ -387,6 +388,34 @@ // Update the GEP to use the new recurrence we just inserted. GEPI->setOperand(1, NewAdd); + // If the incoming value is a constant expr GEP, try peeling out the array + // 0 index if possible to make things simpler. + if (ConstantExpr *CE = dyn_cast(GEPI->getOperand(0))) + if (CE->getOpcode() == Instruction::GetElementPtr) { + unsigned NumOps = CE->getNumOperands(); + assert(NumOps > 1 && "CE folding didn't work!"); + if (CE->getOperand(NumOps-1)->isNullValue()) { + // Check to make sure the last index really is an array index. + gep_type_iterator GTI = gep_type_begin(GEPI); + for (unsigned i = 1, e = GEPI->getNumOperands()-1; + i != e; ++i, ++GTI) + /*empty*/; + if (isa(*GTI)) { + // Pull the last index out of the constant expr GEP. + std::vector CEIdxs(CE->op_begin()+1, CE->op_end()-1); + Constant *NCE = ConstantExpr::getGetElementPtr(CE->getOperand(0), + CEIdxs); + GetElementPtrInst *NGEPI = + new GetElementPtrInst(NCE, Constant::getNullValue(Type::IntTy), + NewAdd, GEPI->getName(), GEPI); + GEPI->replaceAllUsesWith(NGEPI); + GEPI->eraseFromParent(); + GEPI = NGEPI; + } + } + } + + // Finally, if there are any other users of the PHI node, we must // insert a new GEP instruction that uses the pre-incremented version // of the induction amount. From lattner at cs.uiuc.edu Mon Oct 11 20:02:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 20:02:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Message-ID: <200410120102.UAA19811@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.72 -> 1.73 --- Log message: Fix a REALLY obscure bug in my previous checkin, which was splicing the END marker from one ilist into the middle of another basic block! --- Diffs of the changes: (+1 -1) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.72 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.73 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.72 Mon Oct 11 18:06:50 2004 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Mon Oct 11 20:02:29 2004 @@ -138,7 +138,7 @@ // Splice the cast immediately after the operand in question. BasicBlock::InstListType &InstList = I->getParent()->getInstList(); - InstList.splice(It, InstList, CI); + InstList.splice(It, CI->getParent()->getInstList(), CI); } return CI; } From lattner at cs.uiuc.edu Mon Oct 11 20:49:41 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 20:49:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp Message-ID: <200410120149.UAA23448@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ScalarEvolution.cpp updated: 1.26 -> 1.27 --- Log message: This nutty patch has been in my tree since before 1.3 went out, and it needs to go in. This patch allows us to compute the trip count of loops controlled by values loaded from constant arrays. The cannonnical example of this is strlen when passed a constant argument: for (int i = 0; "constantstring"[i]; ++i) ; return i; In this case, it will compute that the loop executes 14 times, which means that the exit value of i is 14. Because of this, the loop gets DCE'd and we are happy. This also applies to anything that does similar things, e.g. loops like this: const float Array[] = { 0.1, 2.1, 3.2, 23.21 }; for (int i = 0; Array[i] < 20; ++i) and is actually fairly general. The problem with this is that it almost never triggers. The reason is that we run indvars and the loop optimizer only at compile time, which is before things like strlen and strcpy have been inlined into the program from libc. Because of this, it almost never is used (it triggers twice in specint2k). I'm committing it because it DOES work, may be useful in the future, and doesn't slow us down at all. If/when we start running the loop optimizer at link-time (-O4?) this will be very nice indeed :) --- Diffs of the changes: (+147 -20) Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.26 llvm/lib/Analysis/ScalarEvolution.cpp:1.27 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.26 Sun Oct 10 23:07:27 2004 +++ llvm/lib/Analysis/ScalarEvolution.cpp Mon Oct 11 20:49:27 2004 @@ -62,9 +62,8 @@ #include "llvm/Analysis/ScalarEvolutionExpressions.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" +#include "llvm/GlobalVariable.h" #include "llvm/Instructions.h" -#include "llvm/Type.h" -#include "llvm/Value.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Assembly/Writer.h" #include "llvm/Transforms/Scalar.h" @@ -84,7 +83,11 @@ Statistic<> NumBruteForceEvaluations("scalar-evolution", - "Number of brute force evaluations needed to calculate high-order polynomial exit values"); + "Number of brute force evaluations needed to " + "calculate high-order polynomial exit values"); + Statistic<> + NumArrayLenItCounts("scalar-evolution", + "Number of trip counts computed with array length"); Statistic<> NumTripCountsComputed("scalar-evolution", "Number of loops with predictable loop counts"); @@ -1090,6 +1093,13 @@ /// will iterate. SCEVHandle ComputeIterationCount(const Loop *L); + /// ComputeLoadConstantCompareIterationCount - Given an exit condition of + /// 'setcc load X, cst', try to se if we can compute the trip count. + SCEVHandle ComputeLoadConstantCompareIterationCount(LoadInst *LI, + Constant *RHS, + const Loop *L, + unsigned SetCCOpcode); + /// ComputeIterationCountExhaustively - If the trip is known to execute a /// constant number of times (the condition evolves only from constants), /// try to evaluate a few iterations of the loop until we get the exit @@ -1387,6 +1397,21 @@ return ComputeIterationCountExhaustively(L, ExitBr->getCondition(), ExitBr->getSuccessor(0) == ExitBlock); + // If the condition was exit on true, convert the condition to exit on false. + Instruction::BinaryOps Cond; + if (ExitBr->getSuccessor(1) == ExitBlock) + Cond = ExitCond->getOpcode(); + else + Cond = ExitCond->getInverseCondition(); + + // Handle common loops like: for (X = "string"; *X; ++X) + if (LoadInst *LI = dyn_cast(ExitCond->getOperand(0))) + if (Constant *RHS = dyn_cast(ExitCond->getOperand(1))) { + SCEVHandle ItCnt = + ComputeLoadConstantCompareIterationCount(LI, RHS, L, Cond); + if (!isa(ItCnt)) return ItCnt; + } + SCEVHandle LHS = getSCEV(ExitCond->getOperand(0)); SCEVHandle RHS = getSCEV(ExitCond->getOperand(1)); @@ -1396,13 +1421,6 @@ Tmp = getSCEVAtScope(RHS, L); if (!isa(Tmp)) RHS = Tmp; - // If the condition was exit on true, convert the condition to exit on false. - Instruction::BinaryOps Cond; - if (ExitBr->getSuccessor(1) == ExitBlock) - Cond = ExitCond->getOpcode(); - else - Cond = ExitCond->getInverseCondition(); - // At this point, we would like to compute how many iterations of the loop the // predicate will return true for these inputs. if (isa(LHS) && !isa(RHS)) { @@ -1473,6 +1491,125 @@ ExitBr->getSuccessor(0) == ExitBlock); } +static ConstantInt * +EvaluateConstantChrecAtConstant(const SCEVAddRecExpr *AddRec, Constant *C) { + SCEVHandle InVal = SCEVConstant::get(cast(C)); + SCEVHandle Val = AddRec->evaluateAtIteration(InVal); + assert(isa(Val) && + "Evaluation of SCEV at constant didn't fold correctly?"); + return cast(Val)->getValue(); +} + +/// GetAddressedElementFromGlobal - Given a global variable with an initializer +/// and a GEP expression (missing the pointer index) indexing into it, return +/// the addressed element of the initializer or null if the index expression is +/// invalid. +static Constant * +GetAddressedElementFromGlobal(GlobalVariable *GV, + const std::vector &Indices) { + Constant *Init = GV->getInitializer(); + for (unsigned i = 0, e = Indices.size(); i != e; ++i) { + uint64_t Idx = Indices[i]->getRawValue(); + if (ConstantStruct *CS = dyn_cast(Init)) { + assert(Idx < CS->getNumOperands() && "Bad struct index!"); + Init = cast(CS->getOperand(Idx)); + } else if (ConstantArray *CA = dyn_cast(Init)) { + if (Idx >= CA->getNumOperands()) return 0; // Bogus program + Init = cast(CA->getOperand(Idx)); + } else if (isa(Init)) { + if (const StructType *STy = dyn_cast(Init->getType())) { + assert(Idx < STy->getNumElements() && "Bad struct index!"); + Init = Constant::getNullValue(STy->getElementType(Idx)); + } else if (const ArrayType *ATy = dyn_cast(Init->getType())) { + if (Idx >= ATy->getNumElements()) return 0; // Bogus program + Init = Constant::getNullValue(ATy->getElementType()); + } else { + assert(0 && "Unknown constant aggregate type!"); + } + return 0; + } else { + return 0; // Unknown initializer type + } + } + return Init; +} + +/// ComputeLoadConstantCompareIterationCount - Given an exit condition of +/// 'setcc load X, cst', try to se if we can compute the trip count. +SCEVHandle ScalarEvolutionsImpl:: +ComputeLoadConstantCompareIterationCount(LoadInst *LI, Constant *RHS, + const Loop *L, unsigned SetCCOpcode) { + if (LI->isVolatile()) return UnknownValue; + + // Check to see if the loaded pointer is a getelementptr of a global. + GetElementPtrInst *GEP = dyn_cast(LI->getOperand(0)); + if (!GEP) return UnknownValue; + + // Make sure that it is really a constant global we are gepping, with an + // initializer, and make sure the first IDX is really 0. + GlobalVariable *GV = dyn_cast(GEP->getOperand(0)); + if (!GV || !GV->isConstant() || !GV->hasInitializer() || + GEP->getNumOperands() < 3 || !isa(GEP->getOperand(1)) || + !cast(GEP->getOperand(1))->isNullValue()) + return UnknownValue; + + // Okay, we allow one non-constant index into the GEP instruction. + Value *VarIdx = 0; + std::vector Indexes; + unsigned VarIdxNum = 0; + for (unsigned i = 2, e = GEP->getNumOperands(); i != e; ++i) + if (ConstantInt *CI = dyn_cast(GEP->getOperand(i))) { + Indexes.push_back(CI); + } else if (!isa(GEP->getOperand(i))) { + if (VarIdx) return UnknownValue; // Multiple non-constant idx's. + VarIdx = GEP->getOperand(i); + VarIdxNum = i-2; + Indexes.push_back(0); + } + + // Okay, we know we have a (load (gep GV, 0, X)) comparison with a constant. + // Check to see if X is a loop variant variable value now. + SCEVHandle Idx = getSCEV(VarIdx); + SCEVHandle Tmp = getSCEVAtScope(Idx, L); + if (!isa(Tmp)) Idx = Tmp; + + // We can only recognize very limited forms of loop index expressions, in + // particular, only affine AddRec's like {C1,+,C2}. + SCEVAddRecExpr *IdxExpr = dyn_cast(Idx); + if (!IdxExpr || !IdxExpr->isAffine() || IdxExpr->isLoopInvariant(L) || + !isa(IdxExpr->getOperand(0)) || + !isa(IdxExpr->getOperand(1))) + return UnknownValue; + + unsigned MaxSteps = MaxBruteForceIterations; + for (unsigned IterationNum = 0; IterationNum != MaxSteps; ++IterationNum) { + ConstantUInt *ItCst = + ConstantUInt::get(IdxExpr->getType()->getUnsignedVersion(), IterationNum); + ConstantInt *Val = EvaluateConstantChrecAtConstant(IdxExpr, ItCst); + + // Form the GEP offset. + Indexes[VarIdxNum] = Val; + + Constant *Result = GetAddressedElementFromGlobal(GV, Indexes); + if (Result == 0) break; // Cannot compute! + + // Evaluate the condition for this iteration. + Result = ConstantExpr::get(SetCCOpcode, Result, RHS); + if (!isa(Result)) break; // Couldn't decide for sure + if (Result == ConstantBool::False) { +#if 0 + std::cerr << "\n***\n*** Computed loop count " << *ItCst + << "\n*** From global " << *GV << "*** BB: " << *L->getHeader() + << "***\n"; +#endif + ++NumArrayLenItCounts; + return SCEVConstant::get(ItCst); // Found terminating iteration! + } + } + return UnknownValue; +} + + /// CanConstantFold - Return true if we can constant fold an instruction of the /// specified type, assuming that all operands were constants. static bool CanConstantFold(const Instruction *I) { @@ -1978,16 +2115,6 @@ return UnknownValue; } -static ConstantInt * -EvaluateConstantChrecAtConstant(const SCEVAddRecExpr *AddRec, Constant *C) { - SCEVHandle InVal = SCEVConstant::get(cast(C)); - SCEVHandle Val = AddRec->evaluateAtIteration(InVal); - assert(isa(Val) && - "Evaluation of SCEV at constant didn't fold correctly?"); - return cast(Val)->getValue(); -} - - /// getNumIterationsInRange - Return the number of iterations of this loop that /// produce values in the specified constant range. Another way of looking at /// this is that it returns the first iteration number where the value is not in From lattner at cs.uiuc.edu Mon Oct 11 23:20:39 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 23:20:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Message-ID: <200410120420.XAA25920@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Function.cpp updated: 1.79 -> 1.80 --- Log message: Implement a new method --- Diffs of the changes: (+27 -3) Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.79 llvm/lib/VMCore/Function.cpp:1.80 --- llvm/lib/VMCore/Function.cpp:1.79 Mon Oct 11 17:21:39 2004 +++ llvm/lib/VMCore/Function.cpp Mon Oct 11 23:20:25 2004 @@ -13,10 +13,8 @@ //===----------------------------------------------------------------------===// #include "llvm/Module.h" -#include "llvm/Constant.h" #include "llvm/DerivedTypes.h" -#include "llvm/Instructions.h" -#include "llvm/Intrinsics.h" +#include "llvm/IntrinsicInst.h" #include "llvm/Support/LeakDetector.h" #include "SymbolTableListTraitsImpl.h" using namespace llvm; @@ -265,5 +263,31 @@ return 0; } +Value *MemIntrinsic::StripPointerCasts(Value *Ptr) { + if (ConstantExpr *CE = dyn_cast(Ptr)) { + if (CE->getOpcode() == Instruction::Cast) { + if (isa(CE->getOperand(0)->getType())) + return StripPointerCasts(CE->getOperand(0)); + } else if (CE->getOpcode() == Instruction::GetElementPtr) { + for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i) + if (!CE->getOperand(i)->isNullValue()) + return Ptr; + return StripPointerCasts(CE->getOperand(0)); + } + return Ptr; + } + + if (CastInst *CI = dyn_cast(Ptr)) { + if (isa(CI->getOperand(0)->getType())) + return StripPointerCasts(CI->getOperand(0)); + } else if (GetElementPtrInst *GEP = dyn_cast(Ptr)) { + for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i) + if (!isa(CE->getOperand(i)) || + !cast(CE->getOperand(i))->isNullValue()) + return Ptr; + return StripPointerCasts(CE->getOperand(0)); + } + return Ptr; +} // vim: sw=2 ai From lattner at cs.uiuc.edu Mon Oct 11 23:20:57 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 23:20:57 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/IntrinsicInst.h Message-ID: <200410120420.XAA25928@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: IntrinsicInst.h added (r1.1) --- Log message: New header. Classes can be added as needed. --- Diffs of the changes: (+198 -0) Index: llvm/include/llvm/IntrinsicInst.h diff -c /dev/null llvm/include/llvm/IntrinsicInst.h:1.1 *** /dev/null Mon Oct 11 23:20:56 2004 --- llvm/include/llvm/IntrinsicInst.h Mon Oct 11 23:20:46 2004 *************** *** 0 **** --- 1,198 ---- + //===-- llvm/InstrinsicInst.h - Intrinsic Instruction Wrappers --*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines classes that make it really easy to deal with intrinsic + // functions with the isa/dyncast family of functions. In particular, this + // allows you to do things like: + // + // if (MemCpyInst *MCI = dyn_cast(Inst)) + // ... MCI->getDest() ... MCI->getSource() ... + // + // All intrinsic function calls are instances of the call instruction, so these + // are all subclasses of the CallInst class. Note that none of these classes + // has state or virtual methods, which is an important part of this gross/neat + // hack working. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_INTRINSICINST_H + #define LLVM_INTRINSICINST_H + + #include "llvm/Constants.h" + #include "llvm/Function.h" + #include "llvm/Instructions.h" + #include "llvm/Intrinsics.h" + + namespace llvm { + class IntrinsicInst : public CallInst { + IntrinsicInst(); // DO NOT IMPLEMENT + IntrinsicInst(const IntrinsicInst&); // DO NOT IMPLEMENT + void operator=(const IntrinsicInst&); // DO NOT IMPLEMENT + public: + + /// StripPointerCasts - This static method strips off any unneeded pointer + /// casts from the specified value, returning the original uncasted value. + /// Note that the returned value is guaranteed to have pointer type. + static Value *StripPointerCasts(Value *Ptr); + }; + + + /// MemIntrinsic - This is the common base class for memset/memcpy/memmove. + /// + struct MemIntrinsic : public IntrinsicInst { + Value *getRawDest() const { return const_cast(getOperand(0)); } + + Value *getLength() const { return const_cast(getOperand(2)); } + ConstantInt *getAlignment() const { + return cast(const_cast(getOperand(3))); + } + + /// getDest - This is just like getRawDest, but it strips off any cast + /// instructions that feed it, giving the original input. The returned + /// value is guaranteed to be a pointer. + Value *getDest() const { return StripPointerCasts(getRawDest()); } + + /// set* - Set the specified arguments of the instruction. + /// + void setDest(Value *Ptr) { + assert(getRawDest()->getType() == Ptr->getType() && + "setDest called with pointer of wrong type!"); + setOperand(0, Ptr); + } + + void setLength(Value *L) { + assert(getLength()->getType() == L->getType() && + "setLength called with value of wrong type!"); + setOperand(2, L); + } + void setAlignment(ConstantInt *A) { + assert(getAlignment()->getType() == A->getType() && + "setAlignment called with value of wrong type!"); + setOperand(3, A); + } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const MemIntrinsic *) { return true; } + static inline bool classof(const CallInst *I) { + if (const Function *CF = I->getCalledFunction()) + switch (CF->getIntrinsicID()) { + case Intrinsic::memcpy: + case Intrinsic::memmove: + case Intrinsic::memset: + return true; + default: break; + } + return false; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } + }; + + + /// MemCpyInst - This class wraps the llvm.memcpy intrinsic. + /// + struct MemCpyInst : public MemIntrinsic { + /// get* - Return the arguments to the instruction. + /// + Value *getRawSource() const { return const_cast(getOperand(1)); } + + /// getSource - This is just like getRawSource, but it strips off any cast + /// instructions that feed it, giving the original input. The returned + /// value is guaranteed to be a pointer. + Value *getSource() const { return StripPointerCasts(getRawSource()); } + + + void setSource(Value *Ptr) { + assert(getRawSource()->getType() == Ptr->getType() && + "setSource called with pointer of wrong type!"); + setOperand(1, Ptr); + } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const MemCpyInst *) { return true; } + static inline bool classof(const MemIntrinsic *I) { + return I->getCalledFunction()->getIntrinsicID() == Intrinsic::memcpy; + } + static inline bool classof(const CallInst *I) { + if (const Function *CF = I->getCalledFunction()) + if (CF->getIntrinsicID() == Intrinsic::memcpy) + return true; + return false; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } + }; + + /// MemMoveInst - This class wraps the llvm.memmove intrinsic. + /// + struct MemMoveInst : public MemIntrinsic { + /// get* - Return the arguments to the instruction. + /// + Value *getRawSource() const { return const_cast(getOperand(1)); } + + /// getSource - This is just like getRawSource, but it strips off any cast + /// instructions that feed it, giving the original input. The returned + /// value is guaranteed to be a pointer. + Value *getSource() const { return StripPointerCasts(getRawSource()); } + + void setSource(Value *Ptr) { + assert(getRawSource()->getType() == Ptr->getType() && + "setSource called with pointer of wrong type!"); + setOperand(1, Ptr); + } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const MemMoveInst *) { return true; } + static inline bool classof(const MemIntrinsic *I) { + return I->getCalledFunction()->getIntrinsicID() == Intrinsic::memmove; + } + static inline bool classof(const CallInst *I) { + if (const Function *CF = I->getCalledFunction()) + if (CF->getIntrinsicID() == Intrinsic::memmove) + return true; + return false; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } + }; + + /// MemSetInst - This class wraps the llvm.memcpy intrinsic. + /// + struct MemSetInst : public MemIntrinsic { + /// get* - Return the arguments to the instruction. + /// + Value *getValue() const { return const_cast(getOperand(1)); } + + void setValue(Value *Val) { + assert(getValue()->getType() == Val->getType() && + "setSource called with pointer of wrong type!"); + setOperand(1, Val); + } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const MemSetInst *) { return true; } + static inline bool classof(const MemIntrinsic *I) { + return I->getCalledFunction()->getIntrinsicID() == Intrinsic::memset; + } + static inline bool classof(const CallInst *I) { + if (const Function *CF = I->getCalledFunction()) + if (CF->getIntrinsicID() == Intrinsic::memset) + return true; + return false; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } + }; + } + + #endif From lattner at cs.uiuc.edu Mon Oct 11 23:32:48 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 23:32:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Message-ID: <200410120432.XAA26997@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Function.cpp updated: 1.80 -> 1.81 --- Log message: Minor tweaks --- Diffs of the changes: (+5 -5) Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.80 llvm/lib/VMCore/Function.cpp:1.81 --- llvm/lib/VMCore/Function.cpp:1.80 Mon Oct 11 23:20:25 2004 +++ llvm/lib/VMCore/Function.cpp Mon Oct 11 23:32:37 2004 @@ -263,7 +263,7 @@ return 0; } -Value *MemIntrinsic::StripPointerCasts(Value *Ptr) { +Value *IntrinsicInst::StripPointerCasts(Value *Ptr) { if (ConstantExpr *CE = dyn_cast(Ptr)) { if (CE->getOpcode() == Instruction::Cast) { if (isa(CE->getOperand(0)->getType())) @@ -281,11 +281,11 @@ if (isa(CI->getOperand(0)->getType())) return StripPointerCasts(CI->getOperand(0)); } else if (GetElementPtrInst *GEP = dyn_cast(Ptr)) { - for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i) - if (!isa(CE->getOperand(i)) || - !cast(CE->getOperand(i))->isNullValue()) + for (unsigned i = 1, e = GEP->getNumOperands(); i != e; ++i) + if (!isa(GEP->getOperand(i)) || + !cast(GEP->getOperand(i))->isNullValue()) return Ptr; - return StripPointerCasts(CE->getOperand(0)); + return StripPointerCasts(GEP->getOperand(0)); } return Ptr; } From lattner at cs.uiuc.edu Mon Oct 11 23:45:33 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 23:45:33 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/IntrinsicInst.h Message-ID: <200410120445.XAA27422@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: IntrinsicInst.h updated: 1.1 -> 1.2 --- Log message: Right, calls have Operand#0 == the called function, don't forget this. --- Diffs of the changes: (+12 -12) Index: llvm/include/llvm/IntrinsicInst.h diff -u llvm/include/llvm/IntrinsicInst.h:1.1 llvm/include/llvm/IntrinsicInst.h:1.2 --- llvm/include/llvm/IntrinsicInst.h:1.1 Mon Oct 11 23:20:46 2004 +++ llvm/include/llvm/IntrinsicInst.h Mon Oct 11 23:45:20 2004 @@ -46,11 +46,11 @@ /// MemIntrinsic - This is the common base class for memset/memcpy/memmove. /// struct MemIntrinsic : public IntrinsicInst { - Value *getRawDest() const { return const_cast(getOperand(0)); } + Value *getRawDest() const { return const_cast(getOperand(1)); } - Value *getLength() const { return const_cast(getOperand(2)); } + Value *getLength() const { return const_cast(getOperand(3)); } ConstantInt *getAlignment() const { - return cast(const_cast(getOperand(3))); + return cast(const_cast(getOperand(4))); } /// getDest - This is just like getRawDest, but it strips off any cast @@ -63,18 +63,18 @@ void setDest(Value *Ptr) { assert(getRawDest()->getType() == Ptr->getType() && "setDest called with pointer of wrong type!"); - setOperand(0, Ptr); + setOperand(1, Ptr); } void setLength(Value *L) { assert(getLength()->getType() == L->getType() && "setLength called with value of wrong type!"); - setOperand(2, L); + setOperand(3, L); } void setAlignment(ConstantInt *A) { assert(getAlignment()->getType() == A->getType() && "setAlignment called with value of wrong type!"); - setOperand(3, A); + setOperand(4, A); } // Methods for support type inquiry through isa, cast, and dyn_cast: @@ -101,7 +101,7 @@ struct MemCpyInst : public MemIntrinsic { /// get* - Return the arguments to the instruction. /// - Value *getRawSource() const { return const_cast(getOperand(1)); } + Value *getRawSource() const { return const_cast(getOperand(2)); } /// getSource - This is just like getRawSource, but it strips off any cast /// instructions that feed it, giving the original input. The returned @@ -112,7 +112,7 @@ void setSource(Value *Ptr) { assert(getRawSource()->getType() == Ptr->getType() && "setSource called with pointer of wrong type!"); - setOperand(1, Ptr); + setOperand(2, Ptr); } // Methods for support type inquiry through isa, cast, and dyn_cast: @@ -136,7 +136,7 @@ struct MemMoveInst : public MemIntrinsic { /// get* - Return the arguments to the instruction. /// - Value *getRawSource() const { return const_cast(getOperand(1)); } + Value *getRawSource() const { return const_cast(getOperand(2)); } /// getSource - This is just like getRawSource, but it strips off any cast /// instructions that feed it, giving the original input. The returned @@ -146,7 +146,7 @@ void setSource(Value *Ptr) { assert(getRawSource()->getType() == Ptr->getType() && "setSource called with pointer of wrong type!"); - setOperand(1, Ptr); + setOperand(2, Ptr); } // Methods for support type inquiry through isa, cast, and dyn_cast: @@ -170,12 +170,12 @@ struct MemSetInst : public MemIntrinsic { /// get* - Return the arguments to the instruction. /// - Value *getValue() const { return const_cast(getOperand(1)); } + Value *getValue() const { return const_cast(getOperand(2)); } void setValue(Value *Val) { assert(getValue()->getType() == Val->getType() && "setSource called with pointer of wrong type!"); - setOperand(1, Val); + setOperand(2, Val); } // Methods for support type inquiry through isa, cast, and dyn_cast: From lattner at cs.uiuc.edu Mon Oct 11 23:52:08 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 23:52:08 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/memmove.ll Message-ID: <200410120452.XAA28235@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: memmove.ll added (r1.1) --- Log message: New testcase for memmove -> memcpy transform --- Diffs of the changes: (+23 -0) Index: llvm/test/Regression/Transforms/InstCombine/memmove.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/memmove.ll:1.1 *** /dev/null Mon Oct 11 23:52:05 2004 --- llvm/test/Regression/Transforms/InstCombine/memmove.ll Mon Oct 11 23:51:55 2004 *************** *** 0 **** --- 1,23 ---- + ; This test makes sure that memmove instructions are properly eliminated. + ; + + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'call void %llvm.memmove' + + %S = internal constant [33 x sbyte] c"panic: restorelist inconsistency\00" + + implementation + + declare void %llvm.memmove(sbyte*, sbyte*, uint, uint) + + void %test1(sbyte* %A, sbyte* %B, uint %N) { + ;; 0 bytes -> noop. + call void %llvm.memmove(sbyte* %A, sbyte* %B, uint 0, uint 1) + ret void + } + + void %test2(sbyte *%A, uint %N) { + ;; dest can't alias source since we can't write to source! + call void %llvm.memmove(sbyte* %A, sbyte* getelementptr ([33 x sbyte]* %S, int 0, int 0), + uint %N, uint 1) + ret void + } From lattner at cs.uiuc.edu Mon Oct 11 23:53:03 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 11 Oct 2004 23:53:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200410120453.XAA28268@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.266 -> 1.267 --- Log message: Transform memmove -> memcpy when the source is obviously constant memory. --- Diffs of the changes: (+33 -16) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.266 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.267 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.266 Mon Oct 11 14:40:04 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Oct 11 23:52:52 2004 @@ -35,10 +35,8 @@ #define DEBUG_TYPE "instcombine" #include "llvm/Transforms/Scalar.h" -#include "llvm/Instructions.h" -#include "llvm/Intrinsics.h" +#include "llvm/IntrinsicInst.h" #include "llvm/Pass.h" -#include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/GlobalVariable.h" #include "llvm/Target/TargetData.h" @@ -3094,23 +3092,42 @@ // CallInst simplification // Instruction *InstCombiner::visitCallInst(CallInst &CI) { + // Intrinsics cannot occur in an invoke, so handle them here instead of in // visitCallSite. - if (Function *F = CI.getCalledFunction()) - switch (F->getIntrinsicID()) { - case Intrinsic::memmove: - case Intrinsic::memcpy: - case Intrinsic::memset: - // memmove/cpy/set of zero bytes is a noop. - if (Constant *NumBytes = dyn_cast(CI.getOperand(3))) { - if (NumBytes->isNullValue()) - return EraseInstFromFunction(CI); - } - break; - default: - break; + if (MemIntrinsic *MI = dyn_cast(&CI)) { + bool Changed = false; + + // memmove/cpy/set of zero bytes is a noop. + if (Constant *NumBytes = dyn_cast(MI->getLength())) { + if (NumBytes->isNullValue()) return EraseInstFromFunction(CI); + + // FIXME: Increase alignment here. + + if (ConstantInt *CI = dyn_cast(NumBytes)) + if (CI->getRawValue() == 1) { + // Replace the instruction with just byte operations. We would + // transform other cases to loads/stores, but we don't know if + // alignment is sufficient. + } } + // If we have a memmove and the source operation is a constant global, + // then the source and dest pointers can't alias, so we can change this + // into a call to memcpy. + if (MemMoveInst *MMI = dyn_cast(MI)) + if (GlobalVariable *GVSrc = dyn_cast(MMI->getSource())) + if (GVSrc->isConstant()) { + Module *M = CI.getParent()->getParent()->getParent(); + Function *MemCpy = M->getOrInsertFunction("llvm.memcpy", + CI.getCalledFunction()->getFunctionType()); + CI.setOperand(0, MemCpy); + Changed = true; + } + + if (Changed) return &CI; + } + return visitCallSite(&CI); } From lattner at cs.uiuc.edu Tue Oct 12 11:10:53 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 12 Oct 2004 11:10:53 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/IntervalIterator.h Message-ID: <200410121610.LAA02478@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: IntervalIterator.h updated: 1.18 -> 1.19 --- Log message: Add std:: prefix for compilers without correct koenig lookup implemented. Patch contributed by Paolo Invernizzi --- Diffs of the changes: (+2 -2) Index: llvm/include/llvm/Analysis/IntervalIterator.h diff -u llvm/include/llvm/Analysis/IntervalIterator.h:1.18 llvm/include/llvm/Analysis/IntervalIterator.h:1.19 --- llvm/include/llvm/Analysis/IntervalIterator.h:1.18 Fri Sep 3 13:19:51 2004 +++ llvm/include/llvm/Analysis/IntervalIterator.h Tue Oct 12 11:10:39 2004 @@ -220,8 +220,8 @@ if (Int->isSuccessor(NodeHeader)) { // If we were in the successor list from before... remove from succ list - Int->Successors.erase(remove(Int->Successors.begin(), - Int->Successors.end(), NodeHeader), + Int->Successors.erase(std::remove(Int->Successors.begin(), + Int->Successors.end(), NodeHeader), Int->Successors.end()); } From lattner at cs.uiuc.edu Tue Oct 12 11:21:32 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 12 Oct 2004 11:21:32 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/AsmWriterEmitter.cpp Message-ID: <200410121621.LAA06766@apoc.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: AsmWriterEmitter.cpp updated: 1.8 -> 1.9 --- Log message: Don't emit the method into the llvm namespace, let the #includer decide where it goes --- Diffs of the changes: (+0 -2) Index: llvm/utils/TableGen/AsmWriterEmitter.cpp diff -u llvm/utils/TableGen/AsmWriterEmitter.cpp:1.8 llvm/utils/TableGen/AsmWriterEmitter.cpp:1.9 --- llvm/utils/TableGen/AsmWriterEmitter.cpp:1.8 Sun Oct 3 15:19:02 2004 +++ llvm/utils/TableGen/AsmWriterEmitter.cpp Tue Oct 12 11:21:18 2004 @@ -27,7 +27,6 @@ void AsmWriterEmitter::run(std::ostream &O) { EmitSourceFileHeader("Assembly Writer Source Fragment", O); - O << "namespace llvm {\n\n"; CodeGenTarget Target; Record *AsmWriter = Target.getAsmWriter(); @@ -140,5 +139,4 @@ O << " }\n" " return true;\n" "}\n"; - O << "} // End llvm namespace \n"; } From gaeke at cs.uiuc.edu Tue Oct 12 11:41:06 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 12 Oct 2004 11:41:06 -0500 Subject: [llvm-commits] CVS: reopt/docs/ Message-ID: <200410121641.LAA28164@zion.cs.uiuc.edu> Changes in directory reopt/docs: --- Log message: Directory /home/vadve/shared/InternalCVS/reopt/docs added to the repository --- Diffs of the changes: (+0 -0) From gaeke at cs.uiuc.edu Tue Oct 12 11:41:51 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 12 Oct 2004 11:41:51 -0500 Subject: [llvm-commits] CVS: reopt/docs/ReoptUsersGuide.rtf Message-ID: <200410121641.LAA28248@zion.cs.uiuc.edu> Changes in directory reopt/docs: ReoptUsersGuide.rtf added (r1.1) --- Log message: Reoptimizer user's guide. This is currently a work in progress. --- Diffs of the changes: (+517 -0) Index: reopt/docs/ReoptUsersGuide.rtf diff -c /dev/null reopt/docs/ReoptUsersGuide.rtf:1.1 *** /dev/null Tue Oct 12 11:41:50 2004 --- reopt/docs/ReoptUsersGuide.rtf Tue Oct 12 11:41:40 2004 *************** *** 0 **** --- 1,517 ---- + {\rtf1\mac\ansicpg10000\cocoartf102 + {\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fmodern\fcharset77 Courier; + \f3\fmodern\fcharset77 Courier-Oblique;\f4\fswiss\fcharset77 Helvetica-Oblique;\f5\fmodern\fcharset77 Courier-Bold; + } + {\colortbl;\red255\green255\blue255;} + \margl1440\margr1440\vieww12000\viewh17160\viewkind0 + \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + + \f0\fs24 \cf0 Reoptimizer User's Guide\ + October 2004\ + Brian Gaeke\ + \ + + \f1\b \ul Table of Contents\ + + \f0\b0 \ulnone \ + Building the reoptimizer from source\ + Running the reoptimizer on a program in the llvm-test module + \f2 \ + + \f0 Options recognized by the + \f2 "run-tests" + \f0 script\ + Running the reoptimizer on an arbitrary program\ + The + \f2 LLVM_REOPT + \f0 environment variable\ + Instrumentation/Tracing Framework options\ + Phase detection options\ + Trace layout engine options\ + Trace optimizer options\ + Trace cache options\ + Debugging options\ + Statistics gathering options\ + Help options\ + How the trace optimizer works\ + 1. The trace optimizer\ + 2. TraceToFunction ( + \f2 reopt/lib/TraceToFunction + \f0 )\ + 3. Trace Optimizations and JIT ( + \f2 reopt/lib/TraceJIT + \f0 )\ + 4. UnpackTraceFunction ( + \f2 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp + \f0 )\ + 5. Machine-code emission ( + \f2 reopt/lib/TraceJIT/TraceJITEmitter.cpp + \f0 )\ + Tips for debugging the reoptimizer\ + Reoptimizer testing tools\ + The Trace I/O library ( + \f2 reopt/lib/TraceIO + \f0 )\ + + \f2 ttftest + \f0 - a standalone TraceToFunction testing tool ( + \f2 reopt/tools/ttftest + \f0 )\ + + \f2 dumptrace + \f0 - list LLVM assembly for a trace's basic blocks ( + \f2 reopt/tools/dumptrace + \f0 )\ + Known problems with the current implementation\ + UnpackTraceFunction generates inefficient code\ + TraceJITEmitter is poorly integrated with the TraceCache\ + \ + + \f1\b \ul Building the reoptimizer from source + \f0\b0 \ul \ + \ulnone \ + 1. Check out a fresh llvm tree, along with the repository of test programs.\ + + \f2 % cvs -d /home/vadve/shared/PublicCVS co llvm\ + % cd llvm/projects\ + % cvs -d /home/vadve/shared/PublicCVS co llvm-test\ + + \f0 2. Check out the reopt module from the internal CVS repository into the llvm/projects subdirectory, creating llvm/projects/reopt.\ + + \f2 % cvs -d /home/vadve/shared/InternalCVS co reopt\ + + \f0 3. Configure and build the system in release mode (or debug mode if you want to try to fix bugs).\ + + \f2 % cd ../..\ + % ./configure + \f3\i [configure args]\ + + \f2\i0 % cd llvm/projects/reopt && ./configure\ + % cd ../..\ + % gmake ENABLE_OPTIMIZED=1\ + + \f4\i or\ + + \f2\i0 % gmake\ + + \f0 \ + + \f1\b \ul Running the reoptimizer on a program in the llvm-test module + \f0\b0 \ul \ + \ulnone \ + There is a script called + \f2 "run-tests" + \f0 in the reopt/test subdirectory, which is essentially a wrapper around + \f2 "gmake TEST=reopt" + \f0 . It knows a canned set of tests by some symbolic names I have invented. For example, two equivalent ways to run the Shootout tests are as follows:\ + + \f2 % gmake TEST=reopt SUBDIR=SingleSource/Benchmarks/Shootout\ + \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + + \f4\i \cf0 or + \f2\i0 \ + % ./run-tests shootout\ + \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + + \f0 \cf0 ...within the reopt/test directory. Both of these commands perform three tasks: first, run the ordinary llc-compiled, non-instrumented version of each Shootout program; second: run the reoptimized version; third: compare the results.\ + \ + You can get a list of the symbolic names known by the + \f2 "run-tests" + \f0 script by typing:\ + + \f2 % ./run-tests -list\ + \ + \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + + \f1\b \cf0 \ul \ulc0 Options recognized by the + \f5 \ul "run-tests" + \f1 \ul script + \f0\b0 \ul \ + \ulnone \ + -list + \f2 + \f0 Show the list of known benchmarks.\ + \ + -clean + \f4\i + \f0\i0 Erase reoptimizer-instrumented program and its output.\ + \ + -clean -output + \f4\i + \f0\i0 Erase reoptimizer-instrumented program's output only, so that\ + you can re-run the reoptimizer on a program without rebuilding it.\ + \ + -debug + \f4\i + \f0\i0 Try to automatically start gdb on the reoptimized version\ + of . Sometimes this doesn't work, because the\ + shell script can't parse the llvm-test makefiles very well.\ + \ + -test + \f4\i + \f0\i0 This is the default option. It runs the using\ + the ordinary llc-compiled, non-instrumented version and\ + compares its output with the output from the reoptimized\ + version, by using GNU make (as described above).\ + \ + -skiptrace= + \f4\i N + \f3 + \f0\i0 When combined with + \f2 -test + \f0 or + \f2 -debug + \f0 , this modifies your \ + + \f2 LLVM_REOPT + \f0 environment variable to tell the reoptimizer \ + that it should skip the trace numbered + \f3\i N + \f0\i0 . You can see the \ + trace numberings by running in debug mode with + \f2 LLVM_REOPT + \f0 \ + set to + \f2 '--debug --enable-trace-opt' + \f0 .\ + \ + -release + \f2 + \f0 When combined with + \f2 -test + \f0 , this runs the reoptimizer in \ + release mode. You must have already built your LLVM tree \ + with + \f2 'gmake ENABLE_OPTIMIZED=1' + \f0 . This option works by \ + causing GNU make to be run with parameters\ + + \f2 'TEST=reopt ENABLE_OPTIMIZED=1' + \f0 .\ + \ + -lps + \f2 + \f0 When combined with + \f2 -test + \f0 , runs Olden benchmarks with \ + + \f2 LARGE_PROBLEM_SIZE + \f0 enabled.\ + \ + + \f1\b \ul Running the reoptimizer on an arbitrary program + \f0\b0 \ul \ + \ulnone \ + 1. Assume you have a whole program which has been compiled and linked in bytecode form using the standard LLVM toolchain (llvm-gcc, gccas, gccld) in the file named + \f2 'prog.llvm.bc' + \f0 . \ + \ + 2. The first thing you have to do is run the reoptimizer's first-level instrumentation passes and generate SparcV9 assembly code for the program. You use the + \f2 'reopt-llc' + \f0 tool, located in the reopt/tools subdirectory, to do this. The following command generates instrumented SparcV9 assembly for + \f2 'prog.llvm.bc' + \f0 in the file + \f2 'prog.reopt.s' + \f0 :\ + \ + + \f2 % reopt-llc -enable-correct-eh-support -o=prog.reopt.s prog.llvm.bc\ + + \f0 \ + If you are sure that the program does not depend on the proper behavior of setjmp/longjmp calls or invoke/unwind instructions, you can omit the + \f2 '-enable-correct-eh-support' + \f0 flag.\ + \ + 3. The next step is to link the program into an executable along with the LLVM libraries that constitute the reoptimizer, as well as any other system libraries that the program needs. The reoptimizer's build process builds a single file ( + \f2 libwholereoptimizer.a + \f0 ) containing all the LLVM libraries you need, but you also need to link in the following libraries on Solaris: + \f2 '-lcpc -lm -lrt -lmalloc -ldl' + \f0 . You also need to link the program using the C++ compiler. So the link line will look like this:\ + \ + + \f2 % g++ -o prog.reopt prog.reopt.s + \f3\i REOPTLIB + \f2\i0 /libwholereoptimizer.a + \f3\i OTHERLIBS + \f2\i0 -lcpc -lm -lrt -lmalloc -ldl\ + + \f0 \ + where + \f3\i REOPTLIB + \f0\i0 is the full path to the + \f2 'llvm/projects/reopt/lib/Release' + \f0 (or + \f2 'Debug' + \f0 ) directory containing your freshly-built reoptimizer libraries, and + \f3\i OTHERLIBS + \f0\i0 names any other system libraries needed (e.g., + \f2 '-ljpeg' + \f0 ) by the program under consideration.\ + \ + 4. Now, you should set your + \f2 LLVM_REOPT + \f0 environment variable to contain any command-line options you want to pass to the reoptimizer. The most important ones are + \f2 '--debug' + \f0 , to turn on debugging printouts, and + \f2 '--enable-trace-opt' + \f0 , to enable the trace optimizer. (Without the latter option, the original trace layout engine is used.)\ + \ + A full list of + \f2 LLVM_REOPT + \f0 settings follows in the next section.\ + \ + 5. Finally, you can run the program with any arguments and/or input files that the normal, non-instrumented version of the program would have accepted.\ + \ + + \f1\b \ul The + \f5 \ul LLVM_REOPT + \f1 \ul environment variable + \f0\b0 \ul \ + \ulnone \ + The reoptimizer has several tunable parameters and settings which are controlled by the + \f2 LLVM_REOPT + \f0 environment variable. For a few of the tunable parameters relating to the trace cache and instrumentation, it may be helpful to look at Anand's thesis for guidance. The list of options that pertain to the reoptimizer is as follows:\ + \ + \ul Instrumentation/Tracing Framework options\ulnone \ + -fli-threshold= + \f4\i count + \f0\i0 Number of times FLI must trigger before attempting SLI\ + -sli-threshold= + \f4\i count + \f0\i0 Number of iterations of SLI before path counters are sampled\ + \ + \ul Phase detection options\ulnone \ + -enable-phase-detect Use a timer interrupt to remove traces periodically from the trace cache\ + -timer-int-s= + \f4\i seconds + \f0\i0 Interval (in seconds) between phase detection sweeps\ + \ + \ul Trace layout engine options\ulnone \ + -count-trace-cycles Count cycles in optimized trace, when using trace layout engine\ + \ + \ul Trace optimizer options\ulnone \ + -enable-trace-opt Use the new trace optimizer instead of the old trace layout engine\ + -run-opt-passes Run optimization passes before unpacking TraceFunction\ + \ + \ul Trace cache options\ulnone \ + -inst-trace-cache-size= + \f4\i size + \f0\i0 Trace cache size for SLI-instrumented code\ + -opt-trace-cache-size= + \f4\i size + \f0\i0 Trace cache size for optimized code\ + \ + \ul Debugging options\ulnone \ + -print-machineinstrs Print generated machine code\ + -skip-trace= + \f4\i n + \f0\i0 Don't optimize the + \f4\i n + \f0\i0 th trace, when using trace optimizer\ + -debug Turn on debugging printouts\ + -dregalloc=y Turn on SparcV9 register allocator debugging printouts\ + \ + \ul Statistics gathering options\ulnone \ + -stats Enable statistics output from program\ + -time-passes Time each pass, printing elapsed time for each on exit\ + \ + \ul Help options\ulnone \ + -version Display the version of LLVM used\ + -help Display available options (-help-hidden for more)\ + \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + \cf0 \ + + \f1\b \ul How the trace optimizer works + \f0\b0 \ulnone \ + \ + \ul 1. The trace optimizer\ulnone \ + \ + The trace optimizer is the component of the reoptimizer (LLVM's runtime optimization framework) that consumes traces generated by the runtime profiler, converts them into functions, runs global optimizations on them, and then reattaches the optimized trace code back to the original function it came from.\ + \ + The trace optimizer's input is an LLVM Trace object, which is essentially a wrapper around a collection of LLVM BasicBlocks from a given Function. It is agnostic as to the particular method of trace generation -- that is, it should be possible to take any given runtime profiling implementation and use it to identify hot regions to optimize using the trace optimizer.\ + \ + Traces given to the trace optimizer should consist of a loop body with one or more side exits. In particular, there should be phi nodes at the beginning of the first trace BasicBlock for variables live across loop iterations; these are detected and handled specially by TraceToFunction.\ + \ + \ul 2. TraceToFunction ( + \f2 \ul reopt/lib/TraceToFunction + \f0 \ul )\ulnone \ + \ + The first pass that runs over newly-identified Traces is the TraceToFunction pass, also known as the TraceFunctionBuilder. TraceToFunction has three major goals: first, to find the live-in and live-out sets from the trace; second, to remove the reoptimizer's first-level loop instrumentation from the trace, if it is found; and third, to construct a function containing the same code as the trace. This function is called the TraceFunction, and it is the principal output of the TraceToFunction pass.\ + \ + A TraceFunction has several components besides the newly-generated LLVM Function containing the trace code. It also contains a pointer to the original LLVM Function which the trace came from; this is known as the trace's "matrix function". It also contains the trace's live-in and live-out sets (represented as vectors of LLVM Values), and mapping information relating LLVM Values in the matrix function to those in the TraceFunction. Also, since live-in and live-out values are expressed as arguments to the TraceFunction, there are separate maps that relate the TraceFunction's arguments to the live values that they represent.\ + \ + \ul 3. Trace Optimizations and JIT ( + \f2 \ul reopt/lib/TraceJIT + \f0 \ul )\ulnone \ + \ + After the TraceFunction is built, the Trace JIT gains control. Its job is to run a specified list of global optimizations on the trace and then generate LLVM machine code (i.e., a MachineFunction) for the trace using the standard LLVM just-in-time compilation passes.\ + \ + The optimizations that are run by the Trace JIT are listed in the TraceJITOpts.cpp source file. By default, presently no optimization passes are run unless you specify the + \f2 '--run-opt-passes' + \f0 flag in your + \f2 LLVM_REOPT + \f0 environment variable (see "The + \f2 LLVM_REOPT + \f0 environment variable" section, below). \ + \ + After the Trace JIT generates machine code for the newly-optimized trace, it uses UnpackTraceFunction to reattach the optimized trace's code to its matrix function, and then it uses the Trace JIT Emitter to emit the machine code into the trace cache.\ + \ + \ul 4. UnpackTraceFunction ( + \f2 \ul reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp + \f0 \ul )\ulnone \ + \ + UnpackTraceFunction sets up a stack frame for the optimized trace and generates move instructions to copy each live-in/out value from its register allocated in the matrix function to/from its register allocated in the trace function. It also generates branch instructions to return control from each trace exit to the original (untraced) basic block which would have been its (off-trace) successor, replacing the LLVM "ret" instructions used by TraceToFunction to represent trace exits. Instances where an LLVM Value has been replaced with a constant must sometimes be treated specially, because constants are not typically allocated to registers. UnpackTraceFunction is also responsible for performing phi-elimination along trace exit edges, if it detects that a trace exit branch would immediately be followed by an LLVM phi instruction.\ + \ + \ul 5. Machine-code emission ( + \f2 \ul reopt/lib/TraceJIT/TraceJITEmitter.cpp + \f0 \ul )\ulnone \ + \ + The unpacked trace code is emitted into the memory used by the trace cache using the VirtualMem abstraction, which implements reads and writes into the process's executable address space using the /proc filesystem. Once the trace has been emitted, the beginning of the SLI trace is overwritten with a branch to the beginning of the optimized trace, effectively disabling the SLI trace from further execution and enabling the optimized trace instead; control then returns from the second-level trigger function, which is invariably followed by a branch into the optimized trace.\ + \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + \cf0 \ + + \f1\b \ul Tips for debugging the reoptimizer + \f0\b0 \ul \ + \ulnone \ + 1. It is useful to provide the + \f2 '-dregalloc=y -print-machineinstrs' + \f0 flags to + \f2 reopt-llc + \f0 , and save the output, so that you can look up the registers to which LLVM Values were allocated when you are single-stepping through traces.\ + \ + 2. Set your + \f2 LLVM_REOPT + \f0 environment variable to include the + \f2 '-debug -dregalloc=y -print-machineinstrs' + \f0 flags. This will allow you to see the machine code before and after it has registers allocated and before and after the trace is unpacked into its parent function.\ + \ + 3. Run the reoptimized binary under gdb, and set a breakpoint at the symbol + \f2 'TraceOptimizerDone' + \f0 . This function, in RuntimeOptimizations.cpp, is called just after a trace is emitted into the trace cache, and just before the trace optimizer returns control to the program. It prints out gdb commands to disassemble the optimized trace and to set a breakpoint at the beginning of the optimized trace. It also prints out the sequence number of the trace, so that you can use the + \f2 LLVM_REOPT + \f0 + \f2 '-skip-trace' + \f0 option to skip the trace in a future execution.\ + \ + 4. When you crash in a given trace, try using the + \f2 LLVM_REOPT '-skip-trace' + \f0 option to skip that trace. You could also try skipping the last trace that was generated. If you crash outside a trace, try skipping the last trace that was executed (if you can figure out which one it was).\ + \ + + \f1\b \ul Reoptimizer testing tools + \f0\b0 \ulnone \ + \ + \ul The Trace I/O library ( + \f2 \ul reopt/lib/TraceIO + \f0 \ul )\ulnone \ + \ + Normally, traces live only in memory and are discarded when a reoptimized program exits. The Trace I/O library is provided to allow the reoptimizer to save (serialize) traces into files so that they can be reloaded for offline analysis later. The Trace I/O library contains two important functions: + \f2 ReadTraceFromFile + \f0 and + \f2 WriteTraceToFile + \f0 . Writing a trace out to disk actually produces two files in the current implementation: (1) an LLVM bytecode file representing the module containing the trace's matrix function, and (2) a text file containing the name of the trace's matrix function and the integer indices of the basic blocks that make up the trace.\ + \ + When the trace optimizer is compiled in Debug mode and enabled using + \f2 LLVM_REOPT='--enable-trace-opt --debug' + \f0 , it will write out every trace using the Trace I/O library. The filenames used match the pattern + \f2 ' + \f3\i matrixfn + \f2\i0 .trace + \f3\i N + \f2\i0 . + \f3\i ext + \f2\i0 ' + \f0 where + \f3\i matrixfn + \f0\i0 is the name of the trace's matrix function, + \f3\i N + \f0\i0 is the number of the trace as used by the + \f2 LLVM_REOPT='--skip-trace' + \f0 option (q.v.), and + \f3\i ext + \f0\i0 is + \f2 'bc' + \f0 for the bytecode file and + \f2 'txt' + \f0 for the text file.\ + \ + + \f2 \ul ttftest + \f0 \ul - a standalone TraceToFunction testing tool \ul \ulc0 ( + \f2 \ul reopt/tools/ttftest + \f0 \ul )\ulnone \ + \ + There are two meaningful things you can do with serialized traces in the current reoptimizer framework. First, you can run TraceToFunction on a trace independently of the rest of the reoptimizer, using a tool called + \f2 ttftest + \f0 . Because TraceToFunction is machine-independent, + \f2 ttftest + \f0 should run correctly on any system capable of running LLVM. ttftest has a few important command-line options, the first two of which are required:\ + \ + -bc= + \f4\i bytecodeFileName + \f0\i0 Name of file containing module\ + -trace= + \f4\i traceFileName + \f0\i0 Name of file containing trace\ + \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + \cf0 -print-live Print live-in/out sets computed by TraceToFunction\ + \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + \cf0 \ + + \f2 ttftest + \f0 will also run the LLVM Verifier on the TraceFunction, and exit with an exit code of 0 if the verifier passes. This is the basic strategy used for the automated TraceToFunction regression tests ( + \f2 reopt/test/TTFTestCases + \f0 and + \f2 reopt/test/TTFTestHarness.pl + \f0 ). The test harness assembles each module, runs ttftest on each of the module's traces in turn, and prints a summary of the number of test cases on which TraceToFunction produced bad LLVM code--naturally, this should always be zero!\ + \ + + \f2 \ul dumptrace + \f0 \ul - list LLVM assembly for a trace's basic blocks\ul \ulc0 ( + \f2 \ul reopt/tools/dumptrace + \f0 \ul )\ulnone \ + \ + If you just want to look at the assembly code for the basic blocks on a trace, the easiest way is to use the + \f2 dumptrace + \f0 tool. Instead of showing you the integer indices of the basic blocks on the trace, it will print out the LLVM assembly code for the basic blocks, in the order they are specified in the trace file.\ + \ + \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + + \f2 \cf0 dumptrace + \f0 also highlights two sets of values for your inspection: the values used on the trace which are defined outside the trace, and the values defined inside the trace which are used outside the trace. (Note that these are often subsets of the live-in/out sets computed by TraceToFunction; if you want to see those, use + \f2 ttftest -print-live + \f0 .)\ + \ + \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + + \f2 \cf0 dumptrace + \f0 requires the same + \f2 -bc + \f0 and + \f2 -trace + \f0 command line options required by + \f2 ttftest + \f0 ; see the previous section for details.\ + \ + + \f1\b \ul Known problems with the current implementation\ + + \f0\b0 \ulnone \ + \ul UnpackTraceFunction generates inefficient code\ulnone \ + \ + The machine code generated by the JIT for a TraceFunction assumes that live-in values and pointers to live-out values will be passed in as arguments according to the SparcV9/Solaris ABI's standard calling conventions. Also, the registers allocated to values in the TraceFunction have no relation to the registers allocated to the same values in the matrix function. These two facts pose problems for the efficient integration of optimized trace machine code into the function from which the trace was extracted.\ + \ + We intended UnpackTraceFunction to implement an efficient calling convention for traces that did not require moving values around into specific registers for the purposes of argument passing: essentially, we hoped that the TraceFunction's code could be generated to use the same register for each live-in/out value that its matrix function used for that value. Theoretically, the SparcV9 target's graph-coloring register allocator could be instructed to use a mechanism known as "suggested colorings" to provide this functionality on a best-effort basis -- that is, allocating a live-in or live-out value the matrix function's register for that value when possible, and allocating some other register (and emitting a move) in the case of a conflict.\ + \ + Currently UnpackTraceFunction does not provide any special instructions to the register allocator, and so it must generate moves for substantially all live-in/out values. Also, the register allocator does not always make the same live-range coalescing decisions for the TraceFunction that it did for the matrix function, so there is a chance, for example, that two values which were allocated to the same register (coalesced) in the matrix function will not be allocated to the same register in the TraceFunction.\ + \ + Also, UnpackTraceFunction must be careful to avoid read-after-write errors when copying trace live-in values from their matrix-function registers to their TraceFunction registers, if the two sets of registers overlap. We currently work around this problem by emitting stores of each trace live-in value onto the TraceFunction's stack, then (after all the loads) emitting loads of each live-in value into its TraceFunction register. This works correctly but is slow. A similar situation exists at trace exits (epilogs) with respect to live-out values. It should be possible to use a temporary register to accomplish the same thing, if you are careful with the ordering of reads and writes.\ + \ + \ul TraceJITEmitter is poorly integrated with the TraceCache\ulnone \ + \ + In the current implementation of the TraceJITEmitter, the TraceCache does not keep track of individual traces when the trace JIT emitter inserts them, and so it cannot evict them. This deficiency exists primarily for two reasons: (1) the TraceCache wants to accept a trace in the form of a vector of binary words of machine code, and then perform fixups (e.g., to the PC-relative immediate fields of branch instructions) on its own, and therefore (2) the TraceCache wants to know the addresses of all branch and call instructions, information which the TraceJITEmitter does not have handy.\ + \ + Strategy (1) does not interact well with the target-independent JIT, which uses callbacks into the TraceJITEmitter to fixup backward branches. It might be possible to pass empty lists of branches and calls to the TraceCache to make it skip its fixup steps. It might also be possible to change the TraceJITEmitter to emit into a temporary buffer, and then build up a vector of machine words from that and pass it off to the TraceCache. Care must be taken to avoid introducing unnecessary overhead due to copying. Currently, the TraceJITEmitter directly emits code into the memory used by the TraceCache, which is correct and reasonably efficient, but does not give the TraceCache any meaningful control over its own contents.\ + \ + In the long term, we want to change the target-independent JIT code to output pieces of machine code and lists of relocations (fixups) on the side, which also happens to be more like what the TraceCache wants -- this would make it possible to cache JIT translations at a per-function granularity, for example.\ + } \ No newline at end of file From lattner at cs.uiuc.edu Tue Oct 12 11:52:20 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 12 Oct 2004 11:52:20 -0500 Subject: [llvm-commits] CVS: poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp Message-ID: <200410121652.LAA08117@apoc.cs.uiuc.edu> Changes in directory poolalloc/lib/PoolAllocate: EquivClassGraphs.cpp updated: 1.3 -> 1.4 --- Log message: Minor cleanups: * fit in 80 lines * Eliminate extra namespaces * Drop llvm:: --- Diffs of the changes: (+20 -23) Index: poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp diff -u poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.3 poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.4 --- poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.3 Mon Oct 11 15:53:28 2004 +++ poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp Tue Oct 12 11:52:09 2004 @@ -28,26 +28,20 @@ #include "llvm/ADT/STLExtras.h" using namespace llvm; -namespace llvm { - namespace PA { - Statistic<> NumFoldGraphInlines("Inline equiv-class graphs bottom up", - "Number of graphs inlined"); - - } // End PA namespace -} // End llvm namespace - - namespace { - RegisterAnalysis X("equivdatastructure", + RegisterAnalysis X("equivdatastructure", "Equivalence-class Bottom-up Data Structure Analysis"); Statistic<> NumEquivBUInlines("equivdatastructures", "Number of graphs inlined"); + Statistic<> NumFoldGraphInlines("Inline equiv-class graphs bottom up", + "Number of graphs inlined"); } // getDSGraphForCallSite - Return the common data structure graph for // callees at the specified call site. // -Function *llvm::PA::EquivClassGraphs::getSomeCalleeForCallSite(const CallSite &CS) const { +Function *PA::EquivClassGraphs:: +getSomeCalleeForCallSite(const CallSite &CS) const { Function *thisFunc = CS.getCaller(); assert(thisFunc && "getDSGraphForCallSite(): Not a valid call site?"); DSNode *calleeNode = CBU->getDSGraph(*thisFunc). @@ -60,7 +54,7 @@ // computeFoldedGraphs - Calculate the bottom up data structure // graphs for each function in the program. // -void llvm::PA::EquivClassGraphs::computeFoldedGraphs(Module &M) { +void PA::EquivClassGraphs::computeFoldedGraphs(Module &M) { CBU = &getAnalysis(); // Find equivalence classes of functions called from common call sites. @@ -91,7 +85,7 @@ // calls to functions. If a call site can invoke any functions [F1, F2... FN], // unify the N functions together in the FuncECs set. // -void llvm::PA::EquivClassGraphs::buildIndirectFunctionSets(Module &M) { +void PA::EquivClassGraphs::buildIndirectFunctionSets(Module &M) { const ActualCalleesTy& AC = CBU->getActualCallees(); // Loop over all of the indirect calls in the program. If a call site can @@ -118,7 +112,8 @@ // Instead of storing the lastInst For Indirection call Sites we store // the DSNode for the function ptr arguemnt Function *thisFunc = LastInst->getParent()->getParent(); - DSNode *calleeNode = CBU->getDSGraph(*thisFunc).getNodeForValue(CS.getCalledValue()).getNode(); + DSGraph &TFG = CBU->getDSGraph(*thisFunc); + DSNode *calleeNode = TFG.getNodeForValue(CS.getCalledValue()).getNode(); OneCalledFunction[calleeNode] = FirstFunc; FuncECs.addElement(I->second); } else { @@ -127,7 +122,8 @@ FuncECs.unionSetsWith(FirstFunc, I->second); #ifndef NDEBUG Function *thisFunc = LastInst->getParent()->getParent(); - DSNode *calleeNode = CBU->getDSGraph(*thisFunc).getNodeForValue(CS.getCalledValue()).getNode(); + DSGraph &TFG = CBU->getDSGraph(*thisFunc); + DSNode *calleeNode = TFG.getNodeForValue(CS.getCalledValue()).getNode(); assert(OneCalledFunction.count(calleeNode) > 0 && "Missed a call?"); #endif } @@ -219,7 +215,7 @@ } -DSGraph &llvm::PA::EquivClassGraphs::getOrCreateGraph(Function &F) { +DSGraph &PA::EquivClassGraphs::getOrCreateGraph(Function &F) { // Has the graph already been created? DSGraph *&Graph = FoldedGraphsMap[&F]; if (Graph) return *Graph; @@ -231,7 +227,7 @@ return *Graph; } -DSGraph* llvm::PA::EquivClassGraphs::cloneGraph(Function &F) { +DSGraph *PA::EquivClassGraphs::cloneGraph(Function &F) { DSGraph *&Graph = FoldedGraphsMap[&F]; DSGraph &CBUGraph = CBU->getDSGraph(F); assert(Graph == NULL || Graph == &CBUGraph && "Cloning a graph twice?"); @@ -255,10 +251,10 @@ } -unsigned llvm::PA::EquivClassGraphs::processSCC(DSGraph &FG, Function& F, - std::vector &Stack, - unsigned &NextID, - hash_map &ValMap) { +unsigned PA::EquivClassGraphs::processSCC(DSGraph &FG, Function& F, + std::vector &Stack, + unsigned &NextID, + hash_map &ValMap){ DEBUG(std::cerr << " ProcessSCC for function " << F.getName() << "\n"); assert(!ValMap.count(&F) && "Shouldn't revisit functions!"); @@ -318,7 +314,7 @@ /// processGraph - Process the CBU graphs for the program in bottom-up order on /// the SCC of the __ACTUAL__ call graph. This builds final folded CBU graphs. -void llvm::PA::EquivClassGraphs::processGraph(DSGraph &G, Function& F) { +void PA::EquivClassGraphs::processGraph(DSGraph &G, Function &F) { DEBUG(std::cerr << " ProcessGraph for function " << F.getName() << "\n"); hash_set calls; @@ -424,5 +420,6 @@ CallerGraph->removeDeadNodes(DSGraph::KeepUnreachableGlobals); } - DEBUG(std::cerr << " --DONE ProcessGraph for function " << F.getName() << "\n"); + DEBUG(std::cerr << " --DONE ProcessGraph for function " + << F.getName() << "\n"); } From brukman at cs.uiuc.edu Tue Oct 12 12:06:28 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 12 Oct 2004 12:06:28 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Type.h Message-ID: <200410121706.MAA28830@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Type.h updated: 1.63 -> 1.64 --- Log message: Opaque types are considered to be first-class. --- Diffs of the changes: (+3 -1) Index: llvm/include/llvm/Type.h diff -u llvm/include/llvm/Type.h:1.63 llvm/include/llvm/Type.h:1.64 --- llvm/include/llvm/Type.h:1.63 Thu Oct 7 14:19:12 2004 +++ llvm/include/llvm/Type.h Tue Oct 12 12:06:17 2004 @@ -29,6 +29,8 @@ // users of the unknown type, causing them to reference a new, more concrete // type. Opaque types are deleted when their use list dwindles to zero users. // +// Opaque types are considered to be first-class types. +// //===----------------------------------------------------------------------===// #ifndef LLVM_TYPE_H @@ -192,7 +194,7 @@ /// isFirstClassType - Return true if the value is holdable in a register. inline bool isFirstClassType() const { return (ID != VoidTyID && ID <= LastPrimitiveTyID) || - ID == PointerTyID || ID == PackedTyID; + ID == PointerTyID || ID == PackedTyID || ID == OpaqueTyID; } /// isSized - Return true if it makes sense to take the size of this type. To From lattner at cs.uiuc.edu Tue Oct 12 12:08:57 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 12 Oct 2004 12:08:57 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Type.h Message-ID: <200410121708.MAA08228@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Type.h updated: 1.64 -> 1.65 --- Log message: Add comment --- Diffs of the changes: (+2 -0) Index: llvm/include/llvm/Type.h diff -u llvm/include/llvm/Type.h:1.64 llvm/include/llvm/Type.h:1.65 --- llvm/include/llvm/Type.h:1.64 Tue Oct 12 12:06:17 2004 +++ llvm/include/llvm/Type.h Tue Oct 12 12:08:44 2004 @@ -192,6 +192,8 @@ inline bool isDerivedType() const { return ID >= FirstDerivedTyID; } /// isFirstClassType - Return true if the value is holdable in a register. + /// Note that we consider opaque types to be first class, as they may be + /// resolved to a first class type later. inline bool isFirstClassType() const { return (ID != VoidTyID && ID <= LastPrimitiveTyID) || ID == PointerTyID || ID == PackedTyID || ID == OpaqueTyID; From brukman at cs.uiuc.edu Tue Oct 12 12:10:11 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 12 Oct 2004 12:10:11 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/MallocBench/Makefile Message-ID: <200410121710.MAA28934@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/MallocBench: Makefile updated: 1.7 -> 1.8 --- Log message: The MallocBench/perl test is so broken, it's not worth attempting to compile it --- Diffs of the changes: (+1 -1) Index: llvm-test/MultiSource/Benchmarks/MallocBench/Makefile diff -u llvm-test/MultiSource/Benchmarks/MallocBench/Makefile:1.7 llvm-test/MultiSource/Benchmarks/MallocBench/Makefile:1.8 --- llvm-test/MultiSource/Benchmarks/MallocBench/Makefile:1.7 Wed Sep 1 09:33:23 2004 +++ llvm-test/MultiSource/Benchmarks/MallocBench/Makefile Tue Oct 12 12:10:01 2004 @@ -1,3 +1,3 @@ LEVEL = ../../.. -PARALLEL_DIRS := cfrac espresso gs make perl +PARALLEL_DIRS := cfrac espresso gs make include $(LEVEL)/Makefile.programs From brukman at cs.uiuc.edu Tue Oct 12 13:34:03 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 12 Oct 2004 13:34:03 -0500 Subject: [llvm-commits] CVS: llvm/tools/analyze/Makefile Message-ID: <200410121834.NAA09791@zion.cs.uiuc.edu> Changes in directory llvm/tools/analyze: Makefile updated: 1.22 -> 1.23 --- Log message: Wrap lines at 80 cols --- Diffs of the changes: (+4 -3) Index: llvm/tools/analyze/Makefile diff -u llvm/tools/analyze/Makefile:1.22 llvm/tools/analyze/Makefile:1.23 --- llvm/tools/analyze/Makefile:1.22 Sun Aug 29 14:29:38 2004 +++ llvm/tools/analyze/Makefile Tue Oct 12 13:33:52 2004 @@ -8,9 +8,10 @@ ##===----------------------------------------------------------------------===## LEVEL = ../.. TOOLNAME = analyze -USEDLIBS = asmparser bcreader analysis ipa datastructure scalaropts.a transforms.a \ - target.a scalaropts.a transformutils.a vmcore support LLVMsystem.a +USEDLIBS = asmparser bcreader analysis ipa datastructure scalaropts.a \ + transforms.a target.a scalaropts.a transformutils.a vmcore support \ + LLVMsystem.a + TOOLLINKOPTS = $(PLATFORMLIBDL) include $(LEVEL)/Makefile.common - From brukman at cs.uiuc.edu Tue Oct 12 13:36:07 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 12 Oct 2004 13:36:07 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/Makefile Message-ID: <200410121836.NAA09825@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: Makefile updated: 1.6 -> 1.7 --- Log message: Wrap lines at 80 cols --- Diffs of the changes: (+2 -2) Index: llvm/tools/bugpoint/Makefile diff -u llvm/tools/bugpoint/Makefile:1.6 llvm/tools/bugpoint/Makefile:1.7 --- llvm/tools/bugpoint/Makefile:1.6 Sun Aug 29 14:29:38 2004 +++ llvm/tools/bugpoint/Makefile Tue Oct 12 13:35:57 2004 @@ -13,8 +13,8 @@ OPTLIBS = transforms instrument profpaths ANALIBS = datastructure ipa target.a -USEDLIBS = ipo scalaropts analysis $(OPTLIBS) $(ANALIBS) \ - transformutils asmparser bcreader bcwriter vmcore support LLVMsystem.a +USEDLIBS = ipo scalaropts analysis $(OPTLIBS) $(ANALIBS) transformutils \ + asmparser bcreader bcwriter vmcore support LLVMsystem.a TOOLLINKOPTS = $(PLATFORMLIBDL) From gaeke at cs.uiuc.edu Tue Oct 12 13:38:43 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 12 Oct 2004 13:38:43 -0500 Subject: [llvm-commits] CVS: reopt/docs/ReoptUsersGuide.rtf Message-ID: <200410121838.NAA10023@zion.cs.uiuc.edu> Changes in directory reopt/docs: ReoptUsersGuide.rtf updated: 1.1 -> 1.2 --- Log message: Added 'what is the reoptimizer' section to the beginning --- Diffs of the changes: (+280 -213) Index: reopt/docs/ReoptUsersGuide.rtf diff -u reopt/docs/ReoptUsersGuide.rtf:1.1 reopt/docs/ReoptUsersGuide.rtf:1.2 --- reopt/docs/ReoptUsersGuide.rtf:1.1 Tue Oct 12 11:41:40 2004 +++ reopt/docs/ReoptUsersGuide.rtf Tue Oct 12 13:38:32 2004 @@ -1,29 +1,33 @@ {\rtf1\mac\ansicpg10000\cocoartf102 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\fmodern\fcharset77 Courier; -\f3\fmodern\fcharset77 Courier-Oblique;\f4\fswiss\fcharset77 Helvetica-Oblique;\f5\fmodern\fcharset77 Courier-Bold; -} +{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;\f2\froman\fcharset77 TimesNewRomanMS; +\f3\fmodern\fcharset77 Courier;\f4\fmodern\fcharset77 Courier-Oblique;\f5\fswiss\fcharset77 Helvetica-Oblique; +\f6\fmodern\fcharset77 Courier-Bold;} {\colortbl;\red255\green255\blue255;} -\margl1440\margr1440\vieww12000\viewh17160\viewkind0 -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural +\margl1440\margr1440\vieww12000\viewh15840\viewkind0 +\deftab720 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f0\fs24 \cf0 Reoptimizer User's Guide\ October 2004\ Brian Gaeke\ \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \ul Table of Contents\ +\f1\b \cf0 \ul \ulc0 Table of Contents\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f0\b0 \ulnone \ +\f0\b0 \cf0 \ulnone \ + Introduction to the reoptimizer\ Building the reoptimizer from source\ Running the reoptimizer on a program in the llvm-test module \f2 \ \f0 Options recognized by the -\f2 "run-tests" +\f3 "run-tests" \f0 script\ Running the reoptimizer on an arbitrary program\ The -\f2 LLVM_REOPT +\f3 LLVM_REOPT \f0 environment variable\ Instrumentation/Tracing Framework options\ Phase detection options\ @@ -36,304 +40,357 @@ How the trace optimizer works\ 1. The trace optimizer\ 2. TraceToFunction ( -\f2 reopt/lib/TraceToFunction +\f3 reopt/lib/TraceToFunction \f0 )\ 3. Trace Optimizations and JIT ( -\f2 reopt/lib/TraceJIT +\f3 reopt/lib/TraceJIT \f0 )\ 4. UnpackTraceFunction ( -\f2 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp +\f3 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp \f0 )\ 5. Machine-code emission ( -\f2 reopt/lib/TraceJIT/TraceJITEmitter.cpp +\f3 reopt/lib/TraceJIT/TraceJITEmitter.cpp \f0 )\ Tips for debugging the reoptimizer\ Reoptimizer testing tools\ The Trace I/O library ( -\f2 reopt/lib/TraceIO +\f3 reopt/lib/TraceIO \f0 )\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f2 ttftest -\f0 - a standalone TraceToFunction testing tool ( -\f2 reopt/tools/ttftest +\f3 \cf0 ttftest +\f0 - a standalone TraceToFunction testing tool ( +\f3 reopt/tools/ttftest \f0 )\ -\f2 dumptrace -\f0 - list LLVM assembly for a trace's basic blocks ( -\f2 reopt/tools/dumptrace +\f3 dumptrace +\f0 - list LLVM assembly for a trace's basic blocks ( +\f3 reopt/tools/dumptrace \f0 )\ Known problems with the current implementation\ UnpackTraceFunction generates inefficient code\ TraceJITEmitter is poorly integrated with the TraceCache\ \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural + +\f1\b \cf0 \ul \ulc0 Introduction to the reoptimizer\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural + +\f0\b0 \cf0 \ulnone \ +The reoptimizer is LLVM's dynamic optimization framework. It consists of three basic parts: a collection of compile-time profiling instrumentation passes, a runtime profiler and trace generator, and a runtime trace optimizer.\ +\ +The profiling instrumentation passes run at compile time are as follows: [FIXME]\ +\ +For more information about the reoptimizer's instrumentation passes and runtime profiler, consult Anand Shukla's M.S. thesis, "Lightweight Cross-Procedure Tracing for Runtime Optimization", July 2003.\ +\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \ul Building the reoptimizer from source -\f0\b0 \ul \ -\ulnone \ +\f1\b \cf0 \ul \ulc0 Building the reoptimizer from source\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural + +\f0\b0 \cf0 \ulnone \ 1. Check out a fresh llvm tree, along with the repository of test programs.\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f2 % cvs -d /home/vadve/shared/PublicCVS co llvm\ +\f3 \cf0 % cvs -d /home/vadve/shared/PublicCVS co llvm\ % cd llvm/projects\ % cvs -d /home/vadve/shared/PublicCVS co llvm-test\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f0 2. Check out the reopt module from the internal CVS repository into the llvm/projects subdirectory, creating llvm/projects/reopt.\ +\f0 \cf0 2. Check out the reopt module from the internal CVS repository into the llvm/projects subdirectory, creating llvm/projects/reopt.\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f2 % cvs -d /home/vadve/shared/InternalCVS co reopt\ +\f3 \cf0 % cvs -d /home/vadve/shared/InternalCVS co reopt\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f0 3. Configure and build the system in release mode (or debug mode if you want to try to fix bugs).\ +\f0 \cf0 3. Configure and build the system in release mode (or debug mode if you want to try to fix bugs).\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f2 % cd ../..\ +\f3 \cf0 % cd ../..\ % ./configure -\f3\i [configure args]\ +\f4\i [configure args] +\f0\i0 \ -\f2\i0 % cd llvm/projects/reopt && ./configure\ +\f3 % cd llvm/projects/reopt && ./configure\ % cd ../..\ % gmake ENABLE_OPTIMIZED=1\ -\f4\i or\ +\f5\i or +\f0\i0 \ -\f2\i0 % gmake\ +\f3 % gmake\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f0 \ +\f0 \cf0 \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural + +\f1\b \cf0 \ul \ulc0 Running the reoptimizer on a program in the llvm-test module\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \ul Running the reoptimizer on a program in the llvm-test module -\f0\b0 \ul \ -\ulnone \ +\f0\b0 \cf0 \ulnone \ There is a script called -\f2 "run-tests" +\f3 "run-tests" \f0 in the reopt/test subdirectory, which is essentially a wrapper around -\f2 "gmake TEST=reopt" +\f3 "gmake TEST=reopt" \f0 . It knows a canned set of tests by some symbolic names I have invented. For example, two equivalent ways to run the Shootout tests are as follows:\ -\f2 % gmake TEST=reopt SUBDIR=SingleSource/Benchmarks/Shootout\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural +\f3 % gmake TEST=reopt SUBDIR=SingleSource/Benchmarks/Shootout +\f0 \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural + +\f5\i \cf0 or\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f4\i \cf0 or -\f2\i0 \ - % ./run-tests shootout\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural +\f3\i0 \cf0 % ./run-tests shootout\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f0 \cf0 ...within the reopt/test directory. Both of these commands perform three tasks: first, run the ordinary llc-compiled, non-instrumented version of each Shootout program; second: run the reoptimized version; third: compare the results.\ \ You can get a list of the symbolic names known by the -\f2 "run-tests" +\f3 "run-tests" \f0 script by typing:\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f2 % ./run-tests -list\ +\f3 \cf0 % ./run-tests -list\ \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f1\b \cf0 \ul \ulc0 Options recognized by the -\f5 \ul "run-tests" +\f6 \ul "run-tests" \f1 \ul script -\f0\b0 \ul \ -\ulnone \ +\f0\b0 \ulnone \ +\ -list -\f2 +\f3 \f0 Show the list of known benchmarks.\ \ -clean -\f4\i +\f5\i \f0\i0 Erase reoptimizer-instrumented program and its output.\ \ -clean -output -\f4\i +\f5\i \f0\i0 Erase reoptimizer-instrumented program's output only, so that\ you can re-run the reoptimizer on a program without rebuilding it.\ \ -debug -\f4\i +\f5\i \f0\i0 Try to automatically start gdb on the reoptimized version\ of . Sometimes this doesn't work, because the\ shell script can't parse the llvm-test makefiles very well.\ \ -test -\f4\i +\f5\i \f0\i0 This is the default option. It runs the using\ the ordinary llc-compiled, non-instrumented version and\ compares its output with the output from the reoptimized\ version, by using GNU make (as described above).\ \ -skiptrace= -\f4\i N -\f3 +\f5\i N +\f4 \f0\i0 When combined with -\f2 -test +\f3 -test \f0 or -\f2 -debug +\f3 -debug \f0 , this modifies your \ -\f2 LLVM_REOPT +\f3 LLVM_REOPT \f0 environment variable to tell the reoptimizer \ that it should skip the trace numbered -\f3\i N +\f4\i N \f0\i0 . You can see the \ trace numberings by running in debug mode with -\f2 LLVM_REOPT +\f3 LLVM_REOPT \f0 \ set to -\f2 '--debug --enable-trace-opt' +\f3 '--debug --enable-trace-opt' \f0 .\ \ -release -\f2 +\f3 \f0 When combined with -\f2 -test +\f3 -test \f0 , this runs the reoptimizer in \ release mode. You must have already built your LLVM tree \ with -\f2 'gmake ENABLE_OPTIMIZED=1' +\f3 'gmake ENABLE_OPTIMIZED=1' \f0 . This option works by \ causing GNU make to be run with parameters\ -\f2 'TEST=reopt ENABLE_OPTIMIZED=1' +\f3 'TEST=reopt ENABLE_OPTIMIZED=1' \f0 .\ \ -lps -\f2 +\f3 \f0 When combined with -\f2 -test +\f3 -test \f0 , runs Olden benchmarks with \ -\f2 LARGE_PROBLEM_SIZE +\f3 LARGE_PROBLEM_SIZE \f0 enabled.\ \ -\f1\b \ul Running the reoptimizer on an arbitrary program -\f0\b0 \ul \ -\ulnone \ +\f1\b \ul Running the reoptimizer on an arbitrary program\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural + +\f0\b0 \cf0 \ulnone \ 1. Assume you have a whole program which has been compiled and linked in bytecode form using the standard LLVM toolchain (llvm-gcc, gccas, gccld) in the file named -\f2 'prog.llvm.bc' +\f3 'prog.llvm.bc' \f0 . \ \ 2. The first thing you have to do is run the reoptimizer's first-level instrumentation passes and generate SparcV9 assembly code for the program. You use the -\f2 'reopt-llc' +\f3 'reopt-llc' \f0 tool, located in the reopt/tools subdirectory, to do this. The following command generates instrumented SparcV9 assembly for -\f2 'prog.llvm.bc' +\f3 'prog.llvm.bc' \f0 in the file -\f2 'prog.reopt.s' +\f3 'prog.reopt.s' \f0 :\ \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f2 % reopt-llc -enable-correct-eh-support -o=prog.reopt.s prog.llvm.bc\ +\f3 \cf0 % reopt-llc -enable-correct-eh-support -o=prog.reopt.s prog.llvm.bc\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f0 \ +\f0 \cf0 \ If you are sure that the program does not depend on the proper behavior of setjmp/longjmp calls or invoke/unwind instructions, you can omit the -\f2 '-enable-correct-eh-support' +\f3 '-enable-correct-eh-support' \f0 flag.\ \ 3. The next step is to link the program into an executable along with the LLVM libraries that constitute the reoptimizer, as well as any other system libraries that the program needs. The reoptimizer's build process builds a single file ( -\f2 libwholereoptimizer.a +\f3 libwholereoptimizer.a \f0 ) containing all the LLVM libraries you need, but you also need to link in the following libraries on Solaris: -\f2 '-lcpc -lm -lrt -lmalloc -ldl' +\f3 '-lcpc -lm -lrt -lmalloc -ldl' \f0 . You also need to link the program using the C++ compiler. So the link line will look like this:\ \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f2 % g++ -o prog.reopt prog.reopt.s -\f3\i REOPTLIB -\f2\i0 /libwholereoptimizer.a -\f3\i OTHERLIBS -\f2\i0 -lcpc -lm -lrt -lmalloc -ldl\ - +\f3 \cf0 % g++ -o prog.reopt prog.reopt.s +\f4\i REOPTLIB +\f3\i0 /libwholereoptimizer.a +\f4\i OTHERLIBS +\f3\i0 -lcpc -lm -lrt -lmalloc -ldl \f0 \ +\ where -\f3\i REOPTLIB +\f4\i REOPTLIB \f0\i0 is the full path to the -\f2 'llvm/projects/reopt/lib/Release' +\f3 'llvm/projects/reopt/lib/Release' \f0 (or -\f2 'Debug' +\f3 'Debug' \f0 ) directory containing your freshly-built reoptimizer libraries, and -\f3\i OTHERLIBS +\f4\i OTHERLIBS \f0\i0 names any other system libraries needed (e.g., -\f2 '-ljpeg' +\f3 '-ljpeg' \f0 ) by the program under consideration.\ \ 4. Now, you should set your -\f2 LLVM_REOPT +\f3 LLVM_REOPT \f0 environment variable to contain any command-line options you want to pass to the reoptimizer. The most important ones are -\f2 '--debug' +\f3 '--debug' \f0 , to turn on debugging printouts, and -\f2 '--enable-trace-opt' +\f3 '--enable-trace-opt' \f0 , to enable the trace optimizer. (Without the latter option, the original trace layout engine is used.)\ \ A full list of -\f2 LLVM_REOPT +\f3 LLVM_REOPT \f0 settings follows in the next section.\ \ 5. Finally, you can run the program with any arguments and/or input files that the normal, non-instrumented version of the program would have accepted.\ \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \ul The -\f5 \ul LLVM_REOPT +\f1\b \cf0 \ul \ulc0 The +\f6 \ul LLVM_REOPT \f1 \ul environment variable -\f0\b0 \ul \ -\ulnone \ +\f0\b0 \ulnone \ +\ The reoptimizer has several tunable parameters and settings which are controlled by the -\f2 LLVM_REOPT +\f3 LLVM_REOPT \f0 environment variable. For a few of the tunable parameters relating to the trace cache and instrumentation, it may be helpful to look at Anand's thesis for guidance. The list of options that pertain to the reoptimizer is as follows:\ \ -\ul Instrumentation/Tracing Framework options\ulnone \ - -fli-threshold= -\f4\i count +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ul \ulc0 Instrumentation/Tracing Framework options\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ulnone -fli-threshold= +\f5\i count \f0\i0 Number of times FLI must trigger before attempting SLI\ -sli-threshold= -\f4\i count +\f5\i count \f0\i0 Number of iterations of SLI before path counters are sampled\ \ -\ul Phase detection options\ulnone \ - -enable-phase-detect Use a timer interrupt to remove traces periodically from the trace cache\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ul \ulc0 Phase detection options\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ulnone -enable-phase-detect Use a timer interrupt to remove traces periodically from the trace cache\ -timer-int-s= -\f4\i seconds +\f5\i seconds \f0\i0 Interval (in seconds) between phase detection sweeps\ \ -\ul Trace layout engine options\ulnone \ - -count-trace-cycles Count cycles in optimized trace, when using trace layout engine\ -\ -\ul Trace optimizer options\ulnone \ - -enable-trace-opt Use the new trace optimizer instead of the old trace layout engine\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ul \ulc0 Trace layout engine options\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ulnone -count-trace-cycles Count cycles in optimized trace, when using trace layout engine\ +\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ul \ulc0 Trace optimizer options\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ulnone -enable-trace-opt Use the new trace optimizer instead of the old trace layout engine\ -run-opt-passes Run optimization passes before unpacking TraceFunction\ \ -\ul Trace cache options\ulnone \ - -inst-trace-cache-size= -\f4\i size +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ul \ulc0 Trace cache options\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ulnone -inst-trace-cache-size= +\f5\i size \f0\i0 Trace cache size for SLI-instrumented code\ -opt-trace-cache-size= -\f4\i size +\f5\i size \f0\i0 Trace cache size for optimized code\ \ -\ul Debugging options\ulnone \ - -print-machineinstrs Print generated machine code\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ul \ulc0 Debugging options\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ulnone -print-machineinstrs Print generated machine code\ -skip-trace= -\f4\i n +\f5\i n \f0\i0 Don't optimize the -\f4\i n +\f5\i n \f0\i0 th trace, when using trace optimizer\ -debug Turn on debugging printouts\ -dregalloc=y Turn on SparcV9 register allocator debugging printouts\ \ -\ul Statistics gathering options\ulnone \ - -stats Enable statistics output from program\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ul \ulc0 Statistics gathering options\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ulnone -stats Enable statistics output from program\ -time-passes Time each pass, printing elapsed time for each on exit\ \ -\ul Help options\ulnone \ - -version Display the version of LLVM used\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ul \ulc0 Help options\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ulnone -version Display the version of LLVM used\ -help Display available options (-help-hidden for more)\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural -\cf0 \ - -\f1\b \ul How the trace optimizer works -\f0\b0 \ulnone \ -\ -\ul 1. The trace optimizer\ulnone \ \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural + +\f1\b \cf0 \ul \ulc0 How the trace optimizer works\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural + +\f0\b0 \cf0 \ulnone \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ul \ulc0 1. The trace optimizer\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ulnone \ The trace optimizer is the component of the reoptimizer (LLVM's runtime optimization framework) that consumes traces generated by the runtime profiler, converts them into functions, runs global optimizations on them, and then reattaches the optimized trace code back to the original function it came from.\ \ The trace optimizer's input is an LLVM Trace object, which is essentially a wrapper around a collection of LLVM BasicBlocks from a given Function. It is agnostic as to the particular method of trace generation -- that is, it should be possible to take any given runtime profiling implementation and use it to identify hot regions to optimize using the trace optimizer.\ \ Traces given to the trace optimizer should consist of a loop body with one or more side exits. In particular, there should be phi nodes at the beginning of the first trace BasicBlock for variables live across loop iterations; these are detected and handled specially by TraceToFunction.\ \ -\ul 2. TraceToFunction ( -\f2 \ul reopt/lib/TraceToFunction +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ul \ulc0 2. TraceToFunction ( +\f3 \ul reopt/lib/TraceToFunction \f0 \ul )\ulnone \ \ The first pass that runs over newly-identified Traces is the TraceToFunction pass, also known as the TraceFunctionBuilder. TraceToFunction has three major goals: first, to find the live-in and live-out sets from the trace; second, to remove the reoptimizer's first-level loop instrumentation from the trace, if it is found; and third, to construct a function containing the same code as the trace. This function is called the TraceFunction, and it is the principal output of the TraceToFunction pass.\ @@ -341,164 +398,172 @@ A TraceFunction has several components besides the newly-generated LLVM Function containing the trace code. It also contains a pointer to the original LLVM Function which the trace came from; this is known as the trace's "matrix function". It also contains the trace's live-in and live-out sets (represented as vectors of LLVM Values), and mapping information relating LLVM Values in the matrix function to those in the TraceFunction. Also, since live-in and live-out values are expressed as arguments to the TraceFunction, there are separate maps that relate the TraceFunction's arguments to the live values that they represent.\ \ \ul 3. Trace Optimizations and JIT ( -\f2 \ul reopt/lib/TraceJIT +\f3 \ul reopt/lib/TraceJIT \f0 \ul )\ulnone \ \ After the TraceFunction is built, the Trace JIT gains control. Its job is to run a specified list of global optimizations on the trace and then generate LLVM machine code (i.e., a MachineFunction) for the trace using the standard LLVM just-in-time compilation passes.\ \ The optimizations that are run by the Trace JIT are listed in the TraceJITOpts.cpp source file. By default, presently no optimization passes are run unless you specify the -\f2 '--run-opt-passes' +\f3 '--run-opt-passes' \f0 flag in your -\f2 LLVM_REOPT +\f3 LLVM_REOPT \f0 environment variable (see "The -\f2 LLVM_REOPT +\f3 LLVM_REOPT \f0 environment variable" section, below). \ \ After the Trace JIT generates machine code for the newly-optimized trace, it uses UnpackTraceFunction to reattach the optimized trace's code to its matrix function, and then it uses the Trace JIT Emitter to emit the machine code into the trace cache.\ \ \ul 4. UnpackTraceFunction ( -\f2 \ul reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp +\f3 \ul reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp \f0 \ul )\ulnone \ \ UnpackTraceFunction sets up a stack frame for the optimized trace and generates move instructions to copy each live-in/out value from its register allocated in the matrix function to/from its register allocated in the trace function. It also generates branch instructions to return control from each trace exit to the original (untraced) basic block which would have been its (off-trace) successor, replacing the LLVM "ret" instructions used by TraceToFunction to represent trace exits. Instances where an LLVM Value has been replaced with a constant must sometimes be treated specially, because constants are not typically allocated to registers. UnpackTraceFunction is also responsible for performing phi-elimination along trace exit edges, if it detects that a trace exit branch would immediately be followed by an LLVM phi instruction.\ \ \ul 5. Machine-code emission ( -\f2 \ul reopt/lib/TraceJIT/TraceJITEmitter.cpp +\f3 \ul reopt/lib/TraceJIT/TraceJITEmitter.cpp \f0 \ul )\ulnone \ \ The unpacked trace code is emitted into the memory used by the trace cache using the VirtualMem abstraction, which implements reads and writes into the process's executable address space using the /proc filesystem. Once the trace has been emitted, the beginning of the SLI trace is overwritten with a branch to the beginning of the optimized trace, effectively disabling the SLI trace from further execution and enabling the optimized trace instead; control then returns from the second-level trigger function, which is invariably followed by a branch into the optimized trace.\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural -\cf0 \ +\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural + +\f1\b \cf0 \ul \ulc0 Tips for debugging the reoptimizer\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \ul Tips for debugging the reoptimizer -\f0\b0 \ul \ -\ulnone \ +\f0\b0 \cf0 \ulnone \ 1. It is useful to provide the -\f2 '-dregalloc=y -print-machineinstrs' +\f3 '-dregalloc=y -print-machineinstrs' \f0 flags to -\f2 reopt-llc +\f3 reopt-llc \f0 , and save the output, so that you can look up the registers to which LLVM Values were allocated when you are single-stepping through traces.\ \ 2. Set your -\f2 LLVM_REOPT +\f3 LLVM_REOPT \f0 environment variable to include the -\f2 '-debug -dregalloc=y -print-machineinstrs' +\f3 '-debug -dregalloc=y -print-machineinstrs' \f0 flags. This will allow you to see the machine code before and after it has registers allocated and before and after the trace is unpacked into its parent function.\ \ 3. Run the reoptimized binary under gdb, and set a breakpoint at the symbol -\f2 'TraceOptimizerDone' +\f3 'TraceOptimizerDone' \f0 . This function, in RuntimeOptimizations.cpp, is called just after a trace is emitted into the trace cache, and just before the trace optimizer returns control to the program. It prints out gdb commands to disassemble the optimized trace and to set a breakpoint at the beginning of the optimized trace. It also prints out the sequence number of the trace, so that you can use the -\f2 LLVM_REOPT +\f3 LLVM_REOPT \f0 -\f2 '-skip-trace' +\f3 '-skip-trace' \f0 option to skip the trace in a future execution.\ \ 4. When you crash in a given trace, try using the -\f2 LLVM_REOPT '-skip-trace' +\f3 LLVM_REOPT '-skip-trace' \f0 option to skip that trace. You could also try skipping the last trace that was generated. If you crash outside a trace, try skipping the last trace that was executed (if you can figure out which one it was).\ \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \ul Reoptimizer testing tools -\f0\b0 \ulnone \ -\ -\ul The Trace I/O library ( -\f2 \ul reopt/lib/TraceIO +\f1\b \cf0 \ul \ulc0 Reoptimizer testing tools\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural + +\f0\b0 \cf0 \ulnone \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ul \ulc0 The Trace I/O library ( +\f3 \ul reopt/lib/TraceIO \f0 \ul )\ulnone \ \ Normally, traces live only in memory and are discarded when a reoptimized program exits. The Trace I/O library is provided to allow the reoptimizer to save (serialize) traces into files so that they can be reloaded for offline analysis later. The Trace I/O library contains two important functions: -\f2 ReadTraceFromFile +\f3 ReadTraceFromFile \f0 and -\f2 WriteTraceToFile +\f3 WriteTraceToFile \f0 . Writing a trace out to disk actually produces two files in the current implementation: (1) an LLVM bytecode file representing the module containing the trace's matrix function, and (2) a text file containing the name of the trace's matrix function and the integer indices of the basic blocks that make up the trace.\ \ When the trace optimizer is compiled in Debug mode and enabled using -\f2 LLVM_REOPT='--enable-trace-opt --debug' +\f3 LLVM_REOPT='--enable-trace-opt --debug' \f0 , it will write out every trace using the Trace I/O library. The filenames used match the pattern -\f2 ' -\f3\i matrixfn -\f2\i0 .trace -\f3\i N -\f2\i0 . -\f3\i ext -\f2\i0 ' +\f3 ' +\f4\i matrixfn +\f3\i0 .trace +\f4\i N +\f3\i0 . +\f4\i ext +\f3\i0 ' \f0 where -\f3\i matrixfn +\f4\i matrixfn \f0\i0 is the name of the trace's matrix function, -\f3\i N +\f4\i N \f0\i0 is the number of the trace as used by the -\f2 LLVM_REOPT='--skip-trace' +\f3 LLVM_REOPT='--skip-trace' \f0 option (q.v.), and -\f3\i ext +\f4\i ext \f0\i0 is -\f2 'bc' +\f3 'bc' \f0 for the bytecode file and -\f2 'txt' +\f3 'txt' \f0 for the text file.\ \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f2 \ul ttftest -\f0 \ul - a standalone TraceToFunction testing tool \ul \ulc0 ( -\f2 \ul reopt/tools/ttftest +\f3 \cf0 \ul \ulc0 ttftest +\f0 \ul - a standalone TraceToFunction testing tool ( +\f3 \ul reopt/tools/ttftest \f0 \ul )\ulnone \ \ There are two meaningful things you can do with serialized traces in the current reoptimizer framework. First, you can run TraceToFunction on a trace independently of the rest of the reoptimizer, using a tool called -\f2 ttftest +\f3 ttftest \f0 . Because TraceToFunction is machine-independent, -\f2 ttftest +\f3 ttftest \f0 should run correctly on any system capable of running LLVM. ttftest has a few important command-line options, the first two of which are required:\ \ -bc= -\f4\i bytecodeFileName +\f5\i bytecodeFileName \f0\i0 Name of file containing module\ -trace= -\f4\i traceFileName +\f5\i traceFileName \f0\i0 Name of file containing trace\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural -\cf0 -print-live Print live-in/out sets computed by TraceToFunction\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural -\cf0 \ - -\f2 ttftest -\f0 will also run the LLVM Verifier on the TraceFunction, and exit with an exit code of 0 if the verifier passes. This is the basic strategy used for the automated TraceToFunction regression tests ( -\f2 reopt/test/TTFTestCases + -print-live Print live-in/out sets computed by TraceToFunction\ +\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural + +\f3 \cf0 ttftest +\f0 will also run the LLVM Verifier on the TraceFunction, and exit with an exit code of 0 if the verifier passes. This is the basic strategy used for the automated TraceToFunction regression tests ( +\f3 reopt/test/TTFTestCases \f0 and -\f2 reopt/test/TTFTestHarness.pl +\f3 reopt/test/TTFTestHarness.pl \f0 ). The test harness assembles each module, runs ttftest on each of the module's traces in turn, and prints a summary of the number of test cases on which TraceToFunction produced bad LLVM code--naturally, this should always be zero!\ \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f2 \ul dumptrace -\f0 \ul - list LLVM assembly for a trace's basic blocks\ul \ulc0 ( -\f2 \ul reopt/tools/dumptrace +\f3 \cf0 \ul \ulc0 dumptrace +\f0 \ul - list LLVM assembly for a trace's basic blocks ( +\f3 \ul reopt/tools/dumptrace \f0 \ul )\ulnone \ \ If you just want to look at the assembly code for the basic blocks on a trace, the easiest way is to use the -\f2 dumptrace +\f3 dumptrace \f0 tool. Instead of showing you the integer indices of the basic blocks on the trace, it will print out the LLVM assembly code for the basic blocks, in the order they are specified in the trace file.\ \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f2 \cf0 dumptrace -\f0 also highlights two sets of values for your inspection: the values used on the trace which are defined outside the trace, and the values defined inside the trace which are used outside the trace. (Note that these are often subsets of the live-in/out sets computed by TraceToFunction; if you want to see those, use -\f2 ttftest -print-live +\f3 \cf0 dumptrace +\f0 also highlights two sets of values for your inspection: the values used on the trace which are defined outside the trace, and the values defined inside the trace which are used outside the trace. (Note that these are often subsets of the live-in/out sets computed by TraceToFunction; if you want to see those, use +\f3 ttftest -print-live \f0 .)\ \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural -\f2 \cf0 dumptrace -\f0 requires the same -\f2 -bc +\f3 dumptrace +\f0 requires the same +\f3 -bc \f0 and -\f2 -trace +\f3 -trace \f0 command line options required by -\f2 ttftest +\f3 ttftest \f0 ; see the previous section for details.\ \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \ul Known problems with the current implementation\ +\f1\b \cf0 \ul \ulc0 Known problems with the current implementation\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f0\b0 \ulnone \ -\ul UnpackTraceFunction generates inefficient code\ulnone \ -\ +\f0\b0 \cf0 \ulnone \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ul \ulc0 UnpackTraceFunction generates inefficient code\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ulnone \ The machine code generated by the JIT for a TraceFunction assumes that live-in values and pointers to live-out values will be passed in as arguments according to the SparcV9/Solaris ABI's standard calling conventions. Also, the registers allocated to values in the TraceFunction have no relation to the registers allocated to the same values in the matrix function. These two facts pose problems for the efficient integration of optimized trace machine code into the function from which the trace was extracted.\ \ We intended UnpackTraceFunction to implement an efficient calling convention for traces that did not require moving values around into specific registers for the purposes of argument passing: essentially, we hoped that the TraceFunction's code could be generated to use the same register for each live-in/out value that its matrix function used for that value. Theoretically, the SparcV9 target's graph-coloring register allocator could be instructed to use a mechanism known as "suggested colorings" to provide this functionality on a best-effort basis -- that is, allocating a live-in or live-out value the matrix function's register for that value when possible, and allocating some other register (and emitting a move) in the case of a conflict.\ @@ -507,11 +572,13 @@ \ Also, UnpackTraceFunction must be careful to avoid read-after-write errors when copying trace live-in values from their matrix-function registers to their TraceFunction registers, if the two sets of registers overlap. We currently work around this problem by emitting stores of each trace live-in value onto the TraceFunction's stack, then (after all the loads) emitting loads of each live-in value into its TraceFunction register. This works correctly but is slow. A similar situation exists at trace exits (epilogs) with respect to live-out values. It should be possible to use a temporary register to accomplish the same thing, if you are careful with the ordering of reads and writes.\ \ -\ul TraceJITEmitter is poorly integrated with the TraceCache\ulnone \ -\ -In the current implementation of the TraceJITEmitter, the TraceCache does not keep track of individual traces when the trace JIT emitter inserts them, and so it cannot evict them. This deficiency exists primarily for two reasons: (1) the TraceCache wants to accept a trace in the form of a vector of binary words of machine code, and then perform fixups (e.g., to the PC-relative immediate fields of branch instructions) on its own, and therefore (2) the TraceCache wants to know the addresses of all branch and call instructions, information which the TraceJITEmitter does not have handy.\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ul \ulc0 TraceJITEmitter is poorly integrated with the TraceCache\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ulnone \ +In the current implementation of the TraceJITEmitter, the TraceCache does not keep track of individual traces when the trace JIT emitter inserts them, and so it cannot evict them. This deficiency exists primarily for two reasons: (1) the TraceCache wants to accept a trace in the form of a vector of binary words of machine code, and then perform fixups (e.g., to the PC-relative immediate fields of branch instructions) on its own, and therefore (2) the TraceCache wants to know the addresses of all branch and call instructions, information which the TraceJITEmitter does not have handy. Strategy (1) does not interact well with the target-independent JIT, which uses callbacks into the TraceJITEmitter to fixup backward branches.\ \ -Strategy (1) does not interact well with the target-independent JIT, which uses callbacks into the TraceJITEmitter to fixup backward branches. It might be possible to pass empty lists of branches and calls to the TraceCache to make it skip its fixup steps. It might also be possible to change the TraceJITEmitter to emit into a temporary buffer, and then build up a vector of machine words from that and pass it off to the TraceCache. Care must be taken to avoid introducing unnecessary overhead due to copying. Currently, the TraceJITEmitter directly emits code into the memory used by the TraceCache, which is correct and reasonably efficient, but does not give the TraceCache any meaningful control over its own contents.\ +It might be possible, as a workaround, to pass empty lists of branches and calls to the TraceCache to make it skip its fixup steps. It might also be possible to change the TraceJITEmitter to emit into a temporary buffer, and then build up a vector of machine words from that and pass it off to the TraceCache. Care must be taken to avoid introducing unnecessary overhead due to copying. Currently, the TraceJITEmitter directly emits code into the memory used by the TraceCache, which is correct and reasonably efficient, but does not give the TraceCache any meaningful control over its own contents.\ \ In the long term, we want to change the target-independent JIT code to output pieces of machine code and lists of relocations (fixups) on the side, which also happens to be more like what the TraceCache wants -- this would make it possible to cache JIT translations at a per-function granularity, for example.\ } \ No newline at end of file From brukman at cs.uiuc.edu Tue Oct 12 14:17:21 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 12 Oct 2004 14:17:21 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/Makefile Message-ID: <200410121917.OAA11172@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: Makefile updated: 1.7 -> 1.8 --- Log message: No space allowed between \ and end-of-line --- Diffs of the changes: (+1 -1) Index: llvm/tools/bugpoint/Makefile diff -u llvm/tools/bugpoint/Makefile:1.7 llvm/tools/bugpoint/Makefile:1.8 --- llvm/tools/bugpoint/Makefile:1.7 Tue Oct 12 13:35:57 2004 +++ llvm/tools/bugpoint/Makefile Tue Oct 12 14:17:11 2004 @@ -13,7 +13,7 @@ OPTLIBS = transforms instrument profpaths ANALIBS = datastructure ipa target.a -USEDLIBS = ipo scalaropts analysis $(OPTLIBS) $(ANALIBS) transformutils \ +USEDLIBS = ipo scalaropts analysis $(OPTLIBS) $(ANALIBS) transformutils \ asmparser bcreader bcwriter vmcore support LLVMsystem.a TOOLLINKOPTS = $(PLATFORMLIBDL) From gaeke at cs.uiuc.edu Tue Oct 12 14:47:27 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 12 Oct 2004 14:47:27 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/lib/TraceCache/VirtualMem.cpp Message-ID: <200410121947.OAA20002@seraph.cs.uiuc.edu> Changes in directory reopt/lib/TraceCache: VirtualMem.cpp updated: 1.19 -> 1.20 --- Log message: Instead of using /proc//as and read/write/lseek system calls, we can use mprotect() on page ranges along with direct reads and writes, thereby saving system calls. --- Diffs of the changes: (+18 -16) Index: reopt/lib/TraceCache/VirtualMem.cpp diff -u reopt/lib/TraceCache/VirtualMem.cpp:1.19 reopt/lib/TraceCache/VirtualMem.cpp:1.20 --- reopt/lib/TraceCache/VirtualMem.cpp:1.19 Thu Sep 2 11:55:44 2004 +++ reopt/lib/TraceCache/VirtualMem.cpp Tue Oct 12 14:47:17 2004 @@ -13,25 +13,17 @@ #include #include #include +#include +#include +#include using namespace llvm; VirtualMem::VirtualMem() { - // I/O into the process's address space is accomplished by reading - // and writing the /proc//as file exported by SVR4 procfs. - // Get a file descriptor open to that file now. - char ctr[25]; - sprintf(ctr, "/proc/%d/as", (int) getpid ()); - fp = open(ctr, O_RDWR); - if (fp < 0) - throw std::string ("Error opening address space file in procfs."); } unsigned int VirtualMem::readInstrFrmVm(uint64_t frm){ - lseek(fp, frm, SEEK_SET); - unsigned int instr=0; - read (fp, &instr, sizeof (unsigned int)); - return instr; + return *((unsigned int *)frm); } unsigned int VirtualMem::readInstrFrmVm(uint64_t frm, TraceCache *tr){ @@ -52,13 +44,19 @@ return readInstrFrmVm (frm); } +std::set rwxPages; + /// writeInstToVM - Emit the word newInstr to memory at address destAddr. /// void VirtualMem::writeInstToVM (uint64_t destAddr, unsigned int newInstr) { DEBUG (std::cerr << "writeInstToVM (" << std::hex << destAddr << ", " << newInstr << ");\n" << std::dec); - lseek (fp, destAddr, SEEK_SET); - write (fp, &newInstr, sizeof (unsigned int)); + if (rwxPages.find (destAddr &~ 0x7fff) == rwxPages.end ()) { + int rc = mprotect ((caddr_t)(destAddr &~ 0x7fff), 0x8000, + PROT_READ|PROT_WRITE|PROT_EXEC); + assert (rc == 0); + } + *((unsigned int *)destAddr) = newInstr; } /// writeTraceToVM - Emit the words in newInstrs to memory starting at @@ -68,8 +66,12 @@ std::vector &newInstrs) { DEBUG (std::cerr << "writeTraceToVM ("< Changes in directory reopt/docs: ReoptUsersGuide.rtf updated: 1.2 -> 1.3 --- Log message: We don't use procfs anymore. --- Diffs of the changes: (+7 -7) Index: reopt/docs/ReoptUsersGuide.rtf diff -u reopt/docs/ReoptUsersGuide.rtf:1.2 reopt/docs/ReoptUsersGuide.rtf:1.3 --- reopt/docs/ReoptUsersGuide.rtf:1.2 Tue Oct 12 13:38:32 2004 +++ reopt/docs/ReoptUsersGuide.rtf Tue Oct 12 14:56:17 2004 @@ -3,7 +3,7 @@ \f3\fmodern\fcharset77 Courier;\f4\fmodern\fcharset77 Courier-Oblique;\f5\fswiss\fcharset77 Helvetica-Oblique; \f6\fmodern\fcharset77 Courier-Bold;} {\colortbl;\red255\green255\blue255;} -\margl1440\margr1440\vieww12000\viewh15840\viewkind0 +\margl1440\margr1440\vieww15300\viewh18220\viewkind0 \deftab720 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural @@ -423,7 +423,7 @@ \f3 \ul reopt/lib/TraceJIT/TraceJITEmitter.cpp \f0 \ul )\ulnone \ \ -The unpacked trace code is emitted into the memory used by the trace cache using the VirtualMem abstraction, which implements reads and writes into the process's executable address space using the /proc filesystem. Once the trace has been emitted, the beginning of the SLI trace is overwritten with a branch to the beginning of the optimized trace, effectively disabling the SLI trace from further execution and enabling the optimized trace instead; control then returns from the second-level trigger function, which is invariably followed by a branch into the optimized trace.\ +The unpacked trace code is emitted into the memory used by the trace cache using the VirtualMem abstraction, which uses the mprotect() system call to lazily add write permissions to executable memory pages before writing into them for the first time. Once the trace has been emitted, the beginning of the SLI trace is overwritten with a branch to the beginning of the optimized trace, effectively disabling the SLI trace from further execution and enabling the optimized trace instead; control then returns from the second-level trigger function, which is invariably followed by a branch into the optimized trace.\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural @@ -499,7 +499,7 @@ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f3 \cf0 \ul \ulc0 ttftest -\f0 \ul - a standalone TraceToFunction testing tool ( +\f0 \ul - a standalone TraceToFunction testing tool ( \f3 \ul reopt/tools/ttftest \f0 \ul )\ulnone \ \ @@ -519,7 +519,7 @@ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f3 \cf0 ttftest +\f3 \cf0 ttftest \f0 will also run the LLVM Verifier on the TraceFunction, and exit with an exit code of 0 if the verifier passes. This is the basic strategy used for the automated TraceToFunction regression tests ( \f3 reopt/test/TTFTestCases \f0 and @@ -529,7 +529,7 @@ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f3 \cf0 \ul \ulc0 dumptrace -\f0 \ul - list LLVM assembly for a trace's basic blocks ( +\f0 \ul - list LLVM assembly for a trace's basic blocks ( \f3 \ul reopt/tools/dumptrace \f0 \ul )\ulnone \ \ @@ -540,13 +540,13 @@ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f3 \cf0 dumptrace -\f0 also highlights two sets of values for your inspection: the values used on the trace which are defined outside the trace, and the values defined inside the trace which are used outside the trace. (Note that these are often subsets of the live-in/out sets computed by TraceToFunction; if you want to see those, use +\f0 also highlights two sets of values for your inspection: the values used on the trace which are defined outside the trace, and the values defined inside the trace which are used outside the trace. (Note that these are often subsets of the live-in/out sets computed by TraceToFunction; if you want to see those, use \f3 ttftest -print-live \f0 .)\ \ \f3 dumptrace -\f0 requires the same +\f0 requires the same \f3 -bc \f0 and \f3 -trace From gaeke at cs.uiuc.edu Tue Oct 12 15:22:17 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 12 Oct 2004 15:22:17 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp Message-ID: <200410122022.PAA23090@seraph.cs.uiuc.edu> Changes in directory reopt/lib/LightWtProfiling: RuntimeOptimizations.cpp updated: 1.54 -> 1.55 --- Log message: Add bug-isolation options: -disable-ttf, -disable-utf, and -disable-branch-stitch. --- Diffs of the changes: (+20 -0) Index: reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp diff -u reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.54 reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.55 --- reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.54 Thu Oct 7 12:00:12 2004 +++ reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp Tue Oct 12 15:22:06 2004 @@ -35,6 +35,20 @@ cl::CommaSeparated, cl::desc("Don't optimize these trace numbers, when using trace optimizer")); +// Bug-isolation mechanisms +cl::opt + DisableTTF("disable-ttf", + cl::init(false), + cl::desc("Disable TraceToFunction, UnpackTraceFunction and branch stitching in trace opt.")); +cl::opt + DisableUTF("disable-utf", + cl::init(false), + cl::desc("Disable UnpackTraceFunction and branch stitching in trace opt.")); +cl::opt + DisableBranchStitching("disable-branch-stitch", + cl::init(false), + cl::desc("Disable branch stitching in trace opt.")); + extern "C" void TraceOptimizerDone (uint64_t a, uint64_t traceStartAddr, uint64_t traceEndAddr) { DEBUG (std::cerr << "\n*** About to return from optimizeTrace() for trace #" @@ -87,6 +101,8 @@ if (TraceContainsCall (T)) return false; + DEBUG(if (DisableTTF) return false); + DEBUG(++TraceCount; if (std::find (SkipTrace.begin (), SkipTrace.end (), TraceCount) != SkipTrace.end ()) { @@ -110,11 +126,15 @@ DEBUG (WriteTraceToFile (&T)); TraceFunction *TF = BuildTraceFunction (T, MP); + DEBUG(if (DisableUTF) return false); + // Compile the TraceFunction to machine code using the optimizing trace JIT // compiler, and unpack the resulting optimized trace back into its matrix // function. uint64_t traceStartAddr = TJIT->compileTraceFunction (TF); + DEBUG(if (DisableBranchStitching) return false); + // Add a branch from address A (the parameter to this method) to the // entry basic block of the unpacked TraceFn. Future executions of the trace // will proceed from the optimized version of the code. From gaeke at cs.uiuc.edu Tue Oct 12 15:22:18 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 12 Oct 2004 15:22:18 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/lib/TraceCache/VirtualMem.cpp Message-ID: <200410122022.PAA23096@seraph.cs.uiuc.edu> Changes in directory reopt/lib/TraceCache: VirtualMem.cpp updated: 1.20 -> 1.21 --- Log message: Chris noticed that nowhere did I actually call rwxPages.insert(anything), and that I had two mprotect calls. I fixed that by factoring the mprotect calls out into a new static function ensurePageIsWritable(). Thanks! --- Diffs of the changes: (+15 -9) Index: reopt/lib/TraceCache/VirtualMem.cpp diff -u reopt/lib/TraceCache/VirtualMem.cpp:1.20 reopt/lib/TraceCache/VirtualMem.cpp:1.21 --- reopt/lib/TraceCache/VirtualMem.cpp:1.20 Tue Oct 12 14:47:17 2004 +++ reopt/lib/TraceCache/VirtualMem.cpp Tue Oct 12 15:22:08 2004 @@ -46,16 +46,21 @@ std::set rwxPages; +static inline void ensurePageIsWritable (uint64_t destAddr) { + if (rwxPages.find (destAddr &~ 0x1fff) == rwxPages.end ()) { + int rc = mprotect ((caddr_t)(destAddr & ~0x1fff), 0x2000, + PROT_READ|PROT_WRITE|PROT_EXEC); + assert (rc == 0); + rwxPages.insert (destAddr &~ 0x1fff); + } +} + /// writeInstToVM - Emit the word newInstr to memory at address destAddr. /// void VirtualMem::writeInstToVM (uint64_t destAddr, unsigned int newInstr) { DEBUG (std::cerr << "writeInstToVM (" << std::hex << destAddr << ", " << newInstr << ");\n" << std::dec); - if (rwxPages.find (destAddr &~ 0x7fff) == rwxPages.end ()) { - int rc = mprotect ((caddr_t)(destAddr &~ 0x7fff), 0x8000, - PROT_READ|PROT_WRITE|PROT_EXEC); - assert (rc == 0); - } + ensurePageIsWritable (destAddr); *((unsigned int *)destAddr) = newInstr; } @@ -66,10 +71,11 @@ std::vector &newInstrs) { DEBUG (std::cerr << "writeTraceToVM ("< Changes in directory llvm/include/llvm: Type.h updated: 1.65 -> 1.66 --- Log message: On second thought, OpaqueType is not really a good first-class type. --- Diffs of the changes: (+2 -5) Index: llvm/include/llvm/Type.h diff -u llvm/include/llvm/Type.h:1.65 llvm/include/llvm/Type.h:1.66 --- llvm/include/llvm/Type.h:1.65 Tue Oct 12 12:08:44 2004 +++ llvm/include/llvm/Type.h Tue Oct 12 15:35:04 2004 @@ -29,8 +29,6 @@ // users of the unknown type, causing them to reference a new, more concrete // type. Opaque types are deleted when their use list dwindles to zero users. // -// Opaque types are considered to be first-class types. -// //===----------------------------------------------------------------------===// #ifndef LLVM_TYPE_H @@ -192,11 +190,10 @@ inline bool isDerivedType() const { return ID >= FirstDerivedTyID; } /// isFirstClassType - Return true if the value is holdable in a register. - /// Note that we consider opaque types to be first class, as they may be - /// resolved to a first class type later. + /// inline bool isFirstClassType() const { return (ID != VoidTyID && ID <= LastPrimitiveTyID) || - ID == PointerTyID || ID == PackedTyID || ID == OpaqueTyID; + ID == PointerTyID || ID == PackedTyID; } /// isSized - Return true if it makes sense to take the size of this type. To From brukman at cs.uiuc.edu Tue Oct 12 16:48:13 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 12 Oct 2004 16:48:13 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/TimeValue.h Message-ID: <200410122148.QAA27773@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: TimeValue.h updated: 1.3 -> 1.4 --- Log message: Fix file comment header --- Diffs of the changes: (+1 -1) Index: llvm/include/llvm/System/TimeValue.h diff -u llvm/include/llvm/System/TimeValue.h:1.3 llvm/include/llvm/System/TimeValue.h:1.4 --- llvm/include/llvm/System/TimeValue.h:1.3 Mon Oct 4 13:10:18 2004 +++ llvm/include/llvm/System/TimeValue.h Tue Oct 12 16:48:02 2004 @@ -1,4 +1,4 @@ -//===-- TimeValue.h - Declare OS TimeValue Concept ---------------*- C++ -*-===// +//===-- TimeValue.h - Declare OS TimeValue Concept --------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // From gaeke at cs.uiuc.edu Tue Oct 12 19:02:54 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 12 Oct 2004 19:02:54 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/test/TEST.reopt.Makefile Message-ID: <200410130002.TAA19380@kain.cs.uiuc.edu> Changes in directory reopt/test: TEST.reopt.Makefile updated: 1.26 -> 1.27 --- Log message: Use $(PROFILE) to pull -pg into the link line if ENABLE_PROFILING=1. --- Diffs of the changes: (+1 -1) Index: reopt/test/TEST.reopt.Makefile diff -u reopt/test/TEST.reopt.Makefile:1.26 reopt/test/TEST.reopt.Makefile:1.27 --- reopt/test/TEST.reopt.Makefile:1.26 Mon Oct 4 15:15:28 2004 +++ reopt/test/TEST.reopt.Makefile Tue Oct 12 19:02:43 2004 @@ -59,7 +59,7 @@ # compiler. $(PROGRAMS_TO_TEST:%=Output/%.reopt-llc): \ Output/%.reopt-llc: Output/%.reopt-llc.s $(REOPTIMIZER_LIB) - $(CXX) $(CFLAGS) $< -o $@ $(REOPTIMIZER_LIB) $(REOPTIMIZER_SOLARISLIBS) + $(CXX) $(CFLAGS) $(PROFILE) $< -o $@ $(REOPTIMIZER_LIB) $(REOPTIMIZER_SOLARISLIBS) # 3. Run the reoptimized version. ifdef SPECTEST From reid at x10sys.com Tue Oct 12 19:19:09 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 12 Oct 2004 19:19:09 -0500 Subject: [llvm-commits] CVS: llvm/autoconf/AutoRegen.sh Message-ID: <200410130019.TAA02085@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: AutoRegen.sh updated: 1.8 -> 1.9 --- Log message: Harden the version requirements to the set that actually works after three days of trying to figure it out. Despite some developer's penchant for relaxing the tool versions, this just isn't possible. Only certain versions work with certain other versions. --- Diffs of the changes: (+3 -3) Index: llvm/autoconf/AutoRegen.sh diff -u llvm/autoconf/AutoRegen.sh:1.8 llvm/autoconf/AutoRegen.sh:1.9 --- llvm/autoconf/AutoRegen.sh:1.8 Sun Oct 10 14:09:33 2004 +++ llvm/autoconf/AutoRegen.sh Tue Oct 12 19:18:58 2004 @@ -22,13 +22,13 @@ fi aclocal --version | egrep '1\.9\.2' > /dev/null if test $? -ne 0 ; then - die "Your aclocal was not detected as being 1.9.1" + die "Your aclocal was not detected as being 1.9.2" fi autoheader --version | egrep '2\.59' > /dev/null if test $? -ne 0 ; then die "Your autoheader was not detected as being 2.59" fi -libtool --version | grep '1.5.10' > /dev/null +libtool --version | grep '1\.5\.10' > /dev/null if test $? -ne 0 ; then die "Your libtool was not detected as being 1.5.10" fi @@ -47,7 +47,7 @@ echo "### present. You should get just three 'Regenerating..' lines." echo "######################################################################" echo "" -echo "Regenerating aclocal.m4 with aclocal" +echo "Regenerating aclocal.m4 with aclocal 1.9.2" cwd=`pwd` if test $with_automake -eq 1 ; then mv configure.ac .configure.ac.save From reid at x10sys.com Tue Oct 12 19:19:36 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 12 Oct 2004 19:19:36 -0500 Subject: [llvm-commits] CVS: llvm/autoconf/ltmain.sh Message-ID: <200410130019.TAA02096@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: ltmain.sh updated: 1.2 -> 1.3 --- Log message: Update for libtool 1.5.10 --- Diffs of the changes: (+592 -480) Index: llvm/autoconf/ltmain.sh diff -u llvm/autoconf/ltmain.sh:1.2 llvm/autoconf/ltmain.sh:1.3 --- llvm/autoconf/ltmain.sh:1.2 Thu Jul 31 15:59:32 2003 +++ llvm/autoconf/ltmain.sh Tue Oct 12 19:19:25 2004 @@ -1,7 +1,7 @@ # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # @@ -24,6 +24,34 @@ # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.5.10 +TIMESTAMP=" (1.1220.2.130 2004/09/19 12:13:49)" + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes. +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. @@ -36,7 +64,7 @@ : else # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$0" --no-reexec ${1+"$@"} + exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then @@ -45,19 +73,9 @@ cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 + exit $EXIT_FAILURE fi # Global variables. @@ -118,10 +137,13 @@ # Shell function definitions: # This seems to be the best place for them +# func_win32_libid arg +# return the library type of file 'arg' +# # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. -win32_libid () { +func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in @@ -130,7 +152,7 @@ ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` if test "X$win32_nmres" = "Ximport" ; then @@ -140,7 +162,7 @@ fi fi ;; - *DLL*) + *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... @@ -154,9 +176,192 @@ $echo $win32_libid_type } + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () { + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case "$@ " in + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () { + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xdir="$my_gentop/$my_xlib" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + status=$? + if test "$status" -ne 0 && test ! -d "$my_xdir"; then + exit $status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename $darwin_archive` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + # Remove the table of contents from the thin files. + $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true + $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $AR -xo "${darwin_base_archive}" + rm "${darwin_base_archive}" + cd "$darwin_curdir" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + rm -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + (cd $my_xdir && $AR x $my_xabs) || exit $? + fi # $darwin_arches + fi # $run + ;; + *) + # We will extract separately just the conflicting names and we will + # no longer touch any unique names. It is faster to leave these + # extract automatically by $AR in one run. + $show "(cd $my_xdir && $AR x $my_xabs)" + $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $? + if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 + $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 + $AR t "$my_xabs" | sort | uniq -cd | while read -r count name + do + i=1 + while test "$i" -le "$count" + do + # Put our $i before any first dot (extension) + # Never overwrite any file + name_to="$name" + while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to" + do + name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` + done + $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')" + $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $? + i=`expr $i + 1` + done + done + fi + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} # End of Shell function definitions ##################################### +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + # Parse our command line options once, thoroughly. while test "$#" -gt 0 do @@ -176,12 +381,13 @@ ;; tag) tagname="$arg" + preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac @@ -191,10 +397,10 @@ # not specially marked. ;; *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi @@ -223,21 +429,22 @@ $echo "Copyright (C) 2003 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit 0 + exit $EXIT_SUCCESS ;; --config) - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done - exit 0 + exit $EXIT_SUCCESS ;; --debug) $echo "$progname: enabling shell trace mode" set -x + preserve_args="$preserve_args $arg" ;; --dry-run | -n) @@ -256,7 +463,7 @@ else $echo "disable static libraries" fi - exit 0 + exit $EXIT_SUCCESS ;; --finish) mode="finish" ;; @@ -268,6 +475,7 @@ --quiet | --silent) show=: + preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag ;; @@ -275,6 +483,7 @@ set tag "$optarg" ${1+"$@"} shift prev=tag + preserve_args="$preserve_args --tag" ;; -dlopen) @@ -285,7 +494,7 @@ -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; *) @@ -298,7 +507,7 @@ if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi # If this variable is set in any of the actions, the command in it @@ -354,7 +563,7 @@ if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. @@ -369,9 +578,11 @@ # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes suppress_output= arg_mode=normal libobj= + later= for arg do @@ -394,24 +605,19 @@ -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit 1 + exit $EXIT_FAILURE fi arg_mode=target continue ;; - -static) - build_old_libs=yes + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" continue ;; - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no + -no-suppress) + suppress_opt=no continue ;; @@ -424,7 +630,7 @@ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' - for arg in $args; do + for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. @@ -474,11 +680,11 @@ case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" - exit 1 + exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; *) # Get the name of the library object. @@ -511,50 +717,30 @@ *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac - # Infer tagged configuration to use if any are available and - # if one wasn't chosen via the "--tag" command line option. - # Only attempt this if the compiler in the base compile - # command doesn't match the default compiler. - if test -n "$available_tags" && test -z "$tagname"; then - case $base_compile in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" - case "$base_compile " in - "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit 1 -# else -# $echo "$modename: using $tagname tagged configuration" - fi + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue ;; esac - fi + done objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` @@ -568,7 +754,7 @@ if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi # Delete any leftover library objects. @@ -579,7 +765,7 @@ fi $run $rm $removelist - trap "$run $rm $removelist; exit 1" 1 2 15 + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in @@ -598,7 +784,7 @@ output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit 1" 1 2 15 + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no @@ -608,7 +794,7 @@ # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then - until $run ln "$0" "$lockfile" 2>/dev/null; do + until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done @@ -626,7 +812,7 @@ compiler." $run $rm $removelist - exit 1 + exit $EXIT_FAILURE fi $echo $srcfile > "$lockfile" fi @@ -681,7 +867,7 @@ if $run eval "$command"; then : else test -n "$output_obj" && $run $rm $removelist - exit 1 + exit $EXIT_FAILURE fi if test "$need_locks" = warn && @@ -701,7 +887,7 @@ compiler." $run $rm $removelist - exit 1 + exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one @@ -722,7 +908,9 @@ EOF # Allow error messages only from the first compilation. - suppress_output=' >/dev/null 2>&1' + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi else # No PIC object so indicate it doesn't exist in the libtool # object file. @@ -751,7 +939,7 @@ if $run eval "$command"; then : else $run $rm $removelist - exit 1 + exit $EXIT_FAILURE fi if test "$need_locks" = warn && @@ -771,7 +959,7 @@ compiler." $run $rm $removelist - exit 1 + exit $EXIT_FAILURE fi # Just move the object if needed @@ -809,7 +997,7 @@ $run $rm "$lockfile" fi - exit 0 + exit $EXIT_SUCCESS ;; # libtool link mode @@ -835,7 +1023,7 @@ ;; esac libtool_args="$nonopt" - base_compile="$nonopt" + base_compile="$nonopt $@" compile_command="$nonopt" finalize_command="$nonopt" @@ -867,6 +1055,7 @@ no_install=no objs= non_pic_objects= + precious_files_regex= prefer_static_libs=no preload=no prev= @@ -880,6 +1069,8 @@ vinfo= vinfo_number=no + func_infer_tag $base_compile + # We need to know -static, to get the right output filenames. for arg do @@ -911,7 +1102,6 @@ # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" - base_compile="$base_compile $arg" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") @@ -975,7 +1165,7 @@ export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" - exit 1 + exit $EXIT_FAILURE fi prev= continue @@ -990,6 +1180,11 @@ prev= continue ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; release) release="-$arg" prev= @@ -1022,7 +1217,7 @@ test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit 1 + exit $EXIT_FAILURE fi # Extract subdirectory from the argument. @@ -1075,7 +1270,7 @@ # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit 1 + exit $EXIT_FAILURE else # Dry-run case. @@ -1096,7 +1291,7 @@ done else $echo "$modename: link input file \`$save_arg' does not exist" - exit 1 + exit $EXIT_FAILURE fi arg=$save_arg prev= @@ -1108,7 +1303,7 @@ [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then @@ -1148,6 +1343,11 @@ finalize_command="$finalize_command $qarg" continue ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; *) eval "$prev=\"\$arg\"" prev= @@ -1196,7 +1396,7 @@ -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" - exit 1 + exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms @@ -1232,7 +1432,7 @@ absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - exit 1 + exit $EXIT_FAILURE fi dir="$absdir" ;; @@ -1287,6 +1487,11 @@ continue ;; + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + deplibs="$deplibs $arg" + continue + ;; + -module) module=yes continue @@ -1351,6 +1556,11 @@ -o) prev=output ;; + -precious-files-regex) + prev=precious_regex + continue + ;; + -release) prev=release continue @@ -1373,7 +1583,7 @@ [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac case "$xrpath " in @@ -1496,7 +1706,7 @@ test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit 1 + exit $EXIT_FAILURE fi # Extract subdirectory from the argument. @@ -1549,7 +1759,7 @@ # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit 1 + exit $EXIT_FAILURE else # Dry-run case. @@ -1616,48 +1826,7 @@ if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 - exit 1 - fi - - # Infer tagged configuration to use if any are available and - # if one wasn't chosen via the "--tag" command line option. - # Only attempt this if the compiler in the base link - # command doesn't match the default compiler. - if test -n "$available_tags" && test -z "$tagname"; then - case $base_compile in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" - case $base_compile in - "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) - # The compiler in $compile_command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit 1 -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac + exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then @@ -1701,7 +1870,7 @@ "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; @@ -1711,7 +1880,7 @@ case $host in *cygwin* | *mingw* | *pw32*) - # don't eliminate duplcations in $postdeps and $predeps + # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) @@ -1764,7 +1933,7 @@ *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac done @@ -1802,6 +1971,15 @@ lib= found=no case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + fi + continue + ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 @@ -1813,12 +1991,18 @@ fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do - # Search the libtool library - lib="$searchdir/lib${name}.la" - if test -f "$lib"; then - found=yes - break - fi + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library @@ -1883,11 +2067,11 @@ fi if test "$pass" = scan; then deplibs="$deplib $deplibs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 @@ -1915,7 +2099,22 @@ fi case $linkmode in lib) - if test "$deplibs_check_method" != pass_all; then + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" @@ -1966,14 +2165,14 @@ if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 - exit 1 + exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 + exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` @@ -2009,7 +2208,7 @@ if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit 1 + exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" @@ -2026,12 +2225,12 @@ done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit 1 + exit $EXIT_FAILURE fi continue fi # $pass = conv - + # Get the name of the library we link against. linklib= for l in $old_library $library_names; do @@ -2039,16 +2238,18 @@ done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit 1 + exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit 1 + exit $EXIT_FAILURE fi - if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't @@ -2086,10 +2287,17 @@ absdir="$libdir" fi else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` @@ -2097,7 +2305,7 @@ if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit 1 + exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). @@ -2124,7 +2332,7 @@ continue fi - + if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" @@ -2211,17 +2419,18 @@ need_relink=yes fi # This is a shared library - - # Warn about portability, can't link against -module's on some systems (darwin) - if test "$shouldnotlink" = yes && test "$pass" = link ; then + + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi - $echo "*** $linklib is not portable!" - fi + $echo "*** $linklib is not portable!" + fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. @@ -2279,9 +2488,10 @@ else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' - eval cmds=\"$extract_expsyms_cmds\" + cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -2292,9 +2502,10 @@ if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' - eval cmds=\"$old_archive_from_expsyms_cmds\" + cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -2317,9 +2528,9 @@ case $host in *-*-sco3.2v5* ) add_dir="-L$dir" ;; *-*-darwin* ) - # if the lib is a module then we can not link against it, someone - # is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then + # if the lib is a module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo @@ -2327,7 +2538,7 @@ $echo "** The link will probably fail, sorry" else add="$dir/$old_library" - fi + fi fi esac elif test "$hardcode_minus_L" = no; then @@ -2352,7 +2563,7 @@ if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) - add_dir="-L$inst_prefix_dir$libdir $add_dir" + add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi @@ -2369,7 +2580,7 @@ if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" - exit 1 + exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then @@ -2412,7 +2623,8 @@ esac add="-l$name" elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" @@ -2424,7 +2636,7 @@ if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) - add_dir="-L$inst_prefix_dir$libdir $add_dir" + add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi @@ -2492,7 +2704,8 @@ if test "$linkmode" = lib; then if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= @@ -2549,7 +2762,7 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 + exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 @@ -2559,7 +2772,8 @@ depdepl= case $host in *-*-darwin*) - # we do not want to link against static libs, but need to link against shared + # we do not want to link against static libs, + # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do @@ -2567,39 +2781,42 @@ done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" - fi - newlib_search_path="$newlib_search_path $path" - path="" + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac fi + path="" ;; *) - path="-L$path" - ;; - esac - + path="-L$path" + ;; + esac ;; - -l*) + -l*) case $host in *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" ;; *) continue ;; - esac + esac ;; *) continue ;; esac case " $deplibs " in *" $depdepl "*) ;; - *) deplibs="$deplibs $depdepl" ;; - esac + *) deplibs="$depdepl $deplibs" ;; + esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; @@ -2689,7 +2906,8 @@ eval $var=\"$tmp_libs\" done # for var fi - # Last step: remove runtime libs from dependency_libs (they stay in deplibs) + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in @@ -2749,19 +2967,19 @@ case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval shared_ext=\"$shrext\" + eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval shared_ext=\"$shrext\" + eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` @@ -2772,7 +2990,7 @@ if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit 1 + exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" @@ -2820,13 +3038,13 @@ if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible - + case $vinfo_number in yes) number_major="$2" @@ -2870,7 +3088,7 @@ *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac @@ -2879,7 +3097,7 @@ *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac @@ -2888,14 +3106,14 @@ *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 + exit $EXIT_FAILURE fi # Calculate the version variables. @@ -2912,7 +3130,7 @@ versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) @@ -2984,7 +3202,7 @@ *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac @@ -3038,6 +3256,12 @@ *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi removelist="$removelist $p" ;; *) ;; @@ -3517,7 +3741,7 @@ fi # Get the real and link names of the library. - eval shared_ext=\"$shrext\" + eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" @@ -3547,10 +3771,11 @@ $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols - eval cmds=\"$export_symbols_cmds\" + cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" @@ -3580,12 +3805,12 @@ for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; - *) + *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done - deplibs="$tmp_deplibs" + deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then @@ -3593,67 +3818,13 @@ eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - status=$? - if test "$status" -ne 0 && test ! -d "$gentop"; then - exit $status - fi generated="$generated $gentop" - for xlib in $convenience; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "$mkdir $xdir" - $run $mkdir "$xdir" - status=$? - if test "$status" -ne 0 && test ! -d "$xdir"; then - exit $status - fi - # We will extract separately just the conflicting names and we will no - # longer touch any unique names. It is faster to leave these extract - # automatically by $AR in one run. - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 - $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 - $AR t "$xabs" | sort | uniq -cd | while read -r count name - do - i=1 - while test "$i" -le "$count" - do - # Put our $i before any first dot (extension) - # Never overwrite any file - name_to="$name" - while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" - do - name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` - done - $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" - $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? - i=`expr $i + 1` - done - done - fi - - libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" fi fi - + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" @@ -3667,19 +3838,23 @@ # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval cmds=\"$module_expsym_cmds\" + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds else - eval cmds=\"$module_cmds\" + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds else - eval cmds=\"$archive_cmds\" + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds fi fi - if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && + if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else @@ -3780,19 +3955,28 @@ # value of $libobjs for piecewise linking. # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds else - eval cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. - eval cmds=\"\$cmds~$rm $delfiles\" + eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -3801,7 +3985,7 @@ # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? - exit 0 + exit $EXIT_SUCCESS fi # Create links to the real library. @@ -3849,7 +4033,7 @@ *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit 1 + exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` @@ -3878,64 +4062,10 @@ eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - status=$? - if test "$status" -ne 0 && test ! -d "$gentop"; then - exit $status - fi generated="$generated $gentop" - for xlib in $convenience; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "$mkdir $xdir" - $run $mkdir "$xdir" - status=$? - if test "$status" -ne 0 && test ! -d "$xdir"; then - exit $status - fi - # We will extract separately just the conflicting names and we will no - # longer touch any unique names. It is faster to leave these extract - # automatically by $AR in one run. - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 - $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 - $AR t "$xabs" | sort | uniq -cd | while read -r count name - do - i=1 - while test "$i" -le "$count" - do - # Put our $i before any first dot (extension) - # Never overwrite any file - name_to="$name" - while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" - do - name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` - done - $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" - $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? - i=`expr $i + 1` - done - done - fi - - reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi @@ -3943,10 +4073,11 @@ reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" - eval cmds=\"$reload_cmds\" + cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -3959,7 +4090,7 @@ $run ${rm}r $gentop fi - exit 0 + exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then @@ -3972,17 +4103,18 @@ # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? - exit 0 + exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" - eval cmds=\"$reload_cmds\" + cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -3994,7 +4126,7 @@ $run ${rm}r $gentop fi - exit 0 + exit $EXIT_SUCCESS ;; prog) @@ -4312,7 +4444,7 @@ ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac else @@ -4400,7 +4532,7 @@ # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? - exit 0 + exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then @@ -4455,10 +4587,10 @@ fi # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $0 --fallback-echo"; then - case $0 in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; - *) qecho="$SHELL `pwd`/$0 --fallback-echo";; + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else @@ -4484,7 +4616,7 @@ cwrappersource=`$echo ${objdir}/lt-${output}.c` cwrapper=`$echo ${output}.exe` $rm $cwrappersource $cwrapper - trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15 + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource < $output "\ #! $SHELL @@ -4714,7 +4846,7 @@ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. -if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" @@ -4793,7 +4925,7 @@ else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" - exit 1 + exit $EXIT_FAILURE fi fi @@ -4855,20 +4987,20 @@ esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit 1 + exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 + exit $EXIT_FAILURE fi fi\ " chmod +x $output fi - exit 0 + exit $EXIT_SUCCESS ;; esac @@ -4891,76 +5023,21 @@ if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - status=$? - if test "$status" -ne 0 && test ! -d "$gentop"; then - exit $status - fi generated="$generated $gentop" - # Add in members from convenience archives. - for xlib in $addlibs; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "$mkdir $xdir" - $run $mkdir "$xdir" - status=$? - if test "$status" -ne 0 && test ! -d "$xdir"; then - exit $status - fi - # We will extract separately just the conflicting names and we will no - # longer touch any unique names. It is faster to leave these extract - # automatically by $AR in one run. - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 - $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 - $AR t "$xabs" | sort | uniq -cd | while read -r count name - do - i=1 - while test "$i" -le "$count" - do - # Put our $i before any first dot (extension) - # Never overwrite any file - name_to="$name" - while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" - do - name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` - done - $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" - $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? - i=`expr $i + 1` - done - done - fi - - oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` - done + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - eval cmds=\"$old_archive_from_new_cmds\" + cmds=$old_archive_from_new_cmds else eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : + cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." @@ -4987,7 +5064,7 @@ for obj in $save_oldobjs do last_oldobj=$obj - done + done for obj in $save_oldobjs do oldobjs="$objlist $obj" @@ -5001,7 +5078,7 @@ oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB - fi + fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= @@ -5012,12 +5089,13 @@ if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else - eval cmds=\"\$concat_cmds~$old_archive_cmds\" + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do + eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? @@ -5049,8 +5127,12 @@ fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + # Only create the output if not a dry run. if test -z "$run"; then @@ -5069,7 +5151,7 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 + exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; @@ -5083,7 +5165,7 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 + exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done @@ -5094,11 +5176,30 @@ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 + exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin @@ -5155,7 +5256,7 @@ $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac - exit 0 + exit $EXIT_SUCCESS ;; # libtool install mode @@ -5244,13 +5345,13 @@ if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi if test -z "$files"; then @@ -5260,7 +5361,7 @@ $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. @@ -5281,7 +5382,7 @@ if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi fi case $destdir in @@ -5293,7 +5394,7 @@ *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac done @@ -5322,7 +5423,7 @@ else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi library_names= @@ -5364,7 +5465,7 @@ # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 - exit 1 + exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then @@ -5379,7 +5480,7 @@ if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit 1 + exit $EXIT_FAILURE fi fi @@ -5414,10 +5515,11 @@ # Do each command in the postinstall commands. lib="$destdir/$realname" - eval cmds=\"$postinstall_cmds\" + cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -5457,7 +5559,7 @@ *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac @@ -5475,7 +5577,7 @@ $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi - exit 0 + exit $EXIT_SUCCESS ;; *) @@ -5529,7 +5631,7 @@ # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 - exit 1 + exit $EXIT_FAILURE fi finalize=yes @@ -5570,8 +5672,12 @@ tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" - if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : + save_umask=`umask` + umask 0077 + if $mkdir "$tmpdir"; then + umask $save_umask else + umask $save_umask $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi @@ -5630,16 +5736,17 @@ $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? - if test -n "$stripme" && test -n "$striplib"; then + if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. - eval cmds=\"$old_postinstall_cmds\" + cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done @@ -5653,9 +5760,9 @@ if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $0 --finish$current_libdirs' + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else - exit 0 + exit $EXIT_SUCCESS fi ;; @@ -5674,10 +5781,11 @@ for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. - eval cmds=\"$finish_cmds\" + cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" @@ -5694,7 +5802,7 @@ fi # Exit here if they wanted silent mode. - test "$show" = : && exit 0 + test "$show" = : && exit $EXIT_SUCCESS $echo "----------------------------------------------------------------------" $echo "Libraries have been installed in:" @@ -5730,7 +5838,7 @@ $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "----------------------------------------------------------------------" - exit 0 + exit $EXIT_SUCCESS ;; # libtool execute mode @@ -5742,7 +5850,7 @@ if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" - exit 1 + exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. @@ -5750,7 +5858,7 @@ if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi dir= @@ -5761,7 +5869,7 @@ else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi # Read the libtool library. @@ -5788,7 +5896,7 @@ dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit 1 + exit $EXIT_FAILURE fi ;; @@ -5868,7 +5976,7 @@ $echo "export $shlibpath_var" fi $echo "$cmd$args" - exit 0 + exit $EXIT_SUCCESS fi ;; @@ -5896,7 +6004,7 @@ if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi rmdirs= @@ -5951,10 +6059,11 @@ if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. - eval cmds=\"$postuninstall_cmds\" + cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then @@ -5966,10 +6075,11 @@ if test -n "$old_library"; then # Do each command in the old_postuninstall commands. - eval cmds=\"$old_postuninstall_cmds\" + cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then @@ -6008,7 +6118,7 @@ if test "$mode" = clean ; then noexename=$name case $file in - *.exe) + *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, @@ -6053,20 +6163,20 @@ "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 - exit 1 + exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd - exit 1 + exit $EXIT_FAILURE fi # We need to display help for each of the modes. @@ -6102,7 +6212,7 @@ a more detailed description of MODE. Report bugs to ." - exit 0 + exit $EXIT_SUCCESS ;; clean) @@ -6214,6 +6324,8 @@ -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries @@ -6255,14 +6367,14 @@ *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 - exit 1 + exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." -exit 0 +exit $EXIT_SUCCESS # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting From reid at x10sys.com Tue Oct 12 19:51:55 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 12 Oct 2004 19:51:55 -0500 Subject: [llvm-commits] CVS: llvm/autoconf/m4/libtool.m4 Message-ID: <200410130051.TAA02245@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: libtool.m4 updated: 1.4 -> 1.5 --- Log message: Changes for libtool 1.5.10 --- Diffs of the changes: (+64 -63) Index: llvm/autoconf/m4/libtool.m4 diff -u llvm/autoconf/m4/libtool.m4:1.4 llvm/autoconf/m4/libtool.m4:1.5 --- llvm/autoconf/m4/libtool.m4:1.4 Sun Sep 19 20:41:24 2004 +++ llvm/autoconf/m4/libtool.m4 Tue Oct 12 19:51:45 2004 @@ -1,18 +1,3 @@ -############################################################################### -############################################################################### -####### READ THIS: -####### THIS FILE IS BASED ON THE VERSION IN libtool 1.5.10. -####### The following changes have been made: -####### * this big bold header has been added -####### * fix obsolete constructs (ala autoupdate) -####### * the name of the generated tool is "mklib" instead of "libtool" -####### The last change is provided to avoid tab completion errors on the "lib" -####### prefix. AutoRegen.sh checks for version 1.5.10 of libtool so attempts -####### to use another version with this AC_PROG_LIBTOOL definition should -####### fail. -####### You've been warned. -############################################################################### -############################################################################### # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 ## Free Software Foundation, Inc. @@ -206,13 +191,13 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib;$old_postinstall_cmds" + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) - old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds" + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac - old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` @@ -554,9 +539,10 @@ SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) + [AC_LANG_PUSH([C]) + AC_LINK_IFELSE([AC_LANG_SOURCE([[]],[[]])], + [lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP([C])]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" @@ -1237,13 +1223,13 @@ yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`; - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`; - dldir=$destdir/`dirname \$dlpath`; - test -d \$dldir || mkdir -p \$dldir; + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`; - dlpath=$dir/\$dldll; + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes @@ -1699,7 +1685,7 @@ # Update the list of available tags. if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile + echo appending configuration tag "$tagname" to $ofile case $tagname in CXX) @@ -2585,7 +2571,7 @@ aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then - archive_cmds="$archive_cmds;\$RANLIB \$lib" + archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; @@ -2858,7 +2844,7 @@ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag};$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; @@ -2889,7 +2875,8 @@ else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi @@ -2930,16 +2917,16 @@ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs;$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs;$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -2947,8 +2934,8 @@ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no @@ -3003,7 +2990,7 @@ _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname;$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -3016,7 +3003,7 @@ ;; *) if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname;$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no @@ -3332,7 +3319,10 @@ cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp;$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib;$rm $lib.exp' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: @@ -3408,7 +3398,8 @@ # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;$rm $lib.exp' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -3453,7 +3444,9 @@ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;$rm $lib.exp' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -3462,8 +3455,8 @@ # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;$rm $lib.exp' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -3736,7 +3729,7 @@ aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then - archive_cmds="$archive_cmds;\$RANLIB \$lib" + archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; @@ -5146,7 +5139,7 @@ ;; amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes @@ -5188,7 +5181,8 @@ else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi @@ -5245,7 +5239,9 @@ *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver;cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver; $echo "local: *; };" >> $output_objdir/$libname.ver; + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds" @@ -5282,7 +5278,7 @@ aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE;$AR $AR_FLAGS $lib $output_objdir/$soname' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes @@ -5404,13 +5400,13 @@ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag};$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section @@ -5433,7 +5429,7 @@ # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll;linknames=' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. @@ -5473,8 +5469,8 @@ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -5482,8 +5478,8 @@ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no @@ -5531,9 +5527,9 @@ hpux9*) if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname;$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname;$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: @@ -5654,7 +5650,7 @@ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def;$echo DATA >> $output_objdir/$libname.def;$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def;$echo EXPORTS >> $output_objdir/$libname.def;emxexp $libobjs >> $output_objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; @@ -5678,7 +5674,9 @@ else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp; $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib;$rm $lib.exp' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi @@ -5697,10 +5695,12 @@ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags;$rm $lib.exp' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -5789,7 +5789,8 @@ # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' From reid at x10sys.com Tue Oct 12 20:01:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 12 Oct 2004 20:01:14 -0500 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200410130101.UAA02343@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.128 -> 1.129 --- Log message: Resolution to PR451: http://llvm.cs.uiuc.edu/PR451 . --- Diffs of the changes: (+157 -133) Index: llvm/configure diff -u llvm/configure:1.128 llvm/configure:1.129 --- llvm/configure:1.128 Mon Oct 4 17:05:52 2004 +++ llvm/configure Tue Oct 12 20:01:03 2004 @@ -4283,13 +4283,6 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -int -main () -{ - - ; - return 0; -} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 @@ -5061,7 +5054,7 @@ # Provide some information about the compiler. -echo "$as_me:5064:" \ +echo "$as_me:5057:" \ "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 @@ -5836,13 +5829,13 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib;$old_postinstall_cmds" + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) - old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds" + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac - old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` @@ -6118,11 +6111,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6121: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6114: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6125: \$? = $ac_status" >&5 + echo "$as_me:6118: \$? = $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 @@ -6361,11 +6354,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6364: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6357: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6368: \$? = $ac_status" >&5 + echo "$as_me:6361: \$? = $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 @@ -6421,11 +6414,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6424: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6417: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6428: \$? = $ac_status" >&5 + echo "$as_me:6421: \$? = $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 @@ -6549,7 +6542,7 @@ ;; amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes @@ -6591,7 +6584,8 @@ else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi @@ -6648,7 +6642,9 @@ *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then - archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver;cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver; $echo "local: *; };" >> $output_objdir/$libname.ver; + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds="$tmp_archive_cmds" @@ -6685,7 +6681,7 @@ aix3*) allow_undefined_flag=unsupported always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE;$AR $AR_FLAGS $lib $output_objdir/$soname' + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes @@ -6909,13 +6905,13 @@ whole_archive_flag_spec=' ' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag};$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section @@ -6938,7 +6934,7 @@ # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll;linknames=' + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. @@ -6978,8 +6974,8 @@ archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -6987,8 +6983,8 @@ archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no @@ -7036,9 +7032,9 @@ hpux9*) if test "$GCC" = yes; then - archive_cmds='$rm $output_objdir/$soname;$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - archive_cmds='$rm $output_objdir/$soname;$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: @@ -7159,7 +7155,7 @@ hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def;$echo DATA >> $output_objdir/$libname.def;$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def;$echo EXPORTS >> $output_objdir/$libname.def;emxexp $libobjs >> $output_objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; @@ -7183,7 +7179,9 @@ else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp; $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib;$rm $lib.exp' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi @@ -7202,10 +7200,12 @@ no_undefined_flag=' -z text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags;$rm $lib.exp' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no @@ -7294,7 +7294,8 @@ # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' @@ -7509,13 +7510,13 @@ yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`; - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`; - dldir=$destdir/`dirname \$dlpath`; - test -d \$dldir || mkdir -p \$dldir; + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`; - dlpath=$dir/\$dldll; + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes @@ -8598,7 +8599,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_CXX=no fi @@ -9906,16 +9908,16 @@ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else - archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs;$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs;$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -9923,8 +9925,8 @@ archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no @@ -9979,7 +9981,7 @@ ld_shlibs_CXX=no ;; aCC) - archive_cmds_CXX='$rm $output_objdir/$soname;$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -9992,7 +9994,7 @@ ;; *) if test "$GXX" = yes; then - archive_cmds_CXX='$rm $output_objdir/$soname;$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -10308,7 +10310,10 @@ cxx) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp;$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib;$rm $lib.exp' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: @@ -10384,7 +10389,8 @@ # Sun C++ 4.2, 5.x and Centerline C++ no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no @@ -10429,7 +10435,9 @@ no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -10438,8 +10446,8 @@ # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -10882,11 +10890,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10885: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10893: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10889: \$? = $ac_status" >&5 + echo "$as_me:10897: \$? = $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 @@ -10942,11 +10950,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10945: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10953: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10949: \$? = $ac_status" >&5 + echo "$as_me:10957: \$? = $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 @@ -11214,13 +11222,13 @@ yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`; - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`; - dldir=$destdir/`dirname \$dlpath`; - test -d \$dldir || mkdir -p \$dldir; + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`; - dlpath=$dir/\$dldll; + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes @@ -12303,7 +12311,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:13249: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13245: \$? = $ac_status" >&5 + echo "$as_me:13253: \$? = $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 @@ -13298,11 +13306,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13301: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13309: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13305: \$? = $ac_status" >&5 + echo "$as_me:13313: \$? = $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 @@ -13426,7 +13434,7 @@ ;; amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes @@ -13468,7 +13476,8 @@ else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi @@ -13525,7 +13534,9 @@ *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver;cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver; $echo "local: *; };" >> $output_objdir/$libname.ver; + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_F77="$tmp_archive_cmds" @@ -13562,7 +13573,7 @@ aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes - archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE;$AR $AR_FLAGS $lib $output_objdir/$soname' + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes @@ -13766,13 +13777,13 @@ whole_archive_flag_spec_F77=' ' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag};$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section @@ -13795,7 +13806,7 @@ # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll;linknames=' + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. @@ -13835,8 +13846,8 @@ archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -13844,8 +13855,8 @@ archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no @@ -13893,9 +13904,9 @@ hpux9*) if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname;$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - archive_cmds_F77='$rm $output_objdir/$soname;$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: @@ -14016,7 +14027,7 @@ hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported - archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def;$echo DATA >> $output_objdir/$libname.def;$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def;$echo EXPORTS >> $output_objdir/$libname.def;emxexp $libobjs >> $output_objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; @@ -14040,7 +14051,9 @@ else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp; $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib;$rm $lib.exp' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi @@ -14059,10 +14072,12 @@ no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no @@ -14151,7 +14166,8 @@ # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_F77= hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' @@ -14366,13 +14382,13 @@ yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`; - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`; - dldir=$destdir/`dirname \$dlpath`; - test -d \$dldir || mkdir -p \$dldir; + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`; - dlpath=$dir/\$dldll; + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes @@ -15329,11 +15345,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15332: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15348: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15336: \$? = $ac_status" >&5 + echo "$as_me:15352: \$? = $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 @@ -15572,11 +15588,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15575: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15591: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15579: \$? = $ac_status" >&5 + echo "$as_me:15595: \$? = $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 @@ -15632,11 +15648,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15635: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15651: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15639: \$? = $ac_status" >&5 + echo "$as_me:15655: \$? = $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 @@ -15760,7 +15776,7 @@ ;; amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes @@ -15802,7 +15818,8 @@ else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi @@ -15859,7 +15876,9 @@ *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver;cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver; $echo "local: *; };" >> $output_objdir/$libname.ver; + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_GCJ="$tmp_archive_cmds" @@ -15896,7 +15915,7 @@ aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE;$AR $AR_FLAGS $lib $output_objdir/$soname' + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes @@ -16120,13 +16139,13 @@ whole_archive_flag_spec_GCJ=' ' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag};$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section @@ -16149,7 +16168,7 @@ # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll;linknames=' + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. @@ -16189,8 +16208,8 @@ archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -16198,8 +16217,8 @@ archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no @@ -16247,9 +16266,9 @@ hpux9*) if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname;$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - archive_cmds_GCJ='$rm $output_objdir/$soname;$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: @@ -16370,7 +16389,7 @@ hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def;$echo DATA >> $output_objdir/$libname.def;$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def;$echo EXPORTS >> $output_objdir/$libname.def;emxexp $libobjs >> $output_objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; @@ -16394,7 +16413,9 @@ else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp; $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib;$rm $lib.exp' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi @@ -16413,10 +16434,12 @@ no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no @@ -16505,7 +16528,8 @@ # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_GCJ= hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' @@ -16720,13 +16744,13 @@ yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`; - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`; - dldir=$destdir/`dirname \$dlpath`; - test -d \$dldir || mkdir -p \$dldir; + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`; - dlpath=$dir/\$dldll; + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes @@ -17809,7 +17833,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < Changes in directory llvm/autoconf: README.TXT added (r1.1) --- Log message: Save Reid's notes from bugzilla on the proper procedure to upgrade libtool --- Diffs of the changes: (+12 -0) Index: llvm/autoconf/README.TXT diff -c /dev/null llvm/autoconf/README.TXT:1.1 *** /dev/null Tue Oct 12 20:08:05 2004 --- llvm/autoconf/README.TXT Tue Oct 12 20:07:55 2004 *************** *** 0 **** --- 1,12 ---- + Upgrading Libtool + ----------------- + + If you are in the mood to upgrade libtool, you must do the following: + + 1. configure/build/install libtool with --prefix= + 2. Copy /share/aclocal/libtool.m4 to llvm/autoconf/m4/libtool.m4 + 3. Copy /share/libtool/ltmain.sh to llvm/autoconf/ltmain.sh + 4. Adjust the llvm/autoconf/m4/libtool.m4 file to ensure that the variable + default_ofile is set to "mklib" instead of "libtool" + 5. Possibly adjust llvm/autoconf/m4/libtool.m4 to get rid of autoconf + warnings related to obsolete autconf features (e.g. AC_TRY_LINK) From lattner at cs.uiuc.edu Tue Oct 12 23:45:06 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 12 Oct 2004 23:45:06 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Constants.h Message-ID: <200410130445.XAA10256@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.58 -> 1.59 --- Log message: Update doco, make doxygen more, use standard dividers. --- Diffs of the changes: (+23 -19) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.58 llvm/include/llvm/Constants.h:1.59 --- llvm/include/llvm/Constants.h:1.58 Mon Oct 11 17:52:01 2004 +++ llvm/include/llvm/Constants.h Tue Oct 12 23:44:53 2004 @@ -8,7 +8,12 @@ //===----------------------------------------------------------------------===// // // This file contains the declarations for the subclasses of Constant, which -// represent the different type of constant pool values +// represent the different flavors of constant values that live in LLVM. Note +// that Constants are immutable (once created they never change) and are fully +// shared by structural equivalence. This means that two structurally +// equivalent constants will always have the same address. Constant's are +// created on demand as needed and never deleted: thus clients don't have to +// worry about the lifetime of the objects. // //===----------------------------------------------------------------------===// @@ -31,8 +36,7 @@ template struct ConvertConstantType; - -//===--------------------------------------------------------------------------- +//===----------------------------------------------------------------------===// /// ConstantIntegral - Shared superclass of boolean and integer constants. /// /// This class just defines some common interfaces to be implemented. @@ -86,7 +90,7 @@ }; -//===--------------------------------------------------------------------------- +//===----------------------------------------------------------------------===// /// ConstantBool - Boolean Values /// class ConstantBool : public ConstantIntegral { @@ -121,7 +125,7 @@ }; -//===--------------------------------------------------------------------------- +//===----------------------------------------------------------------------===// /// ConstantInt - Superclass of ConstantSInt & ConstantUInt, to make dealing /// with integral constants easier. /// @@ -161,7 +165,7 @@ }; -//===--------------------------------------------------------------------------- +//===----------------------------------------------------------------------===// /// ConstantSInt - Signed Integer Values [sbyte, short, int, long] /// class ConstantSInt : public ConstantInt { @@ -214,7 +218,7 @@ } }; -//===--------------------------------------------------------------------------- +//===----------------------------------------------------------------------===// /// ConstantUInt - Unsigned Integer Values [ubyte, ushort, uint, ulong] /// class ConstantUInt : public ConstantInt { @@ -251,7 +255,7 @@ }; -//===--------------------------------------------------------------------------- +//===----------------------------------------------------------------------===// /// ConstantFP - Floating Point Values [float, double] /// class ConstantFP : public Constant { @@ -307,7 +311,7 @@ } }; -//===--------------------------------------------------------------------------- +//===----------------------------------------------------------------------===// /// ConstantAggregateZero - All zero aggregate value /// class ConstantAggregateZero : public Constant { @@ -338,7 +342,7 @@ }; -//===--------------------------------------------------------------------------- +//===----------------------------------------------------------------------===// /// ConstantArray - Constant Array Declarations /// class ConstantArray : public Constant { @@ -386,7 +390,7 @@ }; -//===--------------------------------------------------------------------------- +//===----------------------------------------------------------------------===// // ConstantStruct - Constant Struct Declarations // class ConstantStruct : public Constant { @@ -426,7 +430,7 @@ } }; -//===--------------------------------------------------------------------------- +//===----------------------------------------------------------------------===// /// ConstantPacked - Constant Packed Declarations /// class ConstantPacked : public Constant { @@ -464,7 +468,7 @@ } }; -//===--------------------------------------------------------------------------- +//===----------------------------------------------------------------------===// /// ConstantPointerNull - a constant pointer value that points to null /// class ConstantPointerNull : public Constant { @@ -501,12 +505,12 @@ }; -// ConstantExpr - a constant value that is initialized with an expression using -// other constant values. This is only used to represent values that cannot be -// evaluated at compile-time (e.g., something derived from an address) because -// it does not have a mechanism to store the actual value. Use the appropriate -// Constant subclass above for known constants. -// +/// ConstantExpr - a constant value that is initialized with an expression using +/// other constant values. This is only used to represent values that cannot be +/// evaluated at compile-time (e.g., something derived from an address) because +/// it does not have a mechanism to store the actual value. Use the appropriate +/// Constant subclass above for known constants. +/// class ConstantExpr : public Constant { unsigned iType; // Operation type (an Instruction opcode) friend struct ConstantCreator Changes in directory llvm: Makefile_rules added (r1.1) --- Log message: Get rid of the horrendous FIND_PATH macro, have libs and progs linked into a common directory for simplicity. Provide an easy way to relink some objects --- Diffs of the changes: (+163 -0) Index: llvm/Makefile_rules diff -c /dev/null llvm/Makefile_rules:1.1 *** /dev/null Wed Oct 13 06:40:01 2004 --- llvm/Makefile_rules Wed Oct 13 06:39:51 2004 *************** *** 0 **** --- 1,163 ---- + #,===-- Makefile.rules.am - Common make rules for LLVM ------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + # + # LLVM Specific C/C++ compiler flags + # + LLVM_COMMONFLAGS := -Wall -W -Wwrite-strings -Wno-unused -Wcast-align + LLVM_CXXFLAGS := + LLVM_CFLAGS := + LLVM_CPPFLAGS := \ + -I. \ + -I$(srcdir) \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ + -D_RENTRANT -D_GNU_SOURCE -D__STDC_LIMIT_MACROS + + ifeq ($(BUILDMODE),Profile) + LLVM_CPPFLAGS += -DNDEBUG + LLVM_CXXFLAGS += -pg -O3 -finline-functions -felide-constructors + LLVM_CFLAGS += -pg + else + ifeq ($(BUILDMODE),Release) + LLVM_CPPFLAGS += -DNDEBUG + LLVM_CXXFLAGS += -O3 -finline-functions -fomit-frame-pointer -felide-constructors + LLVM_CFLAGS += -O3 + else + LLVM_CPPFLAGS += -D_DEBUG + LLVM_CXXFLAGS += -O1 + LLVM_CFLAGS += -O1 + endif + endif + + LDIR = $(top_builddir)/$(BUILDMODE)/lib + BDIR = $(top_builddir)/$(BUILDMODE)/bin + DDIR = $(top_builddir)/$(BUILDMODE)/data + EDIR = $(top_builddir)/$(BUILDMODE)/etc + + # Required tool definitions as macros so they can be overridden + LINKLIB := ${LIBTOOL} --tag=CXX --mode=link $(CXX) -o + + BURG := $(top_builddir)/utils/Burg/burg$(EXEEXT) + RunBurg := $(BURG) -I + TBLGEN := $(top_builddir)/utils/TableGen/TableGen$(EXEEXT) + LGCCLDPROG := $(top_builddir)/tools/gccld/gccld$(EXEEXT) + + # Set up the standard automake variables + # + AM_CPPFLAGS = $(LLVM_CPPFLAGS) + AM_CXXFLAGS = $(LLVM_COMMONFLAGS) $(LLVM_CXXFLAGS) + AM_CFLAGS = $(LLVM_COMMONFLAGS) $(LLVM_CFLAGS) + AM_LDFLAGS = -L$(LDIR) + + # LLVM GNU Make Function macros + GETOBJ = $(patsubst %,$(LDIR)/LLVM%.o,$(1)) + GETLIB = $(patsubst %,-lLLVM%,$(1)) + GETOBJS = $(foreach I,$(1) $(2) $(3) $(4) $(5) $(6) $(7) $(8) $(9) $(10),$(call GETOBJ,$(I))) + GETLIBS = $(foreach I,$(1) $(2) $(3) $(4) $(5) $(6) $(7) $(8) $(9) $(10),$(call GETLIB,$(I))) + + # LLVM Rules + + ifdef lib_LIBRARIES + lib_LINKS_TO_MAKE = $(foreach L,$(lib_LIBRARIES),$(patsubst lib%.a,$(LDIR)/lib%.a,$(L))) + all-am : $(lib_LINKS_TO_MAKE) + + $(LDIR)/lib%.a : lib%.a + cwd=`pwd` ; cd $(LDIR) ; $(LN) -s $${cwd}/$* . + endif + + ifdef bin_PROGRAMS + bin_LINKS_TO_MAKE = $(foreach P,$(bin_PROGRAMS),$(patsubst %,$(BDIR)/%,$(P))) + + all-am : $(bin_LINKS_TO_MAKE) + + $(BDIR)/% : % + cwd=`pwd` ; cd $(BDIR) ; $(LN) -s $${cwd}/$* . + endif + + ifdef PRELINK + PRELINK_LIB_NAME = $(LDIR)/$(patsubst lib%.a,%.o,$(PRELINK)) + PRELINK_VAR_NAME = $(patsubst lib%.a,lib%_a,$(PRELINK))_OBJECTS + PRELINK_OBJECTS = $($(PRELINK_VAR_NAME)) + + all-am: $(PRELINK_LIB_NAME) + + $(PRELINK_LIB_NAME) : $(PRELINK_OBJECTS) + $(LIBTOOL) --mode=link $(CXX) -o $(PRELINK_LIB_NAME) $(PRELINK_OBJECTS) + + + clean-am: clean-relink + + clean-relink: + $(RM) -f $(PRELINK_LIB_NAME) + endif + + %.cpp: %.l + @${ECHO} Flexing $< + $(VERB) $(FLEX) -t $< | \ + $(SED) '/^find_rule/d' | \ + $(SED) 's/void yyunput/inline void yyunput/' | \ + $(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \ + $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' > $@.tmp + $(VERB) $(CMP) -s $@ $@.tmp > /dev/null || ${MV} -f $@.tmp $@ + @# remove the output of flex if it didn't get moved over... + @$(RM) -f $@.tmp + + SUFFIXES = .td + + %.c: %.y # Cancel built-in rules for yacc + + %.h: %.y # Cancel built-in rules for yacc + + %.cpp %.h : %.y + @${ECHO} "Bisoning `basename $<`" + $(VERB) $(BISON) -v -d -p $( /dev/null || ${MV} -f $*.tab.c $*.cpp + $(VERB) $(CMP) -s $*.tab.h $*.h > /dev/null || ${MV} -f $*.tab.h $*.h + @# If the files were not updated, don't leave them lying around... + @$(RM) -f $*.tab.c $*.tab.h + + + %GenRegisterNames.inc : %.td + @echo "Building $< register names with tblgen" + $(VERB) $(TBLGEN) -I $(srcdir) $< -gen-register-enums -o $@ + + %GenRegisterInfo.h.inc : %.td + @echo "Building $< register information header with tblgen" + $(VERB) $(TBLGEN) -I $(srcdir) $< -gen-register-desc-header -o $@ + + %GenRegisterInfo.inc : %.td + @echo "Building $< register info implementation with tblgen" + $(VERB) $(TBLGEN) -I $(srcdir) $< -gen-register-desc -o $@ + + %GenInstrNames.inc : %.td + @echo "Building $< instruction names with tblgen" + $(VERB) $(TBLGEN) -I $(srcdir) $< -gen-instr-enums -o $@ + + %GenInstrInfo.inc : %.td + @echo "Building $< instruction information with tblgen" + $(VERB) $(TBLGEN) -I $(srcdir) $< -gen-instr-desc -o $@ + + %GenAsmWriter.inc : %.td + @echo "Building $< assembly writer with tblgen" + $(VERB) $(TBLGEN) -I $(srcdir) $< -gen-asm-writer -o $@ + + %GenATTAsmWriter.inc : %.td + @echo "Building $< AT&T assembly writer with tblgen" + $(VERB) $(TBLGEN) -I $(srcdir) $< -gen-asm-writer -o $@ + + %GenIntelAsmWriter.inc : %.td + @echo "Building $< Intel assembly writer with tblgen" + $(VERB) $(TBLGEN) -I $(srcdir) $< -gen-asm-writer -asmwriternum=1 -o $@ + + %GenInstrSelector.inc: %.td + @echo "Building $< instruction selector with tblgen" + $(VERB) $(TBLGEN) -I $(srcdir) $< -gen-instr-selector -o $@ + + TDFILES = $(wildcard $(srcdir)/*.td ) $(srcdir)/../Target.td From reid at x10sys.com Wed Oct 13 06:47:11 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/Makefile.am Message-ID: <200410131147.GAA18948@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+5 -4) Index: llvm/lib/AsmParser/Makefile.am diff -u llvm/lib/AsmParser/Makefile.am:1.1 llvm/lib/AsmParser/Makefile.am:1.2 --- llvm/lib/AsmParser/Makefile.am:1.1 Sun Oct 10 15:40:06 2004 +++ llvm/lib/AsmParser/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,13 +7,14 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMAsmParser.o +lib_LIBRARIES = libLLVMAsmParser.a BUILT_SOURCES = llvmAsmParser.cpp Lexer.cpp llvmAsmParser.h -LLVMAsmParser_o_SOURCES = Parser.cpp $(BUILT_SOURCES) -LIBS= +libLLVMAsmParser_a_SOURCES = Parser.cpp $(BUILT_SOURCES) + +PRELINK=libLLVMAsmParser.a Lexer.o: llvmAsmParser.h From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/Makefile.am Message-ID: <200410131147.GAA18979@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+5 -4) Index: llvm/lib/CodeGen/SelectionDAG/Makefile.am diff -u llvm/lib/CodeGen/SelectionDAG/Makefile.am:1.1 llvm/lib/CodeGen/SelectionDAG/Makefile.am:1.2 --- llvm/lib/CodeGen/SelectionDAG/Makefile.am:1.1 Sun Oct 10 15:42:50 2004 +++ llvm/lib/CodeGen/SelectionDAG/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,9 +7,10 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMSelectionDAG.o +lib_LIBRARIES = libLLVMSelectionDAG.a -LLVMSelectionDAG_o_SOURCES = DAGBuilder.cpp SelectionDAG.cpp -LIBS= +libLLVMSelectionDAG_a_SOURCES = DAGBuilder.cpp SelectionDAG.cpp + +PRELINK=libLLVMSelectionDAG.a From reid at x10sys.com Wed Oct 13 06:47:12 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Makefile.am Message-ID: <200410131147.GAA18952@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/lib/System/Makefile.am diff -u llvm/lib/System/Makefile.am:1.1 llvm/lib/System/Makefile.am:1.2 --- llvm/lib/System/Makefile.am:1.1 Sun Oct 10 15:43:57 2004 +++ llvm/lib/System/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config lib_LIBRARIES = libLLVMSystem.a From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/Makefile.am Message-ID: <200410131147.GAA18975@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+3 -4) Index: llvm/lib/Transforms/Instrumentation/Makefile.am diff -u llvm/lib/Transforms/Instrumentation/Makefile.am:1.1 llvm/lib/Transforms/Instrumentation/Makefile.am:1.2 --- llvm/lib/Transforms/Instrumentation/Makefile.am:1.1 Sun Oct 10 17:19:55 2004 +++ llvm/lib/Transforms/Instrumentation/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,12 +7,11 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config SUBDIRS = ProfilePaths lib_LIBRARIES = libLLVMInstrument.a -libexec_PROGRAMS = LLVMInstrument.o MYSOURCES = \ BlockProfiling.cpp \ @@ -23,5 +22,5 @@ TraceValues.cpp libLLVMInstrument_a_SOURCES = $(MYSOURCES) -LLVMInstrument_o_SOURCES = $(MYSOURCES) -LIBS= + +PRELINK=libLLVMInstrument.a From reid at x10sys.com Wed Oct 13 06:47:10 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Makefile.am Message-ID: <200410131147.GAA18947@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: Makefile.am updated: 1.2 -> 1.3 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+5 -5) Index: llvm/lib/Analysis/IPA/Makefile.am diff -u llvm/lib/Analysis/IPA/Makefile.am:1.2 llvm/lib/Analysis/IPA/Makefile.am:1.3 --- llvm/lib/Analysis/IPA/Makefile.am:1.2 Sun Oct 10 17:17:39 2004 +++ llvm/lib/Analysis/IPA/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,10 +7,9 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -lib_LIBRARIES = libLLVMIPA.a -libexec_PROGRAMS = LLVMIPA.o +lib_LIBRARIES = libLLVMIPA.a MYSOURCES = \ Andersens.cpp \ @@ -20,6 +19,7 @@ FindUsedTypes.cpp \ GlobalsModRef.cpp \ PrintSCC.cpp + libLLVMIPA_a_SOURCES = $(MYSOURCES) -LLVMIPA_o_SOURCES = $(MYSOURCES) -LIBS= + +PRELINK=libLLVMIPA.a From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Makefile.am Message-ID: <200410131147.GAA18972@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+3 -4) Index: llvm/lib/Transforms/Makefile.am diff -u llvm/lib/Transforms/Makefile.am:1.1 llvm/lib/Transforms/Makefile.am:1.2 --- llvm/lib/Transforms/Makefile.am:1.1 Sun Oct 10 17:19:21 2004 +++ llvm/lib/Transforms/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,15 +7,14 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config SUBDIRS = Utils Instrumentation Scalar IPO lib_LIBRARIES = libLLVMTransforms.a -libexec_PROGRAMS = LLVMTransforms.o MYSOURCES = ExprTypeConvert.cpp LevelRaise.cpp TransformInternals.cpp libLLVMTransforms_a_SOURCES = $(MYSOURCES) -LLVMTransforms_o_SOURCES = $(MYSOURCES) -LIBS= + +PRELINK=libLLVMTransforms.a From reid at x10sys.com Wed Oct 13 06:47:12 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/Makefile.am Message-ID: <200410131147.GAA18949@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: Makefile.am updated: 1.2 -> 1.3 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+2 -4) Index: llvm/lib/Analysis/Makefile.am diff -u llvm/lib/Analysis/Makefile.am:1.2 llvm/lib/Analysis/Makefile.am:1.3 --- llvm/lib/Analysis/Makefile.am:1.2 Sun Oct 10 17:17:13 2004 +++ llvm/lib/Analysis/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,12 +7,11 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config SUBDIRS = IPA DataStructure lib_LIBRARIES = libLLVMAnalysis.a -libexec_PROGRAMS = LLVMAnalysis.o MYSOURCES = \ AliasAnalysisCounter.cpp \ @@ -36,5 +35,4 @@ ValueNumbering.cpp libLLVMAnalysis_a_SOURCES = $(MYSOURCES) -LLVMAnalysis_o_SOURCES = $(MYSOURCES) -LIBS= +PRELINK=libLLVMAnalysis.a From reid at x10sys.com Wed Oct 13 06:47:12 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:12 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-nm/Makefile.am Message-ID: <200410131147.GAA18951@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-nm: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-nm/Makefile.am diff -u llvm/tools/llvm-nm/Makefile.am:1.1 llvm/tools/llvm-nm/Makefile.am:1.2 --- llvm/tools/llvm-nm/Makefile.am:1.1 Sun Oct 10 17:35:55 2004 +++ llvm/tools/llvm-nm/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = llvm-nm From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/Makefile.am Message-ID: <200410131147.GAA18955@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+5 -4) Index: llvm/lib/ExecutionEngine/JIT/Makefile.am diff -u llvm/lib/ExecutionEngine/JIT/Makefile.am:1.1 llvm/lib/ExecutionEngine/JIT/Makefile.am:1.2 --- llvm/lib/ExecutionEngine/JIT/Makefile.am:1.1 Sun Oct 10 15:43:23 2004 +++ llvm/lib/ExecutionEngine/JIT/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,12 +7,13 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMJIT.o +lib_LIBRARIES = libLLVMJIT.a -LLVMJIT_o_SOURCES = Emitter.cpp Intercept.cpp JIT.cpp TargetSelect.cpp -LIBS= +libLLVMJIT_a_SOURCES = Emitter.cpp Intercept.cpp JIT.cpp TargetSelect.cpp + +PRELINK=libLLVMJIT.a # Enable the X86 JIT if compiling on X86 if ARCH_X86 From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/tools/extract/Makefile.am Message-ID: <200410131147.GAA18968@zion.cs.uiuc.edu> Changes in directory llvm/tools/extract: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/extract/Makefile.am diff -u llvm/tools/extract/Makefile.am:1.1 llvm/tools/extract/Makefile.am:1.2 --- llvm/tools/extract/Makefile.am:1.1 Sun Oct 10 17:33:20 2004 +++ llvm/tools/extract/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = extract From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/Makefile.am Message-ID: <200410131147.GAA18967@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/opt/Makefile.am diff -u llvm/tools/opt/Makefile.am:1.1 llvm/tools/opt/Makefile.am:1.2 --- llvm/tools/opt/Makefile.am:1.1 Sun Oct 10 17:36:40 2004 +++ llvm/tools/opt/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = opt From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-db/Makefile.am Message-ID: <200410131147.GAA18953@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-db: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-db/Makefile.am diff -u llvm/tools/llvm-db/Makefile.am:1.1 llvm/tools/llvm-db/Makefile.am:1.2 --- llvm/tools/llvm-db/Makefile.am:1.1 Sun Oct 10 17:35:05 2004 +++ llvm/tools/llvm-db/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = llvm-db From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Makefile.am Message-ID: <200410131147.GAA18956@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Makefile.am updated: 1.2 -> 1.3 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+2 -4) Index: llvm/lib/Analysis/DataStructure/Makefile.am diff -u llvm/lib/Analysis/DataStructure/Makefile.am:1.2 llvm/lib/Analysis/DataStructure/Makefile.am:1.3 --- llvm/lib/Analysis/DataStructure/Makefile.am:1.2 Sun Oct 10 17:17:24 2004 +++ llvm/lib/Analysis/DataStructure/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,10 +7,9 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config lib_LIBRARIES = libLLVMDataStructure.a -libexec_PROGRAMS = LLVMDataStructure.o MYSOURCES = \ BottomUpClosure.cpp\ @@ -31,5 +30,4 @@ TopDownClosure.cpp libLLVMDataStructure_a_SOURCES = $(MYSOURCES) -LLVMDataStructure_o_SOURCES = $(MYSOURCES) -LIBS= +PRELINK=libLLVMDataStructure.a From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-as/Makefile.am Message-ID: <200410131147.GAA18966@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-as: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-as/Makefile.am diff -u llvm/tools/llvm-as/Makefile.am:1.1 llvm/tools/llvm-as/Makefile.am:1.2 --- llvm/tools/llvm-as/Makefile.am:1.1 Sun Oct 10 17:34:39 2004 +++ llvm/tools/llvm-as/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = llvm-as From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/Makefile.am Message-ID: <200410131147.GAA18973@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+4 -4) Index: llvm/lib/Target/PowerPC/Makefile.am diff -u llvm/lib/Target/PowerPC/Makefile.am:1.1 llvm/lib/Target/PowerPC/Makefile.am:1.2 --- llvm/lib/Target/PowerPC/Makefile.am:1.1 Sun Oct 10 17:18:12 2004 +++ llvm/lib/Target/PowerPC/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,9 +7,9 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMPowerPC.o +lib_LIBRARIES = libLLVMPowerPC.a BUILT_SOURCES = \ PowerPCGenInstrNames.inc \ @@ -23,7 +23,7 @@ PPC64GenRegisterInfo.inc \ PPC64GenInstrInfo.inc -LLVMPowerPC_o_SOURCES = \ +libLLVMPowerPC_a_SOURCES = \ PowerPCAsmPrinter.cpp \ PowerPCBranchSelector.cpp \ PowerPCTargetMachine.cpp \ @@ -36,6 +36,6 @@ PPC64ISelSimple.cpp \ PPC64RegisterInfo.cpp -LIBS= +PRELINK=libLLVMPowerPC.a $(BUILT_SOURCES) : $(LLVM_TDFILES) $(TBLGEN) From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-link/Makefile.am Message-ID: <200410131147.GAA18965@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-link: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-link/Makefile.am diff -u llvm/tools/llvm-link/Makefile.am:1.1 llvm/tools/llvm-link/Makefile.am:1.2 --- llvm/tools/llvm-link/Makefile.am:1.1 Sun Oct 10 17:35:44 2004 +++ llvm/tools/llvm-link/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = llvm-link From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-stub/Makefile.am Message-ID: <200410131147.GAA18970@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-stub: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-stub/Makefile.am diff -u llvm/tools/llvm-stub/Makefile.am:1.1 llvm/tools/llvm-stub/Makefile.am:1.2 --- llvm/tools/llvm-stub/Makefile.am:1.1 Sun Oct 10 17:36:18 2004 +++ llvm/tools/llvm-stub/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = llvm-stub From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Makefile.am Message-ID: <200410131147.GAA18959@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+4 -4) Index: llvm/lib/Bytecode/Reader/Makefile.am diff -u llvm/lib/Bytecode/Reader/Makefile.am:1.1 llvm/lib/Bytecode/Reader/Makefile.am:1.2 --- llvm/lib/Bytecode/Reader/Makefile.am:1.1 Sun Oct 10 15:40:44 2004 +++ llvm/lib/Bytecode/Reader/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,15 +7,15 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMBCReader.o +lib_LIBRARIES = libLLVMBCReader.a -LLVMBCReader_o_SOURCES = \ +libLLVMBCReader_a_SOURCES = \ Analyzer.cpp \ ArchiveReader.cpp \ LibraryReader.cpp \ Reader.cpp \ ReaderWrappers.cpp -LIBS= +PRELINK=libLLVMBCReader.a From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/tools/gccas/Makefile.am Message-ID: <200410131147.GAA18969@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccas: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/gccas/Makefile.am diff -u llvm/tools/gccas/Makefile.am:1.1 llvm/tools/gccas/Makefile.am:1.2 --- llvm/tools/gccas/Makefile.am:1.1 Sun Oct 10 17:33:31 2004 +++ llvm/tools/gccas/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = gccas From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/tools/Makefile.am Message-ID: <200410131147.GAA18984@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/Makefile.am diff -u llvm/tools/Makefile.am:1.1 llvm/tools/Makefile.am:1.2 --- llvm/tools/Makefile.am:1.1 Sun Oct 10 17:49:51 2004 +++ llvm/tools/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config SUBDIRS = analyze llvmc bugpoint extract gccas gccld llvm-bcanalyzer llc \ llee lli llvm-ar llvm-as llvm-db llvm-dis llvm-link llvm-nm \ From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/Makefile.am Message-ID: <200410131147.GAA18964@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+4 -4) Index: llvm/lib/Target/X86/Makefile.am diff -u llvm/lib/Target/X86/Makefile.am:1.1 llvm/lib/Target/X86/Makefile.am:1.2 --- llvm/lib/Target/X86/Makefile.am:1.1 Sun Oct 10 17:19:10 2004 +++ llvm/lib/Target/X86/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,9 +7,9 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMX86.o +lib_LIBRARIES = libLLVMX86.a BUILT_SOURCES = \ X86GenRegisterInfo.h.inc \ @@ -20,7 +20,7 @@ X86GenATTAsmWriter.inc \ X86GenIntelAsmWriter.inc -LLVMX86_o_SOURCES = \ +libLLVMX86_a_SOURCES = \ X86AsmPrinter.cpp \ X86CodeEmitter.cpp \ X86FloatingPoint.cpp \ @@ -31,6 +31,6 @@ X86RegisterInfo.cpp \ X86TargetMachine.cpp -LIBS= +PRELINK=libLLVMX86.a $(BUILT_SOURCES) : $(LLVM_TDFILES) $(TBLGEN) From reid at x10sys.com Wed Oct 13 06:49:02 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:49:02 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/Makefile.am Message-ID: <200410131149.GAA19646@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: Makefile.am updated: 1.1 -> 1.2 --- Log message: Updates for changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/utils/TableGen/Makefile.am diff -u llvm/utils/TableGen/Makefile.am:1.1 llvm/utils/TableGen/Makefile.am:1.2 --- llvm/utils/TableGen/Makefile.am:1.1 Sun Oct 10 15:33:14 2004 +++ llvm/utils/TableGen/Makefile.am Wed Oct 13 06:48:50 2004 @@ -7,7 +7,7 @@ # ##===----------------------------------------------------------------------===## -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = TableGen From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-bcanalyzer/Makefile.am Message-ID: <200410131147.GAA18960@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-bcanalyzer: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-bcanalyzer/Makefile.am diff -u llvm/tools/llvm-bcanalyzer/Makefile.am:1.1 llvm/tools/llvm-bcanalyzer/Makefile.am:1.2 --- llvm/tools/llvm-bcanalyzer/Makefile.am:1.1 Sun Oct 10 17:34:54 2004 +++ llvm/tools/llvm-bcanalyzer/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = llvm-bcanalyzer From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Makefile.am Message-ID: <200410131147.GAA18958@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+4 -4) Index: llvm/lib/ExecutionEngine/Interpreter/Makefile.am diff -u llvm/lib/ExecutionEngine/Interpreter/Makefile.am:1.1 llvm/lib/ExecutionEngine/Interpreter/Makefile.am:1.2 --- llvm/lib/ExecutionEngine/Interpreter/Makefile.am:1.1 Sun Oct 10 15:43:12 2004 +++ llvm/lib/ExecutionEngine/Interpreter/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,11 +7,11 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMInterpreter.o +lib_LIBRARIES = libLLVMInterpreter.a -LLVMInterpreter_o_SOURCES = \ +libLLVMInterpreter_a_SOURCES = \ Execution.cpp ExternalFunctions.cpp Interpreter.cpp -LIBS= +PRELINK=libLLVMInterpreter.a From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/Makefile.am Message-ID: <200410131147.GAA18980@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+3 -4) Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/Makefile.am diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/Makefile.am:1.1 llvm/lib/Transforms/Instrumentation/ProfilePaths/Makefile.am:1.2 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/Makefile.am:1.1 Sun Oct 10 17:20:06 2004 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,10 +7,9 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config lib_LIBRARIES = libLLVMProfilePaths.a -libexec_PROGRAMS = LLVMProfilePaths.o MYSOURCES= \ CombineBranch.cpp \ @@ -22,5 +21,5 @@ RetracePath.cpp libLLVMProfilePaths_a_SOURCES = $(MYSOURCES) -LLVMProfilePaths_o_SOURCES = $(MYSOURCES) -LIBS= + +PRELINK=libLLVMProfilePaths.a From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/tools/gccld/Makefile.am Message-ID: <200410131147.GAA18978@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/gccld/Makefile.am diff -u llvm/tools/gccld/Makefile.am:1.1 llvm/tools/gccld/Makefile.am:1.2 --- llvm/tools/gccld/Makefile.am:1.1 Sun Oct 10 17:33:42 2004 +++ llvm/tools/gccld/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = gccld From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Makefile.am Message-ID: <200410131147.GAA18957@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+4 -4) Index: llvm/lib/Bytecode/Writer/Makefile.am diff -u llvm/lib/Bytecode/Writer/Makefile.am:1.1 llvm/lib/Bytecode/Writer/Makefile.am:1.2 --- llvm/lib/Bytecode/Writer/Makefile.am:1.1 Sun Oct 10 15:40:56 2004 +++ llvm/lib/Bytecode/Writer/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,9 +7,9 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMBCWriter.o +lib_LIBRARIES = libLLVMBCWriter.a -LLVMBCWriter_o_SOURCES = SlotCalculator.cpp Writer.cpp -LIBS= +libLLVMBCWriter_a_SOURCES = SlotCalculator.cpp Writer.cpp +PRELINK=libLLVMBCWriter.a From reid at x10sys.com Wed Oct 13 06:47:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/LiveVar/Makefile.am Message-ID: <200410131147.GAA18950@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/LiveVar: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+3 -4) Index: llvm/lib/Target/SparcV9/LiveVar/Makefile.am diff -u llvm/lib/Target/SparcV9/LiveVar/Makefile.am:1.1 llvm/lib/Target/SparcV9/LiveVar/Makefile.am:1.2 --- llvm/lib/Target/SparcV9/LiveVar/Makefile.am:1.1 Sun Oct 10 17:18:47 2004 +++ llvm/lib/Target/SparcV9/LiveVar/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,10 +7,9 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config lib_LIBRARIES = libLLVMSparcV9LiveVar.a -libexec_PROGRAMS = LLVMSparcV9LiveVar.o MYSOURCES = \ BBLiveVar.cpp \ @@ -18,5 +17,5 @@ ValueSet.cpp libLLVMSparcV9LiveVar_a_SOURCES = $(MYSOURCES) -LLVMSparcV9LiveVar_o_SOURCES = $(MYSOURCES) -LIBS= + +PRELINK=libLLVMSparcV9LiveVar.a From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Makefile.am Message-ID: <200410131147.GAA18971@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/Makefile.am diff -u llvm/lib/Target/Makefile.am:1.1 llvm/lib/Target/Makefile.am:1.2 --- llvm/lib/Target/Makefile.am:1.1 Sun Oct 10 17:17:50 2004 +++ llvm/lib/Target/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config SUBDIRS = X86 CBackend PowerPC SparcV9 Skeleton From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Makefile.am Message-ID: <200410131147.GAA18981@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+5 -4) Index: llvm/lib/ExecutionEngine/Makefile.am diff -u llvm/lib/ExecutionEngine/Makefile.am:1.1 llvm/lib/ExecutionEngine/Makefile.am:1.2 --- llvm/lib/ExecutionEngine/Makefile.am:1.1 Sun Oct 10 15:43:34 2004 +++ llvm/lib/ExecutionEngine/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,11 +7,12 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config SUBDIRS = Interpreter JIT -libexec_PROGRAMS = LLVMExecutionEngine.o +lib_LIBRARIES = libLLVMExecutionEngine.a -LLVMExecutionEngine_o_SOURCES = ExecutionEngine.cpp -LIBS= +libLLVMExecutionEngine_a_SOURCES = ExecutionEngine.cpp + +PRELINK=libLLVMExecutionEngine.a From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Makefile.am Message-ID: <200410131147.GAA18977@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/lib/Bytecode/Makefile.am diff -u llvm/lib/Bytecode/Makefile.am:1.1 llvm/lib/Bytecode/Makefile.am:1.2 --- llvm/lib/Bytecode/Makefile.am:1.1 Sun Oct 10 15:41:07 2004 +++ llvm/lib/Bytecode/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,6 +7,6 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config SUBDIRS = Reader Writer From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/Makefile.am Message-ID: <200410131147.GAA18990@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: Makefile.am updated: 1.3 -> 1.4 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+4 -4) Index: llvm/lib/Target/SparcV9/Makefile.am diff -u llvm/lib/Target/SparcV9/Makefile.am:1.3 llvm/lib/Target/SparcV9/Makefile.am:1.4 --- llvm/lib/Target/SparcV9/Makefile.am:1.3 Sun Oct 10 18:36:09 2004 +++ llvm/lib/Target/SparcV9/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,17 +7,17 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config SUBDIRS = InstrSched LiveVar ModuloScheduling RegAlloc -libexec_PROGRAMS = LLVMSparcV9.o +lib_LIBRARIES = libLLVMSparcV9.a BUILT_SOURCES = \ SparcV9CodeEmitter.inc \ SparcV9.burm.cpp -LLVMSparcV9_o_SOURCES = \ +libLLVMSparcV9_a_SOURCES = \ EmitBytecodeToAssembly.cpp \ InternalGlobalMapper.cpp \ MachineCodeForInstruction.cpp \ @@ -39,7 +39,7 @@ SparcV9TmpInstr.cpp \ $(BUILT_SOURCES) -LIBS= +PRELINK=libLLVMSparcV9.a SparcV9.burg.in1 : SparcV9.burg.in $(CXX) -E $(AM_CPPFLAGS) -x c++ $< | $(SED) '/^#/d' | $(SED) 's/Ydefine/#define/' > $@ From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvmc/Makefile.am Message-ID: <200410131147.GAA18991@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvmc/Makefile.am diff -u llvm/tools/llvmc/Makefile.am:1.1 llvm/tools/llvmc/Makefile.am:1.2 --- llvm/tools/llvmc/Makefile.am:1.1 Sun Oct 10 17:36:29 2004 +++ llvm/tools/llvmc/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = llvmc From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ar/Makefile.am Message-ID: <200410131147.GAA18963@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ar: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-ar/Makefile.am diff -u llvm/tools/llvm-ar/Makefile.am:1.1 llvm/tools/llvm-ar/Makefile.am:1.2 --- llvm/tools/llvm-ar/Makefile.am:1.1 Sun Oct 10 17:34:28 2004 +++ llvm/tools/llvm-ar/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = llvm-ar From reid at x10sys.com Wed Oct 13 06:47:12 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Makefile.am Message-ID: <200410131147.GAA18954@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+5 -4) Index: llvm/lib/Target/CBackend/Makefile.am diff -u llvm/lib/Target/CBackend/Makefile.am:1.1 llvm/lib/Target/CBackend/Makefile.am:1.2 --- llvm/lib/Target/CBackend/Makefile.am:1.1 Sun Oct 10 17:18:01 2004 +++ llvm/lib/Target/CBackend/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,9 +7,10 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMCWriter.o +lib_LIBRARIES = libLLVMCWriter.a -LLVMCWriter_o_SOURCES = Writer.cpp -LIBS= +libLLVMCWriter_a_SOURCES = Writer.cpp + +PRELINK=libLLVMCWriter.a From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/Makefile.am Message-ID: <200410131147.GAA18985@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/lib/Support/Makefile.am diff -u llvm/lib/Support/Makefile.am:1.1 llvm/lib/Support/Makefile.am:1.2 --- llvm/lib/Support/Makefile.am:1.1 Sun Oct 10 15:43:46 2004 +++ llvm/lib/Support/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config lib_LIBRARIES = libLLVMSupport.a From reid at x10sys.com Wed Oct 13 06:49:02 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:49:02 -0500 Subject: [llvm-commits] CVS: llvm/utils/fpcmp/Makefile.am Message-ID: <200410131149.GAA19652@zion.cs.uiuc.edu> Changes in directory llvm/utils/fpcmp: Makefile.am updated: 1.1 -> 1.2 --- Log message: Updates for changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/utils/fpcmp/Makefile.am diff -u llvm/utils/fpcmp/Makefile.am:1.1 llvm/utils/fpcmp/Makefile.am:1.2 --- llvm/utils/fpcmp/Makefile.am:1.1 Sun Oct 10 15:33:14 2004 +++ llvm/utils/fpcmp/Makefile.am Wed Oct 13 06:48:50 2004 @@ -7,7 +7,7 @@ # ##===----------------------------------------------------------------------===## -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = fpcmp From reid at x10sys.com Wed Oct 13 06:49:02 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:49:02 -0500 Subject: [llvm-commits] CVS: llvm/utils/Burg/Makefile.am Message-ID: <200410131149.GAA19649@zion.cs.uiuc.edu> Changes in directory llvm/utils/Burg: Makefile.am updated: 1.1 -> 1.2 --- Log message: Updates for changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/utils/Burg/Makefile.am diff -u llvm/utils/Burg/Makefile.am:1.1 llvm/utils/Burg/Makefile.am:1.2 --- llvm/utils/Burg/Makefile.am:1.1 Sun Oct 10 15:33:14 2004 +++ llvm/utils/Burg/Makefile.am Wed Oct 13 06:48:50 2004 @@ -7,7 +7,7 @@ # ##===----------------------------------------------------------------------===## -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = burg From reid at x10sys.com Wed Oct 13 06:49:02 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:49:02 -0500 Subject: [llvm-commits] CVS: llvm/utils/Makefile.am Message-ID: <200410131149.GAA19653@zion.cs.uiuc.edu> Changes in directory llvm/utils: Makefile.am updated: 1.1 -> 1.2 --- Log message: Updates for changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/utils/Makefile.am diff -u llvm/utils/Makefile.am:1.1 llvm/utils/Makefile.am:1.2 --- llvm/utils/Makefile.am:1.1 Sun Oct 10 17:07:57 2004 +++ llvm/utils/Makefile.am Wed Oct 13 06:48:50 2004 @@ -7,6 +7,6 @@ # ##===----------------------------------------------------------------------===## -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config SUBDIRS = Burg fpcmp TableGen From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Skeleton/Makefile.am Message-ID: <200410131147.GAA18992@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Skeleton: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+4 -4) Index: llvm/lib/Target/Skeleton/Makefile.am diff -u llvm/lib/Target/Skeleton/Makefile.am:1.1 llvm/lib/Target/Skeleton/Makefile.am:1.2 --- llvm/lib/Target/Skeleton/Makefile.am:1.1 Sun Oct 10 17:18:24 2004 +++ llvm/lib/Target/Skeleton/Makefile.am Wed Oct 13 06:46:51 2004 @@ -8,9 +8,9 @@ #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMSkeleton.o +lib_LIBRARIES = libLLVMSkeleton.a BUILT_SOURCES = \ SkeletonGenRegisterInfo.h.inc \ @@ -19,13 +19,13 @@ SkeletonGenInstrNames.inc \ SkeletonGenInstrInfo.inc -LLVMSkeleton_o_SOURCES = \ +libLLVMSkeleton_a_SOURCES = \ SkeletonInstrInfo.cpp \ SkeletonJITInfo.cpp \ SkeletonRegisterInfo.cpp \ SkeletonTargetMachine.cpp \ $(BUILT_SOURCES) -LIBS= +PRELINK=libLLVMSkeleton.a $(BUILT_SOURCES) : $(TDFILES) $(TBLGEN) From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/Makefile.am Message-ID: <200410131147.GAA18974@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+2 -4) Index: llvm/lib/Transforms/Scalar/Makefile.am diff -u llvm/lib/Transforms/Scalar/Makefile.am:1.1 llvm/lib/Transforms/Scalar/Makefile.am:1.2 --- llvm/lib/Transforms/Scalar/Makefile.am:1.1 Sun Oct 10 17:20:17 2004 +++ llvm/lib/Transforms/Scalar/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,10 +7,10 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config lib_LIBRARIES = libLLVMScalarOpts.a -libexec_PROGRAMS = LLVMScalarOpts.o +PRELINK=libLLVMScalarOpts.a MYSOURCES = \ ADCE.cpp \ @@ -46,5 +46,3 @@ libLLVMScalarOpts_a_SOURCES = $(MYSOURCES) -LLVMScalarOpts_o_SOURCES = $(MYSOURCES) -LIBS= From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Makefile.am Message-ID: <200410131147.GAA18996@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+4 -4) Index: llvm/lib/VMCore/Makefile.am diff -u llvm/lib/VMCore/Makefile.am:1.1 llvm/lib/VMCore/Makefile.am:1.2 --- llvm/lib/VMCore/Makefile.am:1.1 Sun Oct 10 17:20:40 2004 +++ llvm/lib/VMCore/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,11 +7,11 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMCore.o +lib_LIBRARIES = libLLVMCore.a -LLVMCore_o_SOURCES = \ +libLLVMCore_a_SOURCES = \ AsmWriter.cpp \ BasicBlock.cpp \ ConstantFolding.cpp \ @@ -34,4 +34,4 @@ Value.cpp \ Verifier.cpp -LIBS= +PRELINK=libLLVMCore.a From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/Makefile.am Message-ID: <200410131147.GAA18993@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: Makefile.am updated: 1.3 -> 1.4 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+4 -4) Index: llvm/lib/CodeGen/Makefile.am diff -u llvm/lib/CodeGen/Makefile.am:1.3 llvm/lib/CodeGen/Makefile.am:1.4 --- llvm/lib/CodeGen/Makefile.am:1.3 Sun Oct 10 18:37:40 2004 +++ llvm/lib/CodeGen/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,13 +7,13 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config SUBDIRS = SelectionDAG -libexec_PROGRAMS = LLVMCodeGen.o +lib_LIBRARIES = libLLVMCodeGen.a -LLVMCodeGen_o_SOURCES = \ +libLLVMCodeGen_a_SOURCES = \ AsmPrinter.cpp \ BranchFolding.cpp \ IntrinsicLowering.cpp \ @@ -35,4 +35,4 @@ UnreachableBlockElim.cpp \ VirtRegMap.cpp -LIBS= +PRELINK=libLLVMCodeGen.a From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/Makefile.am Message-ID: <200410131147.GAA18988@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+3 -4) Index: llvm/lib/Transforms/IPO/Makefile.am diff -u llvm/lib/Transforms/IPO/Makefile.am:1.1 llvm/lib/Transforms/IPO/Makefile.am:1.2 --- llvm/lib/Transforms/IPO/Makefile.am:1.1 Sun Oct 10 17:19:43 2004 +++ llvm/lib/Transforms/IPO/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,10 +7,9 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config lib_LIBRARIES = libLLVMIPO.a -libexec_PROGRAMS = LLVMIPO.o MYSOURCES= \ ArgumentPromotion.cpp \ @@ -31,5 +30,5 @@ RaiseAllocations.cpp libLLVMIPO_a_SOURCES = $(MYSOURCES) -LLVMIPO_o_SOURCES = $(MYSOURCES) -LIBS= + +PRELINK=libLLVMIPO.a From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/InstrSched/Makefile.am Message-ID: <200410131147.GAA19007@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/InstrSched: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+3 -4) Index: llvm/lib/Target/SparcV9/InstrSched/Makefile.am diff -u llvm/lib/Target/SparcV9/InstrSched/Makefile.am:1.1 llvm/lib/Target/SparcV9/InstrSched/Makefile.am:1.2 --- llvm/lib/Target/SparcV9/InstrSched/Makefile.am:1.1 Sun Oct 10 17:52:14 2004 +++ llvm/lib/Target/SparcV9/InstrSched/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,10 +7,9 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config lib_LIBRARIES = libLLVMSparcV9InstrSched.a -libexec_PROGRAMS = LLVMSparcV9InstrSched.o MYSOURCES = \ InstrScheduling.cpp \ @@ -19,5 +18,5 @@ SchedPriorities.cpp libLLVMSparcV9InstrSched_a_SOURCES = $(MYSOURCES) -LLVMSparcV9InstrSched_o_SOURCES = $(MYSOURCES) -LIBS= + +PRELINK=libLLVMSparcV9InstrSched.a From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-prof/Makefile.am Message-ID: <200410131147.GAA19001@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-prof: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-prof/Makefile.am diff -u llvm/tools/llvm-prof/Makefile.am:1.1 llvm/tools/llvm-prof/Makefile.am:1.2 --- llvm/tools/llvm-prof/Makefile.am:1.1 Sun Oct 10 17:36:06 2004 +++ llvm/tools/llvm-prof/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = llvm-prof From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/tools/llee/Makefile.am Message-ID: <200410131147.GAA18994@zion.cs.uiuc.edu> Changes in directory llvm/tools/llee: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+3 -3) Index: llvm/tools/llee/Makefile.am diff -u llvm/tools/llee/Makefile.am:1.1 llvm/tools/llee/Makefile.am:1.2 --- llvm/tools/llee/Makefile.am:1.1 Sun Oct 10 17:34:05 2004 +++ llvm/tools/llee/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,11 +7,11 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -lib_LIBRARIES = libexecve.a +lib_LTLIBRARIES = libexecve.la -libexecve_a_SOURCES = ExecveHandler.c StorageProxy.c SysUtils.c +libexecve_la_SOURCES = ExecveHandler.c StorageProxy.c SysUtils.c all: llee From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/Makefile.am Message-ID: <200410131147.GAA19006@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-ld/Makefile.am diff -u llvm/tools/llvm-ld/Makefile.am:1.1 llvm/tools/llvm-ld/Makefile.am:1.2 --- llvm/tools/llvm-ld/Makefile.am:1.1 Sun Oct 10 17:35:33 2004 +++ llvm/tools/llvm-ld/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = llvm-ld From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/tools/analyze/Makefile.am Message-ID: <200410131147.GAA18995@zion.cs.uiuc.edu> Changes in directory llvm/tools/analyze: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -4) Index: llvm/tools/analyze/Makefile.am diff -u llvm/tools/analyze/Makefile.am:1.1 llvm/tools/analyze/Makefile.am:1.2 --- llvm/tools/analyze/Makefile.am:1.1 Sun Oct 10 17:32:57 2004 +++ llvm/tools/analyze/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = analyze @@ -16,9 +16,6 @@ analyze.cpp \ GraphPrinters.cpp -#USEDLIBS = asmparser bcreader analysis ipa datastructure scalaropts.a transforms.a \ -# target.a scalaropts.a transformutils.a vmcore support LLVMsystem.a - analyze_LDADD = \ $(call GETOBJS,AsmParser,BCReader,Core) \ $(call GETLIBS,Analysis,IPA,DataStructure,ScalarOpts,Transforms,Target) \ From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Debugger/Makefile.am Message-ID: <200410131147.GAA18997@zion.cs.uiuc.edu> Changes in directory llvm/lib/Debugger: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+4 -4) Index: llvm/lib/Debugger/Makefile.am diff -u llvm/lib/Debugger/Makefile.am:1.1 llvm/lib/Debugger/Makefile.am:1.2 --- llvm/lib/Debugger/Makefile.am:1.1 Sun Oct 10 15:43:01 2004 +++ llvm/lib/Debugger/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,11 +7,11 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMDebugger.o +lib_LIBRARIES = libLLVMDebugger.a -LLVMDebugger_o_SOURCES = \ +libLLVMDebugger_a_SOURCES = \ Debugger.cpp \ ProgramInfo.cpp \ RuntimeInfo.cpp \ @@ -22,4 +22,4 @@ SourceLanguage-Unknown.cpp \ UnixLocalInferiorProcess.cpp -LIBS= +PRELINK=libLLVMDebugger.a From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/Makefile.am Message-ID: <200410131147.GAA19013@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+3 -4) Index: llvm/lib/Transforms/Utils/Makefile.am diff -u llvm/lib/Transforms/Utils/Makefile.am:1.1 llvm/lib/Transforms/Utils/Makefile.am:1.2 --- llvm/lib/Transforms/Utils/Makefile.am:1.1 Sun Oct 10 17:20:29 2004 +++ llvm/lib/Transforms/Utils/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,10 +7,9 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config lib_LIBRARIES = libLLVMTransformUtils.a -libexec_PROGRAMS = LLVMTransformUtils.o MYSOURCES = \ BasicBlockUtils.cpp \ @@ -28,5 +27,5 @@ ValueMapper.cpp libLLVMTransformUtils_a_SOURCES = $(MYSOURCES) -LLVMTransformUtils_o_SOURCES = $(MYSOURCES) -LIBS= + +PRELINK=libLLVMTransformUtils.a From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/Makefile.am Message-ID: <200410131147.GAA19012@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+6 -4) Index: llvm/tools/bugpoint/Makefile.am diff -u llvm/tools/bugpoint/Makefile.am:1.1 llvm/tools/bugpoint/Makefile.am:1.2 --- llvm/tools/bugpoint/Makefile.am:1.1 Sun Oct 10 17:33:09 2004 +++ llvm/tools/bugpoint/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = bugpoint @@ -22,6 +22,8 @@ TestPasses.cpp bugpoint_LDADD = \ - $(call GETOBJS,AsmParser,BCReader,BCWriter,Core,ProfilePaths) \ - $(call GETLIBS,IPO,ScalarOpts,Analysis,Transforms,Instrument) \ - $(call GETLIBS,DataStructure,IPA,Target,TransformUtils,Support,System) + $(call GETOBJS,IPO,ScalarOpts,Analysis,Transforms,Instrument,ProfilePaths) \ + $(call GETOBJS,DataStructure,IPA) \ + $(call GETLIBS,Target) \ + $(call GETOBJS,TransformUtils,AsmParser,BCReader,BCWriter,Core) \ + $(call GETLIBS,Support,System) From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/tools/llc/Makefile.am Message-ID: <200410131147.GAA18989@zion.cs.uiuc.edu> Changes in directory llvm/tools/llc: Makefile.am updated: 1.2 -> 1.3 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llc/Makefile.am diff -u llvm/tools/llc/Makefile.am:1.2 llvm/tools/llc/Makefile.am:1.3 --- llvm/tools/llc/Makefile.am:1.2 Sun Oct 10 17:50:31 2004 +++ llvm/tools/llc/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = llc From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Makefile.am Message-ID: <200410131147.GAA18986@zion.cs.uiuc.edu> Changes in directory llvm/lib: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+3 -3) Index: llvm/lib/Makefile.am diff -u llvm/lib/Makefile.am:1.1 llvm/lib/Makefile.am:1.2 --- llvm/lib/Makefile.am:1.1 Sun Oct 10 15:36:05 2004 +++ llvm/lib/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -SUBDIRS = Analysis AsmParser Bytecode CodeGen Debugger ExecutionEngine Target \ - Transforms VMCore +SUBDIRS = VMCore Bytecode AsmParser Analysis Transforms CodeGen Target \ + ExecutionEngine Debugger From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/tools/lli/Makefile.am Message-ID: <200410131147.GAA19000@zion.cs.uiuc.edu> Changes in directory llvm/tools/lli: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/lli/Makefile.am diff -u llvm/tools/lli/Makefile.am:1.1 llvm/tools/lli/Makefile.am:1.2 --- llvm/tools/lli/Makefile.am:1.1 Sun Oct 10 17:34:16 2004 +++ llvm/tools/lli/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = lli From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-dis/Makefile.am Message-ID: <200410131147.GAA18987@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-dis: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-dis/Makefile.am diff -u llvm/tools/llvm-dis/Makefile.am:1.1 llvm/tools/llvm-dis/Makefile.am:1.2 --- llvm/tools/llvm-dis/Makefile.am:1.1 Sun Oct 10 17:35:21 2004 +++ llvm/tools/llvm-dis/Makefile.am Wed Oct 13 06:46:52 2004 @@ -7,7 +7,7 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config bin_PROGRAMS = llvm-dis From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/RegAlloc/Makefile.am Message-ID: <200410131147.GAA18976@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/RegAlloc: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+3 -4) Index: llvm/lib/Target/SparcV9/RegAlloc/Makefile.am diff -u llvm/lib/Target/SparcV9/RegAlloc/Makefile.am:1.1 llvm/lib/Target/SparcV9/RegAlloc/Makefile.am:1.2 --- llvm/lib/Target/SparcV9/RegAlloc/Makefile.am:1.1 Sun Oct 10 17:18:58 2004 +++ llvm/lib/Target/SparcV9/RegAlloc/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,10 +7,9 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config lib_LIBRARIES = libLLVMSparcV9RegAlloc.a -libexec_PROGRAMS = LLVMSparcV9RegAlloc.o MYSOURCES = \ IGNode.cpp \ @@ -20,5 +19,5 @@ RegClass.cpp libLLVMSparcV9RegAlloc_a_SOURCES = $(MYSOURCES) -LLVMSparcV9RegAlloc_o_SOURCES = $(MYSOURCES) -LIBS= + +PRELINK=libLLVMSparcV9RegAlloc.a From reid at x10sys.com Wed Oct 13 06:53:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:53:22 -0500 Subject: [llvm-commits] CVS: llvm/autoconf/configure.am Message-ID: <200410131153.GAA20722@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.am updated: 1.3 -> 1.4 --- Log message: Set up BUILD_MODE based on the configuration so the default build mode is established from configuration. Also, don't make the ENABLE_ options AM_CONDITIONALs. --- Diffs of the changes: (+11 -4) Index: llvm/autoconf/configure.am diff -u llvm/autoconf/configure.am:1.3 llvm/autoconf/configure.am:1.4 --- llvm/autoconf/configure.am:1.3 Sun Oct 10 17:17:02 2004 +++ llvm/autoconf/configure.am Wed Oct 13 06:53:12 2004 @@ -72,7 +72,6 @@ esac], [ENABLE_OPTIMIZED=0]) AC_SUBST(ENABLE_OPTIMIZED) -AM_CONDITIONAL(ENABLE_OPTIMIZED,test $ENABLE_OPTIMIZED = 1) dnl Specify whether to build profiled or not AC_ARG_ENABLE(profiled, @@ -86,7 +85,16 @@ esac], [ENABLE_PROFILED=0]) AC_SUBST(ENABLE_PROFILED,$ENABLE_PROFILED) -AM_CONDITIONAL(ENABLE_PROFILED,test $ENABLE_PROFILED = 1) + +if test $ENABLE_PROFILED = 1 ; then + AC_SUBST(BUILDMODE,Profile) +else + if test $ENABLE_OPTIMIZED = 1 ; then + AC_SUBST(BUILDMODE,Release) + else + AC_SUBST(BUILDMODE,Debug) + fi +fi dnl JIT Option AC_ARG_ENABLE(jit, @@ -169,7 +177,7 @@ dnl Check for compilation tools AC_PROG_CXX -AC_PROG_CC(gcc) +AC_PROG_CC AC_PROG_CPP dnl Checks for other build tools @@ -489,7 +497,6 @@ dnl Configure makefiles AC_CONFIG_FILES([Makefile]) -AC_CONFIG_FILES([Makefile.rules]) AC_CONFIG_FILES([lib/Makefile]) AC_CONFIG_FILES([lib/Analysis/IPA/Makefile]) AC_CONFIG_FILES([lib/Analysis/Makefile]) From reid at x10sys.com Wed Oct 13 06:47:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:47:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Hello/Makefile.am Message-ID: <200410131147.GAA19014@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Hello: Makefile.am updated: 1.1 -> 1.2 --- Log message: Update to reflect changes in Makefile rules. --- Diffs of the changes: (+4 -4) Index: llvm/lib/Transforms/Hello/Makefile.am diff -u llvm/lib/Transforms/Hello/Makefile.am:1.1 llvm/lib/Transforms/Hello/Makefile.am:1.2 --- llvm/lib/Transforms/Hello/Makefile.am:1.1 Sun Oct 10 17:19:32 2004 +++ llvm/lib/Transforms/Hello/Makefile.am Wed Oct 13 06:46:51 2004 @@ -7,9 +7,9 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMHello.o +lib_LIBRARIES = libLLVMHello.a -LLVMHello_o_SOURCES = Hello.cpp -LIBS= +libLLVMHello_a_SOURCES = Hello.cpp +PRELINK=libLLVMHello.a From reid at x10sys.com Wed Oct 13 06:56:18 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 06:56:18 -0500 Subject: [llvm-commits] CVS: llvm/Makefile_config configure_am Makefile.rules.am Message-ID: <200410131156.GAA21456@zion.cs.uiuc.edu> Changes in directory llvm: Makefile_config added (r1.1) configure_am updated: 1.1 -> 1.2 Makefile.rules.am (r1.2) removed --- Log message: Changes for automake. --- Diffs of the changes: (+290 -172) Index: llvm/Makefile_config diff -c /dev/null llvm/Makefile_config:1.1 *** /dev/null Wed Oct 13 06:56:17 2004 --- llvm/Makefile_config Wed Oct 13 06:56:07 2004 *************** *** 0 **** --- 1,121 ---- + #,===-- Makefile.rules.am - Common make rules for LLVM ------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + # Options for all automake makefiles + ACLOCAL_AMFLAGS = -I autoconf -I autoconf/m4 --output=autoconf/aclocal.m4 + AUTOMAKE_OPTIONS = foreign dejagnu dist-zip nostdinc + + # Autoconf configured values + LLVM_PREFIX := @LLVM_PREFIX@ + LLVM_BINDIR := @LLVM_BINDIR@ + LLVM_LIBDIR := @LLVM_LIBDIR@ + LLVM_DATADIR := @LLVM_DATADIR@ + LLVM_DOCSDIR := @LLVM_DOCSDIR@ + LLVM_ETCDIR := @LLVM_ETCDIR@ + LLVM_INCLUDEDIR:= @LLVM_INCLUDEDIR@ + LLVM_INFODIR := @LLVM_INFODIR@ + LLVM_MANDIR := @LLVM_MANDIR@ + BUILDMODE := @BUILDMODE@ + + # Shared library extension for this platform. + SHLIBEXT = @SHLIBEXT@ + + # Executable file extension for this platform. + EXEEXT = @EXEEXT@ + + # Target operating system for which LLVM will be compiled. + OS=@OS@ + + # Target hardware architecture + ARCH=@ARCH@ + + # Endian-ness of the target + ENDIAN=@ENDIAN@ + + # Path to the C++ compiler to use. This is an optional setting, which defaults + # to whatever your gmake defaults to. + CXX = @CXX@ + + # Path to the CC binary, which use used by testcases for native builds. + CC := @CC@ + + # Path to the Python interpreter + PYTHON := @PYTHON@ + + # Linker flags. + LDFLAGS+=@LDFLAGS@ + + # Libraries needed by tools + TOOLLINKOPTS=@LIBS@ + + # Path to the library archiver program. + AR_PATH = @AR@ + + # The pathnames of the Flex and Bison programs, respectively. + YACC = @YACC@ + BISON = @BISON@ + FLEX = @LEX@ + + # Paths to miscellaneous programs. + RPWD = pwd + SED = sed + RM = rm + CP = cp + LN = ln + CMP = cmp + ECHO = echo + MKDIR = @abs_top_srcdir@/autoconf/mkinstalldirs + DATE = date + MV = mv + VERB := @ + IGNORE := true + INSTALL = @INSTALL@ + DOT = @DOT@ + ETAGS = @ETAGS@ + ETAGSFLAGS = @ETAGSFLAGS@ + + # Determine the target for which LLVM should generate code. + LLVMGCCARCH := @target@/3.4-llvm + + # Full pathnames of LLVM C/C++ front-end 'cc1' and 'cc1plus' binaries: + LCC1 = @LLVMCC1@ + LCC1XX = @LLVMCC1PLUS@ + + # Path to directory where object files should be stored during a build. + # Set OBJ_ROOT to "." if you do not want to use a separate place for + # object files. + OBJ_ROOT := . + + # Path to location for LLVM C/C++ front-end. You can modify this if you + # want to override the value set by configure. + LLVMGCCDIR := @LLVMGCCDIR@ + + # These are options that can either be enabled here, or can be enabled on the + # make command line (ie, make ENABLE_PROFILING=1): + + # When ENABLE_OPTIMIZED is enabled, Release builds of all of the LLVM code are + # turned on, and Debug builds are turned off. + #ENABLE_OPTIMIZED = 1 + + # When ENABLE_PROFILING is enabled, the llvm source base is built with profile + # information to allow gprof to be used to get execution frequencies. + #ENABLE_PROFILING = 1 + + # This option tells the Makefiles to produce verbose output. + # It essentially prints the commands that make is executing + #VERBOSE = 1 + + + # Include the rules. + # WARNING NOTE WARNING NOTE WARNING NOTE WARNING NOTE + # The inclusion of Makefile_rules MUST be done such that there is a space + # before "include". This prevents automake from processing the file and + # simply passes the inclusion on to GNU Make. The rules in Makefile_rules + # depend on this. DO NOT REMOVE THE SPACE BEFORE "include" + include $(top_srcdir)/Makefile_rules Index: llvm/configure_am diff -u llvm/configure_am:1.1 llvm/configure_am:1.2 --- llvm/configure_am:1.1 Sun Oct 10 17:16:50 2004 +++ llvm/configure_am Wed Oct 13 06:56:07 2004 @@ -473,7 +473,7 @@ ac_subdirs_all="$ac_subdirs_all projects/Java" ac_subdirs_all="$ac_subdirs_all projects/llvm-tv" ac_subdirs_all="$ac_subdirs_all projects/llvm-fefw" -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 build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar LLVMGCCDIR ENABLE_OPTIMIZED ENABLE_OPTIMIZED_TRUE ENABLE_OPTIMIZED_FALSE ENABLE_PROFILED ENABLE_PROFILED_TRUE ENABLE_PROFILED_FALSE JIT OS ARCH_X86_TRUE ARCH_X86_FALSE ARCH_SPARC_TRUE ARCH_SPARC_FALSE ARCH_PPC_TRUE ARCH_PPC_FALSE ARCH_UNKNOWN_TRUE ARCH_UNKNOWN_FALSE ARCH ENDIAN CC CFLAGS LDFLAGS CPPFL! AGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CPP LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL DOT ETAGS PYTHON QMTEST ifGNUmake LLVMCC1 LLVMCC1PLUS ETAGSFLAGS ALLOCA MMAP_FILE HAVE_ZLIB HAVE_BZIP2 SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME subdirs 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 build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar LLVMGCCDIR ENABLE_OPTIMIZED ENABLE_PROFILED BUILDMODE JIT OS ARCH_X86_TRUE ARCH_X86_FALSE ARCH_SPARC_TRUE ARCH_SPARC_FALSE ARCH_PPC_TRUE ARCH_PPC_FALSE ARCH_UNKNOWN_TRUE ARCH_UNKNOWN_FALSE ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE! AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CPP LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL DOT ETAGS PYTHON QMTEST ifGNUmake LLVMCC1 LLVMCC1PLUS ETAGSFLAGS ALLOCA MMAP_FILE HAVE_ZLIB HAVE_BZIP2 SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME subdirs LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -2089,16 +2089,6 @@ fi; - -if test $ENABLE_OPTIMIZED = 1; then - ENABLE_OPTIMIZED_TRUE= - ENABLE_OPTIMIZED_FALSE='#' -else - ENABLE_OPTIMIZED_TRUE='#' - ENABLE_OPTIMIZED_FALSE= -fi - - # Check whether --enable-profiled or --disable-profiled was given. if test "${enable_profiled+set}" = set; then enableval="$enable_profiled" @@ -2116,15 +2106,18 @@ ENABLE_PROFILED=$ENABLE_PROFILED +if test $ENABLE_PROFILED = 1 ; then + BUILDMODE=Profile -if test $ENABLE_PROFILED = 1; then - ENABLE_PROFILED_TRUE= - ENABLE_PROFILED_FALSE='#' else - ENABLE_PROFILED_TRUE='#' - ENABLE_PROFILED_FALSE= -fi + if test $ENABLE_OPTIMIZED = 1 ; then + BUILDMODE=Release + else + BUILDMODE=Debug + + fi +fi # Check whether --enable-jit or --disable-jit was given. if test "${enable_jit+set}" = set; then @@ -5869,7 +5862,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5872 "configure"' > conftest.$ac_ext + echo '#line 5865 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5972,13 +5965,6 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -int -main () -{ - - ; - return 0; -} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 @@ -6750,7 +6736,7 @@ # Provide some information about the compiler. -echo "$as_me:6753:" \ +echo "$as_me:6739:" \ "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 @@ -7525,13 +7511,13 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib;$old_postinstall_cmds" + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) - old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds" + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac - old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` @@ -7807,11 +7793,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7810: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7796: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7814: \$? = $ac_status" >&5 + echo "$as_me:7800: \$? = $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 @@ -8050,11 +8036,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8053: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8039: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8057: \$? = $ac_status" >&5 + echo "$as_me:8043: \$? = $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 @@ -8110,11 +8096,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8113: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8099: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8117: \$? = $ac_status" >&5 + echo "$as_me:8103: \$? = $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 @@ -8238,7 +8224,7 @@ ;; amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes @@ -8280,7 +8266,8 @@ else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi @@ -8337,7 +8324,9 @@ *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then - archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver;cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver; $echo "local: *; };" >> $output_objdir/$libname.ver; + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds="$tmp_archive_cmds" @@ -8374,7 +8363,7 @@ aix3*) allow_undefined_flag=unsupported always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE;$AR $AR_FLAGS $lib $output_objdir/$soname' + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes @@ -8598,13 +8587,13 @@ whole_archive_flag_spec=' ' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag};$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section @@ -8627,7 +8616,7 @@ # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll;linknames=' + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. @@ -8667,8 +8656,8 @@ archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -8676,8 +8665,8 @@ archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no @@ -8725,9 +8714,9 @@ hpux9*) if test "$GCC" = yes; then - archive_cmds='$rm $output_objdir/$soname;$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - archive_cmds='$rm $output_objdir/$soname;$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: @@ -8848,7 +8837,7 @@ hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def;$echo DATA >> $output_objdir/$libname.def;$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def;$echo EXPORTS >> $output_objdir/$libname.def;emxexp $libobjs >> $output_objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; @@ -8872,7 +8861,9 @@ else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp; $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib;$rm $lib.exp' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi @@ -8891,10 +8882,12 @@ no_undefined_flag=' -z text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags;$rm $lib.exp' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no @@ -8983,7 +8976,8 @@ # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' @@ -9198,13 +9192,13 @@ yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`; - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`; - dldir=$destdir/`dirname \$dlpath`; - test -d \$dldir || mkdir -p \$dldir; + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`; - dlpath=$dir/\$dldll; + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes @@ -10287,7 +10281,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_CXX=no fi @@ -11595,16 +11590,16 @@ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else - archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs;$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs;$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -11612,8 +11607,8 @@ archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no @@ -11668,7 +11663,7 @@ ld_shlibs_CXX=no ;; aCC) - archive_cmds_CXX='$rm $output_objdir/$soname;$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -11681,7 +11676,7 @@ ;; *) if test "$GXX" = yes; then - archive_cmds_CXX='$rm $output_objdir/$soname;$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -11997,7 +11992,10 @@ cxx) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp;$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib;$rm $lib.exp' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: @@ -12073,7 +12071,8 @@ # Sun C++ 4.2, 5.x and Centerline C++ no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no @@ -12118,7 +12117,9 @@ no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -12127,8 +12128,8 @@ # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -12571,11 +12572,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12574: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12575: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12578: \$? = $ac_status" >&5 + echo "$as_me:12579: \$? = $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 @@ -12631,11 +12632,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12634: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12635: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12638: \$? = $ac_status" >&5 + echo "$as_me:12639: \$? = $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 @@ -12903,13 +12904,13 @@ yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`; - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`; - dldir=$destdir/`dirname \$dlpath`; - test -d \$dldir || mkdir -p \$dldir; + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`; - dlpath=$dir/\$dldll; + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes @@ -13992,7 +13993,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:14931: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14934: \$? = $ac_status" >&5 + echo "$as_me:14935: \$? = $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 @@ -14987,11 +14988,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14990: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14991: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14994: \$? = $ac_status" >&5 + echo "$as_me:14995: \$? = $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 @@ -15115,7 +15116,7 @@ ;; amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes @@ -15157,7 +15158,8 @@ else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi @@ -15214,7 +15216,9 @@ *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver;cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver; $echo "local: *; };" >> $output_objdir/$libname.ver; + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_F77="$tmp_archive_cmds" @@ -15251,7 +15255,7 @@ aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes - archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE;$AR $AR_FLAGS $lib $output_objdir/$soname' + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes @@ -15455,13 +15459,13 @@ whole_archive_flag_spec_F77=' ' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag};$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section @@ -15484,7 +15488,7 @@ # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll;linknames=' + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. @@ -15524,8 +15528,8 @@ archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -15533,8 +15537,8 @@ archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no @@ -15582,9 +15586,9 @@ hpux9*) if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname;$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - archive_cmds_F77='$rm $output_objdir/$soname;$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: @@ -15705,7 +15709,7 @@ hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported - archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def;$echo DATA >> $output_objdir/$libname.def;$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def;$echo EXPORTS >> $output_objdir/$libname.def;emxexp $libobjs >> $output_objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; @@ -15729,7 +15733,9 @@ else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp; $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib;$rm $lib.exp' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi @@ -15748,10 +15754,12 @@ no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no @@ -15840,7 +15848,8 @@ # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_F77= hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' @@ -16055,13 +16064,13 @@ yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`; - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`; - dldir=$destdir/`dirname \$dlpath`; - test -d \$dldir || mkdir -p \$dldir; + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`; - dlpath=$dir/\$dldll; + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes @@ -17018,11 +17027,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17021: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17030: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17025: \$? = $ac_status" >&5 + echo "$as_me:17034: \$? = $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 @@ -17261,11 +17270,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17264: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17273: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17268: \$? = $ac_status" >&5 + echo "$as_me:17277: \$? = $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 @@ -17321,11 +17330,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17324: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17333: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17328: \$? = $ac_status" >&5 + echo "$as_me:17337: \$? = $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 @@ -17449,7 +17458,7 @@ ;; amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes @@ -17491,7 +17500,8 @@ else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi @@ -17548,7 +17558,9 @@ *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver;cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver; $echo "local: *; };" >> $output_objdir/$libname.ver; + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_GCJ="$tmp_archive_cmds" @@ -17585,7 +17597,7 @@ aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE;$AR $AR_FLAGS $lib $output_objdir/$soname' + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes @@ -17809,13 +17821,13 @@ whole_archive_flag_spec_GCJ=' ' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag};$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section @@ -17838,7 +17850,7 @@ # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll;linknames=' + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. @@ -17878,8 +17890,8 @@ archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -17887,8 +17899,8 @@ archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no @@ -17936,9 +17948,9 @@ hpux9*) if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname;$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - archive_cmds_GCJ='$rm $output_objdir/$soname;$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: @@ -18059,7 +18071,7 @@ hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def;$echo DATA >> $output_objdir/$libname.def;$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def;$echo EXPORTS >> $output_objdir/$libname.def;emxexp $libobjs >> $output_objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; @@ -18083,7 +18095,9 @@ else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp; $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib;$rm $lib.exp' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi @@ -18102,10 +18116,12 @@ no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no @@ -18194,7 +18210,8 @@ # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_GCJ= hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' @@ -18409,13 +18426,13 @@ yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`; - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`; - dldir=$destdir/`dirname \$dlpath`; - test -d \$dldir || mkdir -p \$dldir; + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`; - dlpath=$dir/\$dldll; + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes @@ -19498,7 +19515,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5 -echo "$as_me: error: conditional \"ENABLE_OPTIMIZED\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${ENABLE_PROFILED_TRUE}" && test -z "${ENABLE_PROFILED_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"ENABLE_PROFILED\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"ENABLE_PROFILED\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi if test -z "${ARCH_X86_TRUE}" && test -z "${ARCH_X86_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ARCH_X86\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -26968,7 +26969,6 @@ case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "Makefile.rules" ) CONFIG_FILES="$CONFIG_FILES Makefile.rules" ;; "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/Analysis/IPA/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Analysis/IPA/Makefile" ;; "lib/Analysis/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Analysis/Makefile" ;; @@ -27159,11 +27159,8 @@ s, at am__untar@,$am__untar,;t t s, at LLVMGCCDIR@,$LLVMGCCDIR,;t t s, at ENABLE_OPTIMIZED@,$ENABLE_OPTIMIZED,;t t -s, at ENABLE_OPTIMIZED_TRUE@,$ENABLE_OPTIMIZED_TRUE,;t t -s, at ENABLE_OPTIMIZED_FALSE@,$ENABLE_OPTIMIZED_FALSE,;t t s, at ENABLE_PROFILED@,$ENABLE_PROFILED,;t t -s, at ENABLE_PROFILED_TRUE@,$ENABLE_PROFILED_TRUE,;t t -s, at ENABLE_PROFILED_FALSE@,$ENABLE_PROFILED_FALSE,;t t +s, at BUILDMODE@,$BUILDMODE,;t t s, at JIT@,$JIT,;t t s, at OS@,$OS,;t t s, at ARCH_X86_TRUE@,$ARCH_X86_TRUE,;t t From lattner at cs.uiuc.edu Wed Oct 13 10:09:35 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 10:09:35 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SetOperations.h Message-ID: <200410131509.KAA04149@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: SetOperations.h updated: 1.6 -> 1.7 --- Log message: Get rid of template templates that were preventing VC from compiling the set_intersect template. Thanks to Morten Ofstad and Jeff Cohen for the patch! --- Diffs of the changes: (+18 -18) Index: llvm/include/llvm/ADT/SetOperations.h diff -u llvm/include/llvm/ADT/SetOperations.h:1.6 llvm/include/llvm/ADT/SetOperations.h:1.7 --- llvm/include/llvm/ADT/SetOperations.h:1.6 Wed Sep 1 17:55:34 2004 +++ llvm/include/llvm/ADT/SetOperations.h Wed Oct 13 10:09:21 2004 @@ -17,8 +17,8 @@ namespace llvm { -// set_union(A, B) - Compute A := A u B, return whether A changed. -// +/// set_union(A, B) - Compute A := A u B, return whether A changed. +/// template bool set_union(S1Ty &S1, const S2Ty &S2) { bool Changed = false; @@ -31,22 +31,22 @@ return Changed; } -// set_intersect(A, B) - Compute A := A ^ B -// Identical to set_intersection, except that it works on set<>'s and -// is nicer to use. Functionally, this iterates through S1, removing -// elements that are not contained in S2. -// -template class S1Ty, class ETy, class S2Ty> -void set_intersect(S1Ty &S1, const S2Ty &S2) { - for (typename S1Ty::iterator I = S1.begin(); I != S1.end();) { - const ETy &E = *I; - ++I; - if (!S2.count(E)) S1.erase(E); // Erase element if not in S2 - } +/// set_intersect(A, B) - Compute A := A ^ B +/// Identical to set_intersection, except that it works on set<>'s and +/// is nicer to use. Functionally, this iterates through S1, removing +/// elements that are not contained in S2. +/// +template +void set_intersect(S1Ty &S1, const S2Ty &S2) { + for (typename S1Ty::iterator I = S1.begin(); I != S1.end();) { + const typename S1Ty::key_type &E = *I; + ++I; + if (!S2.count(E)) S1.erase(E); // Erase element if not in S2 + } } -// set_difference(A, B) - Return A - B -// +/// set_difference(A, B) - Return A - B +/// template S1Ty set_difference(const S1Ty &S1, const S2Ty &S2) { S1Ty Result; @@ -57,8 +57,8 @@ return Result; } -// set_subtract(A, B) - Compute A := A - B -// +/// set_subtract(A, B) - Compute A := A - B +/// template void set_subtract(S1Ty &S1, const S2Ty &S2) { for (typename S2Ty::const_iterator SI = S2.begin(), SE = S2.end(); From lattner at cs.uiuc.edu Wed Oct 13 10:11:37 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 10:11:37 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SetVector.h Message-ID: <200410131511.KAA04166@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: SetVector.h updated: 1.8 -> 1.9 --- Log message: Use explicit std:: qualification to avoid relying on Koenig lookup, which VC++ does not do properly. Thanks to Morten Ofstad for the patch! --- Diffs of the changes: (+1 -1) Index: llvm/include/llvm/ADT/SetVector.h diff -u llvm/include/llvm/ADT/SetVector.h:1.8 llvm/include/llvm/ADT/SetVector.h:1.9 --- llvm/include/llvm/ADT/SetVector.h:1.8 Sat Sep 11 15:38:25 2004 +++ llvm/include/llvm/ADT/SetVector.h Wed Oct 13 10:11:23 2004 @@ -112,7 +112,7 @@ /// @brief Remove an item from the set vector. void remove(const value_type& X) { if (0 < set_.erase(X)) { - iterator I = find(vector_.begin(),vector_.end(),X); + iterator I = std::find(vector_.begin(),vector_.end(),X); assert(I != vector_.end() && "Corrupted SetVector instances!"); vector_.erase(I); } From lattner at cs.uiuc.edu Wed Oct 13 10:26:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 10:26:00 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/FileLexer.l Message-ID: <200410131526.KAA04629@apoc.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: FileLexer.l updated: 1.22 -> 1.23 --- Log message: Patch to make VS happier, thanks to Morten Ofstad for pointing this out. --- Diffs of the changes: (+1 -1) Index: llvm/utils/TableGen/FileLexer.l diff -u llvm/utils/TableGen/FileLexer.l:1.22 llvm/utils/TableGen/FileLexer.l:1.23 --- llvm/utils/TableGen/FileLexer.l:1.22 Thu May 27 12:44:18 2004 +++ llvm/utils/TableGen/FileLexer.l Wed Oct 13 10:25:46 2004 @@ -147,7 +147,7 @@ /// files. Switch back to an includer if an includee has run out of input. /// extern "C" -int yywrap() { +int yywrap(void) { if (IncludeStack.back().File != stdin) fclose(IncludeStack.back().File); IncludeStack.pop_back(); From lattner at cs.uiuc.edu Wed Oct 13 11:59:36 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 11:59:36 -0500 Subject: [llvm-commits] CVS: poolalloc/test/Makefile Message-ID: <200410131659.LAA05044@apoc.cs.uiuc.edu> Changes in directory poolalloc/test: Makefile updated: 1.19 -> 1.20 --- Log message: This was moved --- Diffs of the changes: (+8 -8) Index: poolalloc/test/Makefile diff -u poolalloc/test/Makefile:1.19 poolalloc/test/Makefile:1.20 --- poolalloc/test/Makefile:1.19 Fri Mar 5 18:02:09 2004 +++ poolalloc/test/Makefile Wed Oct 13 11:59:22 2004 @@ -17,7 +17,7 @@ MultiSource/Benchmarks/llubenchmark LARGE_PROBLEM_SIZE_DIRS := \ - $(addprefix $(LLVM_OBJ_ROOT)/test/Programs/,$(LARGE_PROBLEM_SIZE_DIRS)) + $(addprefix $(LLVM_OBJ_ROOT)/projects/llvm-test/,$(LARGE_PROBLEM_SIZE_DIRS)) NORMAL_PROBLEM_SIZE_DIRS := \ MultiSource/Benchmarks/Ptrdist \ @@ -25,7 +25,7 @@ #MultiSource/Benchmarks/MallocBench/cfrac NORMAL_PROBLEM_SIZE_DIRS := \ - $(addprefix $(LLVM_OBJ_ROOT)/test/Programs/,$(NORMAL_PROBLEM_SIZE_DIRS)) + $(addprefix $(LLVM_OBJ_ROOT)/projects/llvm-test/,$(NORMAL_PROBLEM_SIZE_DIRS)) ############################################################################## @@ -104,34 +104,34 @@ # Targets for running tests and gathering statistics for arbitrary tests ############################################################################## -# test target - Descend into test/Programs and run the TEST.poolalloc.Makefile +# test target - Descend into projects/llvm-test and run the TEST.poolalloc.Makefile # tests... test:: - (cd $(LLVM_OBJ_ROOT)/test/Programs/$(SUBDIR); \ + (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \ PROJECT_DIR=$(BUILD_OBJ_ROOT) $(MAKE) -j1 TEST=poolalloc \ report report.html) @printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a" vtl:: - (cd $(LLVM_OBJ_ROOT)/test/Programs/$(SUBDIR); \ + (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \ PROJECT_DIR=$(BUILD_OBJ_ROOT) $(MAKE) -j1 TEST=pavtl \ test report) @printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a" perf:: - (cd $(LLVM_OBJ_ROOT)/test/Programs/$(SUBDIR); \ + (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \ PROJECT_DIR=$(BUILD_OBJ_ROOT) $(MAKE) -j1 TEST=perf \ test report) @printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a" p4perf:: - (cd $(LLVM_OBJ_ROOT)/test/Programs/$(SUBDIR); \ + (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \ PROJECT_DIR=$(BUILD_OBJ_ROOT) $(MAKE) -j1 TEST=p4perf \ test report) @printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a" strace:: - (cd $(LLVM_OBJ_ROOT)/test/Programs/$(SUBDIR); \ + (cd $(LLVM_OBJ_ROOT)/projects/llvm-test/$(SUBDIR); \ PROJECT_DIR=$(BUILD_OBJ_ROOT) $(MAKE) -j1 TEST=strace \ test) @printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a" From lattner at cs.uiuc.edu Wed Oct 13 13:47:41 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 13:47:41 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/Makefile.spec Message-ID: <200410131847.NAA07665@apoc.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC: Makefile.spec updated: 1.42 -> 1.43 --- Log message: Two changes: stop passing things like ../../Output/foo.llvm.bc, when we can just pass ../foo.llvm.bc Second, unbreak the profile target as LLVM_OBJ_ROOT is now absolute, so saying ../../$(LLVM_OBJ_ROOT) won't work anymore. --- Diffs of the changes: (+16 -16) Index: llvm-test/External/SPEC/Makefile.spec diff -u llvm-test/External/SPEC/Makefile.spec:1.42 llvm-test/External/SPEC/Makefile.spec:1.43 --- llvm-test/External/SPEC/Makefile.spec:1.42 Thu Oct 7 16:56:53 2004 +++ llvm-test/External/SPEC/Makefile.spec Wed Oct 13 13:47:27 2004 @@ -61,7 +61,7 @@ Output/%.out-nat: Output/%.native $(SPEC_SANDBOX) nat-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ - ../../$< $(RUN_OPTIONS) + ../$*.native $(RUN_OPTIONS) -(cd Output/nat-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/nat-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time @@ -69,7 +69,7 @@ Output/%.out-lli: Output/%.llvm.bc $(LLI) $(SPEC_SANDBOX) lli-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ - $(LLI) $(LLI_OPTS) ../../$< $(RUN_OPTIONS) + $(LLI) $(LLI_OPTS) ../$*.llvm.bc $(RUN_OPTIONS) -(cd Output/lli-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/lli-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time @@ -77,7 +77,7 @@ Output/%.out-jit: Output/%.llvm.bc $(LLI) $(SPEC_SANDBOX) jit-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ - $(LLI) $(JIT_OPTS) ../../$< $(RUN_OPTIONS) + $(LLI) $(JIT_OPTS) ../$*.llvm.bc $(RUN_OPTIONS) -(cd Output/jit-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/jit-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time @@ -85,7 +85,7 @@ Output/%.out-jit-ls: Output/%.llvm.bc $(LLI) $(SPEC_SANDBOX) jit-ls-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ - $(LLI) -regalloc=iterativescan $(JIT_OPTS) ../../$< $(RUN_OPTIONS) + $(LLI) -regalloc=iterativescan $(JIT_OPTS) ../$*.llvm.bc $(RUN_OPTIONS) -(cd Output/jit-ls-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/jit-ls-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time @@ -93,7 +93,7 @@ Output/%.out-llc: Output/%.llc $(SPEC_SANDBOX) llc-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ - ../../$< $(RUN_OPTIONS) + ../$*.llc $(RUN_OPTIONS) -(cd Output/llc-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/llc-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time @@ -101,7 +101,7 @@ Output/%.out-llc-ls: Output/%.llc-ls $(SPEC_SANDBOX) llc-ls-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ - ../../$< $(RUN_OPTIONS) + ../$*.llc-ls $(RUN_OPTIONS) -(cd Output/llc-ls-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/llc-ls-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time @@ -109,7 +109,7 @@ Output/%.out-cbe: Output/%.cbe $(SPEC_SANDBOX) cbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ - ../../$< $(RUN_OPTIONS) + ../$*.cbe $(RUN_OPTIONS) -(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/cbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time @@ -117,7 +117,7 @@ Output/%.trace-out-llc: Output/%.trace.llc $(SPEC_SANDBOX) llc-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ - ../../$< $(RUN_OPTIONS) + ../$*.trace.llc $(RUN_OPTIONS) -(cd Output/llc-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/llc-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time @@ -125,7 +125,7 @@ Output/%.trace-out-cbe: Output/%.trace.cbe $(SPEC_SANDBOX) cbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ - ../../$< $(RUN_OPTIONS) + ../$*.trace.cbe $(RUN_OPTIONS) -(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/cbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time @@ -141,7 +141,7 @@ Output/%.bugpoint-gccas: Output/%.noopt-llvm.bc $(LBUGPOINT) \ Output/gccas-pass-args Output/%.out-nat $(SPEC_SANDBOX) bugpoint-$(RUN_TYPE) $@ $(REF_IN_DIR) \ - $(LBUGPOINT) ../../$< `cat Output/gccas-pass-args` $(OPTPASSES) \ + $(LBUGPOINT) ../$*.noopt-llvm.bc `cat Output/gccas-pass-args` $(OPTPASSES) \ $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS) @echo "===> Leaving Output/bugpoint-$(RUN_TYPE)" @@ -149,33 +149,33 @@ Output/%.bugpoint-gccld: Output/%.noopt-llvm.bc $(LBUGPOINT) \ Output/gccld-pass-args Output/%.out-nat $(SPEC_SANDBOX) bugpoint-$(RUN_TYPE) $@ $(REF_IN_DIR) \ - $(LBUGPOINT) ../../$< `cat Output/gccld-pass-args` $(OPTPASSES) \ + $(LBUGPOINT) ../$*.noopt-llvm.bc `cat Output/gccld-pass-args` $(OPTPASSES) \ $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS) @echo "===> Leaving Output/bugpoint-$(RUN_TYPE)" $(PROGRAMS_TO_TEST:%=Output/%.bugpoint-llc): \ Output/%.bugpoint-llc: Output/%.llvm.bc $(LBUGPOINT) Output/%.out-nat $(SPEC_SANDBOX) bugpoint-$(RUN_TYPE) $@ $(REF_IN_DIR) \ - $(LBUGPOINT) ../../$< -run-llc $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS) + $(LBUGPOINT) ../$*.llvm.bc -run-llc $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS) @echo "===> Leaving Output/bugpoint-$(RUN_TYPE)" $(PROGRAMS_TO_TEST:%=Output/%.bugpoint-llc-ls): \ Output/%.bugpoint-llc-ls: Output/%.llvm.bc $(LBUGPOINT) Output/%.out-nat $(SPEC_SANDBOX) bugpoint-$(RUN_TYPE) $@ $(REF_IN_DIR) \ - $(LBUGPOINT) ../../$< -run-llc $(BUGPOINT_OPTIONS) \ + $(LBUGPOINT) ../$*.llvm.bc -run-llc $(BUGPOINT_OPTIONS) \ -regalloc=iterativescan $(BUGPOINT_ARGS) @echo "===> Leaving Output/bugpoint-$(RUN_TYPE)" $(PROGRAMS_TO_TEST:%=Output/%.bugpoint-jit): \ Output/%.bugpoint-jit: Output/%.llvm.bc $(LBUGPOINT) Output/%.out-nat $(SPEC_SANDBOX) bugpoint-$(RUN_TYPE) $@ $(REF_IN_DIR) \ - $(LBUGPOINT) ../../$< -run-jit $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS) + $(LBUGPOINT) ../$*.llvm.bc -run-jit $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS) @echo "===> Leaving Output/bugpoint-$(RUN_TYPE)" $(PROGRAMS_TO_TEST:%=Output/%.bugpoint-jit-ls): \ Output/%.bugpoint-jit-ls: Output/%.llvm.bc $(LBUGPOINT) Output/%.out-nat $(SPEC_SANDBOX) bugpoint-$(RUN_TYPE) $@ $(REF_IN_DIR) \ - $(LBUGPOINT) ../../$< -run-jit $(BUGPOINT_OPTIONS) \ + $(LBUGPOINT) ../$*.llvm.bc -run-jit $(BUGPOINT_OPTIONS) \ -regalloc=iterativescan $(BUGPOINT_ARGS) @echo "===> Leaving Output/bugpoint-$(RUN_TYPE)" @@ -188,7 +188,7 @@ @rm -f $@ $(SPEC_SANDBOX) profile-$(RUN_TYPE) Output/$*.out-prof $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) $(LLI) $(JIT_OPTS)\ - -fake-argv0 '../$*.llvm.bc' -load ../../$(LIBPROFILESO) ../../$< -llvmprof-output ../../$@ $(RUN_OPTIONS) + -fake-argv0 '../$*.llvm.bc' -load $(LIBPROFILESO) ../../$< -llvmprof-output ../../$@ $(RUN_OPTIONS) -(cd Output/profile-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > Output/$*.out-prof -cp Output/profile-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time -cp Output/profile-$(RUN_TYPE)/llvmprof.out $@ From lattner at cs.uiuc.edu Wed Oct 13 13:49:14 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 13:49:14 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/Makefile.spec Message-ID: <200410131849.NAA07701@apoc.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC: Makefile.spec updated: 1.43 -> 1.44 --- Log message: Get rid of wierd tracing targets and "performance" target --- Diffs of the changes: (+0 -32) Index: llvm-test/External/SPEC/Makefile.spec diff -u llvm-test/External/SPEC/Makefile.spec:1.43 llvm-test/External/SPEC/Makefile.spec:1.44 --- llvm-test/External/SPEC/Makefile.spec:1.43 Wed Oct 13 13:47:27 2004 +++ llvm-test/External/SPEC/Makefile.spec Wed Oct 13 13:49:03 2004 @@ -113,23 +113,6 @@ -(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ -cp Output/cbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time -$(PROGRAMS_TO_TEST:%=Output/%.trace-out-llc): \ -Output/%.trace-out-llc: Output/%.trace.llc - $(SPEC_SANDBOX) llc-$(RUN_TYPE) $@ $(REF_IN_DIR) \ - $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ - ../$*.trace.llc $(RUN_OPTIONS) - -(cd Output/llc-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ - -cp Output/llc-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time - -$(PROGRAMS_TO_TEST:%=Output/%.trace-out-cbe): \ -Output/%.trace-out-cbe: Output/%.trace.cbe - $(SPEC_SANDBOX) cbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \ - $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ - ../$*.trace.cbe $(RUN_OPTIONS) - -(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ - -cp Output/cbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time - - # Specify stdin, reference output, and command line options for the program... BUGPOINT_OPTIONS += -input=$(STDIN_FILENAME) -output=../$*.out-nat BUGPOINT_OPTIONS += -timeout=$(RUNTIMELIMIT) @@ -194,18 +177,3 @@ -cp Output/profile-$(RUN_TYPE)/llvmprof.out $@ @cmp -s Output/$*.out-prof Output/$*.out-nat || \ printf "***\n***\n*** WARNING: Output of profiled program (Output/$*.out-prof)\n*** doesn't match the output of the native program (Output/$*.out-nat)!\n***\n***\n"; - - - - -$(PROGRAMS_TO_TEST:%=Output/%.out-tracing): \ -Output/%.out-tracing: Output/%.trace - $(SPEC_SANDBOX) trace-$(RUN_TYPE) $@ $(REF_IN_DIR) \ - $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ - ../../$< $(RUN_OPTIONS) - -(cd Output/trace-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ - -cp Output/trace-$(RUN_TYPE)/$(STDOUT_FILENAME).time $@.time - -$(PROGRAMS_TO_TEST:%=Output/%.performance): \ -Output/%.performance: Output/%.out-llc Output/%.out-tracing - -$(TIMESCRIPT) $* Output/$*.out-llc.time Output/$*.out-tracing.time $@ From lattner at cs.uiuc.edu Wed Oct 13 13:51:54 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 13:51:54 -0500 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs Message-ID: <200410131851.NAA07740@apoc.cs.uiuc.edu> Changes in directory llvm-test: Makefile.programs updated: 1.137 -> 1.138 --- Log message: Remove old tracing hacks --- Diffs of the changes: (+0 -24) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.137 llvm-test/Makefile.programs:1.138 --- llvm-test/Makefile.programs:1.137 Mon Sep 20 13:39:32 2004 +++ llvm-test/Makefile.programs Wed Oct 13 13:51:43 2004 @@ -144,30 +144,6 @@ DISABLE_DIFFS := 1 endif -ifneq ($(TRACE)$(TRACEM),) - ## When tracing is enabled do the following: - ## -- disable output diffs - ## -- generate llc output if not disabled - ## -- generate cbe output if not disabled - ## -- Make the trace output files precious if tracing is enabled because - ## we often don't want to generate the complete trace file! - -DISABLE_DIFFS = 1 -OPTPASSES += $(TRACEFLAGS) -LDFLAGS += $(TRACELIBS) -ifndef DISABLE_LLC -all:: $(LLCOUTPUT) -endif -ifndef DISABLE_CBE -all:: $(CBEOUTPUT) -endif -ifndef DISABLE_JIT -all:: $(JITOUTPUT) -endif - -.PRECIOUS: $(LLIOUTPUT) $(JITOUTPUT) $(LLCOUTPUT) $(CBEOUTPUT) -endif - ifndef DISABLE_LLC all:: $(LLCCODEGEN) else From lattner at cs.uiuc.edu Wed Oct 13 20:35:30 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 20:35:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200410140135.UAA09680@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.78 -> 1.79 --- Log message: Minor cleanups --- Diffs of the changes: (+3 -7) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.78 llvm/lib/Bytecode/Writer/Writer.cpp:1.79 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.78 Wed Sep 1 17:55:35 2004 +++ llvm/lib/Bytecode/Writer/Writer.cpp Wed Oct 13 20:35:17 2004 @@ -179,8 +179,8 @@ Loc = w.size(); } -inline BytecodeBlock::~BytecodeBlock() { // Do backpatch when block goes out - // of scope... +inline BytecodeBlock::~BytecodeBlock() { // Do backpatch when block goes out + // of scope... if (Loc == Writer.size() && ElideIfEmpty) { // If the block is empty, and we are allowed to, do not emit the block at // all! @@ -188,8 +188,6 @@ return; } - //cerr << "OldLoc = " << Loc << " NewLoc = " << NewLoc << " diff = " - // << (NewLoc-Loc) << endl; if (HasLongFormat) Writer.output(unsigned(Writer.size()-Loc), int(Loc-4)); else @@ -277,12 +275,10 @@ break; } - case Type::OpaqueTyID: { + case Type::OpaqueTyID: // No need to emit anything, just the count of opaque types is enough. break; - } - //case Type::PackedTyID: default: std::cerr << __FILE__ << ":" << __LINE__ << ": Don't know how to serialize" << " Type '" << T->getDescription() << "'\n"; From lattner at cs.uiuc.edu Wed Oct 13 20:39:29 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 20:39:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200410140139.UAA09704@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.132 -> 1.133 --- Log message: Fit in 80 columns --- Diffs of the changes: (+14 -13) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.132 llvm/lib/Bytecode/Reader/Reader.cpp:1.133 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.132 Tue Sep 28 11:57:46 2004 +++ llvm/lib/Bytecode/Reader/Reader.cpp Wed Oct 13 20:39:18 2004 @@ -742,8 +742,8 @@ FirstVariableOperand = FTy->getNumParams(); - if ((Oprnds.size()-FirstVariableOperand) & 1) // Must be pairs of type/value - error("Invalid call instruction!"); + if ((Oprnds.size()-FirstVariableOperand) & 1) + error("Invalid call instruction!"); // Must be pairs of type/value for (unsigned i = FirstVariableOperand, e = Oprnds.size(); i != e; i += 2) @@ -913,8 +913,8 @@ /// Get a particular numbered basic block, which might be a forward reference. /// This works together with ParseBasicBlock to handle these forward references -/// in a clean manner. This function is used when constructing phi, br, switch, -/// and other instructions that reference basic blocks. Blocks are numbered +/// in a clean manner. This function is used when constructing phi, br, switch, +/// and other instructions that reference basic blocks. Blocks are numbered /// sequentially as they appear in the function. BasicBlock *BytecodeReader::getBasicBlock(unsigned ID) { // Make sure there is room in the table... @@ -1826,7 +1826,8 @@ } // Notify handler about the global value. - if (Handler) Handler->handleGlobalVariable(ElTy, isConstant, Linkage, SlotNo, initSlot); + if (Handler) + Handler->handleGlobalVariable(ElTy, isConstant, Linkage, SlotNo,initSlot); // Get next item VarType = read_vbr_uint(); @@ -1959,17 +1960,17 @@ case 2: // 1.2.5 (Not Released) // LLVM 1.2 and earlier had two-word block headers. This is a bit wasteful, - // especially for small files where the 8 bytes per block is a large fraction - // of the total block size. In LLVM 1.3, the block type and length are - // compressed into a single 32-bit unsigned integer. 27 bits for length, 5 - // bits for block type. + // especially for small files where the 8 bytes per block is a large + // fraction of the total block size. In LLVM 1.3, the block type and length + // are compressed into a single 32-bit unsigned integer. 27 bits for length, + // 5 bits for block type. hasLongBlockHeaders = true; // LLVM 1.2 and earlier wrote type slot numbers as vbr_uint32. In LLVM 1.3 - // this has been reduced to vbr_uint24. It shouldn't make much difference - // since we haven't run into a module with > 24 million types, but for safety - // the 24-bit restriction has been enforced in 1.3 to free some bits in - // various places and to ensure consistency. + // this has been reduced to vbr_uint24. It shouldn't make much difference + // since we haven't run into a module with > 24 million types, but for + // safety the 24-bit restriction has been enforced in 1.3 to free some bits + // in various places and to ensure consistency. has32BitTypes = true; // LLVM 1.2 and earlier did not provide a target triple nor a list of From lattner at cs.uiuc.edu Wed Oct 13 20:46:18 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 20:46:18 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200410140146.UAA09722@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.79 -> 1.80 --- Log message: Wrap to 80 cols, delete some seriously old debugging printouts --- Diffs of the changes: (+15 -26) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.79 llvm/lib/Bytecode/Writer/Writer.cpp:1.80 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.79 Wed Oct 13 20:35:17 2004 +++ llvm/lib/Bytecode/Writer/Writer.cpp Wed Oct 13 20:46:07 2004 @@ -235,8 +235,6 @@ int Slot = Table.getSlot(AT->getElementType()); assert(Slot != -1 && "Type used but not available!!"); output_typeid((unsigned)Slot); - //std::cerr << "Type slot = " << Slot << " Type = " << T->getName() << endl; - output_vbr(AT->getNumElements()); break; } @@ -426,9 +424,10 @@ // // Format: [opcode] [type] [numargs] [arg0] [arg1] ... [arg] // -void BytecodeWriter::outputInstructionFormat0(const Instruction *I, unsigned Opcode, - const SlotCalculator &Table, - unsigned Type) { +void BytecodeWriter::outputInstructionFormat0(const Instruction *I, + unsigned Opcode, + const SlotCalculator &Table, + unsigned Type) { // Opcode must have top two bits clear... output_vbr(Opcode << 2); // Instruction Opcode ID output_typeid(Type); // Result type @@ -554,9 +553,7 @@ // 19-08: Resulting type plane // 31-20: Operand #1 (if set to (2^12-1), then zero operands) // - unsigned Bits = 1 | (Opcode << 2) | (Type << 8) | (Slots[0] << 20); - // cerr << "1 " << IType << " " << Type << " " << Slots[0] << endl; - output(Bits); + output(1 | (Opcode << 2) | (Type << 8) | (Slots[0] << 20)); } @@ -575,11 +572,7 @@ // 23-16: Operand #1 // 31-24: Operand #2 // - unsigned Bits = 2 | (Opcode << 2) | (Type << 8) | - (Slots[0] << 16) | (Slots[1] << 24); - // cerr << "2 " << IType << " " << Type << " " << Slots[0] << " " - // << Slots[1] << endl; - output(Bits); + output(2 | (Opcode << 2) | (Type << 8) | (Slots[0] << 16) | (Slots[1] << 24)); } @@ -599,11 +592,8 @@ // 25-20: Operand #2 // 31-26: Operand #3 // - unsigned Bits = 3 | (Opcode << 2) | (Type << 8) | + output(3 | (Opcode << 2) | (Type << 8) | (Slots[0] << 14) | (Slots[1] << 20) | (Slots[2] << 26); - //cerr << "3 " << IType << " " << Type << " " << Slots[0] << " " - // << Slots[1] << " " << Slots[2] << endl; - output(Bits); } void BytecodeWriter::outputInstruction(const Instruction &I) { @@ -790,8 +780,7 @@ outputSymbolTable(M->getSymbolTable()); } -void BytecodeWriter::outputTypes(unsigned TypeNum) -{ +void BytecodeWriter::outputTypes(unsigned TypeNum) { // Write the type plane for types first because earlier planes (e.g. for a // primitive type like float) may have constants constructed using types // coming later (e.g., via getelementptr from a pointer type). The type @@ -864,7 +853,7 @@ // Output the type plane before any constants! outputTypes( Table.getModuleTypeLevel() ); else - // Output module-level string constants before any other constants.x + // Output module-level string constants before any other constants. outputConstantStrings(); for (unsigned pno = 0; pno != NumPlanes; pno++) { @@ -1035,7 +1024,8 @@ (!Table.CompactionTableIsEmpty())) { BytecodeBlock CTB(BytecodeFormat::CompactionTableBlockID, *this, true/*ElideIfEmpty*/); - const std::vector > &CT =Table.getCompactionTable(); + const std::vector > &CT = + Table.getCompactionTable(); // First things first, emit the type compaction table if there is one. outputCompactionTypes(Type::FirstDerivedTyID); @@ -1048,10 +1038,10 @@ void BytecodeWriter::outputSymbolTable(const SymbolTable &MST) { // Do not output the Bytecode block for an empty symbol table, it just wastes // space! - if ( MST.isEmpty() ) return; + if (MST.isEmpty()) return; BytecodeBlock SymTabBlock(BytecodeFormat::SymbolTableBlockID, *this, - true/* ElideIfEmpty*/); + true/*ElideIfEmpty*/); // Write the number of types output_vbr(MST.num_types()); @@ -1108,9 +1098,8 @@ // sequential in memory, however, so write out as much as possible in big // chunks, until we're done. // - - std::vector::const_iterator I = Buffer.begin(),E = Buffer.end(); - while (I != E) { // Loop until it's all written + for (std::vector::const_iterator I = Buffer.begin(), + E = Buffer.end(); I != E; ++I) { // Scan to see how big this chunk is... const unsigned char *ChunkPtr = &*I; const unsigned char *LastPtr = ChunkPtr; From lattner at cs.uiuc.edu Wed Oct 13 20:49:44 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 20:49:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.h Message-ID: <200410140149.UAA09744@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.h updated: 1.13 -> 1.14 --- Log message: Fit to 80 cols --- Diffs of the changes: (+6 -7) Index: llvm/lib/Bytecode/Reader/Reader.h diff -u llvm/lib/Bytecode/Reader/Reader.h:1.13 llvm/lib/Bytecode/Reader/Reader.h:1.14 --- llvm/lib/Bytecode/Reader/Reader.h:1.13 Sat Aug 21 15:50:49 2004 +++ llvm/lib/Bytecode/Reader/Reader.h Wed Oct 13 20:49:34 2004 @@ -348,17 +348,16 @@ /// @brief The basic blocks we've parsed, while parsing a function. std::vector ParsedBasicBlocks; - /// This maintains a mapping between 's and - /// forward references to constants. Such values may be referenced before they - /// are defined, and if so, the temporary object that they represent is held - /// here. - /// @brief Temporary place for forward references to constants. + /// This maintains a mapping between 's and forward references + /// to constants. Such values may be referenced before they are defined, and + /// if so, the temporary object that they represent is held here. @brief + /// Temporary place for forward references to constants. ConstantRefsType ConstantFwdRefs; /// Constant values are read in after global variables. Because of this, we /// must defer setting the initializers on global variables until after module - /// level constants have been read. In the mean time, this list keeps track of - /// what we must do. + /// level constants have been read. In the mean time, this list keeps track + /// of what we must do. GlobalInitsList GlobalInits; // For lazy reading-in of functions, we need to save away several pieces of From lattner at cs.uiuc.edu Wed Oct 13 20:57:40 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 20:57:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200410140157.UAA11156@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.80 -> 1.81 --- Log message: Add back a missing paren --- Diffs of the changes: (+2 -2) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.80 llvm/lib/Bytecode/Writer/Writer.cpp:1.81 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.80 Wed Oct 13 20:46:07 2004 +++ llvm/lib/Bytecode/Writer/Writer.cpp Wed Oct 13 20:57:28 2004 @@ -593,7 +593,7 @@ // 31-26: Operand #3 // output(3 | (Opcode << 2) | (Type << 8) | - (Slots[0] << 14) | (Slots[1] << 20) | (Slots[2] << 26); + (Slots[0] << 14) | (Slots[1] << 20) | (Slots[2] << 26)); } void BytecodeWriter::outputInstruction(const Instruction &I) { @@ -896,7 +896,7 @@ // Fields: bit0 = isConstant, bit1 = hasInitializer, bit2-4=Linkage, // bit5+ = Slot # for type - unsigned oSlot = ((unsigned)Slot << 5) | (getEncodedLinkage(I) << 2) | + unsigned oSlot = ((unsigned)Slot << 6) | (getEncodedLinkage(I) << 2) | (I->hasInitializer() << 1) | (unsigned)I->isConstant(); output_vbr(oSlot ); From lattner at cs.uiuc.edu Wed Oct 13 21:07:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 21:07:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200410140207.VAA12001@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.81 -> 1.82 --- Log message: unbreak previous checkin :( --- Diffs of the changes: (+1 -1) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.81 llvm/lib/Bytecode/Writer/Writer.cpp:1.82 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.81 Wed Oct 13 20:57:28 2004 +++ llvm/lib/Bytecode/Writer/Writer.cpp Wed Oct 13 21:06:48 2004 @@ -1099,7 +1099,7 @@ // chunks, until we're done. // for (std::vector::const_iterator I = Buffer.begin(), - E = Buffer.end(); I != E; ++I) { + E = Buffer.end(); I != E; ) { // Scan to see how big this chunk is... const unsigned char *ChunkPtr = &*I; const unsigned char *LastPtr = ChunkPtr; From lattner at cs.uiuc.edu Wed Oct 13 21:31:48 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 13 Oct 2004 21:31:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200410140231.VAA14541@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.82 -> 1.83 --- Log message: Today is not my day. Fix broken # --- Diffs of the changes: (+1 -1) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.82 llvm/lib/Bytecode/Writer/Writer.cpp:1.83 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.82 Wed Oct 13 21:06:48 2004 +++ llvm/lib/Bytecode/Writer/Writer.cpp Wed Oct 13 21:31:35 2004 @@ -896,7 +896,7 @@ // Fields: bit0 = isConstant, bit1 = hasInitializer, bit2-4=Linkage, // bit5+ = Slot # for type - unsigned oSlot = ((unsigned)Slot << 6) | (getEncodedLinkage(I) << 2) | + unsigned oSlot = ((unsigned)Slot << 5) | (getEncodedLinkage(I) << 2) | (I->hasInitializer() << 1) | (unsigned)I->isConstant(); output_vbr(oSlot ); From reid at x10sys.com Wed Oct 13 22:06:09 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 22:06:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/MappedFile.cpp Message-ID: <200410140306.WAA03918@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: MappedFile.cpp updated: 1.1 -> 1.2 --- Log message: Implementation of MappedFile for Win32. Patch provided by Jeff Cohen. --- Diffs of the changes: (+101 -6) Index: llvm/lib/System/Win32/MappedFile.cpp diff -u llvm/lib/System/Win32/MappedFile.cpp:1.1 llvm/lib/System/Win32/MappedFile.cpp:1.2 --- llvm/lib/System/Win32/MappedFile.cpp:1.1 Mon Oct 4 06:08:32 2004 +++ llvm/lib/System/Win32/MappedFile.cpp Wed Oct 13 22:05:59 2004 @@ -2,37 +2,132 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by Reid Spencer and is distributed under the +// This file was developed by Jeff Cohen and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // -// This file provides the Win32 specific implementation of the MappedFile -// concept. +// This file provides the Win32 implementation of the MappedFile concept. // //===----------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// +//=== WARNING: Implementation here must contain only Win32 code. +//===----------------------------------------------------------------------===// + #include "Win32.h" +#include "llvm/System/MappedFile.h" +#include "llvm/System/Process.h" + +namespace llvm { +using namespace sys; + +struct sys::MappedFileInfo { + HANDLE hFile; + HANDLE hMapping; + size_t size; +}; void MappedFile::initialize() { + assert(!info_); + info_ = new MappedFileInfo; + info_->hFile = INVALID_HANDLE_VALUE; + info_->hMapping = NULL; + + DWORD mode = options_ & WRITE_ACCESS ? GENERIC_WRITE : GENERIC_READ; + DWORD disposition = options_ & WRITE_ACCESS ? OPEN_ALWAYS : OPEN_EXISTING; + DWORD share = options_ & WRITE_ACCESS ? FILE_SHARE_WRITE : FILE_SHARE_READ; + share = options_ & SHARED_MAPPING ? share : 0; + info_->hFile = CreateFile(path_.c_str(), mode, share, NULL, disposition, + FILE_ATTRIBUTE_NORMAL, NULL); + if (info_->hFile == INVALID_HANDLE_VALUE) { + delete info_; + info_ = NULL; + ThrowError(std::string("Can't open file: ") + path_.get()); + } + + LARGE_INTEGER size; + if (!GetFileSizeEx(info_->hFile, &size) || + (info_->size = size_t(size.QuadPart), info_->size != size.QuadPart)) { + CloseHandle(info_->hFile); + delete info_; + info_ = NULL; + ThrowError(std::string("Can't get size of file: ") + path_.get()); + } } void MappedFile::terminate() { + unmap(); + if (info_->hFile != INVALID_HANDLE_VALUE) + CloseHandle(info_->hFile); + delete info_; + info_ = NULL; } void MappedFile::unmap() { + assert(info_ && "MappedFile not initialized"); + if (isMapped()) { + UnmapViewOfFile(base_); + base_ = NULL; + } + if (info_->hMapping != INVALID_HANDLE_VALUE) { + CloseHandle(info_->hMapping); + info_->hMapping = NULL; + } } void* MappedFile::map() { - static char junk[4096]; - return junk; + if (!isMapped()) { + DWORD prot = PAGE_READONLY; + if (options_ & EXEC_ACCESS) + prot = SEC_IMAGE; + else if (options_ & WRITE_ACCESS) + prot = PAGE_READWRITE; + info_->hMapping = CreateFileMapping(info_->hFile, NULL, prot, 0, 0, NULL); + if (info_->hMapping == NULL) + ThrowError(std::string("Can't map file: ") + path_.get()); + + prot = (options_ & WRITE_ACCESS) ? FILE_MAP_WRITE : FILE_MAP_READ; + base_ = MapViewOfFileEx(info_->hMapping, prot, 0, 0, 0, NULL); + if (base_ == NULL) { + CloseHandle(info_->hMapping); + info_->hMapping = NULL; + ThrowError(std::string("Can't map file: ") + path_.get()); + } + } + return base_; } size_t MappedFile::size() { - return 4096; + assert(info_ && "MappedFile not initialized"); + return info_->size; } void MappedFile::size(size_t new_size) { + assert(info_ && "MappedFile not initialized"); + + // Take the mapping out of memory. + unmap(); + + // Adjust the new_size to a page boundary. + size_t pagesizem1 = Process::GetPageSize() - 1; + new_size = (new_size + pagesizem1) & ~pagesizem1; + + // If the file needs to be extended, do so. + if (new_size > info_->size) { + LARGE_INTEGER eof; + eof.QuadPart = new_size; + if (!SetFilePointerEx(info_->hFile, eof, NULL, FILE_BEGIN)) + ThrowError(std::string("Can't set end of file: ") + path_.get()); + if (!SetEndOfFile(info_->hFile)) + ThrowError(std::string("Can't set end of file: ") + path_.get()); + info_->size = new_size; + } + + // Remap the file. + map(); +} + } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Wed Oct 13 22:07:10 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 22:07:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/FreeBSD/MappedFile.cpp Message-ID: <200410140307.WAA03932@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/FreeBSD: MappedFile.cpp updated: 1.1 -> 1.2 --- Log message: Get proper BSD #includes for MappedFile implementation. --- Diffs of the changes: (+2 -0) Index: llvm/lib/System/FreeBSD/MappedFile.cpp diff -u llvm/lib/System/FreeBSD/MappedFile.cpp:1.1 llvm/lib/System/FreeBSD/MappedFile.cpp:1.2 --- llvm/lib/System/FreeBSD/MappedFile.cpp:1.1 Mon Oct 4 06:08:32 2004 +++ llvm/lib/System/FreeBSD/MappedFile.cpp Wed Oct 13 22:06:59 2004 @@ -12,6 +12,8 @@ // //===----------------------------------------------------------------------===// +#include + // Include the generic unix implementation #include "../Unix/MappedFile.cpp" From reid at x10sys.com Wed Oct 13 22:09:12 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 22:09:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Signals.cpp Message-ID: <200410140309.WAA03954@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Signals.cpp updated: 1.8 -> 1.9 --- Log message: Use __MINGW instead of __MING. Patch contributed by Henrik Bach. --- Diffs of the changes: (+1 -1) Index: llvm/lib/System/Win32/Signals.cpp diff -u llvm/lib/System/Win32/Signals.cpp:1.8 llvm/lib/System/Win32/Signals.cpp:1.9 --- llvm/lib/System/Win32/Signals.cpp:1.8 Thu Sep 30 13:28:07 2004 +++ llvm/lib/System/Win32/Signals.cpp Wed Oct 13 22:09:02 2004 @@ -16,7 +16,7 @@ #include #include -#ifdef __MING +#ifdef __MINGW #include #else #include From reid at x10sys.com Wed Oct 13 22:33:35 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 13 Oct 2004 22:33:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Darwin/MappedFile.cpp Message-ID: <200410140333.WAA04100@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Darwin: MappedFile.cpp updated: 1.1 -> 1.2 --- Log message: Allow this file to compile on Darwin. --- Diffs of the changes: (+1 -0) Index: llvm/lib/System/Darwin/MappedFile.cpp diff -u llvm/lib/System/Darwin/MappedFile.cpp:1.1 llvm/lib/System/Darwin/MappedFile.cpp:1.2 --- llvm/lib/System/Darwin/MappedFile.cpp:1.1 Mon Oct 4 06:08:32 2004 +++ llvm/lib/System/Darwin/MappedFile.cpp Wed Oct 13 22:33:25 2004 @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// // Include the generic unix implementation +#include #include "../Unix/MappedFile.cpp" // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From lattner at cs.uiuc.edu Thu Oct 14 00:13:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 00:13:04 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll Message-ID: <200410140513.AAA30969@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/SimplifyCFG: PhiNoEliminate.ll added (r1.1) --- Log message: When converting phi nodes into select instructions, we shouldn't promote PHI nodes unless we KNOW that we are able to promote all of them. In this case promoting the phi to a select is silly because we will always have to do the call conditionally. As such, select promotion is actually a pessimization. --- Diffs of the changes: (+29 -0) Index: llvm/test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll diff -c /dev/null llvm/test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll:1.1 *** /dev/null Thu Oct 14 00:13:00 2004 --- llvm/test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll Thu Oct 14 00:12:50 2004 *************** *** 0 **** --- 1,29 ---- + ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep select + + ;; The PHI node in this example should not be turned into a select, as we are + ;; not able to ifcvt the entire block. As such, converting to a select just + ;; introduces inefficiency without saving copies. + + int %bar(bool %C) { + entry: + br bool %C, label %then, label %endif + + then: + %tmp.3 = call int %qux() + br label %endif + + endif: + %R = phi int [123, %entry], [12312, %then] + ;; stuff to disable tail duplication + call int %qux() + call int %qux() + call int %qux() + call int %qux() + call int %qux() + call int %qux() + call int %qux() + ret int %R + } + + declare int %qux() + From lattner at cs.uiuc.edu Thu Oct 14 00:13:47 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 00:13:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/SimplifyCFG.cpp Message-ID: <200410140513.AAA30979@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: SimplifyCFG.cpp updated: 1.53 -> 1.54 --- Log message: When converting phi nodes into select instructions, we shouldn't promote PHI nodes unless we KNOW that we are able to promote all of them. This fixes: test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll --- Diffs of the changes: (+92 -40) Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.53 llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.54 --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.53 Wed Sep 29 00:43:32 2004 +++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp Thu Oct 14 00:13:36 2004 @@ -185,7 +185,13 @@ // if the specified value dominates the block. We don't handle the true // generality of domination here, just a special case which works well enough // for us. -static bool DominatesMergePoint(Value *V, BasicBlock *BB, bool AllowAggressive){ +// +// If AggressiveInsts is non-null, and if V does not dominate BB, we check to +// see if V (which must be an instruction) is cheap to compute and is +// non-trapping. If both are true, the instruction is inserted into the set and +// true is returned. +static bool DominatesMergePoint(Value *V, BasicBlock *BB, + std::set *AggressiveInsts) { Instruction *I = dyn_cast(V); if (!I) return true; // Non-instructions all dominate instructions. BasicBlock *PBB = I->getParent(); @@ -199,7 +205,7 @@ // statement". if (BranchInst *BI = dyn_cast(PBB->getTerminator())) if (BI->isUnconditional() && BI->getSuccessor(0) == BB) { - if (!AllowAggressive) return false; + if (!AggressiveInsts) return false; // Okay, it looks like the instruction IS in the "condition". Check to // see if its a cheap instruction to unconditionally compute, and if it // only uses stuff defined outside of the condition. If so, hoist it out. @@ -232,9 +238,10 @@ // Okay, we can only really hoist these out if their operands are not // defined in the conditional region. for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) - if (!DominatesMergePoint(I->getOperand(i), BB, false)) + if (!DominatesMergePoint(I->getOperand(i), BB, 0)) return false; - // Okay, it's safe to do this! + // Okay, it's safe to do this! Remember this instruction. + AggressiveInsts->insert(I); } return true; @@ -1038,54 +1045,99 @@ DEBUG(std::cerr << "FOUND IF CONDITION! " << *IfCond << " T: " << IfTrue->getName() << " F: " << IfFalse->getName() << "\n"); - // Figure out where to insert instructions as necessary. + // Loop over the PHI's seeing if we can promote them all to select + // instructions. While we are at it, keep track of the instructions + // that need to be moved to the dominating block. + std::set AggressiveInsts; + bool CanPromote = true; + BasicBlock::iterator AfterPHIIt = BB->begin(); - while (isa(AfterPHIIt)) ++AfterPHIIt; + while (isa(AfterPHIIt)) { + PHINode *PN = cast(AfterPHIIt++); + if (PN->getIncomingValue(0) == PN->getIncomingValue(1)) + PN->replaceAllUsesWith(PN->getIncomingValue(0)); + else if (!DominatesMergePoint(PN->getIncomingValue(0), BB, + &AggressiveInsts) || + !DominatesMergePoint(PN->getIncomingValue(1), BB, + &AggressiveInsts)) { + CanPromote = false; + break; + } + } - BasicBlock::iterator I = BB->begin(); - while (PHINode *PN = dyn_cast(I)) { - ++I; + // Did we eliminate all PHI's? + CanPromote |= AfterPHIIt == BB->begin(); + + // If we all PHI nodes are promotable, check to make sure that all + // instructions in the predecessor blocks can be promoted as well. If + // not, we won't be able to get rid of the control flow, so it's not + // worth promoting to select instructions. + BasicBlock *DomBlock, *IfBlock1 = 0, *IfBlock2 = 0; + if (CanPromote) { + PN = cast(BB->begin()); + BasicBlock *Pred = PN->getIncomingBlock(0); + if (cast(Pred->getTerminator())->isUnconditional()) { + IfBlock1 = Pred; + DomBlock = *pred_begin(Pred); + for (BasicBlock::iterator I = Pred->begin(); + !isa(I); ++I) + if (!AggressiveInsts.count(I)) { + // This is not an aggressive instruction that we can promote. + // Because of this, we won't be able to get rid of the control + // flow, so the xform is not worth it. + CanPromote = false; + break; + } + } + + Pred = PN->getIncomingBlock(1); + if (CanPromote && + cast(Pred->getTerminator())->isUnconditional()) { + IfBlock2 = Pred; + DomBlock = *pred_begin(Pred); + for (BasicBlock::iterator I = Pred->begin(); + !isa(I); ++I) + if (!AggressiveInsts.count(I)) { + // This is not an aggressive instruction that we can promote. + // Because of this, we won't be able to get rid of the control + // flow, so the xform is not worth it. + CanPromote = false; + break; + } + } + } + + // If we can still promote the PHI nodes after this gauntlet of tests, + // do all of the PHI's now. + if (CanPromote) { + // Move all 'aggressive' instructions, which are defined in the + // conditional parts of the if's up to the dominating block. + if (IfBlock1) { + DomBlock->getInstList().splice(DomBlock->getTerminator(), + IfBlock1->getInstList(), + IfBlock1->begin(), + IfBlock1->getTerminator()); + } + if (IfBlock2) { + DomBlock->getInstList().splice(DomBlock->getTerminator(), + IfBlock2->getInstList(), + IfBlock2->begin(), + IfBlock2->getTerminator()); + } - // If we can eliminate this PHI by directly computing it based on the - // condition, do so now. We can't eliminate PHI nodes where the - // incoming values are defined in the conditional parts of the branch, - // so check for this. - // - if (DominatesMergePoint(PN->getIncomingValue(0), BB, true) && - DominatesMergePoint(PN->getIncomingValue(1), BB, true)) { + while (PHINode *PN = dyn_cast(BB->begin())) { + // Change the PHI node into a select instruction. Value *TrueVal = PN->getIncomingValue(PN->getIncomingBlock(0) == IfFalse); Value *FalseVal = PN->getIncomingValue(PN->getIncomingBlock(0) == IfTrue); - // If one of the incoming values is defined in the conditional - // region, move it into it's predecessor block, which we know is - // safe. - if (!DominatesMergePoint(TrueVal, BB, false)) { - Instruction *TrueI = cast(TrueVal); - BasicBlock *OldBB = TrueI->getParent(); - OldBB->getInstList().remove(TrueI); - BasicBlock *NewBB = *pred_begin(OldBB); - NewBB->getInstList().insert(NewBB->getTerminator(), TrueI); - } - if (!DominatesMergePoint(FalseVal, BB, false)) { - Instruction *FalseI = cast(FalseVal); - BasicBlock *OldBB = FalseI->getParent(); - OldBB->getInstList().remove(FalseI); - BasicBlock *NewBB = *pred_begin(OldBB); - NewBB->getInstList().insert(NewBB->getTerminator(), FalseI); - } - - // Change the PHI node into a select instruction. - BasicBlock::iterator InsertPos = PN; - while (isa(InsertPos)) ++InsertPos; - std::string Name = PN->getName(); PN->setName(""); PN->replaceAllUsesWith(new SelectInst(IfCond, TrueVal, FalseVal, - Name, InsertPos)); + Name, AfterPHIIt)); BB->getInstList().erase(PN); - Changed = true; } + Changed = true; } } } From brukman at cs.uiuc.edu Thu Oct 14 00:50:54 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 00:50:54 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/CodeGenTarget.cpp CodeGenTarget.h Message-ID: <200410140550.AAA04789@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: CodeGenTarget.cpp updated: 1.24 -> 1.25 CodeGenTarget.h updated: 1.13 -> 1.14 --- Log message: * Add option to read isLittleEndianEncoding for InstrInfo classes * Doxygen-ify some function comments --- Diffs of the changes: (+13 -0) Index: llvm/utils/TableGen/CodeGenTarget.cpp diff -u llvm/utils/TableGen/CodeGenTarget.cpp:1.24 llvm/utils/TableGen/CodeGenTarget.cpp:1.25 --- llvm/utils/TableGen/CodeGenTarget.cpp:1.24 Sun Oct 3 14:34:31 2004 +++ llvm/utils/TableGen/CodeGenTarget.cpp Thu Oct 14 00:50:43 2004 @@ -188,6 +188,7 @@ } /// getPHIInstruction - Return the designated PHI instruction. +/// const CodeGenInstruction &CodeGenTarget::getPHIInstruction() const { Record *PHI = getInstructionSet()->getValueAsDef("PHIInst"); std::map::const_iterator I = @@ -197,6 +198,13 @@ return I->second; } +/// isLittleEndianEncoding - Return whether this target encodes its instruction +/// in little-endian format, i.e. bits laid out in the order [0..n] +/// +bool CodeGenTarget::isLittleEndianEncoding() const { + return getInstructionSet()->getValueAsBit("isLittleEndianEncoding"); +} + CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr) : TheDef(R), AsmString(AsmStr) { Name = R->getValueAsString("Name"); @@ -250,6 +258,7 @@ /// getOperandNamed - Return the index of the operand with the specified /// non-empty name. If the instruction does not have an operand with the /// specified name, throw an exception. +/// unsigned CodeGenInstruction::getOperandNamed(const std::string &Name) const { assert(!Name.empty() && "Cannot search for operand with no name!"); for (unsigned i = 0, e = OperandList.size(); i != e; ++i) Index: llvm/utils/TableGen/CodeGenTarget.h diff -u llvm/utils/TableGen/CodeGenTarget.h:1.13 llvm/utils/TableGen/CodeGenTarget.h:1.14 --- llvm/utils/TableGen/CodeGenTarget.h:1.13 Fri Aug 20 23:05:00 2004 +++ llvm/utils/TableGen/CodeGenTarget.h Thu Oct 14 00:50:43 2004 @@ -96,6 +96,10 @@ /// getPHIInstruction - Return the designated PHI instruction. /// const CodeGenInstruction &getPHIInstruction() const; + + /// isLittleEndianEncoding - are instruction bit patterns defined as [0..n]? + /// + bool isLittleEndianEncoding() const; }; } // End llvm namespace From brukman at cs.uiuc.edu Thu Oct 14 00:53:11 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 00:53:11 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/CodeEmitterGen.cpp CodeEmitterGen.h Message-ID: <200410140553.AAA04817@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: CodeEmitterGen.cpp updated: 1.38 -> 1.39 CodeEmitterGen.h updated: 1.10 -> 1.11 --- Log message: * Factor out (into new fn) a loop emitting operand shifts into the instruction * Reverse instruction bit components for a LittleEndian-style encoding * Fix some comments and spacing --- Diffs of the changes: (+84 -46) Index: llvm/utils/TableGen/CodeEmitterGen.cpp diff -u llvm/utils/TableGen/CodeEmitterGen.cpp:1.38 llvm/utils/TableGen/CodeEmitterGen.cpp:1.39 --- llvm/utils/TableGen/CodeEmitterGen.cpp:1.38 Wed Sep 1 17:55:40 2004 +++ llvm/utils/TableGen/CodeEmitterGen.cpp Thu Oct 14 00:53:01 2004 @@ -19,6 +19,58 @@ #include "llvm/Support/Debug.h" using namespace llvm; +void CodeEmitterGen::emitInstrOpBits(std::ostream &o, + const std::vector &Vals, + std::map &OpOrder, + std::map &OpContinuous) +{ + for (unsigned f = 0, e = Vals.size(); f != e; ++f) { + if (Vals[f].getPrefix()) { + BitsInit *FieldInitializer = (BitsInit*)Vals[f].getValue(); + + // Scan through the field looking for bit initializers of the current + // variable... + for (int i = FieldInitializer->getNumBits()-1; i >= 0; --i) { + Init *I = FieldInitializer->getBit(i); + if (BitInit *BI = dynamic_cast(I)) { + DEBUG(o << " // bit init: f: " << f << ", i: " << i << "\n"); + } else if (UnsetInit *UI = dynamic_cast(I)) { + DEBUG(o << " // unset init: f: " << f << ", i: " << i << "\n"); + } else if (VarBitInit *VBI = dynamic_cast(I)) { + TypedInit *TI = VBI->getVariable(); + if (VarInit *VI = dynamic_cast(TI)) { + // If the bits of the field are laid out consecutively in the + // instruction, then instead of separately ORing in bits, just + // mask and shift the entire field for efficiency. + if (OpContinuous[VI->getName()]) { + // already taken care of in the loop above, thus there is no + // need to individually OR in the bits + + // for debugging, output the regular version anyway, commented + DEBUG(o << " // Value |= getValueBit(op" + << OpOrder[VI->getName()] << ", " << VBI->getBitNum() + << ")" << " << " << i << ";\n"); + } else { + o << " Value |= getValueBit(op" << OpOrder[VI->getName()] + << ", " << VBI->getBitNum() + << ")" << " << " << i << ";\n"; + } + } else if (FieldInit *FI = dynamic_cast(TI)) { + // FIXME: implement this! + std::cerr << "Error: FieldInit not implemented!\n"; + abort(); + } else { + std::cerr << "Error: unimplemented case in " + << "CodeEmitterGen::emitInstrOpBits()\n"; + abort(); + } + } + } + } + } +} + + void CodeEmitterGen::run(std::ostream &o) { CodeGenTarget Target; std::vector Insts = Records.getAllDerivedDefinitions("Instruction"); @@ -43,6 +95,24 @@ BitsInit *BI = R->getValueAsBitsInit("Inst"); + // For little-endian instruction bit encodings, reverse the bit order + if (Target.isLittleEndianEncoding()) { + unsigned numBits = BI->getNumBits(); + BitsInit *NewBI = new BitsInit(numBits); + for (unsigned bit = 0, end = numBits / 2; bit != end; ++bit) { + unsigned bitSwapIdx = numBits - bit - 1; + Init *OrigBit = BI->getBit(bit); + Init *BitSwap = BI->getBit(bitSwapIdx); + NewBI->setBit(bit, BitSwap); + NewBI->setBit(bitSwapIdx, OrigBit); + } + if (numBits % 2) { + unsigned middle = (numBits + 1) / 2; + NewBI->setBit(middle, BI->getBit(middle)); + } + BI = NewBI; + } + unsigned Value = 0; const std::vector &Vals = R->getValues(); @@ -61,17 +131,16 @@ DEBUG(o << " // " << *R->getValue("Inst") << "\n"); o << " Value = " << Value << "U;\n\n"; - // Loop over all of the fields in the instruction determining which are the + // Loop over all of the fields in the instruction, determining which are the // operands to the instruction. - // unsigned op = 0; std::map OpOrder; std::map OpContinuous; for (unsigned i = 0, e = Vals.size(); i != e; ++i) { - if (!Vals[i].getPrefix() && !Vals[i].getValue()->isComplete()) { + if (!Vals[i].getPrefix() && !Vals[i].getValue()->isComplete()) { // Is the operand continuous? If so, we can just mask and OR it in // instead of doing it bit-by-bit, saving a lot in runtime cost. - const BitsInit *InstInit = BI; + BitsInit *InstInit = BI; int beginBitInVar = -1, endBitInVar = -1; int beginBitInInst = -1, endBitInInst = -1; bool continuous = true; @@ -173,58 +242,19 @@ } } - for (unsigned f = 0, e = Vals.size(); f != e; ++f) { - if (Vals[f].getPrefix()) { - BitsInit *FieldInitializer = (BitsInit*)Vals[f].getValue(); - - // Scan through the field looking for bit initializers of the current - // variable... - for (int i = FieldInitializer->getNumBits()-1; i >= 0; --i) { - Init *I = FieldInitializer->getBit(i); - if (BitInit *BI = dynamic_cast(I)) { - DEBUG(o << " // bit init: f: " << f << ", i: " << i << "\n"); - } else if (UnsetInit *UI = dynamic_cast(I)) { - DEBUG(o << " // unset init: f: " << f << ", i: " << i << "\n"); - } else if (VarBitInit *VBI = dynamic_cast(I)) { - TypedInit *TI = VBI->getVariable(); - if (VarInit *VI = dynamic_cast(TI)) { - // If the bits of the field are laid out consecutively in the - // instruction, then instead of separately ORing in bits, just - // mask and shift the entire field for efficiency. - if (OpContinuous[VI->getName()]) { - // already taken care of in the loop above, thus there is no - // need to individually OR in the bits - - // for debugging, output the regular version anyway, commented - DEBUG(o << " // Value |= getValueBit(op" - << OpOrder[VI->getName()] << ", " << VBI->getBitNum() - << ")" << " << " << i << ";\n"); - } else { - o << " Value |= getValueBit(op" << OpOrder[VI->getName()] - << ", " << VBI->getBitNum() - << ")" << " << " << i << ";\n"; - } - } else if (FieldInit *FI = dynamic_cast(TI)) { - // FIXME: implement this! - o << "FIELD INIT not implemented yet!\n"; - } else { - o << "Error: UNIMPLEMENTED\n"; - } - } - } - } - } + emitInstrOpBits(o, Vals, OpOrder, OpContinuous); o << " break;\n" << " }\n"; } + // Default case: unhandled opcode o << " default:\n" << " std::cerr << \"Not supported instr: \" << MI << \"\\n\";\n" << " abort();\n" << " }\n" << " return Value;\n" - << "}\n"; + << "}\n\n"; o << "} // End llvm namespace \n"; } Index: llvm/utils/TableGen/CodeEmitterGen.h diff -u llvm/utils/TableGen/CodeEmitterGen.h:1.10 llvm/utils/TableGen/CodeEmitterGen.h:1.11 --- llvm/utils/TableGen/CodeEmitterGen.h:1.10 Tue Nov 11 16:41:34 2003 +++ llvm/utils/TableGen/CodeEmitterGen.h Thu Oct 14 00:53:01 2004 @@ -15,9 +15,13 @@ #define CODEMITTERGEN_H #include "TableGenBackend.h" +#include +#include namespace llvm { +class RecordVal; + class CodeEmitterGen : public TableGenBackend { RecordKeeper &Records; public: @@ -28,6 +32,10 @@ private: void emitMachineOpEmitter(std::ostream &o, const std::string &Namespace); void emitGetValueBit(std::ostream &o, const std::string &Namespace); + void emitInstrOpBits(std::ostream &o, + const std::vector &Vals, + std::map &OpOrder, + std::map &OpContinuous); }; } // End llvm namespace From brukman at cs.uiuc.edu Thu Oct 14 00:53:50 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 00:53:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Target.td Message-ID: <200410140553.AAA04842@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: Target.td updated: 1.41 -> 1.42 --- Log message: Add isLittleEndianEncoding to InstrInfo class, defaults to `off' --- Diffs of the changes: (+6 -0) Index: llvm/lib/Target/Target.td diff -u llvm/lib/Target/Target.td:1.41 llvm/lib/Target/Target.td:1.42 --- llvm/lib/Target/Target.td:1.41 Sun Oct 3 14:34:18 2004 +++ llvm/lib/Target/Target.td Thu Oct 14 00:53:40 2004 @@ -170,6 +170,12 @@ // list TSFlagsFields = []; list TSFlagsShifts = []; + + // Target can specify its instructions in either big or little-endian formats. + // For instance, while both Sparc and PowerPC are big-endian platforms, the + // Sparc manual specifies its instructions in the format [31..0] (big), while + // PowerPC specifies them using the format [0..31] (little). + bit isLittleEndianEncoding = 0; } //===----------------------------------------------------------------------===// From brukman at cs.uiuc.edu Thu Oct 14 00:54:48 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 00:54:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPC.td PPC32.td PPC64.td Message-ID: <200410140554.AAA04875@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPC.td updated: 1.9 -> 1.10 PPC32.td updated: 1.1 -> 1.2 PPC64.td updated: 1.2 -> 1.3 --- Log message: PowerPC instruction definitions use LittleEndian-style encoding [0..31] --- Diffs of the changes: (+6 -0) Index: llvm/lib/Target/PowerPC/PowerPC.td diff -u llvm/lib/Target/PowerPC/PowerPC.td:1.9 llvm/lib/Target/PowerPC/PowerPC.td:1.10 --- llvm/lib/Target/PowerPC/PowerPC.td:1.9 Sat Sep 4 21:42:44 2004 +++ llvm/lib/Target/PowerPC/PowerPC.td Thu Oct 14 00:54:38 2004 @@ -27,6 +27,8 @@ let TSFlagsFields = ["ArgCount", "Arg0Type", "Arg1Type", "Arg2Type", "Arg3Type", "Arg4Type", "VMX", "PPC64"]; let TSFlagsShifts = [ 0, 3, 8, 13, 18, 23, 28, 29 ]; + + let isLittleEndianEncoding = 1; } def PowerPC : Target { Index: llvm/lib/Target/PowerPC/PPC32.td diff -u llvm/lib/Target/PowerPC/PPC32.td:1.1 llvm/lib/Target/PowerPC/PPC32.td:1.2 --- llvm/lib/Target/PowerPC/PPC32.td:1.1 Mon Aug 16 23:55:41 2004 +++ llvm/lib/Target/PowerPC/PPC32.td Thu Oct 14 00:54:38 2004 @@ -27,6 +27,8 @@ let TSFlagsFields = ["ArgCount", "Arg0Type", "Arg1Type", "Arg2Type", "Arg3Type", "Arg4Type", "VMX", "PPC64"]; let TSFlagsShifts = [ 0, 3, 8, 13, 18, 23, 28, 29 ]; + + let isLittleEndianEncoding = 1; } def PPC32 : Target { Index: llvm/lib/Target/PowerPC/PPC64.td diff -u llvm/lib/Target/PowerPC/PPC64.td:1.2 llvm/lib/Target/PowerPC/PPC64.td:1.3 --- llvm/lib/Target/PowerPC/PPC64.td:1.2 Thu Aug 19 14:36:57 2004 +++ llvm/lib/Target/PowerPC/PPC64.td Thu Oct 14 00:54:38 2004 @@ -27,6 +27,8 @@ let TSFlagsFields = ["ArgCount", "Arg0Type", "Arg1Type", "Arg2Type", "Arg3Type", "Arg4Type", "VMX", "PPC64"]; let TSFlagsShifts = [ 0, 3, 8, 13, 18, 23, 28, 29 ]; + + let isLittleEndianEncoding = 1; } def PPC64 : Target { From brukman at cs.uiuc.edu Thu Oct 14 00:55:48 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 00:55:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Message-ID: <200410140555.AAA04899@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCInstrFormats.td updated: 1.20 -> 1.21 --- Log message: There is only one field in an instruction, and that is `Inst', the final view of the instruction binary format, all others are simply operands and should not have the `field' label --- Diffs of the changes: (+51 -51) Index: llvm/lib/Target/PowerPC/PowerPCInstrFormats.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.20 llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.21 --- llvm/lib/Target/PowerPC/PowerPCInstrFormats.td:1.20 Sat Sep 4 00:00:00 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrFormats.td Thu Oct 14 00:55:37 2004 @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// class Format val> { - bits<5> Value = val; + bits<5> Value = val; } def Pseudo: Format<0>; @@ -65,7 +65,7 @@ // 1.7.1 I-Form class IForm opcode, bit aa, bit lk, bit ppc64, bit vmx, dag OL, string asmstr> : I { - field bits<24> LI; + bits<24> LI; let ArgCount = 1; let Arg0Type = Imm24.Value; @@ -82,9 +82,9 @@ // 1.7.2 B-Form class BForm opcode, bit aa, bit lk, bit ppc64, bit vmx, dag OL, string asmstr> : I { - field bits<5> BO; - field bits<5> BI; - field bits<14> BD; + bits<5> BO; + bits<5> BI; + bits<14> BD; let ArgCount = 3; let Arg0Type = Imm5.Value; @@ -114,9 +114,9 @@ // 1.7.4 D-Form class DForm_base opcode, bit ppc64, bit vmx, dag OL, string asmstr> : I { - field bits<5> A; - field bits<5> B; - field bits<16> C; + bits<5> A; + bits<5> B; + bits<16> C; let ArgCount = 3; let Arg0Type = Gpr.Value; @@ -141,8 +141,8 @@ class DForm_2_r0 opcode, bit ppc64, bit vmx, dag OL, string asmstr> : I { - field bits<5> A; - field bits<16> B; + bits<5> A; + bits<16> B; let ArgCount = 2; let Arg0Type = Gpr.Value; @@ -176,10 +176,10 @@ class DForm_5 opcode, bit ppc64, bit vmx, dag OL, string asmstr> : I { - field bits<3> BF; - field bits<1> L; - field bits<5> RA; - field bits<16> I; + bits<3> BF; + bits<1> L; + bits<5> RA; + bits<16> I; let ArgCount = 4; let Arg0Type = Imm3.Value; @@ -231,9 +231,9 @@ // 1.7.5 DS-Form class DSForm_1 opcode, bits<2> xo, bit ppc64, bit vmx, dag OL, string asmstr> : I { - field bits<5> RST; - field bits<14> DS; - field bits<5> RA; + bits<5> RST; + bits<14> DS; + bits<5> RA; let ArgCount = 3; let Arg0Type = Gpr.Value; @@ -256,9 +256,9 @@ class XForm_base_r3xo opcode, bits<10> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : I { - field bits<5> RST; - field bits<5> A; - field bits<5> B; + bits<5> RST; + bits<5> A; + bits<5> B; let ArgCount = 3; let Arg0Type = Gpr.Value; @@ -313,10 +313,10 @@ class XForm_16 opcode, bits<10> xo, bit ppc64, bit vmx, dag OL, string asmstr> : I { - field bits<3> BF; - field bits<1> L; - field bits<5> RA; - field bits<5> RB; + bits<3> BF; + bits<1> L; + bits<5> RA; + bits<5> RB; let ArgCount = 4; let Arg0Type = Imm3.Value; @@ -346,9 +346,9 @@ class XForm_17 opcode, bits<10> xo, bit ppc64, bit vmx, dag OL, string asmstr> : I { - field bits<3> BF; - field bits<5> FRA; - field bits<5> FRB; + bits<3> BF; + bits<5> FRA; + bits<5> FRB; let ArgCount = 3; let Arg0Type = Imm3.Value; @@ -400,9 +400,9 @@ class XLForm_2 opcode, bits<10> xo, bit lk, bit ppc64, bit vmx, dag OL, string asmstr> : I { - field bits<5> BO; - field bits<5> BI; - field bits<2> BH; + bits<5> BO; + bits<5> BI; + bits<2> BH; let ArgCount = 3; let Arg0Type = Imm5.Value; @@ -435,8 +435,8 @@ // 1.7.8 XFX-Form class XFXForm_1 opcode, bits<10> xo, bit ppc64, bit vmx, dag OL, string asmstr> : I { - field bits<5> ST; - field bits<10> SPR; + bits<5> ST; + bits<10> SPR; let ArgCount = 2; let Arg0Type = Imm5.Value; @@ -476,9 +476,9 @@ // 1.7.10 XS-Form class XSForm_1 opcode, bits<9> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : I { - field bits<5> RS; - field bits<5> A; - field bits<6> SH; + bits<5> RS; + bits<5> A; + bits<6> SH; let ArgCount = 3; let Arg0Type = Gpr.Value; @@ -498,9 +498,9 @@ // 1.7.11 XO-Form class XOForm_1 opcode, bits<9> xo, bit oe, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : I { - field bits<5> RT; - field bits<5> RA; - field bits<5> RB; + bits<5> RT; + bits<5> RA; + bits<5> RB; let ArgCount = 3; let Arg0Type = Gpr.Value; @@ -535,10 +535,10 @@ class AForm_1 opcode, bits<5> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : I { let ArgCount = 4; - field bits<5> FRT; - field bits<5> FRA; - field bits<5> FRB; - field bits<5> FRC; + bits<5> FRT; + bits<5> FRA; + bits<5> FRB; + bits<5> FRC; let Arg0Type = Fpr.Value; let Arg1Type = Fpr.Value; @@ -574,11 +574,11 @@ class MForm_1 opcode, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : I { let ArgCount = 5; - field bits<5> RS; - field bits<5> RA; - field bits<5> RB; - field bits<5> MB; - field bits<5> ME; + bits<5> RS; + bits<5> RA; + bits<5> RB; + bits<5> MB; + bits<5> ME; let Arg0Type = Gpr.Value; let Arg1Type = Gpr.Value; @@ -604,10 +604,10 @@ class MDForm_1 opcode, bits<3> xo, bit rc, bit ppc64, bit vmx, dag OL, string asmstr> : I { let ArgCount = 4; - field bits<5> RS; - field bits<5> RA; - field bits<6> SH; - field bits<6> MBE; + bits<5> RS; + bits<5> RA; + bits<6> SH; + bits<6> MBE; let Arg0Type = Gpr.Value; let Arg1Type = Gpr.Value; From tbrethou at cs.uiuc.edu Thu Oct 14 01:04:43 2004 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Thu, 14 Oct 2004 01:04:43 -0500 (CDT) Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp Message-ID: <200410140604.BAA02626@seraph.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/ModuloScheduling: ModuloScheduling.cpp updated: 1.30 -> 1.31 --- Log message: Checking in code that works on my simple test case. However, there is still a bug with branches that I need to fix. --- Diffs of the changes: (+205 -104) Index: llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp diff -u llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.30 llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.31 --- llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp:1.30 Sun Oct 10 18:34:50 2004 +++ llvm/lib/Target/SparcV9/ModuloScheduling/ModuloScheduling.cpp Thu Oct 14 01:04:28 2004 @@ -1192,16 +1192,14 @@ int maxStageCount = 0; MSchedGraphNode *branch = 0; - MSchedGraphNode *BAbranch = 0; + for(MSSchedule::kernel_iterator I = schedule.kernel_begin(), E = schedule.kernel_end(); I != E; ++I) { maxStageCount = std::max(maxStageCount, I->second); //Ignore the branch, we will handle this separately if(I->first->isBranch()) { - if (I->first->getInst()->getOpcode() == V9::BA) - BAbranch = I->first; - else + if (I->first->getInst()->getOpcode() != V9::BA) branch = I->first; continue; } @@ -1241,6 +1239,10 @@ //Save copy in tmpInstruction tmp = new TmpInstruction(mOp.getVRegValue()); + //Get machine code for this instruction + MachineCodeForInstruction & tempMvec = MachineCodeForInstruction::get((Instruction*) mOp.getVRegValue()); + tempMvec.addTemp((Value*) tmp); + DEBUG(std::cerr << "Value: " << *(mOp.getVRegValue()) << " New Value: " << *tmp << " Stage: " << i << "\n"); newValues[mOp.getVRegValue()][i]= tmp; @@ -1275,8 +1277,6 @@ //Stick in branch at the end machineBB->push_back(branch->getInst()->clone()); - //Stick in BA branch at the end - machineBB->push_back(BAbranch->getInst()->clone()); (((MachineBasicBlock*)origBB)->getParent())->getBasicBlockList().push_back(machineBB); prologues.push_back(machineBB); @@ -1322,7 +1322,7 @@ DEBUG(std::cerr << " Epilogue #: " << i << "\n"); - + std::map inEpilogue; for(MachineBasicBlock::const_iterator MI = origBB->begin(), ME = origBB->end(); ME != MI; ++MI) { for(int j=schedule.getMaxStage(); j > i; --j) { @@ -1334,19 +1334,25 @@ for(unsigned opNum=0; opNum < clone->getNumOperands(); ++opNum) { //get machine operand const MachineOperand &mOp = clone->getOperand(opNum); - - //If this is the last instructions for the max iterations ago, don't update operands - if(j == schedule.getMaxStage() && (i == 0)) - continue; if((mOp.getType() == MachineOperand::MO_VirtualRegister && mOp.isUse())) { DEBUG(std::cerr << "Writing PHI for " << *(mOp.getVRegValue()) << "\n"); + + //If this is the last instructions for the max iterations ago, don't update operands + if(inEpilogue.count(mOp.getVRegValue())) + if(inEpilogue[mOp.getVRegValue()] == i) + continue; //Quickly write appropriate phis for this operand if(newValues.count(mOp.getVRegValue())) { if(newValues[mOp.getVRegValue()].count(i)) { Instruction *tmp = new TmpInstruction(newValues[mOp.getVRegValue()][i]); + + //Get machine code for this instruction + MachineCodeForInstruction & tempMvec = MachineCodeForInstruction::get((Instruction*) mOp.getVRegValue()); + tempMvec.addTemp((Value*) tmp); + MachineInstr *saveValue = BuildMI(machineBB, V9::PHI, 3).addReg(newValues[mOp.getVRegValue()][i]).addReg(kernelPHIs[mOp.getVRegValue()][i]).addRegDef(tmp); DEBUG(std::cerr << "Resulting PHI: " << *saveValue << "\n"); valPHIs[mOp.getVRegValue()] = tmp; @@ -1358,6 +1364,9 @@ clone->getOperand(opNum).setValueReg(valPHIs[mOp.getVRegValue()]); } } + else if((mOp.getType() == MachineOperand::MO_VirtualRegister && mOp.isDef())) { + inEpilogue[mOp.getVRegValue()] = i; + } } machineBB->push_back(clone); } @@ -1392,6 +1401,10 @@ //Insert into machine basic block machineBB->push_back(instClone); + if(I->first->isBranch()) { + //Add kernel noop + BuildMI(machineBB, V9::NOP, 0); + } //Loop over Machine Operands for(unsigned i=0; i < inst->getNumOperands(); ++i) { @@ -1409,6 +1422,10 @@ //If its in the value saved, we need to create a temp instruction and use that instead if(valuesToSave.count(mOp.getVRegValue())) { TmpInstruction *tmp = new TmpInstruction(mOp.getVRegValue()); + + //Get machine code for this instruction + MachineCodeForInstruction & tempMvec = MachineCodeForInstruction::get((Instruction*) mOp.getVRegValue()); + tempMvec.addTemp((Value*) tmp); //Update the operand in the cloned instruction instClone->getOperand(i).setValueReg(tmp); @@ -1425,6 +1442,10 @@ TmpInstruction *tmp = new TmpInstruction(mOp.getVRegValue()); + //Get machine code for this instruction + MachineCodeForInstruction & tempVec = MachineCodeForInstruction::get((Instruction*) mOp.getVRegValue()); + tempVec.addTemp((Value*) tmp); + //Create new machine instr and put in MBB MachineInstr *saveValue = BuildMI(machineBB, V9::ORr, 3).addReg(mOp.getVRegValue()).addImm(0).addRegDef(tmp); @@ -1476,12 +1497,23 @@ if(count < (V->second).size()) { if(lastPhi == 0) { lastPhi = new TmpInstruction(I->second); + + //Get machine code for this instruction + MachineCodeForInstruction & tempMvec = MachineCodeForInstruction::get((Instruction*) V->first); + tempMvec.addTemp((Value*) lastPhi); + MachineInstr *saveValue = BuildMI(*machineBB, machineBB->begin(), V9::PHI, 3).addReg(kernelValue[V->first]).addReg(I->second).addRegDef(lastPhi); DEBUG(std::cerr << "Resulting PHI: " << *saveValue << "\n"); newValLocation[lastPhi] = machineBB; } else { Instruction *tmp = new TmpInstruction(I->second); + + //Get machine code for this instruction + MachineCodeForInstruction & tempMvec = MachineCodeForInstruction::get((Instruction*) V->first); + tempMvec.addTemp((Value*) tmp); + + MachineInstr *saveValue = BuildMI(*machineBB, machineBB->begin(), V9::PHI, 3).addReg(lastPhi).addReg(I->second).addRegDef(tmp); DEBUG(std::cerr << "Resulting PHI: " << *saveValue << "\n"); lastPhi = tmp; @@ -1513,60 +1545,97 @@ //Worklist to delete things std::vector > worklist; + + //Worklist of TmpInstructions that need to be added to a MCFI + std::vector addToMCFI; + //Worklist to add OR instructions to end of kernel so not to invalidate the iterator + //std::vector > newORs; + const TargetInstrInfo *TMI = target.getInstrInfo(); //Start with the kernel and for each phi insert a copy for the phi def and for each arg for(MachineBasicBlock::iterator I = kernelBB->begin(), E = kernelBB->end(); I != E; ++I) { + //Get op code and check if its a phi - if(I->getOpcode() == V9::PHI) { - Instruction *tmp = 0; - for(unsigned i = 0; i < I->getNumOperands(); ++i) { - //Get Operand - const MachineOperand &mOp = I->getOperand(i); - assert(mOp.getType() == MachineOperand::MO_VirtualRegister && "Should be a Value*\n"); - - if(!tmp) { - tmp = new TmpInstruction(mOp.getVRegValue()); - } + if(I->getOpcode() == V9::PHI) { + + DEBUG(std::cerr << "Replacing PHI: " << *I << "\n"); + Instruction *tmp = 0; - //Now for all our arguments we read, OR to the new TmpInstruction that we created - if(mOp.isUse()) { - DEBUG(std::cerr << "Use: " << mOp << "\n"); - //Place a copy at the end of its BB but before the branches - assert(newValLocation.count(mOp.getVRegValue()) && "We must know where this value is located\n"); - //Reverse iterate to find the branches, we can safely assume no instructions have been - //put in the nop positions - for(MachineBasicBlock::iterator inst = --(newValLocation[mOp.getVRegValue()])->end(), endBB = (newValLocation[mOp.getVRegValue()])->begin(); inst != endBB; --inst) { - MachineOpCode opc = inst->getOpcode(); - if(TMI->isBranch(opc) || TMI->isNop(opc)) - continue; - else { - BuildMI(*(newValLocation[mOp.getVRegValue()]), ++inst, V9::ORr, 3).addReg(mOp.getVRegValue()).addImm(0).addRegDef(tmp); - break; - } - - } + for(unsigned i = 0; i < I->getNumOperands(); ++i) { + //Get Operand + const MachineOperand &mOp = I->getOperand(i); + assert(mOp.getType() == MachineOperand::MO_VirtualRegister && "Should be a Value*\n"); + + if(!tmp) { + tmp = new TmpInstruction(mOp.getVRegValue()); + addToMCFI.push_back(tmp); + } - } - else { - //Remove the phi and replace it with an OR - DEBUG(std::cerr << "Def: " << mOp << "\n"); - BuildMI(*kernelBB, I, V9::ORr, 3).addReg(tmp).addImm(0).addRegDef(mOp.getVRegValue()); - worklist.push_back(std::make_pair(kernelBB, I)); - } + //Now for all our arguments we read, OR to the new TmpInstruction that we created + if(mOp.isUse()) { + DEBUG(std::cerr << "Use: " << mOp << "\n"); + //Place a copy at the end of its BB but before the branches + assert(newValLocation.count(mOp.getVRegValue()) && "We must know where this value is located\n"); + //Reverse iterate to find the branches, we can safely assume no instructions have been + //put in the nop positions + for(MachineBasicBlock::iterator inst = --(newValLocation[mOp.getVRegValue()])->end(), endBB = (newValLocation[mOp.getVRegValue()])->begin(); inst != endBB; --inst) { + MachineOpCode opc = inst->getOpcode(); + if(TMI->isBranch(opc) || TMI->isNop(opc)) + continue; + else { + BuildMI(*(newValLocation[mOp.getVRegValue()]), ++inst, V9::ORr, 3).addReg(mOp.getVRegValue()).addImm(0).addRegDef(tmp); + break; + } + + } - } - } - + } + else { + //Remove the phi and replace it with an OR + DEBUG(std::cerr << "Def: " << mOp << "\n"); + //newORs.push_back(std::make_pair(tmp, mOp.getVRegValue())); + BuildMI(*kernelBB, I, V9::ORr, 3).addReg(tmp).addImm(0).addRegDef(mOp.getVRegValue()); + worklist.push_back(std::make_pair(kernelBB, I)); + } + + } + + } + + else { + //We found an instruction that we can add to its mcfi + if(addToMCFI.size() > 0) { + for(unsigned i = 0; i < I->getNumOperands(); ++i) { + const MachineOperand &mOp = I->getOperand(i); + if(mOp.getType() == MachineOperand::MO_VirtualRegister) { + if(!isa(mOp.getVRegValue()) && !isa(mOp.getVRegValue())) { + //Get machine code for this instruction + MachineCodeForInstruction & tempMvec = MachineCodeForInstruction::get((Instruction*) mOp.getVRegValue()); + for(unsigned x = 0; x < addToMCFI.size(); ++x) { + tempMvec.addTemp(addToMCFI[x]); + } + addToMCFI.clear(); + break; + } + } + } + } + } + } + //for(std::vector >::reverse_iterator I = newORs.rbegin(), IE = newORs.rend(); I != IE; ++I) + //BuildMI(*kernelBB, kernelBB->begin(), V9::ORr, 3).addReg(I->first).addImm(0).addRegDef(I->second); + //Remove phis from epilogue for(std::vector::iterator MB = epilogues.begin(), ME = epilogues.end(); MB != ME; ++MB) { for(MachineBasicBlock::iterator I = (*MB)->begin(), E = (*MB)->end(); I != E; ++I) { //Get op code and check if its a phi if(I->getOpcode() == V9::PHI) { Instruction *tmp = 0; + for(unsigned i = 0; i < I->getNumOperands(); ++i) { //Get Operand const MachineOperand &mOp = I->getOperand(i); @@ -1574,6 +1643,7 @@ if(!tmp) { tmp = new TmpInstruction(mOp.getVRegValue()); + addToMCFI.push_back(tmp); } //Now for all our arguments we read, OR to the new TmpInstruction that we created @@ -1593,7 +1663,7 @@ } } - + } else { //Remove the phi and replace it with an OR @@ -1604,16 +1674,40 @@ } } + + else { + //We found an instruction that we can add to its mcfi + if(addToMCFI.size() > 0) { + for(unsigned i = 0; i < I->getNumOperands(); ++i) { + const MachineOperand &mOp = I->getOperand(i); + if(mOp.getType() == MachineOperand::MO_VirtualRegister) { + + if(!isa(mOp.getVRegValue()) && !isa(mOp.getVRegValue())) { + //Get machine code for this instruction + MachineCodeForInstruction & tempMvec = MachineCodeForInstruction::get((Instruction*) mOp.getVRegValue()); + for(unsigned x = 0; x < addToMCFI.size(); ++x) { + tempMvec.addTemp(addToMCFI[x]); + } + addToMCFI.clear(); + break; + } + } + } + } + } } } //Delete the phis for(std::vector >::iterator I = worklist.begin(), E = worklist.end(); I != E; ++I) { - DEBUG(std::cerr << "Deleting PHI " << I->second << "\n"); + + DEBUG(std::cerr << "Deleting PHI " << *I->second << "\n"); I->first->erase(I->second); } + + assert((addToMCFI.size() == 0) && "We should have added all TmpInstructions to some MachineCodeForInstruction"); } @@ -1744,30 +1838,34 @@ } } - - //Update branch for(unsigned opNum = 0; opNum < branch->getNumOperands(); ++opNum) { MachineOperand &mOp = branch->getOperand(opNum); if (mOp.getType() == MachineOperand::MO_PCRelativeDisp) { mOp.setValueReg(llvm_epilogues[(llvm_epilogues.size()-1-I)]); + } } //Update llvm basic block with our new branch instr DEBUG(std::cerr << BB->getBasicBlock()->getTerminator() << "\n"); const BranchInst *branchVal = dyn_cast(BB->getBasicBlock()->getTerminator()); - TmpInstruction *tmp = new TmpInstruction(branchVal->getCondition()); + //TmpInstruction *tmp = new TmpInstruction(branchVal->getCondition()); + + //Add TmpInstruction to original branches MCFI + //MachineCodeForInstruction & tempMvec = MachineCodeForInstruction::get(branchVal); + //tempMvec.addTemp((Value*) tmp); + if(I == prologues.size()-1) { TerminatorInst *newBranch = new BranchInst(llvmKernelBB, llvm_epilogues[(llvm_epilogues.size()-1-I)], - tmp, + branchVal->getCondition(), llvm_prologues[I]); } else TerminatorInst *newBranch = new BranchInst(llvm_prologues[I+1], llvm_epilogues[(llvm_epilogues.size()-1-I)], - tmp, + branchVal->getCondition(), llvm_prologues[I]); assert(branch != 0 && "There must be a terminator for this machine basic block!\n"); @@ -1776,8 +1874,9 @@ BuildMI(prologues[I], V9::NOP, 0); //Add a unconditional branch to the next prologue - if(I != prologues.size()-1) + if(I != prologues.size()-1) { BuildMI(prologues[I], V9::BA, 1).addPCDisp(llvm_prologues[I+1]); + } else BuildMI(prologues[I], V9::BA, 1).addPCDisp(llvmKernelBB); @@ -1787,12 +1886,18 @@ //Fix up kernel machine branches MachineInstr *branch = 0; + MachineInstr *BAbranch = 0; + for(MachineBasicBlock::reverse_iterator mInst = machineKernelBB->rbegin(), mInstEnd = machineKernelBB->rend(); mInst != mInstEnd; ++mInst) { MachineOpCode OC = mInst->getOpcode(); if(TMI->isBranch(OC)) { - branch = &*mInst; - DEBUG(std::cerr << *mInst << "\n"); - break; + if(mInst->getOpcode() == V9::BA) { + BAbranch = &*mInst; + } + else { + branch = &*mInst; + break; + } } } @@ -1807,27 +1912,39 @@ } } + Value *origBAVal = 0; + + //Update kernel BA branch + for(unsigned opNum = 0; opNum < BAbranch->getNumOperands(); ++opNum) { + MachineOperand &mOp = BAbranch->getOperand(opNum); + if (mOp.getType() == MachineOperand::MO_PCRelativeDisp) { + origBAVal = mOp.getVRegValue(); + if(llvm_epilogues.size() > 0) + mOp.setValueReg(llvm_epilogues[0]); + + } + } + + assert((origBAVal != 0) && "Could not find original branch always value"); + //Update kernelLLVM branches const BranchInst *branchVal = dyn_cast(BB->getBasicBlock()->getTerminator()); + //TmpInstruction *tmp = new TmpInstruction(branchVal->getCondition()); + + //Add TmpInstruction to original branches MCFI + //MachineCodeForInstruction & tempMvec = MachineCodeForInstruction::get(branchVal); + //tempMvec.addTemp((Value*) tmp); + TerminatorInst *newBranch = new BranchInst(llvmKernelBB, llvm_epilogues[0], - new TmpInstruction(branchVal->getCondition()), + branchVal->getCondition(), llvmKernelBB); - //Add kernel noop - BuildMI(machineKernelBB, V9::NOP, 0); - - //Add unconditional branch to first epilogue - BuildMI(machineKernelBB, V9::BA, 1).addPCDisp(llvm_epilogues[0]); - - - //Add kernel noop - BuildMI(machineKernelBB, V9::NOP, 0); //Lastly add unconditional branches for the epilogues for(unsigned I = 0; I < epilogues.size(); ++I) { - //Now since I don't trust fall throughs, add a unconditional branch to the next prologue + //Now since we don't have fall throughs, add a unconditional branch to the next prologue if(I != epilogues.size()-1) { BuildMI(epilogues[I], V9::BA, 1).addPCDisp(llvm_epilogues[I+1]); //Add unconditional branch to end of epilogue @@ -1835,41 +1952,25 @@ llvm_epilogues[I]); } - else { - MachineBasicBlock *origBlock = (MachineBasicBlock*) BB; - for(MachineBasicBlock::reverse_iterator inst = origBlock->rbegin(), instEnd = origBlock->rend(); inst != instEnd; ++inst) { - MachineOpCode OC = inst->getOpcode(); - if(TMI->isBranch(OC)) { - branch = &*inst; - DEBUG(std::cerr << "Exit branch from loop" << *inst << "\n"); - break; - - } - - for(unsigned opNum = 0; opNum < branch->getNumOperands(); ++opNum) { - MachineOperand &mOp = branch->getOperand(opNum); - - if (mOp.getType() == MachineOperand::MO_PCRelativeDisp) { - BuildMI(epilogues[I], V9::BA, 1).addPCDisp(mOp.getVRegValue()); - break; - } - } - - } + else { + BuildMI(epilogues[I], V9::BA, 1).addPCDisp(origBAVal); + - //Update last epilogue exit branch - BranchInst *branchVal = (BranchInst*) dyn_cast(BB->getBasicBlock()->getTerminator()); - //Find where we are supposed to branch to - BasicBlock *nextBlock = 0; - for(unsigned j=0; j getNumSuccessors(); ++j) { - if(branchVal->getSuccessor(j) != BB->getBasicBlock()) - nextBlock = branchVal->getSuccessor(j); - } - TerminatorInst *newBranch = new BranchInst(nextBlock, llvm_epilogues[I]); - } - //Add one more nop! - BuildMI(epilogues[I], V9::NOP, 0); - + //Update last epilogue exit branch + BranchInst *branchVal = (BranchInst*) dyn_cast(BB->getBasicBlock()->getTerminator()); + //Find where we are supposed to branch to + BasicBlock *nextBlock = 0; + for(unsigned j=0; j getNumSuccessors(); ++j) { + if(branchVal->getSuccessor(j) != BB->getBasicBlock()) + nextBlock = branchVal->getSuccessor(j); + } + + assert((nextBlock != 0) && "Next block should not be null!"); + TerminatorInst *newBranch = new BranchInst(nextBlock, llvm_epilogues[I]); + } + //Add one more nop! + BuildMI(epilogues[I], V9::NOP, 0); + } //FIX UP Machine BB entry!! From brukman at cs.uiuc.edu Thu Oct 14 01:05:06 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 01:05:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/Makefile Message-ID: <200410140605.BAA06636@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: Makefile updated: 1.12 -> 1.13 --- Log message: * Make a PPC32-specific code emitter because we have separate classes for 32- and 64-bit code emitters that cannot share code unless we use virtual functions * Identify components being built by tablegen with more detail by assigning them to PowerPC, PPC32, or PPC64 more specifically; also avoids seeing 'building PowerPC XYZ' messages twice, where one is for PPC32 and one for PPC64 --- Diffs of the changes: (+6 -6) Index: llvm/lib/Target/PowerPC/Makefile diff -u llvm/lib/Target/PowerPC/Makefile:1.12 llvm/lib/Target/PowerPC/Makefile:1.13 --- llvm/lib/Target/PowerPC/Makefile:1.12 Sat Sep 4 21:42:44 2004 +++ llvm/lib/Target/PowerPC/Makefile Thu Oct 14 01:04:56 2004 @@ -14,14 +14,14 @@ # Make sure that tblgen is run, first thing. $(SourceDepend): PowerPCGenInstrNames.inc PowerPCGenRegisterNames.inc \ - PowerPCGenCodeEmitter.inc PowerPCGenAsmWriter.inc \ + PowerPCGenAsmWriter.inc PPC32GenCodeEmitter.inc \ PPC32GenRegisterInfo.h.inc PPC32GenRegisterInfo.inc PPC32GenInstrInfo.inc \ PPC64GenRegisterInfo.h.inc PPC64GenRegisterInfo.inc PPC64GenInstrInfo.inc TDFILES = $(wildcard $(SourceDir)/*.td) $(SourceDir)/../Target.td %GenRegisterNames.inc:: PPC32.td $(TDFILES) $(TBLGEN) - @echo "Building PowerPC register names with tblgen" + @echo "Building $(TARGET) register names with tblgen" $(VERB) $(TBLGEN) -I $(BUILD_SRC_DIR) $< -gen-register-enums -o $@ %GenRegisterInfo.h.inc:: %.td $(TDFILES) $(TBLGEN) @@ -37,14 +37,14 @@ $(VERB) $(TBLGEN) -I $(BUILD_SRC_DIR) $< -gen-instr-enums -o $@ %GenInstrInfo.inc:: %.td $(TDFILES) $(TBLGEN) - @echo "Building $(TARGET) instruction information with tblgen" + @echo "Building `basename $<` instruction information with tblgen" $(VERB) $(TBLGEN) -I $(BUILD_SRC_DIR) $< -gen-instr-desc -o $@ -$(TARGET)GenCodeEmitter.inc:: PPC32.td $(TDFILES) $(TBLGEN) - @echo "Building $(TARGET) code emitter" +%GenCodeEmitter.inc:: %.td $(TDFILES) $(TBLGEN) + @echo "Building `basename $<` code emitter with tblgen" $(VERB) $(TBLGEN) -I $(SourceDir) $< -gen-emitter -o $@ -$(TARGET)GenAsmWriter.inc:: PowerPC.td $(TDFILES) $(TBLGEN) +$(TARGET)GenAsmWriter.inc:: $(TARGET).td $(TDFILES) $(TBLGEN) @echo "Building $(TARGET).td assembly writer with tblgen" $(VERB) $(TBLGEN) -I $(SourceDir) $< -gen-asm-writer -o $@ From brukman at cs.uiuc.edu Thu Oct 14 01:07:36 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 01:07:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <200410140607.BAA13236@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.4 -> 1.5 --- Log message: * Include the real (generated) version of getBinaryCodeForInstr() * Add implementation of getMachineOpValue() for generated code emitter * Convert assert()s in unimplemented functions to abort()s so that non-debug builds fail predictably * Add file header comments --- Diffs of the changes: (+20 -10) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.4 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.5 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.4 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Thu Oct 14 01:07:25 2004 @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// // +// This file defines the PowerPC 32-bit CodeEmitter and associated machinery to +// JIT-compile bytecode to native PowerPC. // //===----------------------------------------------------------------------===// @@ -24,6 +26,8 @@ TargetMachine &TM; MachineCodeEmitter &MCE; + int64_t getMachineOpValue(MachineInstr &MI, MachineOperand &MO); + public: PPC32CodeEmitter(TargetMachine &T, MachineCodeEmitter &M) : TM(T), MCE(M) {} @@ -41,12 +45,14 @@ /// emitWord - write a 32-bit word to memory at the current PC /// void emitWord(unsigned w) { MCE.emitWord(w); } - - unsigned getValueBit(int64_t Val, unsigned bit); + + /// getValueBit - return the particular bit of Val + /// + unsigned getValueBit(int64_t Val, unsigned bit) { return (Val >> bit) & 1; } /// getBinaryCodeForInstr - returns the assembled code for an instruction /// - unsigned getBinaryCodeForInstr(MachineInstr &MI) { return 0; } + unsigned getBinaryCodeForInstr(MachineInstr &MI); }; } @@ -60,7 +66,7 @@ MachineCodeEmitter &MCE) { // Machine code emitter pass for PowerPC PM.add(new PPC32CodeEmitter(*this, MCE)); - // Delete machine code for this function after emitting it: + // Delete machine code for this function after emitting it PM.add(createMachineCodeDeleter()); // We don't yet support machine code emission return true; @@ -80,22 +86,26 @@ emitWord(getBinaryCodeForInstr(*I)); } -unsigned PPC32CodeEmitter::getValueBit(int64_t Val, unsigned bit) { - Val >>= bit; - return (Val & 1); +int64_t PPC32CodeEmitter::getMachineOpValue(MachineInstr &MI, + MachineOperand &MO) { + abort(); + return 0; } + void *PPC32JITInfo::getJITStubForFunction(Function *F, MachineCodeEmitter &MCE) { - assert (0 && "PPC32JITInfo::getJITStubForFunction not implemented"); + std::cerr << "PPC32JITInfo::getJITStubForFunction not implemented\n"; + abort(); return 0; } void PPC32JITInfo::replaceMachineCodeForFunction (void *Old, void *New) { - assert (0 && "PPC32JITInfo::replaceMachineCodeForFunction not implemented"); + std::cerr << "PPC32JITInfo::replaceMachineCodeForFunction not implemented\n"; + abort(); } -//#include "PowerPCGenCodeEmitter.inc" +#include "PPC32GenCodeEmitter.inc" } // end llvm namespace From brukman at cs.uiuc.edu Thu Oct 14 01:35:25 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 01:35:25 -0500 Subject: [llvm-commits] CVS: llvm/tools/lli/Makefile Message-ID: <200410140635.BAA27356@zion.cs.uiuc.edu> Changes in directory llvm/tools/lli: Makefile updated: 1.45 -> 1.46 --- Log message: Enable the PowerPC JIT by compiling powerpc.o library into lli --- Diffs of the changes: (+13 -0) Index: llvm/tools/lli/Makefile diff -u llvm/tools/lli/Makefile:1.45 llvm/tools/lli/Makefile:1.46 --- llvm/tools/lli/Makefile:1.45 Fri Oct 8 13:14:56 2004 +++ llvm/tools/lli/Makefile Thu Oct 14 01:35:11 2004 @@ -46,6 +46,19 @@ sparcv9regalloc endif +# You can enable the PowerPC JIT on a non-PowerPC host by setting the flag +# ENABLE_PPC_JIT on the make command line. If not, it will still be +# enabled automagically on an PowerPC host. +ifeq ($(ARCH), PowerPC) + ENABLE_PPC_JIT = 1 +endif + +# What the PowerPC JIT requires +ifdef ENABLE_PPC_JIT + CPPFLAGS += -DENABLE_PPC_JIT + JITLIBS += powerpc +endif + USEDLIBS = lli-interpreter $(JITLIBS) $(ARCHLIBS) scalaropts analysis.a \ transformutils.a bcreader vmcore support target.a LLVMsystem.a From brukman at cs.uiuc.edu Thu Oct 14 01:40:07 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 01:40:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Message-ID: <200410140640.BAA27446@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32CodeEmitter.cpp updated: 1.5 -> 1.6 --- Log message: * Claim to support machine code emission - return false from addPassesToEmitMachineCode() * Add support for registers and constants in getMachineOpValue() This enables running "int main() { ret 0 }" via the PowerPC JIT. --- Diffs of the changes: (+26 -4) Index: llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.5 llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.6 --- llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp:1.5 Thu Oct 14 01:07:25 2004 +++ llvm/lib/Target/PowerPC/PPC32CodeEmitter.cpp Thu Oct 14 01:39:56 2004 @@ -68,8 +68,7 @@ PM.add(new PPC32CodeEmitter(*this, MCE)); // Delete machine code for this function after emitting it PM.add(createMachineCodeDeleter()); - // We don't yet support machine code emission - return true; + return false; } bool PPC32CodeEmitter::runOnMachineFunction(MachineFunction &MF) { @@ -88,8 +87,31 @@ int64_t PPC32CodeEmitter::getMachineOpValue(MachineInstr &MI, MachineOperand &MO) { - abort(); - return 0; + int64_t rv = 0; // Return value; defaults to 0 for unhandled cases + // or things that get fixed up later by the JIT. + if (MO.isPCRelativeDisp()) { + std::cerr << "PPC32CodeEmitter: PC-relative disp unhandled\n"; + abort(); + } else if (MO.isRegister()) { + rv = MO.getReg(); + } else if (MO.isImmediate()) { + rv = MO.getImmedValue(); +#if 0 + } else if (MO.isGlobalAddress()) { + } else if (MO.isMachineBasicBlock()) { + MachineBasicBlock *MBB = MO.getMachineBasicBlock(); + } else if (MO.isExternalSymbol()) { + } else if (MO.isFrameIndex()) { + unsigned index = MO.getFrameIndex(); + } else if (MO.isConstantPoolIndex()) { + unsigned index = MO.getCosntantPoolIndex(); +#endif + } else { + std::cerr << "ERROR: Unknown type of MachineOperand: " << MO << "\n"; + abort(); + } + + return rv; } From lattner at cs.uiuc.edu Thu Oct 14 09:51:22 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 09:51:22 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/IntervalIterator.h Message-ID: <200410141451.JAA00629@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: IntervalIterator.h updated: 1.19 -> 1.20 --- Log message: Remove unneeded typedef, patch by Morten Ofstad --- Diffs of the changes: (+0 -2) Index: llvm/include/llvm/Analysis/IntervalIterator.h diff -u llvm/include/llvm/Analysis/IntervalIterator.h:1.19 llvm/include/llvm/Analysis/IntervalIterator.h:1.20 --- llvm/include/llvm/Analysis/IntervalIterator.h:1.19 Tue Oct 12 11:10:39 2004 +++ llvm/include/llvm/Analysis/IntervalIterator.h Thu Oct 14 09:51:09 2004 @@ -94,8 +94,6 @@ bool IOwnMem; // If True, delete intervals when done with them // See file header for conditions of use public: - typedef BasicBlock* _BB; - typedef IntervalIterator _Self; typedef std::forward_iterator_tag iterator_category; From lattner at cs.uiuc.edu Thu Oct 14 09:59:29 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 09:59:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/PostDominators.cpp Message-ID: <200410141459.JAA03973@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: PostDominators.cpp updated: 1.48 -> 1.49 --- Log message: Do not use the same variable name for two different variables in the same scope. This confused VC++ (and probably people too!). Patch by Morten Ofstad! --- Diffs of the changes: (+2 -3) Index: llvm/lib/Analysis/PostDominators.cpp diff -u llvm/lib/Analysis/PostDominators.cpp:1.48 llvm/lib/Analysis/PostDominators.cpp:1.49 --- llvm/lib/Analysis/PostDominators.cpp:1.48 Wed Sep 1 17:55:35 2004 +++ llvm/lib/Analysis/PostDominators.cpp Thu Oct 14 09:59:16 2004 @@ -182,9 +182,8 @@ // be a predecessor in the depth first order that we are iterating through // the function. // - DominatorSet::DomSetType::const_iterator I = Dominators.begin(); - DominatorSet::DomSetType::const_iterator End = Dominators.end(); - for (; I != End; ++I) { // Iterate over dominators... + for (DominatorSet::DomSetType::const_iterator I = Dominators.begin(), + E = Dominators.end(); I != E; ++I) { // Iterate over dominators. // All of our dominators should form a chain, where the number // of elements in the dominator set indicates what level the // node is at in the chain. We want the node immediately From lattner at cs.uiuc.edu Thu Oct 14 10:47:12 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 10:47:12 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h Message-ID: <200410141547.KAA12098@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: Dominators.h updated: 1.45 -> 1.46 --- Log message: Make sure any client of Dominators.h links in Dominators.cpp --- Diffs of the changes: (+6 -0) Index: llvm/include/llvm/Analysis/Dominators.h diff -u llvm/include/llvm/Analysis/Dominators.h:1.45 llvm/include/llvm/Analysis/Dominators.h:1.46 --- llvm/include/llvm/Analysis/Dominators.h:1.45 Fri May 21 13:38:16 2004 +++ llvm/include/llvm/Analysis/Dominators.h Thu Oct 14 10:46:59 2004 @@ -268,6 +268,9 @@ AU.addRequired(); AU.setPreservesAll(); } + + // stub - dummy function, just ignore it + static void stub(); }; @@ -506,6 +509,9 @@ const DominatorTree::Node *Node); }; +// Make sure that any clients of this file link in Dominators.cpp +static IncludeFile +DOMINATORS_INCLUDE_FILE((void*)&DominatorSet::stub); } // End llvm namespace #endif From lattner at cs.uiuc.edu Thu Oct 14 10:47:27 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 10:47:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp Message-ID: <200410141547.KAA12106@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Dominators.cpp updated: 1.58 -> 1.59 --- Log message: Make sure any client of Dominators.h links in Dominators.cpp Patch by Morten Ofstad --- Diffs of the changes: (+2 -0) Index: llvm/lib/VMCore/Dominators.cpp diff -u llvm/lib/VMCore/Dominators.cpp:1.58 llvm/lib/VMCore/Dominators.cpp:1.59 --- llvm/lib/VMCore/Dominators.cpp:1.58 Wed Sep 1 17:55:37 2004 +++ llvm/lib/VMCore/Dominators.cpp Thu Oct 14 10:47:16 2004 @@ -298,6 +298,8 @@ return false; } +void DominatorSet::stub() {} + namespace llvm { static std::ostream &operator<<(std::ostream &o, const std::set &BBs) { From brukman at cs.uiuc.edu Thu Oct 14 13:48:07 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 13:48:07 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstrBuilder.h Message-ID: <200410141848.NAA09064@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineInstrBuilder.h updated: 1.22 -> 1.23 --- Log message: Convert tabs to spaces --- Diffs of the changes: (+2 -2) Index: llvm/include/llvm/CodeGen/MachineInstrBuilder.h diff -u llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.22 llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.23 --- llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.22 Sun May 23 00:04:00 2004 +++ llvm/include/llvm/CodeGen/MachineInstrBuilder.h Thu Oct 14 13:47:56 2004 @@ -124,13 +124,13 @@ } const MachineInstrBuilder &addGlobalAddress(GlobalValue *GV, - bool isPCRelative = false) const { + bool isPCRelative = false) const { MI->addGlobalAddressOperand(GV, isPCRelative); return *this; } const MachineInstrBuilder &addExternalSymbol(const std::string &Name, - bool isPCRelative = false) const{ + bool isPCRelative = false) const{ MI->addExternalSymbolOperand(Name, isPCRelative); return *this; } From brukman at cs.uiuc.edu Thu Oct 14 13:58:29 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 13:58:29 -0500 Subject: [llvm-commits] CVS: llvm/tools/Makefile.JIT Message-ID: <200410141858.NAA22690@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile.JIT added (r1.1) --- Log message: Since several tools and examples want JIT support, factor out the process of adding the right libs for any given architecture's JIT into a single place --- Diffs of the changes: (+68 -0) Index: llvm/tools/Makefile.JIT diff -c /dev/null llvm/tools/Makefile.JIT:1.1 *** /dev/null Thu Oct 14 13:58:29 2004 --- llvm/tools/Makefile.JIT Thu Oct 14 13:58:19 2004 *************** *** 0 **** --- 1,68 ---- + ##===- tools/Makefile.JIT ----------------------------------*- Makefile -*-===## + # + # The LLVM Compiler Infrastructure + # + # This file was developed by the LLVM research group and is distributed under + # the University of Illinois Open Source License. See LICENSE.TXT for details. + # + ##===----------------------------------------------------------------------===## + # + # This file adds the appropriate libraries to USEDLIBS to enable JIT support for + # a tool on a supported target. + # + ##===----------------------------------------------------------------------===## + + LEVEL = ../.. + + # Get the $(ARCH) setting + include $(LEVEL)/Makefile.config + + # Generic JIT libraries + JITLIBS = lli-jit codegen executionengine + ARCHLIBS = + + # You can enable the X86 JIT on a non-X86 host by setting the flag + # ENABLE_X86_JIT on the make command line. If not, it will still be + # enabled automagically on an X86 host. + ifeq ($(ARCH), x86) + ENABLE_X86_JIT = 1 + endif + + # What the X86 JIT requires + ifdef ENABLE_X86_JIT + CPPFLAGS += -DENABLE_X86_JIT + JITLIBS += x86 selectiondag + # X86 doesn't require any ARCHLIBS + endif + + # You can enable the Sparc JIT on a non-Sparc host by setting the flag + # ENABLE_SPARC_JIT on the make command line. If not, it will still be + # enabled automagically on an Sparc host. + ifeq ($(ARCH), Sparc) + ENABLE_SPARC_JIT = 1 + endif + + # What the Sparc JIT requires + ifdef ENABLE_SPARC_JIT + CPPFLAGS += -DENABLE_SPARC_JIT + JITLIBS += sparcv9 + ARCHLIBS += sparcv9sched sparcv9livevar instrument.a profpaths \ + bcwriter transforms.a ipo.a ipa.a datastructure.a \ + sparcv9regalloc + endif + + # You can enable the PowerPC JIT on a non-PowerPC host by setting the flag + # ENABLE_PPC_JIT on the make command line. If not, it will still be + # enabled automagically on an PowerPC host. + ifeq ($(ARCH), PowerPC) + ENABLE_PPC_JIT = 1 + endif + + # What the PowerPC JIT requires + ifdef ENABLE_PPC_JIT + CPPFLAGS += -DENABLE_PPC_JIT + JITLIBS += powerpc + endif + + USEDLIBS += lli-interpreter $(JITLIBS) $(ARCHLIBS) scalaropts analysis.a \ + transformutils.a bcreader vmcore support target.a LLVMsystem.a From brukman at cs.uiuc.edu Thu Oct 14 13:59:20 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 13:59:20 -0500 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200410141859.NAA22708@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.123 -> 1.124 --- Log message: Transfer Makefile.JIT into the build tree for JIT-enabling tools and examples --- Diffs of the changes: (+1 -0) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.123 llvm/autoconf/configure.ac:1.124 --- llvm/autoconf/configure.ac:1.123 Mon Oct 4 17:05:53 2004 +++ llvm/autoconf/configure.ac Thu Oct 14 13:59:09 2004 @@ -60,6 +60,7 @@ AC_CONFIG_MAKEFILE(test/QMTest/llvm.py) AC_CONFIG_MAKEFILE(test/QMTest/llvmdb.py) AC_CONFIG_MAKEFILE(tools/Makefile) +AC_CONFIG_MAKEFILE(tools/Makefile.JIT) AC_CONFIG_MAKEFILE(utils/Makefile) AC_CONFIG_MAKEFILE(projects/Makefile) From brukman at cs.uiuc.edu Thu Oct 14 13:59:53 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 13:59:53 -0500 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200410141859.NAA22727@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.129 -> 1.130 --- Log message: Add Makefile.JIT to the list of Makefiles transferred to the build dir to give tools and examples a simple way to JIT-enable themselves --- Diffs of the changes: (+34 -28) Index: llvm/configure diff -u llvm/configure:1.129 llvm/configure:1.130 --- llvm/configure:1.129 Tue Oct 12 20:01:03 2004 +++ llvm/configure Thu Oct 14 13:59:42 2004 @@ -1641,6 +1641,9 @@ ac_config_commands="$ac_config_commands tools/Makefile" + ac_config_commands="$ac_config_commands tools/Makefile.JIT" + + ac_config_commands="$ac_config_commands utils/Makefile" @@ -4180,7 +4183,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4183 "configure"' > conftest.$ac_ext + echo '#line 4186 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5054,7 +5057,7 @@ # Provide some information about the compiler. -echo "$as_me:5057:" \ +echo "$as_me:5060:" \ "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 @@ -6111,11 +6114,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6114: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6117: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6118: \$? = $ac_status" >&5 + echo "$as_me:6121: \$? = $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 @@ -6354,11 +6357,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6357: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6360: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6361: \$? = $ac_status" >&5 + echo "$as_me:6364: \$? = $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 @@ -6414,11 +6417,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6417: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6420: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6421: \$? = $ac_status" >&5 + echo "$as_me:6424: \$? = $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 @@ -8599,7 +8602,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:10896: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10897: \$? = $ac_status" >&5 + echo "$as_me:10900: \$? = $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 @@ -10950,11 +10953,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10953: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10956: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10957: \$? = $ac_status" >&5 + echo "$as_me:10960: \$? = $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 @@ -12311,7 +12314,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:13252: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13253: \$? = $ac_status" >&5 + echo "$as_me:13256: \$? = $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 @@ -13306,11 +13309,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13309: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13312: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13313: \$? = $ac_status" >&5 + echo "$as_me:13316: \$? = $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 @@ -15345,11 +15348,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15348: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15351: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15352: \$? = $ac_status" >&5 + echo "$as_me:15355: \$? = $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 @@ -15588,11 +15591,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15591: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15594: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15595: \$? = $ac_status" >&5 + echo "$as_me:15598: \$? = $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 @@ -15648,11 +15651,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15651: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15654: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15655: \$? = $ac_status" >&5 + echo "$as_me:15658: \$? = $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 @@ -17833,7 +17836,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < Changes in directory llvm/tools/lli: Makefile updated: 1.46 -> 1.47 --- Log message: Use the shared Makefile.JIT for JIT-enablement --- Diffs of the changes: (+2 -52) Index: llvm/tools/lli/Makefile diff -u llvm/tools/lli/Makefile:1.46 llvm/tools/lli/Makefile:1.47 --- llvm/tools/lli/Makefile:1.46 Thu Oct 14 01:35:11 2004 +++ llvm/tools/lli/Makefile Thu Oct 14 14:00:33 2004 @@ -9,58 +9,8 @@ LEVEL = ../.. TOOLNAME = lli -# Get the $(ARCH) setting -include $(LEVEL)/Makefile.config - -# Generic JIT libraries -JITLIBS = lli-jit codegen executionengine -ARCHLIBS = - -# You can enable the X86 JIT on a non-X86 host by setting the flag -# ENABLE_X86_JIT on the make command line. If not, it will still be -# enabled automagically on an X86 host. -ifeq ($(ARCH), x86) - ENABLE_X86_JIT = 1 -endif - -# What the X86 JIT requires -ifdef ENABLE_X86_JIT - CPPFLAGS += -DENABLE_X86_JIT - JITLIBS += x86 selectiondag - # X86 doesn't require any ARCHLIBS -endif - -# You can enable the Sparc JIT on a non-Sparc host by setting the flag -# ENABLE_SPARC_JIT on the make command line. If not, it will still be -# enabled automagically on an Sparc host. -ifeq ($(ARCH), Sparc) - ENABLE_SPARC_JIT = 1 -endif - -# What the Sparc JIT requires -ifdef ENABLE_SPARC_JIT - CPPFLAGS += -DENABLE_SPARC_JIT - JITLIBS += sparcv9 - ARCHLIBS += sparcv9sched sparcv9livevar instrument.a profpaths \ - bcwriter transforms.a ipo.a ipa.a datastructure.a \ - sparcv9regalloc -endif - -# You can enable the PowerPC JIT on a non-PowerPC host by setting the flag -# ENABLE_PPC_JIT on the make command line. If not, it will still be -# enabled automagically on an PowerPC host. -ifeq ($(ARCH), PowerPC) - ENABLE_PPC_JIT = 1 -endif - -# What the PowerPC JIT requires -ifdef ENABLE_PPC_JIT - CPPFLAGS += -DENABLE_PPC_JIT - JITLIBS += powerpc -endif - -USEDLIBS = lli-interpreter $(JITLIBS) $(ARCHLIBS) scalaropts analysis.a \ - transformutils.a bcreader vmcore support target.a LLVMsystem.a +# Enable JIT support +include ../Makefile.JIT # Have gcc tell the linker to export symbols from the program so that # dynamically loaded modules can be linked against them. From brukman at cs.uiuc.edu Thu Oct 14 14:01:35 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 14:01:35 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-db/Makefile Message-ID: <200410141901.OAA22830@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-db: Makefile updated: 1.5 -> 1.6 --- Log message: Use the shared Makefile.JIT for JIT-enablement --- Diffs of the changes: (+3 -40) Index: llvm/tools/llvm-db/Makefile diff -u llvm/tools/llvm-db/Makefile:1.5 llvm/tools/llvm-db/Makefile:1.6 --- llvm/tools/llvm-db/Makefile:1.5 Fri Oct 8 13:14:56 2004 +++ llvm/tools/llvm-db/Makefile Thu Oct 14 14:01:25 2004 @@ -9,47 +9,10 @@ LEVEL = ../.. TOOLNAME = llvm-db +USEDLIBS = debugger -# Get the $(ARCH) setting -include $(LEVEL)/Makefile.config - -# Generic JIT libraries -JITLIBS = lli-jit codegen executionengine -ARCHLIBS = - -# You can enable the X86 JIT on a non-X86 host by setting the flag -# ENABLE_X86_JIT on the make command line. If not, it will still be -# enabled automagically on an X86 host. -ifeq ($(ARCH), x86) - ENABLE_X86_JIT = 1 -endif - -# What the X86 JIT requires -ifdef ENABLE_X86_JIT - CPPFLAGS += -DENABLE_X86_JIT - JITLIBS += x86 selectiondag - # X86 doesn't require any ARCHLIBS -endif - -# You can enable the Sparc JIT on a non-Sparc host by setting the flag -# ENABLE_SPARC_JIT on the make command line. If not, it will still be -# enabled automagically on an Sparc host. -ifeq ($(ARCH), Sparc) - ENABLE_SPARC_JIT = 1 -endif - -# What the Sparc JIT requires -ifdef ENABLE_SPARC_JIT - CPPFLAGS += -DENABLE_SPARC_JIT - JITLIBS += sparcv9 - ARCHLIBS += sparcv9sched sparcv9livevar instrument.a profpaths \ - bcwriter transforms.a ipo.a ipa.a datastructure.a \ - sparcv9regalloc -endif - -USEDLIBS = lli-interpreter $(JITLIBS) $(ARCHLIBS) scalaropts analysis.a \ - transformutils.a debugger bcreader vmcore support target.a LLVMsystem.a - +# Enable JIT support +include ../Makefile.JIT # Have gcc tell the linker to export symbols from the program so that # dynamically loaded modules can be linked against them. From brukman at cs.uiuc.edu Thu Oct 14 14:02:21 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 14:02:21 -0500 Subject: [llvm-commits] CVS: llvm/examples/Fibonacci/Makefile Message-ID: <200410141902.OAA22859@zion.cs.uiuc.edu> Changes in directory llvm/examples/Fibonacci: Makefile updated: 1.4 -> 1.5 --- Log message: Use the shared Makefile.JIT for JIT-enablement, which also enables the examples to have the JIT functioning on more platforms than just x86 --- Diffs of the changes: (+4 -3) Index: llvm/examples/Fibonacci/Makefile diff -u llvm/examples/Fibonacci/Makefile:1.4 llvm/examples/Fibonacci/Makefile:1.5 --- llvm/examples/Fibonacci/Makefile:1.4 Sat Sep 11 15:30:11 2004 +++ llvm/examples/Fibonacci/Makefile Thu Oct 14 14:02:10 2004 @@ -6,10 +6,11 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../.. TOOLNAME = Fibonacci -USEDLIBS = lli-jit lli-interpreter codegen executionengine x86 selectiondag \ - scalaropts analysis.a transformutils.a bcreader target.a vmcore \ - support.a LLVMsystem.a + +# Enable JIT support +include $(LEVEL)/tools/Makefile.JIT include $(LEVEL)/Makefile.common From brukman at cs.uiuc.edu Thu Oct 14 14:02:23 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 14:02:23 -0500 Subject: [llvm-commits] CVS: llvm/examples/HowToUseJIT/Makefile Message-ID: <200410141902.OAA22869@zion.cs.uiuc.edu> Changes in directory llvm/examples/HowToUseJIT: Makefile updated: 1.5 -> 1.6 --- Log message: Use the shared Makefile.JIT for JIT-enablement, which also enables the examples to have the JIT functioning on more platforms than just x86 --- Diffs of the changes: (+3 -3) Index: llvm/examples/HowToUseJIT/Makefile diff -u llvm/examples/HowToUseJIT/Makefile:1.5 llvm/examples/HowToUseJIT/Makefile:1.6 --- llvm/examples/HowToUseJIT/Makefile:1.5 Sat Sep 11 15:30:11 2004 +++ llvm/examples/HowToUseJIT/Makefile Thu Oct 14 14:02:13 2004 @@ -8,8 +8,8 @@ ##===----------------------------------------------------------------------===## LEVEL = ../.. TOOLNAME = HowToUseJIT -USEDLIBS = lli-jit lli-interpreter codegen executionengine x86 selectiondag \ - scalaropts analysis.a transformutils.a bcreader target.a vmcore \ - support.a LLVMsystem.a + +# Enable JIT support +include $(LEVEL)/tools/Makefile.JIT include $(LEVEL)/Makefile.common From gaeke at cs.uiuc.edu Thu Oct 14 14:51:05 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu, 14 Oct 2004 14:51:05 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Message-ID: <200410141951.OAA28359@seraph.cs.uiuc.edu> Changes in directory reopt/lib/LightWtProfiling: UnpackTraceFunction.cpp updated: 1.111 -> 1.112 --- Log message: Start saving extra space in UTF prolog for "spilled" excess args. We still need to keep track of where each excess arg goes, though... soon to come. --- Diffs of the changes: (+11 -6) Index: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp diff -u reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.111 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.112 --- reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.111 Thu Sep 2 11:55:44 2004 +++ reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Thu Oct 14 14:50:53 2004 @@ -702,14 +702,19 @@ // Calculate the stack size. // The actual amount we will allocate is (Static Stack Frame Size + Slop + - // Space for Regs). The Slop = 176 number is from looking at the SparcV9 - // ABI. The Space for Regs = 104 number is the number of 64-bit registers - // that are known to the SparcV9 backend. + // Space for Regs + Space for Spilled Args). The Slop = 176 number is from + // looking at the SparcV9 ABI. The Space for Regs = 104 number is the number + // of 64-bit registers that are known to the SparcV9 backend. The Space for + // Spilled Args number is used to make stack space available to hold live-in + // values which would have been allocated to incoming-argument slots in the + // caller's stack frame, had we been directly executing the TraceToFunction + // output. StaticStackSize = getStaticStackSize (MF); - TotalStackSize = (StaticStackSize + 176 + 104 * 8); + int SpilledArgsSpace = std::max ((int)TF->TraceFn->asize() - 6, 0) * 8; + TotalStackSize = (StaticStackSize + 176 + 104 * 8 + SpilledArgsSpace); DEBUG(std::cerr << "UnpackTraceFunction: Stack sizes: static = " - << StaticStackSize << ", total = " << TotalStackSize << "\n"); - + << StaticStackSize << ", spilled args = " << SpilledArgsSpace + << ", total = " << TotalStackSize << "\n"); bool Changed = false; for (MachineFunction::iterator I = MF.begin (), E = MF.end (); I != E; ++I) From lattner at cs.uiuc.edu Thu Oct 14 14:54:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 14:54:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200410141954.OAA20198@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.23 -> 1.24 --- Log message: Fix a bug John tracked down in libstdc++ where we were incorrectly deleting weak functions. Thanks for finding this John! --- Diffs of the changes: (+2 -1) Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.23 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.24 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.23 Mon Oct 11 00:54:41 2004 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Thu Oct 14 14:53:50 2004 @@ -808,7 +808,8 @@ for (Module::iterator FI = M.begin(), E = M.end(); FI != E; ) { Function *F = FI++; F->removeDeadConstantUsers(); - if (F->use_empty() && (F->hasInternalLinkage() || F->hasWeakLinkage())) { + if (F->use_empty() && (F->hasInternalLinkage() || + F->hasLinkOnceLinkage())) { M.getFunctionList().erase(F); LocalChange = true; ++NumFnDeleted; From brukman at cs.uiuc.edu Thu Oct 14 15:06:46 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Thu, 14 Oct 2004 15:06:46 -0500 Subject: [llvm-commits] CVS: llvm/tools/Makefile.JIT Message-ID: <200410142006.PAA27451@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile.JIT updated: 1.1 -> 1.2 --- Log message: * We don't use the ENABLE_*_JIT flags in the source base anymore * Convert references to Sparc to SparcV9 to clearly identify CPU type --- Diffs of the changes: (+5 -8) Index: llvm/tools/Makefile.JIT diff -u llvm/tools/Makefile.JIT:1.1 llvm/tools/Makefile.JIT:1.2 --- llvm/tools/Makefile.JIT:1.1 Thu Oct 14 13:58:19 2004 +++ llvm/tools/Makefile.JIT Thu Oct 14 15:06:36 2004 @@ -30,21 +30,19 @@ # What the X86 JIT requires ifdef ENABLE_X86_JIT - CPPFLAGS += -DENABLE_X86_JIT JITLIBS += x86 selectiondag # X86 doesn't require any ARCHLIBS endif -# You can enable the Sparc JIT on a non-Sparc host by setting the flag -# ENABLE_SPARC_JIT on the make command line. If not, it will still be -# enabled automagically on an Sparc host. +# You can enable the SparcV9 JIT on a non-SparcV9 host by setting the flag +# ENABLE_SPARCV9_JIT on the make command line. If not, it will still be +# enabled automagically on an SparcV9 host. ifeq ($(ARCH), Sparc) - ENABLE_SPARC_JIT = 1 + ENABLE_SPARCV9_JIT = 1 endif # What the Sparc JIT requires -ifdef ENABLE_SPARC_JIT - CPPFLAGS += -DENABLE_SPARC_JIT +ifdef ENABLE_SPARCV9_JIT JITLIBS += sparcv9 ARCHLIBS += sparcv9sched sparcv9livevar instrument.a profpaths \ bcwriter transforms.a ipo.a ipa.a datastructure.a \ @@ -60,7 +58,6 @@ # What the PowerPC JIT requires ifdef ENABLE_PPC_JIT - CPPFLAGS += -DENABLE_PPC_JIT JITLIBS += powerpc endif From gaeke at cs.uiuc.edu Thu Oct 14 16:44:22 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu, 14 Oct 2004 16:44:22 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/include/reopt/UnpackTraceFunction.h Message-ID: <200410142144.QAA29125@seraph.cs.uiuc.edu> Changes in directory reopt/include/reopt: UnpackTraceFunction.h updated: 1.18 -> 1.19 --- Log message: Add prototypes for placeSpilledArgs and fixupSpilledArgPlacement. --- Diffs of the changes: (+2 -0) Index: reopt/include/reopt/UnpackTraceFunction.h diff -u reopt/include/reopt/UnpackTraceFunction.h:1.18 reopt/include/reopt/UnpackTraceFunction.h:1.19 --- reopt/include/reopt/UnpackTraceFunction.h:1.18 Fri Sep 24 16:22:40 2004 +++ reopt/include/reopt/UnpackTraceFunction.h Thu Oct 14 16:44:12 2004 @@ -69,6 +69,8 @@ bool rewriteEpilogInstr (MachineBasicBlock &MBB, MachineBasicBlock::iterator iter); void rewriteEpilog (MachineBasicBlock &MBB); + void placeSpilledArgs (); + int fixupSpilledArgPlacement (int offset); void postprocessMachineInstrsForTrace (MachineBasicBlock &MBB, MachineBasicBlock::iterator Start); bool runOnMachineBasicBlock (MachineBasicBlock &MBB); From gaeke at cs.uiuc.edu Thu Oct 14 16:44:23 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu, 14 Oct 2004 16:44:23 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Message-ID: <200410142144.QAA29131@seraph.cs.uiuc.edu> Changes in directory reopt/lib/LightWtProfiling: UnpackTraceFunction.cpp updated: 1.112 -> 1.113 --- Log message: Add calls to fixupSpilledArgPlacement(), which should (for the moment) do nothing, because the SpilledArgMap is not filled in (yet). --- Diffs of the changes: (+26 -3) Index: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp diff -u reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.112 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.113 --- reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.112 Thu Oct 14 14:50:53 2004 +++ reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Thu Oct 14 16:44:13 2004 @@ -271,7 +271,8 @@ TRI.cpMem2RegMI (mvec, MatrixFP, Source.Placement, R, RegType, g2); if (Target.AllocState == AllocInfo::Spilled) // Finally copy it onto TraceFn's stack - TRI.cpReg2MemMI (mvec, R, TraceFP, Target.Placement, RegType, g2); + TRI.cpReg2MemMI (mvec, R, TraceFP, + fixupSpilledArgPlacement (Target.Placement), RegType, g2); for (std::vector::iterator vi = mvec.begin (), ve = mvec.end (); vi != ve; ++vi) E.push_back (*vi); @@ -399,7 +400,8 @@ g2, mvec); } else if (Source.AllocState == AllocInfo::Spilled) { // Copy live-out value from TraceFn's stack to the register. - TRI.cpMem2RegMI (mvec, TraceFP, Source.Placement, R, RegType, g2); + TRI.cpMem2RegMI (mvec, TraceFP, fixupSpilledArgPlacement (Source.Placement), + R, RegType, g2); } // Most live-outs are in registers in MatrixFn. They get saved on TraceFn's @@ -622,6 +624,22 @@ BuildMI (&MBB, V9::NOP, 0); } +typedef std::map SpilledArgMapTy; +SpilledArgMapTy SpilledArgMap; + +void UnpackTraceFunction::placeSpilledArgs () { + SpilledArgMap.clear (); + // FIXME - implement +} + +int UnpackTraceFunction::fixupSpilledArgPlacement (int offset) { + SpilledArgMapTy::iterator It = SpilledArgMap.find (offset); + if (It != SpilledArgMap.end ()) + return It->second; + else + return offset; +} + void UnpackTraceFunction::postprocessMachineInstrsForTrace (MachineBasicBlock &MBB, MachineBasicBlock::iterator Start) { const SparcV9RegInfo &TRI = *TM->getRegInfo (); @@ -629,8 +647,12 @@ // Rewrite references to %fp to use TraceFP (%g1) instead. for (unsigned i = 0; i < BI->getNumOperands(); ++i) if (BI->getOperand (i).hasAllocatedReg () - && BI->getOperand (i).getReg () == MatrixFP) + && BI->getOperand (i).getReg () == MatrixFP) { BI->SetMachineOperandReg (i, TraceFP); + if (i + 1 < BI->getNumOperands() && BI->getOperand (i + 1).isImmediate ()) + BI->SetMachineOperandConst (i + 1, MachineOperand::MO_SignExtendedImmed, + fixupSpilledArgPlacement (BI->getOperand (i + 1).getImmedValue ())); + } // If this is a CALL, add compensation code around it. if (BI->getOpcode() == V9::CALL || BI->getOpcode() == V9::JMPLCALLi) { std::vector mvec; @@ -715,6 +737,7 @@ DEBUG(std::cerr << "UnpackTraceFunction: Stack sizes: static = " << StaticStackSize << ", spilled args = " << SpilledArgsSpace << ", total = " << TotalStackSize << "\n"); + if (SpilledArgsSpace) placeSpilledArgs(); bool Changed = false; for (MachineFunction::iterator I = MF.begin (), E = MF.end (); I != E; ++I) From gaeke at cs.uiuc.edu Thu Oct 14 16:44:24 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Thu, 14 Oct 2004 16:44:24 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/test/run-big-tests Message-ID: <200410142144.QAA29137@seraph.cs.uiuc.edu> Changes in directory reopt/test: run-big-tests updated: 1.1 -> 1.2 --- Log message: Updated to match working spec tests as of 13-Oct. --- Diffs of the changes: (+1 -1) Index: reopt/test/run-big-tests diff -u reopt/test/run-big-tests:1.1 reopt/test/run-big-tests:1.2 --- reopt/test/run-big-tests:1.1 Wed Sep 8 16:30:39 2004 +++ reopt/test/run-big-tests Thu Oct 14 16:44:14 2004 @@ -1,5 +1,5 @@ #!/bin/sh -for test in art equake gzip mcf parser gap vortex bzip2 go m88ksim compress li +for test in art equake ammp gzip parser vortex bzip2 m88ksim compress li do ./run-tests -clean $test ./run-tests $test ${1+"$@"} From natebegeman at mac.com Thu Oct 14 19:50:56 2004 From: natebegeman at mac.com (Nate Begeman) Date: Thu, 14 Oct 2004 19:50:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Message-ID: <200410150050.TAA27854@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32ISelSimple.cpp updated: 1.90 -> 1.91 --- Log message: Better codegen of binary integer ops with 32 bit immediate operands. This transformation fires a few dozen times across the testsuite. For example, int test2(int X) { return X ^ 0x0FF00FF0; } Old: _test2: lis r2, 4080 ori r2, r2, 4080 xor r3, r3, r2 blr New: _test2: xoris r3, r3, 4080 xori r3, r3, 4080 blr --- Diffs of the changes: (+22 -2) Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.90 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.91 --- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.90 Thu Oct 7 21:49:24 2004 +++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Thu Oct 14 19:50:19 2004 @@ -32,7 +32,7 @@ using namespace llvm; namespace { - Statistic<> NumClear("ppc-codegen", "Number of AND turned into mask"); + Statistic<> NumHiAndLo("ppc-codegen", "Number of 32b imms not loaded"); /// TypeClass - Used by the PowerPC backend to group LLVM types by their basic /// PPC Representation. @@ -2128,13 +2128,19 @@ if (Opcode == 2) { unsigned MB, ME, mask = CI->getRawValue(); if (isRunOfOnes(mask, MB, ME)) { - ++NumClear; BuildMI(*MBB, IP, PPC::RLWINM, 4, DestReg).addReg(Op0Reg).addImm(0) .addImm(MB).addImm(ME); return; } } + // PowerPC 16 bit signed immediates are sign extended before use by the + // instruction. Therefore, we can only split up an add of a reg with a 32 bit + // immediate into addis and addi if the sign bit of the low 16 bits is cleared + // so that for register A, const imm X, we don't end up with + // A + XXXX0000 + FFFFXXXX. + bool WontSignExtend = (0 == (Op1->getRawValue() & 0x8000)); + // For Add, Sub, and SubF the instruction takes a signed immediate. For And, // Or, and Xor, the instruction takes an unsigned immediate. There is no // shifted immediate form of SubF so disallow its opcode for those constants. @@ -2152,6 +2158,20 @@ else BuildMI(*MBB, IP, ImmOpTab[1][Opcode], 2, DestReg).addReg(Op0Reg) .addZImm(Op1->getRawValue() >> 16); + } else if ((Opcode < 2 && WontSignExtend) || Opcode == 3 || Opcode == 4) { + unsigned TmpReg = makeAnotherReg(Op1->getType()); + ++NumHiAndLo; + if (Opcode < 2) { + BuildMI(*MBB, IP, ImmOpTab[1][Opcode], 2, TmpReg).addReg(Op0Reg) + .addSImm(Op1->getRawValue() >> 16); + BuildMI(*MBB, IP, ImmOpTab[0][Opcode], 2, DestReg).addReg(TmpReg) + .addSImm(Op1->getRawValue()); + } else { + BuildMI(*MBB, IP, ImmOpTab[1][Opcode], 2, TmpReg).addReg(Op0Reg) + .addZImm(Op1->getRawValue() >> 16); + BuildMI(*MBB, IP, ImmOpTab[0][Opcode], 2, DestReg).addReg(TmpReg) + .addZImm(Op1->getRawValue()); + } } else { unsigned Op1Reg = getReg(Op1, MBB, IP); BuildMI(*MBB, IP, OpTab[Opcode], 2, DestReg).addReg(Op0Reg).addReg(Op1Reg); From criswell at cs.uiuc.edu Thu Oct 14 22:05:35 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu, 14 Oct 2004 22:05:35 -0500 Subject: [llvm-commits] CVS: llvm-www/Features.html Message-ID: <200410150305.WAA07844@choi.cs.uiuc.edu> Changes in directory llvm-www: Features.html updated: 1.13 -> 1.14 --- Log message: Fix typo. Attempt clarification. --- Diffs of the changes: (+2 -2) Index: llvm-www/Features.html diff -u llvm-www/Features.html:1.13 llvm-www/Features.html:1.14 --- llvm-www/Features.html:1.13 Thu Sep 23 07:38:16 2004 +++ llvm-www/Features.html Thu Oct 14 22:05:24 2004 @@ -30,8 +30,8 @@
  • A Just-In-Time (JIT) code generation system for x86 and Sparc.
  • -
  • A C back-end useful for testing, for supporting targets other than - X86/Sparc/PowerPC Sparc, and allowing LLVM to use a native code generator.
  • +
  • A C back-end useful for testing and for generating native code on targets + other than X86, Sparc, and PowerPC.
  • A profiling system similar to gprof.
  • From lattner at cs.uiuc.edu Thu Oct 14 22:16:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 22:16:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/VirtRegMap.cpp Message-ID: <200410150316.WAA24485@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: VirtRegMap.cpp updated: 1.30 -> 1.31 --- Log message: This patch adds and improves debugging output. No functionality changes. --- Diffs of the changes: (+7 -3) Index: llvm/lib/CodeGen/VirtRegMap.cpp diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.30 llvm/lib/CodeGen/VirtRegMap.cpp:1.31 --- llvm/lib/CodeGen/VirtRegMap.cpp:1.30 Fri Oct 1 18:16:43 2004 +++ llvm/lib/CodeGen/VirtRegMap.cpp Thu Oct 14 22:16:29 2004 @@ -323,11 +323,13 @@ std::map::iterator SSI = SpillSlotsAvailable.find(StackSlot); if (SSI != SpillSlotsAvailable.end()) { + DEBUG(std::cerr << "Reusing SS#" << StackSlot << " from physreg " + << MRI->getName(SSI->second) << " for vreg" + << VirtReg <<" instead of reloading into physreg " + << MRI->getName(VRM.getPhys(VirtReg)) << "\n"); // If this stack slot value is already available, reuse it! PhysReg = SSI->second; MI.SetMachineOperandReg(i, PhysReg); - DEBUG(std::cerr << "Reusing SS#" << StackSlot << " from physreg " - << MRI->getName(SSI->second) << "\n"); // The only technical detail we have is that we don't know that // PhysReg won't be clobbered by a reloaded stack slot that occurs @@ -519,6 +521,7 @@ // If there is a dead store to this stack slot, nuke it now. MachineInstr *&LastStore = MaybeDeadStores[StackSlot]; if (LastStore) { + DEBUG(std::cerr << " Killed store:\t" << *LastStore); ++NumDSE; MBB.erase(LastStore); } @@ -539,7 +542,8 @@ PhysRegsAvailable[PhysReg] = StackSlot; SpillSlotsAvailable[StackSlot] = PhysReg; DEBUG(std::cerr << "Updating SS#" << StackSlot <<" in physreg " - << MRI->getName(PhysReg) << "\n"); + << MRI->getName(PhysReg) << " for virtreg #" + << VirtReg << "\n"); ++NumStores; VirtReg = PhysReg; From lattner at cs.uiuc.edu Thu Oct 14 22:19:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 22:19:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/VirtRegMap.cpp Message-ID: <200410150319.WAA24504@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: VirtRegMap.cpp updated: 1.31 -> 1.32 --- Log message: This patch fixes the nasty bug that caused 175.vpr to fail for X86 last night. The problem occurred when trying to reload this instruction: MOV32mr %reg2326, 8, %reg2297, 4, %reg2295 The value of reg2326 was available in EBX, so it was reused from there, instead of reloading it into EDX. The value of reg2297 was available in EDX, so it was reused from there, instead of reloading it into EDI. The value of reg2295 was not available, so we tried reloading it into EBX, its assigned register. However, we checked and saw that we already reloaded something into EBX, so we chose what reg2326 was assigned to (EDX) and reloaded into that register instead. Unfortunately EDX had already been used by reg2297, so reloading into EDX clobbered the value used by the reg2326 operand, breaking the program. The fix for this is to check that the newly picked register is ok. In this case we now find that EDX is already used and try using EDI, which succeeds. --- Diffs of the changes: (+2 -1) Index: llvm/lib/CodeGen/VirtRegMap.cpp diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.31 llvm/lib/CodeGen/VirtRegMap.cpp:1.32 --- llvm/lib/CodeGen/VirtRegMap.cpp:1.31 Thu Oct 14 22:16:29 2004 +++ llvm/lib/CodeGen/VirtRegMap.cpp Thu Oct 14 22:19:31 2004 @@ -352,6 +352,7 @@ // Otherwise, reload it and remember that we have it. PhysReg = VRM.getPhys(VirtReg); + RecheckRegister: // Note that, if we reused a register for a previous operand, the // register we want to reload into might not actually be // available. If this occurs, use the register indicated by the @@ -361,7 +362,7 @@ if (ReusedOperands[ro].PhysRegReused == PhysReg) { // Yup, use the reload register that we didn't use before. PhysReg = ReusedOperands[ro].AssignedPhysReg; - break; + goto RecheckRegister; } else { ReusedOp &Op = ReusedOperands[ro]; unsigned PRRU = Op.PhysRegReused; From lattner at cs.uiuc.edu Thu Oct 14 23:27:39 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 23:27:39 -0500 Subject: [llvm-commits] CVS: llvm-www/RandomBoxes/013-CompilerDev.html Message-ID: <200410150427.XAA24725@apoc.cs.uiuc.edu> Changes in directory llvm-www/RandomBoxes: 013-CompilerDev.html updated: 1.1 -> 1.2 --- Log message: Fix broken link --- Diffs of the changes: (+1 -1) Index: llvm-www/RandomBoxes/013-CompilerDev.html diff -u llvm-www/RandomBoxes/013-CompilerDev.html:1.1 llvm-www/RandomBoxes/013-CompilerDev.html:1.2 --- llvm-www/RandomBoxes/013-CompilerDev.html:1.1 Fri May 28 14:24:58 2004 +++ llvm-www/RandomBoxes/013-CompilerDev.html Thu Oct 14 23:27:29 2004 @@ -1,5 +1,5 @@ LLVM is a great platform for compiler research. It has a simple and easy to understand representation and a completely modular system for adding passes to the compiler. LLVM also provides extensive assertions -to pinpoint bugs when they occur, an IR verifier, and tools +to pinpoint bugs when they occur, an IR verifier, and tools to automatically identify and narrow down bugs in arbitrary compiler transformations. From lattner at cs.uiuc.edu Thu Oct 14 23:38:49 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 23:38:49 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h MachineInstrBuilder.h Message-ID: <200410150438.XAA04187@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineInstr.h updated: 1.154 -> 1.155 MachineInstrBuilder.h updated: 1.23 -> 1.24 --- Log message: Allow machine operands to represent global variables with offsets. This is useful when you have a reference like: int A[100]; void foo() { A[10] = 1; } In this case, &A[10] is a single constant and should be treated as such. Only MO_GlobalAddress and MO_ExternalSymbol are allowed to use this field, no other operand type is. This is another fine patch contributed by Jeff Cohen!! --- Diffs of the changes: (+44 -21) Index: llvm/include/llvm/CodeGen/MachineInstr.h diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.154 llvm/include/llvm/CodeGen/MachineInstr.h:1.155 --- llvm/include/llvm/CodeGen/MachineInstr.h:1.154 Wed Sep 1 17:55:34 2004 +++ llvm/include/llvm/CodeGen/MachineInstr.h Thu Oct 14 23:38:36 2004 @@ -126,48 +126,60 @@ char flags; // see bit field definitions above MachineOperandType opType:8; // Pack into 8 bits efficiently after flags. - int regNum; // register number for an explicit register + union { + int regNum; // register number for an explicit register // will be set for a value after reg allocation -private: + + int offset; // Offset to address of global or external, only + // valid for MO_GlobalAddress and MO_ExternalSym + } extra; + void zeroContents () { memset (&contents, 0, sizeof (contents)); + memset (&extra, 0, sizeof (extra)); } MachineOperand(int ImmVal = 0, MachineOperandType OpTy = MO_VirtualRegister) - : flags(0), opType(OpTy), regNum(-1) { + : flags(0), opType(OpTy) { zeroContents (); contents.immedVal = ImmVal; + extra.regNum = -1; } MachineOperand(int Reg, MachineOperandType OpTy, UseType UseTy) - : flags(UseTy), opType(OpTy), regNum(Reg) { + : flags(UseTy), opType(OpTy) { zeroContents (); + extra.regNum = Reg; } MachineOperand(Value *V, MachineOperandType OpTy, UseType UseTy, - bool isPCRelative = false) - : flags(UseTy | (isPCRelative?PCRELATIVE:0)), opType(OpTy), regNum(-1) { + bool isPCRelative = false, int Offset = 0) + : flags(UseTy | (isPCRelative?PCRELATIVE:0)), opType(OpTy) { zeroContents (); contents.value = V; + extra.offset = Offset; } MachineOperand(MachineBasicBlock *mbb) - : flags(0), opType(MO_MachineBasicBlock), regNum(-1) { + : flags(0), opType(MO_MachineBasicBlock) { zeroContents (); contents.MBB = mbb; + extra.regNum = -1; } - MachineOperand(const std::string &SymName, bool isPCRelative) - : flags(isPCRelative?PCRELATIVE:0), opType(MO_ExternalSymbol), regNum(-1) { + MachineOperand(const std::string &SymName, bool isPCRelative, int Offset) + : flags(isPCRelative?PCRELATIVE:0), opType(MO_ExternalSymbol) { zeroContents (); contents.SymbolName = new std::string (SymName); + extra.offset = Offset; } public: MachineOperand(const MachineOperand &M) - : flags(M.flags), opType(M.opType), regNum(M.regNum) { + : flags(M.flags), opType(M.opType) { zeroContents (); contents = M.contents; + extra = M.extra; if (isExternalSymbol()) contents.SymbolName = new std::string(M.getSymbolName()); } @@ -184,7 +196,7 @@ contents = MO.contents; flags = MO.flags; opType = MO.opType; - regNum = MO.regNum; + extra = MO.extra; if (isExternalSymbol()) contents.SymbolName = new std::string(MO.getSymbolName()); return *this; @@ -245,7 +257,7 @@ } int getMachineRegNum() const { assert(opType == MO_MachineRegister && "Wrong MachineOperand accessor"); - return regNum; + return extra.regNum; } int getImmedValue() const { assert(isImmediate() && "Wrong MachineOperand accessor"); @@ -271,6 +283,11 @@ assert(isGlobalAddress() && "Wrong MachineOperand accessor"); return (GlobalValue*)contents.value; } + int getOffset() const { + assert((isGlobalAddress() || isExternalSymbol()) && + "Wrong MachineOperand accessor"); + return extra.offset; + } const std::string &getSymbolName() const { assert(isExternalSymbol() && "Wrong MachineOperand accessor"); return *contents.SymbolName; @@ -292,7 +309,7 @@ /// allocated to this operand. /// bool hasAllocatedReg() const { - return (regNum >= 0 && + return (extra.regNum >= 0 && (opType == MO_VirtualRegister || opType == MO_CCRegister || opType == MO_MachineRegister)); } @@ -302,7 +319,7 @@ /// unsigned getReg() const { assert(hasAllocatedReg()); - return regNum; + return extra.regNum; } /// MachineOperand mutators... @@ -311,7 +328,7 @@ // This method's comment used to say: 'TODO: get rid of this duplicate // code.' It's not clear where the duplication is. assert(hasAllocatedReg() && "This operand cannot have a register number!"); - regNum = Reg; + extra.regNum = Reg; } void setValueReg(Value *val) { @@ -324,6 +341,12 @@ contents.immedVal = immVal; } + void setOffset(int Offset) { + assert((isGlobalAddress() || isExternalSymbol()) && + "Wrong MachineOperand accessor"); + extra.offset = Offset; + } + friend std::ostream& operator<<(std::ostream& os, const MachineOperand& mop); /// markHi32, markLo32, etc. - These methods are deprecated and only used by @@ -342,7 +365,7 @@ void setRegForValue(int reg) { assert(opType == MO_VirtualRegister || opType == MO_CCRegister || opType == MO_MachineRegister); - regNum = reg; + extra.regNum = reg; } friend class MachineInstr; @@ -615,18 +638,18 @@ operands.push_back(MachineOperand(I, MachineOperand::MO_ConstantPoolIndex)); } - void addGlobalAddressOperand(GlobalValue *GV, bool isPCRelative) { + void addGlobalAddressOperand(GlobalValue *GV, bool isPCRelative, int Offset) { assert(!OperandsComplete() && "Trying to add an operand to a machine instr that is already done!"); operands.push_back( MachineOperand((Value*)GV, MachineOperand::MO_GlobalAddress, - MachineOperand::Use, isPCRelative)); + MachineOperand::Use, isPCRelative, Offset)); } /// addExternalSymbolOperand - Add an external symbol operand to this instr /// void addExternalSymbolOperand(const std::string &SymName, bool isPCRelative) { - operands.push_back(MachineOperand(SymName, isPCRelative)); + operands.push_back(MachineOperand(SymName, isPCRelative, 0)); } //===--------------------------------------------------------------------===// Index: llvm/include/llvm/CodeGen/MachineInstrBuilder.h diff -u llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.23 llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.24 --- llvm/include/llvm/CodeGen/MachineInstrBuilder.h:1.23 Thu Oct 14 13:47:56 2004 +++ llvm/include/llvm/CodeGen/MachineInstrBuilder.h Thu Oct 14 23:38:36 2004 @@ -124,8 +124,8 @@ } const MachineInstrBuilder &addGlobalAddress(GlobalValue *GV, - bool isPCRelative = false) const { - MI->addGlobalAddressOperand(GV, isPCRelative); + bool isPCRelative = false, int Offset = 0) const { + MI->addGlobalAddressOperand(GV, isPCRelative, Offset); return *this; } From lattner at cs.uiuc.edu Thu Oct 14 23:38:52 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 23:38:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineInstr.cpp Message-ID: <200410150438.XAA04198@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineInstr.cpp updated: 1.105 -> 1.106 --- Log message: Allow machine operands to represent global variables with offsets. This is useful when you have a reference like: int A[100]; void foo() { A[10] = 1; } In this case, &A[10] is a single constant and should be treated as such. Only MO_GlobalAddress and MO_ExternalSymbol are allowed to use this field, no other operand type is. This is another fine patch contributed by Jeff Cohen!! --- Diffs of the changes: (+9 -5) Index: llvm/lib/CodeGen/MachineInstr.cpp diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.105 llvm/lib/CodeGen/MachineInstr.cpp:1.106 --- llvm/lib/CodeGen/MachineInstr.cpp:1.105 Wed Sep 1 17:55:35 2004 +++ llvm/lib/CodeGen/MachineInstr.cpp Thu Oct 14 23:38:41 2004 @@ -127,7 +127,7 @@ assert(i < operands.size()); // may be explicit or implicit op operands[i].opType = opTy; operands[i].contents.value = V; - operands[i].regNum = -1; + operands[i].extra.regNum = -1; } void @@ -141,7 +141,7 @@ operands[i].opType = opTy; operands[i].contents.value = NULL; operands[i].contents.immedVal = intValue; - operands[i].regNum = -1; + operands[i].extra.regNum = -1; operands[i].flags = 0; } @@ -150,7 +150,7 @@ operands[i].opType = MachineOperand::MO_MachineRegister; operands[i].contents.value = NULL; - operands[i].regNum = regNum; + operands[i].extra.regNum = regNum; } // Used only by the SPARC back-end. @@ -302,10 +302,14 @@ OS << ""; break; case MachineOperand::MO_GlobalAddress: - OS << "getName() << ">"; + OS << "getName(); + if (MO.getOffset()) OS << "+" << MO.getOffset(); + OS << ">"; break; case MachineOperand::MO_ExternalSymbol: - OS << ""; + OS << ""; break; default: assert(0 && "Unrecognized operand type"); From lattner at cs.uiuc.edu Thu Oct 14 23:43:31 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 23:43:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrBuilder.h Message-ID: <200410150443.XAA07613@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrBuilder.h updated: 1.12 -> 1.13 --- Log message: Allow X86 addressing modes to represent globals with offsets. Patch contributed by Jeff Cohen! --- Diffs of the changes: (+10 -5) Index: llvm/lib/Target/X86/X86InstrBuilder.h diff -u llvm/lib/Target/X86/X86InstrBuilder.h:1.12 llvm/lib/Target/X86/X86InstrBuilder.h:1.13 --- llvm/lib/Target/X86/X86InstrBuilder.h:1.12 Sun Aug 29 19:13:26 2004 +++ llvm/lib/Target/X86/X86InstrBuilder.h Thu Oct 14 23:43:20 2004 @@ -30,13 +30,13 @@ /// X86AddressMode - This struct holds a generalized full x86 address mode. /// The base register can be a frame index, which will eventually be replaced -/// with BP or SP and Disp being offsetted accordingly. -/// FIXME: add support for globals as a new base type. +/// with BP or SP and Disp being offsetted accordingly. The displacement may +/// also include the offset of a global value. struct X86AddressMode { enum { UnknownBase, RegBase, - FrameIndexBase + FrameIndexBase, } BaseType; union { @@ -47,8 +47,9 @@ unsigned Scale; unsigned IndexReg; unsigned Disp; + GlobalValue *GV; - X86AddressMode() : BaseType(UnknownBase) {} + X86AddressMode() : BaseType(UnknownBase), GV(NULL) {} }; /// addDirectMem - This function is used to add a direct memory reference to the @@ -82,7 +83,11 @@ MIB.addFrameIndex(AM.Base.FrameIndex); else assert (0); - return MIB.addZImm(AM.Scale).addReg(AM.IndexReg).addSImm(AM.Disp); + MIB.addZImm(AM.Scale).addReg(AM.IndexReg); + if (AM.GV) + return MIB.addGlobalAddress(AM.GV, false, AM.Disp); + else + return MIB.addSImm(AM.Disp); } /// addFrameReference - This function is used to add a reference to the base of From lattner at cs.uiuc.edu Thu Oct 14 23:45:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 23:45:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.cpp Message-ID: <200410150445.XAA07964@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86AsmPrinter.cpp updated: 1.124 -> 1.125 --- Log message: Give the X86 asm printer the ability to print out addressing modes that have constant displacements from global variables. Patch by Jeff Cohen! --- Diffs of the changes: (+53 -25) Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.124 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.125 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.124 Mon Oct 4 02:31:08 2004 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Thu Oct 14 23:44:53 2004 @@ -61,7 +61,8 @@ if (MI->getOperand(Op).isConstantPoolIndex()) return true; return Op+4 <= MI->getNumOperands() && MI->getOperand(Op ).isRegister() && isScale(MI->getOperand(Op+1)) && - MI->getOperand(Op+2).isRegister() && MI->getOperand(Op+3).isImmediate(); + MI->getOperand(Op+2).isRegister() && (MI->getOperand(Op+3).isImmediate() || + MI->getOperand(Op+3).isGlobalAddress()); } // SwitchSection - Switch to the specified section of the executable if we are @@ -289,11 +290,17 @@ std::cerr << "Shouldn't use addPCDisp() when building X86 MachineInstrs"; abort (); return; - case MachineOperand::MO_GlobalAddress: + case MachineOperand::MO_GlobalAddress: { if (!elideOffsetKeyword) O << "OFFSET "; O << Mang->getValueName(MO.getGlobal()); + int Offset = MO.getOffset(); + if (Offset > 0) + O << " + " << Offset; + else if (Offset < 0) + O << " - " << -Offset; return; + } case MachineOperand::MO_ExternalSymbol: O << MO.getSymbolName(); return; @@ -323,12 +330,12 @@ const MachineOperand &BaseReg = MI->getOperand(Op); int ScaleVal = MI->getOperand(Op+1).getImmedValue(); const MachineOperand &IndexReg = MI->getOperand(Op+2); - int DispVal = MI->getOperand(Op+3).getImmedValue(); + const MachineOperand &DispSpec = MI->getOperand(Op+3); O << "["; bool NeedPlus = false; if (BaseReg.getReg()) { - printOp(BaseReg); + printOp(BaseReg, true); NeedPlus = true; } @@ -340,15 +347,22 @@ NeedPlus = true; } - if (DispVal) { + if (DispSpec.isGlobalAddress()) { if (NeedPlus) - if (DispVal > 0) - O << " + "; - else { - O << " - "; - DispVal = -DispVal; - } - O << DispVal; + O << " + "; + printOp(DispSpec, true); + } else { + int DispVal = DispSpec.getImmedValue(); + if (DispVal) { + if (NeedPlus) + if (DispVal > 0) + O << " + "; + else { + O << " - "; + DispVal = -DispVal; + } + O << DispVal; + } } O << "]"; } @@ -484,10 +498,16 @@ std::cerr << "Shouldn't use addPCDisp() when building X86 MachineInstrs"; abort (); return; - case MachineOperand::MO_GlobalAddress: + case MachineOperand::MO_GlobalAddress: { if (!isCallOp) O << '$'; O << Mang->getValueName(MO.getGlobal()); + int Offset = MO.getOffset(); + if (Offset > 0) + O << "+" << Offset; + else if (Offset < 0) + O << Offset; return; + } case MachineOperand::MO_ExternalSymbol: if (!isCallOp) O << '$'; O << MO.getSymbolName(); @@ -517,22 +537,30 @@ const MachineOperand &BaseReg = MI->getOperand(Op); int ScaleVal = MI->getOperand(Op+1).getImmedValue(); const MachineOperand &IndexReg = MI->getOperand(Op+2); - int DispVal = MI->getOperand(Op+3).getImmedValue(); + const MachineOperand &DispSpec = MI->getOperand(Op+3); + + if (DispSpec.isGlobalAddress()) { + printOp(DispSpec, true); + } else { + int DispVal = DispSpec.getImmedValue(); + if (DispVal) + O << DispVal; + } - if (DispVal) O << DispVal; + if (IndexReg.getReg() || BaseReg.getReg()) { + O << "("; + if (BaseReg.getReg()) + printOp(BaseReg); - O << "("; - if (BaseReg.getReg()) - printOp(BaseReg); + if (IndexReg.getReg()) { + O << ","; + printOp(IndexReg); + if (ScaleVal != 1) + O << "," << ScaleVal; + } - if (IndexReg.getReg()) { - O << ","; - printOp(IndexReg); - if (ScaleVal != 1) - O << "," << ScaleVal; + O << ")"; } - - O << ")"; } From lattner at cs.uiuc.edu Thu Oct 14 23:53:24 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 14 Oct 2004 23:53:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp Message-ID: <200410150453.XAA08296@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.65 -> 1.66 --- Log message: Give the X86 JIT the ability to encode global+disp constants. Patch contributed by Jeff Cohen! --- Diffs of the changes: (+54 -27) Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.65 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.66 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.65 Sun Sep 12 16:26:04 2004 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Thu Oct 14 23:53:13 2004 @@ -193,7 +193,7 @@ void emitPCRelativeBlockAddress(const MachineBasicBlock *BB); void emitMaybePCRelativeValue(unsigned Address, bool isPCRelative); void emitGlobalAddressForCall(GlobalValue *GV); - void emitGlobalAddressForPtr(GlobalValue *GV); + void emitGlobalAddressForPtr(GlobalValue *GV, int Disp = 0); void emitRegModRMByte(unsigned ModRMReg, unsigned RegOpcodeField); void emitSIBByte(unsigned SS, unsigned Index, unsigned Base); @@ -294,7 +294,7 @@ /// this is part of a "take the address of a global" instruction, which is not /// PC relative. /// -void Emitter::emitGlobalAddressForPtr(GlobalValue *GV) { +void Emitter::emitGlobalAddressForPtr(GlobalValue *GV, int Disp /* = 0 */) { // Get the address from the backend... unsigned Address = MCE.getGlobalValueAddress(GV); @@ -306,7 +306,7 @@ Address = getResolver(MCE).getLazyResolver((Function*)GV); } - emitMaybePCRelativeValue(Address, false); + emitMaybePCRelativeValue(Address + Disp, false); } @@ -374,14 +374,25 @@ void Emitter::emitMemModRMByte(const MachineInstr &MI, unsigned Op, unsigned RegOpcodeField) { - const MachineOperand &Disp = MI.getOperand(Op+3); + const MachineOperand &Op3 = MI.getOperand(Op+3); + GlobalValue *GV = 0; + int DispVal = 0; + + if (Op3.isGlobalAddress()) { + GV = Op3.getGlobal(); + DispVal = Op3.getOffset(); + } else { + DispVal = Op3.getImmedValue(); + } + if (MI.getOperand(Op).isConstantPoolIndex()) { // Emit a direct address reference [disp32] where the displacement of the // constant pool entry is controlled by the MCE. + assert(!GV && "Constant Pool reference cannot be relative to global!"); MCE.emitByte(ModRMByte(0, RegOpcodeField, 5)); unsigned Index = MI.getOperand(Op).getConstantPoolIndex(); unsigned Address = MCE.getConstantPoolEntryAddress(Index); - MCE.emitWord(Address+Disp.getImmedValue()); + MCE.emitWord(Address+DispVal); return; } @@ -394,20 +405,27 @@ if (BaseReg.getReg() == 0) { // Just a displacement? // Emit special case [disp32] encoding MCE.emitByte(ModRMByte(0, RegOpcodeField, 5)); - emitConstant(Disp.getImmedValue(), 4); + if (GV) + emitGlobalAddressForPtr(GV, DispVal); + else + emitConstant(DispVal, 4); } else { unsigned BaseRegNo = getX86RegNum(BaseReg.getReg()); - if (Disp.getImmedValue() == 0 && BaseRegNo != N86::EBP) { + if (GV) { + // Emit the most general non-SIB encoding: [REG+disp32] + MCE.emitByte(ModRMByte(2, RegOpcodeField, BaseRegNo)); + emitGlobalAddressForPtr(GV, DispVal); + } else if (DispVal == 0 && BaseRegNo != N86::EBP) { // Emit simple indirect register encoding... [EAX] f.e. MCE.emitByte(ModRMByte(0, RegOpcodeField, BaseRegNo)); - } else if (isDisp8(Disp.getImmedValue())) { + } else if (isDisp8(DispVal)) { // Emit the disp8 encoding... [REG+disp8] MCE.emitByte(ModRMByte(1, RegOpcodeField, BaseRegNo)); - emitConstant(Disp.getImmedValue(), 1); + emitConstant(DispVal, 1); } else { // Emit the most general non-SIB encoding: [REG+disp32] MCE.emitByte(ModRMByte(2, RegOpcodeField, BaseRegNo)); - emitConstant(Disp.getImmedValue(), 4); + emitConstant(DispVal, 4); } } @@ -421,10 +439,14 @@ // MOD=0, BASE=5, to JUST get the index, scale, and displacement. MCE.emitByte(ModRMByte(0, RegOpcodeField, 4)); ForceDisp32 = true; - } else if (Disp.getImmedValue() == 0 && BaseReg.getReg() != X86::EBP) { + } else if (GV) { + // Emit the normal disp32 encoding... + MCE.emitByte(ModRMByte(2, RegOpcodeField, 4)); + ForceDisp32 = true; + } else if (DispVal == 0 && BaseReg.getReg() != X86::EBP) { // Emit no displacement ModR/M byte MCE.emitByte(ModRMByte(0, RegOpcodeField, 4)); - } else if (isDisp8(Disp.getImmedValue())) { + } else if (isDisp8(DispVal)) { // Emit the disp8 encoding... MCE.emitByte(ModRMByte(1, RegOpcodeField, 4)); ForceDisp8 = true; // Make sure to force 8 bit disp if Base=EBP @@ -446,18 +468,20 @@ unsigned BaseRegNo = getX86RegNum(BaseReg.getReg()); unsigned IndexRegNo; if (IndexReg.getReg()) - IndexRegNo = getX86RegNum(IndexReg.getReg()); + IndexRegNo = getX86RegNum(IndexReg.getReg()); else - IndexRegNo = 4; // For example [ESP+1*+4] + IndexRegNo = 4; // For example [ESP+1*+4] emitSIBByte(SS, IndexRegNo, BaseRegNo); } // Do we need to output a displacement? - if (Disp.getImmedValue() != 0 || ForceDisp32 || ForceDisp8) { - if (!ForceDisp32 && isDisp8(Disp.getImmedValue())) - emitConstant(Disp.getImmedValue(), 1); + if (DispVal != 0 || ForceDisp32 || ForceDisp8) { + if (!ForceDisp32 && isDisp8(DispVal)) + emitConstant(DispVal, 1); + else if (GV) + emitGlobalAddressForPtr(GV, DispVal); else - emitConstant(Disp.getImmedValue(), 4); + emitConstant(DispVal, 4); } } } @@ -492,8 +516,8 @@ case X86II::D8: case X86II::D9: case X86II::DA: case X86II::DB: case X86II::DC: case X86II::DD: case X86II::DE: case X86II::DF: MCE.emitByte(0xD8+ - (((Desc.TSFlags & X86II::Op0Mask)-X86II::D8) - >> X86II::Op0Shift)); + (((Desc.TSFlags & X86II::Op0Mask)-X86II::D8) + >> X86II::Op0Shift)); break; // Two-byte opcode prefix default: assert(0 && "Invalid prefix!"); case 0: break; // No prefix! @@ -525,7 +549,7 @@ } else if (MO.isImmediate()) { emitConstant(MO.getImmedValue(), sizeOfImm(Desc)); } else { - assert(0 && "Unknown RawFrm operand!"); + assert(0 && "Unknown RawFrm operand!"); } } break; @@ -535,15 +559,17 @@ if (MI.getNumOperands() == 2) { const MachineOperand &MO1 = MI.getOperand(1); if (Value *V = MO1.getVRegValueOrNull()) { - assert(sizeOfImm(Desc) == 4 && "Don't know how to emit non-pointer values!"); + assert(sizeOfImm(Desc) == 4 && + "Don't know how to emit non-pointer values!"); emitGlobalAddressForPtr(cast(V)); } else if (MO1.isGlobalAddress()) { - assert(sizeOfImm(Desc) == 4 && "Don't know how to emit non-pointer values!"); + assert(sizeOfImm(Desc) == 4 && + "Don't know how to emit non-pointer values!"); assert(!MO1.isPCRelative() && "Function pointer ref is PC relative?"); - emitGlobalAddressForPtr(MO1.getGlobal()); + emitGlobalAddressForPtr(MO1.getGlobal(), MO1.getOffset()); } else if (MO1.isExternalSymbol()) { - assert(sizeOfImm(Desc) == 4 && "Don't know how to emit non-pointer values!"); - + assert(sizeOfImm(Desc) == 4 && + "Don't know how to emit non-pointer values!"); unsigned Address = MCE.getGlobalValueAddress(MO1.getSymbolName()); assert(Address && "Unknown external symbol!"); emitMaybePCRelativeValue(Address, MO1.isPCRelative()); @@ -608,7 +634,8 @@ if (MI.getOperand(4).isImmediate()) emitConstant(MI.getOperand(4).getImmedValue(), sizeOfImm(Desc)); else if (MI.getOperand(4).isGlobalAddress()) - emitGlobalAddressForPtr(MI.getOperand(4).getGlobal()); + emitGlobalAddressForPtr(MI.getOperand(4).getGlobal(), + MI.getOperand(4).getOffset()); else assert(0 && "Unknown operand!"); } From gaeke at cs.uiuc.edu Fri Oct 15 00:03:14 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 00:03:14 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/include/reopt/UnpackTraceFunction.h Message-ID: <200410150503.AAA01646@seraph.cs.uiuc.edu> Changes in directory reopt/include/reopt: UnpackTraceFunction.h updated: 1.19 -> 1.20 --- Log message: Whoops, I meant to declare SpilledArgMap and its type in UnpackTraceFunction.h. --- Diffs of the changes: (+4 -0) Index: reopt/include/reopt/UnpackTraceFunction.h diff -u reopt/include/reopt/UnpackTraceFunction.h:1.19 reopt/include/reopt/UnpackTraceFunction.h:1.20 --- reopt/include/reopt/UnpackTraceFunction.h:1.19 Thu Oct 14 16:44:12 2004 +++ reopt/include/reopt/UnpackTraceFunction.h Fri Oct 15 00:03:04 2004 @@ -69,8 +69,12 @@ bool rewriteEpilogInstr (MachineBasicBlock &MBB, MachineBasicBlock::iterator iter); void rewriteEpilog (MachineBasicBlock &MBB); + + typedef std::map SpilledArgMapTy; + SpilledArgMapTy SpilledArgMap; void placeSpilledArgs (); int fixupSpilledArgPlacement (int offset); + void postprocessMachineInstrsForTrace (MachineBasicBlock &MBB, MachineBasicBlock::iterator Start); bool runOnMachineBasicBlock (MachineBasicBlock &MBB); From gaeke at cs.uiuc.edu Fri Oct 15 00:03:15 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 00:03:15 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Message-ID: <200410150503.AAA01650@seraph.cs.uiuc.edu> Changes in directory reopt/lib/LightWtProfiling: UnpackTraceFunction.cpp updated: 1.113 -> 1.114 --- Log message: Whoops, I meant to declare SpilledArgMap and its type in UnpackTraceFunction.h. --- Diffs of the changes: (+0 -3) Index: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp diff -u reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.113 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.114 --- reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.113 Thu Oct 14 16:44:13 2004 +++ reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Fri Oct 15 00:03:04 2004 @@ -624,9 +624,6 @@ BuildMI (&MBB, V9::NOP, 0); } -typedef std::map SpilledArgMapTy; -SpilledArgMapTy SpilledArgMap; - void UnpackTraceFunction::placeSpilledArgs () { SpilledArgMap.clear (); // FIXME - implement From lattner at cs.uiuc.edu Fri Oct 15 00:05:40 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 15 Oct 2004 00:05:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelSimple.cpp Message-ID: <200410150505.AAA08541@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelSimple.cpp updated: 1.286 -> 1.287 --- Log message: Instruction select globals with offsets better. For example, on this test case: int C[100]; int foo() { return C[4]; } We now codegen: foo: mov %EAX, DWORD PTR [C + 16] ret instead of: foo: mov %EAX, OFFSET C mov %EAX, DWORD PTR [%EAX + 16] ret Other impressive features may be coming later. This patch is contributed by Jeff Cohen! --- Diffs of the changes: (+17 -7) Index: llvm/lib/Target/X86/X86ISelSimple.cpp diff -u llvm/lib/Target/X86/X86ISelSimple.cpp:1.286 llvm/lib/Target/X86/X86ISelSimple.cpp:1.287 --- llvm/lib/Target/X86/X86ISelSimple.cpp:1.286 Fri Oct 8 17:24:31 2004 +++ llvm/lib/Target/X86/X86ISelSimple.cpp Fri Oct 15 00:05:29 2004 @@ -826,6 +826,9 @@ AM.BaseType = X86AddressMode::FrameIndexBase; AM.Base.FrameIndex = getFixedSizedAllocaFI(AI); return; + } else if (GlobalValue *GV = dyn_cast(Addr)) { + AM.GV = GV; + return; } // If it's not foldable, reset addr mode. @@ -3108,7 +3111,7 @@ addFullAddress(BuildMI(BB, Opcode, 5), AM).addImm(Val); } } else if (isa(I.getOperand(0))) { - addFullAddress(BuildMI(BB, X86::MOV32mi, 5), AM).addImm(0); + addFullAddress(BuildMI(BB, X86::MOV32mi, 5), AM).addImm(0); } else if (ConstantBool *CB = dyn_cast(I.getOperand(0))) { addFullAddress(BuildMI(BB, X86::MOV8mi, 5), AM).addImm(CB->getValue()); } else if (ConstantFP *CFP = dyn_cast(I.getOperand(0))) { @@ -3139,6 +3142,11 @@ AM.Disp += 4; addFullAddress(BuildMI(BB, X86::MOV32mr, 5), AM).addReg(ValReg+1); } else { + // FIXME: stop emitting these two instructions: + // movl $global,%eax + // movl %eax,(%ebx) + // when one instruction will suffice. That includes when the global + // has an offset applied to it. unsigned ValReg = getReg(I.getOperand(0)); static const unsigned Opcodes[] = { X86::MOV8mr, X86::MOV16mr, X86::MOV32mr, X86::FST32m @@ -3663,12 +3671,11 @@ return; } -#if 0 // FIXME: TODO! - if (GlobalValue *GV = dyn_cast(V)) { - // FIXME: When addressing modes are more powerful/correct, we could load - // global addresses directly as 32-bit immediates. + if (GlobalValue *GV = dyn_cast(GEPOps.back())) { + AM.GV = GV; + GEPOps.pop_back(); + return; } -#endif AM.Base.Reg = MBB ? getReg(GEPOps[0], MBB, IP) : 1; GEPOps.pop_back(); // Consume the last GEP operand @@ -3744,8 +3751,11 @@ } if (AM.BaseType == X86AddressMode::RegBase && - AM.IndexReg == 0 && AM.Disp == 0) + AM.IndexReg == 0 && AM.Disp == 0 && !AM.GV) BuildMI(*MBB, IP, X86::MOV32rr, 1, TargetReg).addReg(AM.Base.Reg); + else if (AM.BaseType == X86AddressMode::RegBase && AM.Base.Reg == 0 && + AM.IndexReg == 0 && AM.Disp == 0) + BuildMI(*MBB, IP, X86::MOV32ri, 1, TargetReg).addGlobalAddress(AM.GV); else addFullAddress(BuildMI(*MBB, IP, X86::LEA32r, 5, TargetReg), AM); --IP; From gaeke at cs.uiuc.edu Fri Oct 15 00:26:10 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 00:26:10 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Message-ID: <200410150526.AAA01710@seraph.cs.uiuc.edu> Changes in directory reopt/lib/LightWtProfiling: UnpackTraceFunction.cpp updated: 1.114 -> 1.115 --- Log message: Since I seem to be too woozy to write code tonight, here's a description in English of how placeSpilledArgs ought to work. --- Diffs of the changes: (+22 -0) Index: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp diff -u reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.114 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.115 --- reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.114 Fri Oct 15 00:03:04 2004 +++ reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp Fri Oct 15 00:25:59 2004 @@ -624,8 +624,30 @@ BuildMI (&MBB, V9::NOP, 0); } +/// placeSpilledArgs - Relocate excess TraceFn args, which were +/// probably allocated to excess-incoming-arg stack slots, which are +/// supposed to be allocated by the caller. Since we don't have a typical +/// caller's stack frame, we need to relocate the excess args into our own +/// stack frame. void UnpackTraceFunction::placeSpilledArgs () { SpilledArgMap.clear (); + for (unsigned a = 6, s = TF->TraceFn->asize(); a < s; ++a) { + // Get old position for argument #a using GetValueAllocState. If it + // is not spilled in the TraceFn to an offset which is > 2047, then + // it isn't in an invalid region of the stack frame, and we don't + // have to relocate it. + + // Find a new position for argument #a by using a similar formula to + // that of stackOffsetForReg(). For the formula's purposes, we can + // treat excess args as being "registers" numbered starting with + // SparcV9::fsr + 1. + + // Use the new position (which is relative to sp) to calculate an + // offset from fp instead, by subtracting the TotalStackSize. The + // result should be > 0 and < 2047. + + // Put the pair into the SpilledArgMap. + } // FIXME - implement } From criswell at cs.uiuc.edu Fri Oct 15 08:33:38 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri, 15 Oct 2004 08:33:38 -0500 Subject: [llvm-commits] CVS: llvm-test/External/Namd/ Message-ID: <200410151333.IAA08752@choi.cs.uiuc.edu> Changes in directory llvm-test/External/Namd: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm-test/External/Namd added to the repository --- Diffs of the changes: (+0 -0) From criswell at cs.uiuc.edu Fri Oct 15 08:35:05 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri, 15 Oct 2004 08:35:05 -0500 Subject: [llvm-commits] CVS: llvm-test/External/Namd/Makefile Message-ID: <200410151335.IAA08773@choi.cs.uiuc.edu> Changes in directory llvm-test/External/Namd: Makefile added (r1.1) --- Log message: Makefile for the external benchmark namd. This currently runs five (5) iterations because the program fails to generate correct output after five iterations. --- Diffs of the changes: (+15 -0) Index: llvm-test/External/Namd/Makefile diff -c /dev/null llvm-test/External/Namd/Makefile:1.1 *** /dev/null Fri Oct 15 08:35:00 2004 --- llvm-test/External/Namd/Makefile Fri Oct 15 08:34:50 2004 *************** *** 0 **** --- 1,15 ---- + LEVEL = ../.. + + include $(LEVEL)/Makefile.config + + NAMD_ROOT := /home/vadve/shared/benchmarks/spec_namd + PROG = spec_namd + SourceDir := $(NAMD_ROOT) + + CFLAGS += -Wno-deprecated + CPPFLAGS += -Wno-deprecated + LIBS += -lm -lstdc++ + LDFLAGS = -lm -lstdc++ + + RUN_OPTIONS = --iterations 5 --input $(NAMD_ROOT)/apoa1.input + include $(LEVEL)/MultiSource/Makefile.multisrc From criswell at cs.uiuc.edu Fri Oct 15 08:37:26 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri, 15 Oct 2004 08:37:26 -0500 Subject: [llvm-commits] CVS: llvm-test/configure Message-ID: <200410151337.IAA22845@choi.cs.uiuc.edu> Changes in directory llvm-test: configure updated: 1.10 -> 1.11 --- Log message: Added namd as an external test. --- Diffs of the changes: (+209 -135) Index: llvm-test/configure diff -u llvm-test/configure:1.10 llvm-test/configure:1.11 --- llvm-test/configure:1.10 Thu Oct 7 19:25:31 2004 +++ llvm-test/configure Fri Oct 15 08:37:14 2004 @@ -465,7 +465,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_SRC LLVM_OBJ CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PYTHON SPEC95_ROOT USE_SPEC95 SPEC2000_ROOT USE_SPEC2000 POVRAY_ROOT USE_POVRAY F2C F2C_INC F2C_LIB USE_F2C DISABLE_LLC_DIFFS 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_SRC LLVM_OBJ CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PYTHON SPEC95_ROOT USE_SPEC95 SPEC2000_ROOT USE_SPEC2000 POVRAY_ROOT USE_POVRAY NAMD_ROOT USE_NAMD F2C F2C_INC F2C_LIB USE_F2C DISABLE_LLC_DIFFS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1032,6 +1032,7 @@ --enable-spec95=ARG Use spec95 as a benchmark (srcs in DIR) --enable-spec2000=ARG Use spec2000 as a benchmark (srcs in DIR) --enable-povray=ARG Use povray as a benchmark (srcs in DIR) + --enable-namd=ARG Use namd as a benchmark (srcs in DIR) --enable-llc_diffs Enable LLC Diffs when testing (default is YES) Optional Packages: @@ -3966,7 +3967,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 3969 "configure"' > conftest.$ac_ext + echo '#line 3970 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4069,13 +4070,6 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -int -main () -{ - - ; - return 0; -} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 @@ -4847,7 +4841,7 @@ # Provide some information about the compiler. -echo "$as_me:4850:" \ +echo "$as_me:4844:" \ "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 @@ -5622,13 +5616,13 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib;$old_postinstall_cmds" + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) - old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds" + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac - old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` @@ -5904,11 +5898,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5907: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5901: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:5911: \$? = $ac_status" >&5 + echo "$as_me:5905: \$? = $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 @@ -6147,11 +6141,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6150: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6144: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6154: \$? = $ac_status" >&5 + echo "$as_me:6148: \$? = $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 @@ -6207,11 +6201,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6210: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6204: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6214: \$? = $ac_status" >&5 + echo "$as_me:6208: \$? = $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 @@ -6335,7 +6329,7 @@ ;; amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes @@ -6377,7 +6371,8 @@ else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi @@ -6434,7 +6429,9 @@ *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then - archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver;cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver; $echo "local: *; };" >> $output_objdir/$libname.ver; + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds="$tmp_archive_cmds" @@ -6471,7 +6468,7 @@ aix3*) allow_undefined_flag=unsupported always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE;$AR $AR_FLAGS $lib $output_objdir/$soname' + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes @@ -6695,13 +6692,13 @@ whole_archive_flag_spec=' ' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag};$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section @@ -6724,7 +6721,7 @@ # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll;linknames=' + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. @@ -6764,8 +6761,8 @@ archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -6773,8 +6770,8 @@ archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no @@ -6822,9 +6819,9 @@ hpux9*) if test "$GCC" = yes; then - archive_cmds='$rm $output_objdir/$soname;$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - archive_cmds='$rm $output_objdir/$soname;$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: @@ -6945,7 +6942,7 @@ hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def;$echo DATA >> $output_objdir/$libname.def;$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def;$echo EXPORTS >> $output_objdir/$libname.def;emxexp $libobjs >> $output_objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; @@ -6969,7 +6966,9 @@ else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp; $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib;$rm $lib.exp' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi @@ -6988,10 +6987,12 @@ no_undefined_flag=' -z text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags;$rm $lib.exp' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no @@ -7080,7 +7081,8 @@ # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' @@ -7295,13 +7297,13 @@ yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`; - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`; - dldir=$destdir/`dirname \$dlpath`; - test -d \$dldir || mkdir -p \$dldir; + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`; - dlpath=$dir/\$dldll; + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes @@ -8384,7 +8386,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_CXX=no fi @@ -9692,16 +9695,16 @@ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else - archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs;$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs;$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -9709,8 +9712,8 @@ archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no @@ -9765,7 +9768,7 @@ ld_shlibs_CXX=no ;; aCC) - archive_cmds_CXX='$rm $output_objdir/$soname;$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -9778,7 +9781,7 @@ ;; *) if test "$GXX" = yes; then - archive_cmds_CXX='$rm $output_objdir/$soname;$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -10094,7 +10097,10 @@ cxx) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp;$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib;$rm $lib.exp' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: @@ -10170,7 +10176,8 @@ # Sun C++ 4.2, 5.x and Centerline C++ no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no @@ -10215,7 +10222,9 @@ no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. @@ -10224,8 +10233,8 @@ # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -10668,11 +10677,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10671: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10680: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10675: \$? = $ac_status" >&5 + echo "$as_me:10684: \$? = $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 @@ -10728,11 +10737,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10731: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10740: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10735: \$? = $ac_status" >&5 + echo "$as_me:10744: \$? = $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 @@ -11000,13 +11009,13 @@ yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`; - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`; - dldir=$destdir/`dirname \$dlpath`; - test -d \$dldir || mkdir -p \$dldir; + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`; - dlpath=$dir/\$dldll; + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes @@ -12089,7 +12098,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13036: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13031: \$? = $ac_status" >&5 + echo "$as_me:13040: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13084,11 +13093,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13087: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13096: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13091: \$? = $ac_status" >&5 + echo "$as_me:13100: \$? = $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 @@ -13212,7 +13221,7 @@ ;; amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes @@ -13254,7 +13263,8 @@ else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi @@ -13311,7 +13321,9 @@ *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver;cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver; $echo "local: *; };" >> $output_objdir/$libname.ver; + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_F77="$tmp_archive_cmds" @@ -13348,7 +13360,7 @@ aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes - archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE;$AR $AR_FLAGS $lib $output_objdir/$soname' + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes @@ -13552,13 +13564,13 @@ whole_archive_flag_spec_F77=' ' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag};$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section @@ -13581,7 +13593,7 @@ # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll;linknames=' + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. @@ -13621,8 +13633,8 @@ archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -13630,8 +13642,8 @@ archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no @@ -13679,9 +13691,9 @@ hpux9*) if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname;$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - archive_cmds_F77='$rm $output_objdir/$soname;$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: @@ -13802,7 +13814,7 @@ hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported - archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def;$echo DATA >> $output_objdir/$libname.def;$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def;$echo EXPORTS >> $output_objdir/$libname.def;emxexp $libobjs >> $output_objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; @@ -13826,7 +13838,9 @@ else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp; $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib;$rm $lib.exp' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi @@ -13845,10 +13859,12 @@ no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no @@ -13937,7 +13953,8 @@ # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_F77= hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' @@ -14152,13 +14169,13 @@ yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`; - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`; - dldir=$destdir/`dirname \$dlpath`; - test -d \$dldir || mkdir -p \$dldir; + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`; - dlpath=$dir/\$dldll; + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes @@ -15115,11 +15132,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15118: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15135: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15122: \$? = $ac_status" >&5 + echo "$as_me:15139: \$? = $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 @@ -15358,11 +15375,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15361: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15378: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15365: \$? = $ac_status" >&5 + echo "$as_me:15382: \$? = $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 @@ -15418,11 +15435,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15421: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15438: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15425: \$? = $ac_status" >&5 + echo "$as_me:15442: \$? = $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 @@ -15546,7 +15563,7 @@ ;; amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes @@ -15588,7 +15605,8 @@ else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; - fi;$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi @@ -15645,7 +15663,9 @@ *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver;cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver; $echo "local: *; };" >> $output_objdir/$libname.ver; + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ +cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +$echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_GCJ="$tmp_archive_cmds" @@ -15682,7 +15702,7 @@ aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE;$AR $AR_FLAGS $lib $output_objdir/$soname' + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes @@ -15906,13 +15926,13 @@ whole_archive_flag_spec_GCJ=' ' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag};$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data;$AR $AR_FLAGS $lib $libobjs;$RANLIB $lib;(cd $output_objdir && a2ixlibrary -32)' + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section @@ -15935,7 +15955,7 @@ # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. - archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll;linknames=' + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. @@ -15975,8 +15995,8 @@ archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case "$cc_basename" in xlc*) @@ -15984,8 +16004,8 @@ archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym;$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags;nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no @@ -16033,9 +16053,9 @@ hpux9*) if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname;$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else - archive_cmds_GCJ='$rm $output_objdir/$soname;$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags;test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: @@ -16156,7 +16176,7 @@ hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def;$echo DATA >> $output_objdir/$libname.def;$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def;$echo EXPORTS >> $output_objdir/$libname.def;emxexp $libobjs >> $output_objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; @@ -16180,7 +16200,9 @@ else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp; $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib;$rm $lib.exp' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi @@ -16199,10 +16221,12 @@ no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags;$rm $lib.exp' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no @@ -16291,7 +16315,8 @@ # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp;cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp;$echo "local: *; };" >> $lib.exp; $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags;$rm $lib.exp' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_GCJ= hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' @@ -16506,13 +16531,13 @@ yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`; - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`; - dldir=$destdir/`dirname \$dlpath`; - test -d \$dldir || mkdir -p \$dldir; + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`; - dlpath=$dir/\$dldll; + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes @@ -17595,7 +17620,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5 +echo $ECHO_N "checking for namd benchmark sources... $ECHO_C" >&6 +case "$checkresult" in +auto|yes) + defaultdir=/home/vadve/shared/benchmarks/spec_namd + if test -d "$defaultdir" + then + NAMD_ROOT=$defaultdir + + USE_NAMD=USE_NAMD=1 + + checkresult="yes, found in $defaultdir" + else + checkresult=no + fi + ;; +no) + + + checkresult=no + ;; +*) if test -d "$checkresult" + then + NAMD_ROOT="$checkresult" + + USE_NAMD=USE_NAMD=1 + + checkresult="yes, in $checkresult" + else + + + checkresult="no, not found in $checkresult" + fi + ;; +esac +echo "$as_me:$LINENO: result: $checkresult" >&5 +echo "${ECHO_T}$checkresult" >&6 + + + # Check whether --with-f2c or --without-f2c was given. if test "${with_f2c+set}" = set; then @@ -20199,6 +20271,8 @@ s, at USE_SPEC2000@,$USE_SPEC2000,;t t s, at POVRAY_ROOT@,$POVRAY_ROOT,;t t s, at USE_POVRAY@,$USE_POVRAY,;t t +s, at NAMD_ROOT@,$NAMD_ROOT,;t t +s, at USE_NAMD@,$USE_NAMD,;t t s, at F2C@,$F2C,;t t s, at F2C_INC@,$F2C_INC,;t t s, at F2C_LIB@,$F2C_LIB,;t t From criswell at cs.uiuc.edu Fri Oct 15 08:37:27 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri, 15 Oct 2004 08:37:27 -0500 Subject: [llvm-commits] CVS: llvm-test/autoconf/configure.ac Message-ID: <200410151337.IAA22848@choi.cs.uiuc.edu> Changes in directory llvm-test/autoconf: configure.ac updated: 1.9 -> 1.10 --- Log message: Added namd as an external test. --- Diffs of the changes: (+1 -0) Index: llvm-test/autoconf/configure.ac diff -u llvm-test/autoconf/configure.ac:1.9 llvm-test/autoconf/configure.ac:1.10 --- llvm-test/autoconf/configure.ac:1.9 Thu Oct 7 16:47:54 2004 +++ llvm-test/autoconf/configure.ac Fri Oct 15 08:37:16 2004 @@ -116,6 +116,7 @@ EXTERNAL_BENCHMARK(spec95,/home/vadve/shared/benchmarks/spec95/benchspec) EXTERNAL_BENCHMARK(spec2000,/home/vadve/shared/benchmarks/speccpu2000/benchspec) EXTERNAL_BENCHMARK(povray,/home/vadve/shared/benchmarks/povray31) +EXTERNAL_BENCHMARK(namd,/home/vadve/shared/benchmarks/spec_namd) dnl Check for f2c CHECK_F2C_ALL() From criswell at cs.uiuc.edu Fri Oct 15 08:38:38 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri, 15 Oct 2004 08:38:38 -0500 Subject: [llvm-commits] CVS: llvm-test/External/Makefile Message-ID: <200410151338.IAA22864@choi.cs.uiuc.edu> Changes in directory llvm-test/External: Makefile updated: 1.15 -> 1.16 --- Log message: Add Namd. --- Diffs of the changes: (+5 -1) Index: llvm-test/External/Makefile diff -u llvm-test/External/Makefile:1.15 llvm-test/External/Makefile:1.16 --- llvm-test/External/Makefile:1.15 Mon Sep 20 13:42:24 2004 +++ llvm-test/External/Makefile Fri Oct 15 08:38:26 2004 @@ -8,10 +8,14 @@ # # Create the list of directories to compile # -PARALLEL_DIRS := SPEC Povray +PARALLEL_DIRS := SPEC Povray Namd ifndef USE_POVRAY PARALLEL_DIRS := $(filter-out Povray/, $(PARALLEL_DIRS)) endif +ifndef USE_NAMD +PARALLEL_DIRS := $(filter-out Namd/, $(PARALLEL_DIRS)) +endif + include Makefile.external From criswell at cs.uiuc.edu Fri Oct 15 08:38:58 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri, 15 Oct 2004 08:38:58 -0500 Subject: [llvm-commits] CVS: llvm-test/Makefile.config.in Message-ID: <200410151338.IAA22882@choi.cs.uiuc.edu> Changes in directory llvm-test: Makefile.config.in updated: 1.4 -> 1.5 --- Log message: Add Namd. --- Diffs of the changes: (+4 -0) Index: llvm-test/Makefile.config.in diff -u llvm-test/Makefile.config.in:1.4 llvm-test/Makefile.config.in:1.5 --- llvm-test/Makefile.config.in:1.4 Thu Oct 7 16:48:26 2004 +++ llvm-test/Makefile.config.in Fri Oct 15 08:38:46 2004 @@ -45,5 +45,9 @@ @USE_POVRAY@ POVRAY_ROOT := @POVRAY_ROOT@ +# Path to the Namd source code + at USE_NAMD@ +NAMD_ROOT := @NAMD_ROOT@ + # Disable LLC diffs for testing. @DISABLE_LLC_DIFFS@ From criswell at cs.uiuc.edu Fri Oct 15 08:39:45 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri, 15 Oct 2004 08:39:45 -0500 Subject: [llvm-commits] CVS: llvm-test/External/Namd/Makefile Message-ID: <200410151339.IAA22896@choi.cs.uiuc.edu> Changes in directory llvm-test/External/Namd: Makefile updated: 1.1 -> 1.2 --- Log message: Get the configuration from the Makefile.config file. --- Diffs of the changes: (+0 -1) Index: llvm-test/External/Namd/Makefile diff -u llvm-test/External/Namd/Makefile:1.1 llvm-test/External/Namd/Makefile:1.2 --- llvm-test/External/Namd/Makefile:1.1 Fri Oct 15 08:34:50 2004 +++ llvm-test/External/Namd/Makefile Fri Oct 15 08:39:33 2004 @@ -2,7 +2,6 @@ include $(LEVEL)/Makefile.config -NAMD_ROOT := /home/vadve/shared/benchmarks/spec_namd PROG = spec_namd SourceDir := $(NAMD_ROOT) From lattner at cs.uiuc.edu Fri Oct 15 12:04:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 15 Oct 2004 12:04:42 -0500 Subject: [llvm-commits] CVS: llvm/docs/Bugpoint.html Message-ID: <200410151704.MAA02861@apoc.cs.uiuc.edu> Changes in directory llvm/docs: Bugpoint.html updated: 1.2 -> 1.3 --- Log message: Fix broken links --- Diffs of the changes: (+3 -3) Index: llvm/docs/Bugpoint.html diff -u llvm/docs/Bugpoint.html:1.2 llvm/docs/Bugpoint.html:1.3 --- llvm/docs/Bugpoint.html:1.2 Thu Jul 1 15:41:43 2004 +++ llvm/docs/Bugpoint.html Fri Oct 15 12:04:28 2004 @@ -20,7 +20,7 @@ failures: optimizer crashes, miscompilations by optimizers, or bad native code generation (including problems in the static and JIT compilers). It aims to reduce large test cases to small, useful ones. For example, -if gccas crashes while optimizing a file, it +if gccas crashes while optimizing a file, it will identify the optimization (or combination of optimizations) that causes the crash, and reduce the file down to a small example which triggers the crash.

    @@ -84,8 +84,8 @@ bugpoint deletes any individual LLVM instructions whose absence does not eliminate the failure. At the end, bugpoint should tell you what passes crash, give you a bytecode file, and give you instructions on how to -reproduce the failure with opt, analyze, or llc.

    +reproduce the failure with opt, analyze, or llc.

    Code generator debugger

    From lattner at cs.uiuc.edu Fri Oct 15 12:05:26 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 15 Oct 2004 12:05:26 -0500 Subject: [llvm-commits] CVS: llvm-www/releases/1.3/docs/index.html Message-ID: <200410151705.MAA02880@apoc.cs.uiuc.edu> Changes in directory llvm-www/releases/1.3/docs: index.html updated: 1.1 -> 1.2 --- Log message: Fix broken link --- Diffs of the changes: (+2 -2) Index: llvm-www/releases/1.3/docs/index.html diff -u llvm-www/releases/1.3/docs/index.html:1.1 llvm-www/releases/1.3/docs/index.html:1.2 --- llvm-www/releases/1.3/docs/index.html:1.1 Fri Aug 13 17:03:03 2004 +++ llvm-www/releases/1.3/docs/index.html Fri Oct 15 12:05:14 2004 @@ -28,7 +28,7 @@
      -
    • LLVM: A Compilation Framework for +
    • LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation: - Describes the LLVM instruction set and compilation strategy. This should be the first document you read to get an overview of LLVM.
    • @@ -195,6 +195,6 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/08/13 22:03:03 $ + Last modified: $Date: 2004/10/15 17:05:14 $ From lattner at cs.uiuc.edu Fri Oct 15 12:05:57 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 15 Oct 2004 12:05:57 -0500 Subject: [llvm-commits] CVS: llvm-www/releases/1.3/docs/Bugpoint.html Message-ID: <200410151705.MAA02903@apoc.cs.uiuc.edu> Changes in directory llvm-www/releases/1.3/docs: Bugpoint.html updated: 1.1 -> 1.2 --- Log message: Fix broken links --- Diffs of the changes: (+3 -3) Index: llvm-www/releases/1.3/docs/Bugpoint.html diff -u llvm-www/releases/1.3/docs/Bugpoint.html:1.1 llvm-www/releases/1.3/docs/Bugpoint.html:1.2 --- llvm-www/releases/1.3/docs/Bugpoint.html:1.1 Fri Aug 13 17:03:03 2004 +++ llvm-www/releases/1.3/docs/Bugpoint.html Fri Oct 15 12:05:47 2004 @@ -20,7 +20,7 @@ failures: optimizer crashes, miscompilations by optimizers, or bad native code generation (including problems in the static and JIT compilers). It aims to reduce large test cases to small, useful ones. For example, -if gccas crashes while optimizing a file, it +if gccas crashes while optimizing a file, it will identify the optimization (or combination of optimizations) that causes the crash, and reduce the file down to a small example which triggers the crash.

      @@ -84,8 +84,8 @@ bugpoint deletes any individual LLVM instructions whose absence does not eliminate the failure. At the end, bugpoint should tell you what passes crash, give you a bytecode file, and give you instructions on how to -reproduce the failure with opt, analyze, or llc.

      +reproduce the failure with opt, analyze, or llc.

      Code generator debugger

      From lattner at cs.uiuc.edu Fri Oct 15 12:07:16 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 15 Oct 2004 12:07:16 -0500 Subject: [llvm-commits] CVS: llvm-www/Developers.html Message-ID: <200410151707.MAA02926@apoc.cs.uiuc.edu> Changes in directory llvm-www: Developers.html updated: 1.9 -> 1.10 --- Log message: Fix broken link --- Diffs of the changes: (+1 -2) Index: llvm-www/Developers.html diff -u llvm-www/Developers.html:1.9 llvm-www/Developers.html:1.10 --- llvm-www/Developers.html:1.9 Wed Aug 25 21:18:25 2004 +++ llvm-www/Developers.html Fri Oct 15 12:07:06 2004 @@ -26,8 +26,7 @@ Tanya Brethour - Tonic + Tonic From brukman at cs.uiuc.edu Fri Oct 15 12:17:08 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri, 15 Oct 2004 12:17:08 -0500 Subject: [llvm-commits] CVS: llvm-www/demo/index.cgi Message-ID: <200410151717.MAA22860@zion.cs.uiuc.edu> Changes in directory llvm-www/demo: index.cgi updated: 1.29 -> 1.30 --- Log message: Add `deplibs' to the list of keywords --- Diffs of the changes: (+2 -2) Index: llvm-www/demo/index.cgi diff -u llvm-www/demo/index.cgi:1.29 llvm-www/demo/index.cgi:1.30 --- llvm-www/demo/index.cgi:1.29 Tue Aug 17 10:45:51 2004 +++ llvm-www/demo/index.cgi Fri Oct 15 12:16:58 2004 @@ -5,7 +5,7 @@ # doing remote web JO99C compilations. (It could still be used for that # purpose, though the two scripts have diverged somewhat.) # -# Last modified $Date: 2004/08/17 15:45:51 $ +# Last modified $Date: 2004/10/15 17:16:58 $ # use CGI; @@ -87,7 +87,7 @@ sub syntaxHighlightLLVM { my ($input) = @_; $input =~ s@\b(void|bool|sbyte|ubyte|short|ushort|int|uint|long|ulong|float|double|type|label|opaque)\b@$1@g; - $input =~ s@\b(add|sub|mul|div|rem|and|or|xor|setne|seteq|setlt|setgt|setle|setge|phi|call|cast|to|shl|shr|vaarg|vanext|ret|br|switch|invoke|unwind|malloc|alloca|free|load|store|getelementptr|begin|end|true|false|declare|global|constant|const|internal|uninitialized|external|implementation|linkonce|weak|appending|null|to|except|not|target|endian|pointersize|big|little|volatile)\b@$1@g; + $input =~ s@\b(add|sub|mul|div|rem|and|or|xor|setne|seteq|setlt|setgt|setle|setge|phi|call|cast|to|shl|shr|vaarg|vanext|ret|br|switch|invoke|unwind|malloc|alloca|free|load|store|getelementptr|begin|end|true|false|declare|global|constant|const|internal|uninitialized|external|implementation|linkonce|weak|appending|null|to|except|not|target|endian|pointersize|big|little|volatile|deplibs)\b@$1@g; return $input; } From gaeke at cs.uiuc.edu Fri Oct 15 14:31:30 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:31:30 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/lib/Makefile Message-ID: <200410151931.OAA06309@kain.cs.uiuc.edu> Changes in directory reopt/lib: Makefile updated: 1.26 -> 1.27 --- Log message: Don't build Trigger or Optimizations directories. --- Diffs of the changes: (+1 -1) Index: reopt/lib/Makefile diff -u reopt/lib/Makefile:1.26 reopt/lib/Makefile:1.27 --- reopt/lib/Makefile:1.26 Tue Oct 5 15:38:58 2004 +++ reopt/lib/Makefile Fri Oct 15 14:31:19 2004 @@ -1,5 +1,5 @@ LEVEL = .. -DIRS := BinInterface Mapping TraceCache Trigger LightWtProfiling Inst Optimizations TraceToFunction TraceJIT TraceIO +DIRS := BinInterface Mapping TraceCache LightWtProfiling Inst TraceToFunction TraceJIT TraceIO include $(LEVEL)/Makefile.config From gaeke at cs.uiuc.edu Fri Oct 15 14:31:34 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:31:34 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/lib/Trigger/Compile.sh GetTraceTime.cpp Makefile RuntimeOptimizations.cpp Trigger.cpp TriggerAuxillary.cpp TriggerAuxillary.h Message-ID: <200410151931.OAA06332@kain.cs.uiuc.edu> Changes in directory reopt/lib/Trigger: Compile.sh (r1.1) removed GetTraceTime.cpp (r1.3) removed Makefile (r1.2) removed RuntimeOptimizations.cpp (r1.4) removed Trigger.cpp (r1.24) removed TriggerAuxillary.cpp (r1.10) removed TriggerAuxillary.h (r1.5) removed --- Log message: Removing the "old" reoptimizer and LLVMTrace class, which were doomed because of their reliance on MachineCodeForInstruction mapping information. --- Diffs of the changes: (+0 -0) From gaeke at cs.uiuc.edu Fri Oct 15 14:31:30 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:31:30 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp Message-ID: <200410151931.OAA06315@kain.cs.uiuc.edu> Changes in directory reopt/lib/LightWtProfiling: RuntimeOptimizations.cpp updated: 1.55 -> 1.56 --- Log message: Minor comment/whitespace edits. When "skipping" traces, go all the way through unpackTraceFunction; just don't write the final branch. --- Diffs of the changes: (+17 -16) Index: reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp diff -u reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.55 reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.56 --- reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp:1.55 Tue Oct 12 15:22:06 2004 +++ reopt/lib/LightWtProfiling/RuntimeOptimizations.cpp Fri Oct 15 14:31:20 2004 @@ -30,12 +30,11 @@ extern bool SaveRegAllocState; static int TraceCount = 0; +// Bug-isolation mechanisms cl::list SkipTrace("skip-trace", cl::CommaSeparated, cl::desc("Don't optimize these trace numbers, when using trace optimizer")); - -// Bug-isolation mechanisms cl::opt DisableTTF("disable-ttf", cl::init(false), @@ -72,7 +71,6 @@ return false; } - static bool TraceContainsCall (Trace &T) { for (Trace::const_iterator ti = T.begin (), te = T.end (); ti != te; ++ti) for (BasicBlock::const_iterator bi = (*ti)->begin(), be = (*ti)->end (); @@ -101,15 +99,8 @@ if (TraceContainsCall (T)) return false; - DEBUG(if (DisableTTF) return false); + DEBUG (if (DisableTTF) return false); - DEBUG(++TraceCount; - if (std::find (SkipTrace.begin (), SkipTrace.end (), TraceCount) - != SkipTrace.end ()) { - std::cerr << "optimizeTrace: skipping trace " << TraceCount << "\n"; - return false; - }); - // Initialization stuff: ensure module has been read in, and allocate a // target machine, if there isn't one already. static TraceJIT *TJIT = 0; @@ -126,22 +117,32 @@ DEBUG (WriteTraceToFile (&T)); TraceFunction *TF = BuildTraceFunction (T, MP); - DEBUG(if (DisableUTF) return false); + DEBUG (if (DisableUTF) return false); // Compile the TraceFunction to machine code using the optimizing trace JIT // compiler, and unpack the resulting optimized trace back into its matrix // function. uint64_t traceStartAddr = TJIT->compileTraceFunction (TF); - DEBUG(if (DisableBranchStitching) return false); - +#ifndef NDEBUG + ++TraceCount; // Add a branch from address A (the parameter to this method) to the // entry basic block of the unpacked TraceFn. Future executions of the trace // will proceed from the optimized version of the code. - DEBUG(std::cerr << "Writing branch at 0x" << std::hex << a - << " to point to 0x" << traceStartAddr << std::dec << "\n"); TraceOptimizerDone(a, traceStartAddr, TJIT->getEmitter ()->getCurrentPCValue ()); + + DEBUG(if (DisableBranchStitching || + (std::find (SkipTrace.begin (), SkipTrace.end (), TraceCount) + != SkipTrace.end ())) { + std::cerr << "optimizeTrace: Skipping branch stitch for trace #" + << TraceCount << "\n"; + return false; + }); + + DEBUG(std::cerr << "optimizeTrace: Writing branch at 0x" << std::hex << a + << " to point to 0x" << traceStartAddr << std::dec << "\n"); +#endif vm->writeBranchInstruction(a, traceStartAddr); doFlush (a, a + 4); return true; From gaeke at cs.uiuc.edu Fri Oct 15 14:31:36 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:31:36 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/lib/Optimizations/Makefile RuntimeLICM.cpp Message-ID: <200410151931.OAA06341@kain.cs.uiuc.edu> Changes in directory reopt/lib/Optimizations: Makefile (r1.1) removed RuntimeLICM.cpp (r1.6) removed --- Log message: Removing the "old" RuntimeLICM, which relies on the old LLVMTrace class. As a replacement, you can simply run -licm inside the TraceJIT. --- Diffs of the changes: (+0 -0) From gaeke at cs.uiuc.edu Fri Oct 15 14:31:35 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:31:35 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/lib/BinInterface/LLVMTrace.cpp Message-ID: <200410151931.OAA06336@kain.cs.uiuc.edu> Changes in directory reopt/lib/BinInterface: LLVMTrace.cpp (r1.9) removed --- Log message: Removing the "old" reoptimizer and LLVMTrace class, which were doomed because of their reliance on MachineCodeForInstruction mapping information. --- Diffs of the changes: (+0 -0) From gaeke at cs.uiuc.edu Fri Oct 15 14:31:31 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:31:31 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/lib/Mapping/getLLVMinfo.cpp Message-ID: <200410151931.OAA06322@kain.cs.uiuc.edu> Changes in directory reopt/lib/Mapping: getLLVMinfo.cpp updated: 1.26 -> 1.27 --- Log message: Get rid of FunctionLI and getLLVMInstrPositionInfo, whose sole purpose in life is to query the old, broken MachineCodeForInstruction mapping information. --- Diffs of the changes: (+0 -27) Index: reopt/lib/Mapping/getLLVMinfo.cpp diff -u reopt/lib/Mapping/getLLVMinfo.cpp:1.26 reopt/lib/Mapping/getLLVMinfo.cpp:1.27 --- reopt/lib/Mapping/getLLVMinfo.cpp:1.26 Wed Mar 31 10:31:29 2004 +++ reopt/lib/Mapping/getLLVMinfo.cpp Fri Oct 15 14:31:21 2004 @@ -22,7 +22,6 @@ extern int llvmFunctionCount; // Global symbols added to the program by FunctionInfo pass: extern unsigned char *FunctionBB[]; -extern unsigned char *FunctionLI[]; namespace llvm { @@ -98,32 +97,6 @@ static void createMImapF(unsigned char *LMIinfo, unsigned length); static void createBBmapRevFwdF(Module *M); -/// getLLVMInstrPositionInfo - Look up the given Instruction in the -/// LLVM-to-MI map for the Function that contains it, and return the -/// vector of integers (?) that represents it. -/// -std::vector getLLVMInstrPositionInfo (Instruction *LI) { - // Get pointers to the BasicBlock, Function, and Module which contain LI. - BasicBlock *BB = LI->getParent(); - Function *F = BB->getParent(); - Module *M = F->getParent(); - - maybeFillInMapsForModule (M); - - unsigned FunctionNo = FunctionKey[F]; - static unsigned lastUsedFunctionNo = ~0; - if (lastUsedFunctionNo != FunctionNo) { - // First time we see a given Function, we have to initialize - // MImapF for that Function. - unsigned char *LIMap = FunctionLI[FunctionNo]; - unsigned length = *(unsigned *)LIMap - 4; - createMImapF(&LIMap[4], length); - lastUsedFunctionNo = FunctionNo; - } - - return MImapF[BasicBlockKey[BB]][llvmInstructionKey[LI]]; -} - /// getBasicBlockInfo(BasicBlock *) - Find the given BasicBlock in the /// forward basic block map, and return the pair of 64-bit addresses /// that corresponds to that basic block's starting and ending address From gaeke at cs.uiuc.edu Fri Oct 15 14:35:34 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:35:34 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/include/reopt/BinInterface/LLVMTrace.h Message-ID: <200410151935.OAA06594@kain.cs.uiuc.edu> Changes in directory reopt/include/reopt/BinInterface: LLVMTrace.h (r1.5) removed --- Log message: (*) brg waves bye bye to LLVMTrace --- Diffs of the changes: (+0 -0) From gaeke at cs.uiuc.edu Fri Oct 15 14:36:46 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:36:46 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/test/run-tests Message-ID: <200410151936.OAA06611@kain.cs.uiuc.edu> Changes in directory reopt/test: run-tests updated: 1.23 -> 1.24 --- Log message: Don't mess with my $LLVM_REOPT --- Diffs of the changes: (+0 -2) Index: reopt/test/run-tests diff -u reopt/test/run-tests:1.23 reopt/test/run-tests:1.24 --- reopt/test/run-tests:1.23 Tue Oct 5 10:43:51 2004 +++ reopt/test/run-tests Fri Oct 15 14:36:36 2004 @@ -145,8 +145,6 @@ fi if [ $spectest -eq 1 ]; then # note: SPEC Sandbox.sh does NOT play nice with our debug output! - LLVM_REOPT='--enable-trace-opt' - export LLVM_REOPT exec gmake -k SUBDIR=$SUBDIR SPECTEST=1 RUNTIMELIMIT=900 $MKOPTS else exec gmake SUBDIR=$SUBDIR RUNTIMELIMIT=900 $MKOPTS From gaeke at cs.uiuc.edu Fri Oct 15 14:37:12 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:37:12 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/include/reopt/MappingInfo.h Message-ID: <200410151937.OAA06630@kain.cs.uiuc.edu> Changes in directory reopt/include/reopt: MappingInfo.h updated: 1.12 -> 1.13 --- Log message: getLLVMInstrPositionInfo has left the building --- Diffs of the changes: (+0 -6) Index: reopt/include/reopt/MappingInfo.h diff -u reopt/include/reopt/MappingInfo.h:1.12 reopt/include/reopt/MappingInfo.h:1.13 --- reopt/include/reopt/MappingInfo.h:1.12 Fri Sep 24 16:22:38 2004 +++ reopt/include/reopt/MappingInfo.h Fri Oct 15 14:37:02 2004 @@ -26,12 +26,6 @@ /// unsigned getLLVMFunctionPositionInfo (Function *F); -/// getLLVMInstrPositionInfo - Look up the given Instruction in the -/// LLVM-to-MI map for the Function that contains it, and return the -/// vector of integers (?) that represents it. -/// -std::vector getLLVMInstrPositionInfo (Instruction *LI); - /// getBasicBlockInfo(BasicBlock *) - Find the given BasicBlock in the /// forward basic block map, and return the pair of 64-bit addresses /// that corresponds to that basic block's starting and ending address From gaeke at cs.uiuc.edu Fri Oct 15 14:37:54 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:37:54 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/test/TEST.reopt.Makefile Message-ID: <200410151937.OAA06855@kain.cs.uiuc.edu> Changes in directory reopt/test: TEST.reopt.Makefile updated: 1.27 -> 1.28 --- Log message: Turn debug flags on when ENABLE_OPTIMIZED is *off*, not the other way around. --- Diffs of the changes: (+2 -2) Index: reopt/test/TEST.reopt.Makefile diff -u reopt/test/TEST.reopt.Makefile:1.27 reopt/test/TEST.reopt.Makefile:1.28 --- reopt/test/TEST.reopt.Makefile:1.27 Tue Oct 12 19:02:43 2004 +++ reopt/test/TEST.reopt.Makefile Fri Oct 15 14:37:43 2004 @@ -40,10 +40,10 @@ @echo "===== Finished running Reoptimizer tests for $(TESTNAME) =====" ifdef ENABLE_OPTIMIZED +REOPTLLC_DEBUG_FLAGS= +else REOPTLLC_DEBUG_FLAGS=-disable-sched -disable-strip -dregalloc=y \ -print-machineinstrs -else -REOPTLLC_DEBUG_FLAGS= endif # 1. Run the necessary instrumentation passes over the bytecode, From lattner at cs.uiuc.edu Fri Oct 15 14:40:44 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 15 Oct 2004 14:40:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Analyzer.cpp Message-ID: <200410151940.OAA12341@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Analyzer.cpp updated: 1.17 -> 1.18 --- Log message: Don't print a bunch of metrics that are meaningless for external functions --- Diffs of the changes: (+20 -17) Index: llvm/lib/Bytecode/Reader/Analyzer.cpp diff -u llvm/lib/Bytecode/Reader/Analyzer.cpp:1.17 llvm/lib/Bytecode/Reader/Analyzer.cpp:1.18 --- llvm/lib/Bytecode/Reader/Analyzer.cpp:1.17 Fri Sep 10 23:14:07 2004 +++ llvm/lib/Bytecode/Reader/Analyzer.cpp Fri Oct 15 14:40:31 2004 @@ -693,25 +693,28 @@ bca.FunctionInfo.end(); while ( I != E ) { - Out << std::left << std::setw(0); - Out << "\nFunction: " << I->second.name << "\n"; + Out << std::left << std::setw(0) << "\n"; + if (I->second.numBasicBlocks == 0) Out << "External "; + Out << "Function: " << I->second.name << "\n"; print(Out, "Type:", I->second.description); print(Out, "Byte Size", I->second.byteSize); - print(Out, "Basic Blocks", I->second.numBasicBlocks); - print(Out, "Instructions", I->second.numInstructions); - print(Out, "Long Instructions", I->second.longInstructions); - print(Out, "Operands", I->second.numOperands); - print(Out, "Instruction Size", I->second.instructionSize); - print(Out, "Average Instruction Size", - double(I->second.instructionSize)/double(I->second.numInstructions)); - print(Out, "Bytes Per Instruction", I->second.density); - print(Out, "# of VBR 32-bit Integers", I->second.vbrCount32); - print(Out, "# of VBR 64-bit Integers", I->second.vbrCount64); - print(Out, "# of VBR Compressed Bytes", I->second.vbrCompBytes); - print(Out, "# of VBR Expanded Bytes", I->second.vbrExpdBytes); - print(Out, "Bytes Saved With VBR", - double(I->second.vbrExpdBytes)-double(I->second.vbrCompBytes), - double(I->second.vbrExpdBytes)); + if (I->second.numBasicBlocks) { + print(Out, "Basic Blocks", I->second.numBasicBlocks); + print(Out, "Instructions", I->second.numInstructions); + print(Out, "Long Instructions", I->second.longInstructions); + print(Out, "Operands", I->second.numOperands); + print(Out, "Instruction Size", I->second.instructionSize); + print(Out, "Average Instruction Size", + double(I->second.instructionSize) / I->second.numInstructions); + print(Out, "Bytes Per Instruction", I->second.density); + print(Out, "# of VBR 32-bit Integers", I->second.vbrCount32); + print(Out, "# of VBR 64-bit Integers", I->second.vbrCount64); + print(Out, "# of VBR Compressed Bytes", I->second.vbrCompBytes); + print(Out, "# of VBR Expanded Bytes", I->second.vbrExpdBytes); + print(Out, "Bytes Saved With VBR", + double(I->second.vbrExpdBytes) - I->second.vbrCompBytes), + double(I->second.vbrExpdBytes); + } ++I; } } From gaeke at cs.uiuc.edu Fri Oct 15 14:42:39 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:42:39 -0500 (CDT) Subject: [llvm-commits] CVS: reopt/autoconf/configure.ac Message-ID: <200410151942.OAA07726@kain.cs.uiuc.edu> Changes in directory reopt/autoconf: configure.ac updated: 1.7 -> 1.8 --- Log message: We don't need to configure lib/Trigger/Makefile anymore. --- Diffs of the changes: (+0 -1) Index: reopt/autoconf/configure.ac diff -u reopt/autoconf/configure.ac:1.7 reopt/autoconf/configure.ac:1.8 --- reopt/autoconf/configure.ac:1.7 Tue Sep 7 12:33:09 2004 +++ reopt/autoconf/configure.ac Fri Oct 15 14:42:28 2004 @@ -18,7 +18,6 @@ AC_CONFIG_MAKEFILE(lib/Mapping/Makefile) AC_CONFIG_MAKEFILE(lib/ScratchMemory/Makefile) AC_CONFIG_MAKEFILE(lib/TraceCache/Makefile) -AC_CONFIG_MAKEFILE(lib/Trigger/Makefile) AC_CONFIG_MAKEFILE(test/Makefile) AC_CONFIG_MAKEFILE(test/TEST.reopt.Makefile) AC_CONFIG_MAKEFILE(tools/Makefile) From gaeke at cs.uiuc.edu Fri Oct 15 14:45:50 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:45:50 -0500 Subject: [llvm-commits] CVS: reopt/configure Message-ID: <200410151945.OAA24973@zion.cs.uiuc.edu> Changes in directory reopt: configure updated: 1.8 -> 1.9 --- Log message: Regenerated with autoconf-2.57 --- Diffs of the changes: (+0 -6) Index: reopt/configure diff -u reopt/configure:1.8 reopt/configure:1.9 --- reopt/configure:1.8 Tue Sep 7 12:33:21 2004 +++ reopt/configure Fri Oct 15 14:45:40 2004 @@ -1264,9 +1264,6 @@ ac_config_commands="$ac_config_commands lib/TraceCache/Makefile" - ac_config_commands="$ac_config_commands lib/Trigger/Makefile" - - ac_config_commands="$ac_config_commands test/Makefile" @@ -1874,7 +1871,6 @@ ${srcdir}/autoconf/mkinstalldirs `dirname lib/Mapping/Makefile` ${srcdir}/autoconf/mkinstalldirs `dirname lib/ScratchMemory/Makefile` ${srcdir}/autoconf/mkinstalldirs `dirname lib/TraceCache/Makefile` -${srcdir}/autoconf/mkinstalldirs `dirname lib/Trigger/Makefile` ${srcdir}/autoconf/mkinstalldirs `dirname test/Makefile` ${srcdir}/autoconf/mkinstalldirs `dirname test/TEST.reopt.Makefile` ${srcdir}/autoconf/mkinstalldirs `dirname tools/Makefile` @@ -1902,7 +1898,6 @@ "lib/Mapping/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Mapping/Makefile" ;; "lib/ScratchMemory/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/ScratchMemory/Makefile" ;; "lib/TraceCache/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/TraceCache/Makefile" ;; - "lib/Trigger/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Trigger/Makefile" ;; "test/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS test/Makefile" ;; "test/TEST.reopt.Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS test/TEST.reopt.Makefile" ;; "tools/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS tools/Makefile" ;; @@ -2263,7 +2258,6 @@ lib/Mapping/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Mapping/Makefile lib/Mapping/Makefile ;; lib/ScratchMemory/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/ScratchMemory/Makefile lib/ScratchMemory/Makefile ;; lib/TraceCache/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/TraceCache/Makefile lib/TraceCache/Makefile ;; - lib/Trigger/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/lib/Trigger/Makefile lib/Trigger/Makefile ;; test/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/test/Makefile test/Makefile ;; test/TEST.reopt.Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/test/TEST.reopt.Makefile test/TEST.reopt.Makefile ;; tools/Makefile ) ${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/tools/Makefile tools/Makefile ;; From gaeke at cs.uiuc.edu Fri Oct 15 14:48:12 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:48:12 -0500 Subject: [llvm-commits] CVS: reopt/docs/ReoptUsersGuide.rtf Message-ID: <200410151948.OAA25235@zion.cs.uiuc.edu> Changes in directory reopt/docs: ReoptUsersGuide.rtf updated: 1.3 -> 1.4 --- Log message: Add to-do item; expand on descr. of -count-trace-cycles; add -disable-* options in LLVM_REOPT section; other minor edits. --- Diffs of the changes: (+55 -53) Index: reopt/docs/ReoptUsersGuide.rtf diff -u reopt/docs/ReoptUsersGuide.rtf:1.3 reopt/docs/ReoptUsersGuide.rtf:1.4 --- reopt/docs/ReoptUsersGuide.rtf:1.3 Tue Oct 12 14:56:17 2004 +++ reopt/docs/ReoptUsersGuide.rtf Fri Oct 15 14:48:02 2004 @@ -56,15 +56,14 @@ The Trace I/O library ( \f3 reopt/lib/TraceIO \f0 )\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f3 \cf0 ttftest -\f0 - a standalone TraceToFunction testing tool ( +\f3 ttftest +\f0 - a standalone TraceToFunction testing tool ( \f3 reopt/tools/ttftest \f0 )\ \f3 dumptrace -\f0 - list LLVM assembly for a trace's basic blocks ( +\f0 - list LLVM assembly for a trace's basic blocks ( \f3 reopt/tools/dumptrace \f0 )\ Known problems with the current implementation\ @@ -73,40 +72,37 @@ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \cf0 \ul \ulc0 Introduction to the reoptimizer\ +\f1\b \cf0 \ul Introduction to the reoptimizer\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f0\b0 \cf0 \ulnone \ The reoptimizer is LLVM's dynamic optimization framework. It consists of three basic parts: a collection of compile-time profiling instrumentation passes, a runtime profiler and trace generator, and a runtime trace optimizer.\ \ -The profiling instrumentation passes run at compile time are as follows: [FIXME]\ +The profiling instrumentation passes run at compile time are as follows: [ +\f1\b TO DO +\f0\b0 - also need to explain basic terms like FLI, SLI; it would be nice to have a diagram here]\ \ For more information about the reoptimizer's instrumentation passes and runtime profiler, consult Anand Shukla's M.S. thesis, "Lightweight Cross-Procedure Tracing for Runtime Optimization", July 2003.\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \cf0 \ul \ulc0 Building the reoptimizer from source\ +\f1\b \cf0 \ul Building the reoptimizer from source\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f0\b0 \cf0 \ulnone \ 1. Check out a fresh llvm tree, along with the repository of test programs.\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f3 \cf0 % cvs -d /home/vadve/shared/PublicCVS co llvm\ +\f3 % cvs -d /home/vadve/shared/PublicCVS co llvm\ % cd llvm/projects\ % cvs -d /home/vadve/shared/PublicCVS co llvm-test\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f0 \cf0 2. Check out the reopt module from the internal CVS repository into the llvm/projects subdirectory, creating llvm/projects/reopt.\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\f0 2. Check out the reopt module from the internal CVS repository into the llvm/projects subdirectory, creating llvm/projects/reopt.\ -\f3 \cf0 % cvs -d /home/vadve/shared/InternalCVS co reopt\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\f3 % cvs -d /home/vadve/shared/InternalCVS co reopt\ -\f0 \cf0 3. Configure and build the system in release mode (or debug mode if you want to try to fix bugs).\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\f0 3. Configure and build the system in release mode (or debug mode if you want to try to fix bugs).\ -\f3 \cf0 % cd ../..\ +\f3 % cd ../..\ % ./configure \f4\i [configure args] \f0\i0 \ @@ -119,12 +115,11 @@ \f0\i0 \ \f3 % gmake\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f0 \cf0 \ +\f0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \cf0 \ul \ulc0 Running the reoptimizer on a program in the llvm-test module\ +\f1\b \cf0 \ul Running the reoptimizer on a program in the llvm-test module\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f0\b0 \cf0 \ulnone \ @@ -142,20 +137,18 @@ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f3\i0 \cf0 % ./run-tests shootout\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f0 \cf0 ...within the reopt/test directory. Both of these commands perform three tasks: first, run the ordinary llc-compiled, non-instrumented version of each Shootout program; second: run the reoptimized version; third: compare the results.\ +\f0 ...within the reopt/test directory. Both of these commands perform three tasks: first, run the ordinary llc-compiled, non-instrumented version of each Shootout program; second: run the reoptimized version; third: compare the results.\ \ You can get a list of the symbolic names known by the \f3 "run-tests" \f0 script by typing:\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f3 \cf0 % ./run-tests -list\ +\f3 % ./run-tests -list\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \cf0 \ul \ulc0 Options recognized by the +\f1\b \cf0 \ul Options recognized by the \f6 \ul "run-tests" \f1 \ul script \f0\b0 \ulnone \ @@ -247,12 +240,10 @@ \f3 'prog.reopt.s' \f0 :\ \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f3 \cf0 % reopt-llc -enable-correct-eh-support -o=prog.reopt.s prog.llvm.bc\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\f3 % reopt-llc -enable-correct-eh-support -o=prog.reopt.s prog.llvm.bc\ -\f0 \cf0 \ +\f0 \ If you are sure that the program does not depend on the proper behavior of setjmp/longjmp calls or invoke/unwind instructions, you can omit the \f3 '-enable-correct-eh-support' \f0 flag.\ @@ -263,9 +254,8 @@ \f3 '-lcpc -lm -lrt -lmalloc -ldl' \f0 . You also need to link the program using the C++ compiler. So the link line will look like this:\ \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f3 \cf0 % g++ -o prog.reopt prog.reopt.s +\f3 % g++ -o prog.reopt prog.reopt.s \f4\i REOPTLIB \f3\i0 /libwholereoptimizer.a \f4\i OTHERLIBS @@ -300,7 +290,7 @@ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \cf0 \ul \ulc0 The +\f1\b \cf0 \ul The \f6 \ul LLVM_REOPT \f1 \ul environment variable \f0\b0 \ulnone \ @@ -310,7 +300,7 @@ \f0 environment variable. For a few of the tunable parameters relating to the trace cache and instrumentation, it may be helpful to look at Anand's thesis for guidance. The list of options that pertain to the reoptimizer is as follows:\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul \ulc0 Instrumentation/Tracing Framework options\ +\cf0 \ul Instrumentation/Tracing Framework options\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ulnone -fli-threshold= \f5\i count @@ -320,7 +310,7 @@ \f0\i0 Number of iterations of SLI before path counters are sampled\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul \ulc0 Phase detection options\ +\cf0 \ul Phase detection options\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ulnone -enable-phase-detect Use a timer interrupt to remove traces periodically from the trace cache\ -timer-int-s= @@ -328,18 +318,25 @@ \f0\i0 Interval (in seconds) between phase detection sweeps\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul \ulc0 Trace layout engine options\ +\cf0 \ul Trace layout engine options\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ulnone -count-trace-cycles Count cycles in optimized trace, when using trace layout engine\ +\cf0 \ulnone -count-trace-cycles Count cycles in optimized trace, when using trace layout engine.\ + This facility uses the Solaris cpc library, and you can sample the\ + data at a specified interval using the +\f3 cputrack +\f0 command.\ + For more information, see the +\f3 cputrack(1) +\f0 man page.\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul \ulc0 Trace optimizer options\ +\cf0 \ul Trace optimizer options\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ulnone -enable-trace-opt Use the new trace optimizer instead of the old trace layout engine\ -run-opt-passes Run optimization passes before unpacking TraceFunction\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul \ulc0 Trace cache options\ +\cf0 \ul Trace cache options\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ulnone -inst-trace-cache-size= \f5\i size @@ -349,7 +346,7 @@ \f0\i0 Trace cache size for optimized code\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul \ulc0 Debugging options\ +\cf0 \ul Debugging options\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ulnone -print-machineinstrs Print generated machine code\ -skip-trace= @@ -359,27 +356,32 @@ \f0\i0 th trace, when using trace optimizer\ -debug Turn on debugging printouts\ -dregalloc=y Turn on SparcV9 register allocator debugging printouts\ -\ + -disable-ttf Disable TraceToFunction, UnpackTraceFunction and branch stitching\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 -disable-utf Disable UnpackTraceFunction and branch stitching\ + -disable-branch-stitch Disable branch stitching\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul \ulc0 Statistics gathering options\ +\cf0 \ul Statistics gathering options\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ulnone -stats Enable statistics output from program\ -time-passes Time each pass, printing elapsed time for each on exit\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul \ulc0 Help options\ +\cf0 \ul Help options\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ulnone -version Display the version of LLVM used\ -help Display available options (-help-hidden for more)\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \cf0 \ul \ulc0 How the trace optimizer works\ +\f1\b \cf0 \ul How the trace optimizer works\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f0\b0 \cf0 \ulnone \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul \ulc0 1. The trace optimizer\ +\cf0 \ul 1. The trace optimizer\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ulnone \ The trace optimizer is the component of the reoptimizer (LLVM's runtime optimization framework) that consumes traces generated by the runtime profiler, converts them into functions, runs global optimizations on them, and then reattaches the optimized trace code back to the original function it came from.\ @@ -389,7 +391,7 @@ Traces given to the trace optimizer should consist of a loop body with one or more side exits. In particular, there should be phi nodes at the beginning of the first trace BasicBlock for variables live across loop iterations; these are detected and handled specially by TraceToFunction.\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul \ulc0 2. TraceToFunction ( +\cf0 \ul 2. TraceToFunction ( \f3 \ul reopt/lib/TraceToFunction \f0 \ul )\ulnone \ \ @@ -427,7 +429,7 @@ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \cf0 \ul \ulc0 Tips for debugging the reoptimizer\ +\f1\b \cf0 \ul Tips for debugging the reoptimizer\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f0\b0 \cf0 \ulnone \ @@ -457,12 +459,12 @@ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \cf0 \ul \ulc0 Reoptimizer testing tools\ +\f1\b \cf0 \ul Reoptimizer testing tools\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f0\b0 \cf0 \ulnone \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul \ulc0 The Trace I/O library ( +\cf0 \ul The Trace I/O library ( \f3 \ul reopt/lib/TraceIO \f0 \ul )\ulnone \ \ @@ -498,7 +500,7 @@ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f3 \cf0 \ul \ulc0 ttftest +\f3 \cf0 \ul ttftest \f0 \ul - a standalone TraceToFunction testing tool ( \f3 \ul reopt/tools/ttftest \f0 \ul )\ulnone \ @@ -528,7 +530,7 @@ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f3 \cf0 \ul \ulc0 dumptrace +\f3 \cf0 \ul dumptrace \f0 \ul - list LLVM assembly for a trace's basic blocks ( \f3 \ul reopt/tools/dumptrace \f0 \ul )\ulnone \ @@ -556,12 +558,12 @@ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b \cf0 \ul \ulc0 Known problems with the current implementation\ +\f1\b \cf0 \ul Known problems with the current implementation\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f0\b0 \cf0 \ulnone \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul \ulc0 UnpackTraceFunction generates inefficient code\ +\cf0 \ul UnpackTraceFunction generates inefficient code\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ulnone \ The machine code generated by the JIT for a TraceFunction assumes that live-in values and pointers to live-out values will be passed in as arguments according to the SparcV9/Solaris ABI's standard calling conventions. Also, the registers allocated to values in the TraceFunction have no relation to the registers allocated to the same values in the matrix function. These two facts pose problems for the efficient integration of optimized trace machine code into the function from which the trace was extracted.\ @@ -573,7 +575,7 @@ Also, UnpackTraceFunction must be careful to avoid read-after-write errors when copying trace live-in values from their matrix-function registers to their TraceFunction registers, if the two sets of registers overlap. We currently work around this problem by emitting stores of each trace live-in value onto the TraceFunction's stack, then (after all the loads) emitting loads of each live-in value into its TraceFunction register. This works correctly but is slow. A similar situation exists at trace exits (epilogs) with respect to live-out values. It should be possible to use a temporary register to accomplish the same thing, if you are careful with the ordering of reads and writes.\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul \ulc0 TraceJITEmitter is poorly integrated with the TraceCache\ +\cf0 \ul TraceJITEmitter is poorly integrated with the TraceCache\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ulnone \ In the current implementation of the TraceJITEmitter, the TraceCache does not keep track of individual traces when the trace JIT emitter inserts them, and so it cannot evict them. This deficiency exists primarily for two reasons: (1) the TraceCache wants to accept a trace in the form of a vector of binary words of machine code, and then perform fixups (e.g., to the PC-relative immediate fields of branch instructions) on its own, and therefore (2) the TraceCache wants to know the addresses of all branch and call instructions, information which the TraceJITEmitter does not have handy. Strategy (1) does not interact well with the target-independent JIT, which uses callbacks into the TraceJITEmitter to fixup backward branches.\ From gaeke at cs.uiuc.edu Fri Oct 15 14:50:09 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 14:50:09 -0500 Subject: [llvm-commits] CVS: reopt/autoconf/AutoRegen.sh Message-ID: <200410151950.OAA25419@zion.cs.uiuc.edu> Changes in directory reopt/autoconf: AutoRegen.sh added (r1.1) --- Log message: Add an autoconf regeneration shell script for reoptimizer. --- Diffs of the changes: (+23 -0) Index: reopt/autoconf/AutoRegen.sh diff -c /dev/null reopt/autoconf/AutoRegen.sh:1.1 *** /dev/null Fri Oct 15 14:50:09 2004 --- reopt/autoconf/AutoRegen.sh Fri Oct 15 14:49:59 2004 *************** *** 0 **** --- 1,23 ---- + #!/bin/sh + die () { + echo "$@" 1>&2 + exit 1 + } + test -d autoconf && test -f autoconf/configure.ac && cd autoconf + test -f configure.ac || die "Can't find 'autoconf' dir; please cd into it first" + autoconf --version | egrep '2\.5[0-9]' > /dev/null + if test $? -ne 0 + then + die "Your autoconf was not detected as being 2.5x" + fi + echo "Note: Warnings about 'AC_CONFIG_SUBDIRS: you should use literals' are ok" + echo "Regenerating aclocal.m4 with aclocal" + cwd=`pwd` + aclocal || die "aclocal failed" + echo "Regenerating configure with autoconf 2.5x" + autoconf -o ../configure configure.ac || die "autoconf failed" + # config.h.in is not used in the reoptimizer: + #cd .. + #echo "Regenerating config.h.in with autoheader 2.5x" + #autoheader -I autoconf -I autoconf/m4 autoconf/configure.ac || die "autoheader failed" + exit 0 From gaeke at persephone.cs.uiuc.edu Fri Oct 15 15:16:40 2004 From: gaeke at persephone.cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 15:16:40 -0500 (CDT) Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP95/145.fpppp/Makefile Message-ID: <20041015201640.CE6925BFF87@persephone.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CFP95/145.fpppp: Makefile updated: 1.2 -> 1.3 --- Log message: Set FP relative tolerance according to spec95 fpppp.pm file --- Diffs of the changes: (+1 -0) Index: llvm-test/External/SPEC/CFP95/145.fpppp/Makefile diff -u llvm-test/External/SPEC/CFP95/145.fpppp/Makefile:1.2 llvm-test/External/SPEC/CFP95/145.fpppp/Makefile:1.3 --- llvm-test/External/SPEC/CFP95/145.fpppp/Makefile:1.2 Thu Oct 7 17:13:50 2004 +++ llvm-test/External/SPEC/CFP95/145.fpppp/Makefile Fri Oct 15 15:16:25 2004 @@ -3,5 +3,6 @@ STDIN_FILENAME = natoms.in STDOUT_FILENAME = natoms.out +FP_TOLERANCE = 0.0550 include ../../Makefile.spec95 From gaeke at persephone.cs.uiuc.edu Fri Oct 15 15:45:41 2004 From: gaeke at persephone.cs.uiuc.edu (Brian Gaeke) Date: Fri, 15 Oct 2004 15:45:41 -0500 (CDT) Subject: [llvm-commits] CVS: llvm-test/Makefile.f2c Message-ID: <20041015204541.86B1E5C002C@persephone.cs.uiuc.edu> Changes in directory llvm-test: Makefile.f2c updated: 1.2 -> 1.3 --- Log message: No space is allowed betweeen -L and the directory name. --- Diffs of the changes: (+2 -2) Index: llvm-test/Makefile.f2c diff -u llvm-test/Makefile.f2c:1.2 llvm-test/Makefile.f2c:1.3 --- llvm-test/Makefile.f2c:1.2 Thu Oct 7 12:20:59 2004 +++ llvm-test/Makefile.f2c Fri Oct 15 15:45:18 2004 @@ -30,6 +30,6 @@ %.c: %.f $(F2C) $< >& /dev/null -CPPFLAGS = -I $(F2C_INC) -LDFLAGS += -L $(F2C_LIB) -lf2c +CPPFLAGS = -I$(F2C_INC) +LDFLAGS += -L$(F2C_LIB) -lf2c From criswell at cs.uiuc.edu Fri Oct 15 15:51:38 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri, 15 Oct 2004 15:51:38 -0500 Subject: [llvm-commits] CVS: llvm-test/External/Namd/Makefile Message-ID: <200410152051.PAA09351@choi.cs.uiuc.edu> Changes in directory llvm-test/External/Namd: Makefile updated: 1.2 -> 1.3 --- Log message: Expand the time limit as this benchmark can easily exceed it. Now I understand why Chris asked me how long it took to run. :) --- Diffs of the changes: (+5 -0) Index: llvm-test/External/Namd/Makefile diff -u llvm-test/External/Namd/Makefile:1.2 llvm-test/External/Namd/Makefile:1.3 --- llvm-test/External/Namd/Makefile:1.2 Fri Oct 15 08:39:33 2004 +++ llvm-test/External/Namd/Makefile Fri Oct 15 15:51:21 2004 @@ -10,5 +10,10 @@ LIBS += -lm -lstdc++ LDFLAGS = -lm -lstdc++ +# +# Expand the runtime limit as this is a very intensive benchmark +# +RUNTIMELIMIT := 1000 + RUN_OPTIONS = --iterations 5 --input $(NAMD_ROOT)/apoa1.input include $(LEVEL)/MultiSource/Makefile.multisrc From criswell at cs.uiuc.edu Fri Oct 15 17:23:21 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri, 15 Oct 2004 17:23:21 -0500 Subject: [llvm-commits] CVS: llvm-test/External/Namd/Makefile Message-ID: <200410152223.RAA18696@choi.cs.uiuc.edu> Changes in directory llvm-test/External/Namd: Makefile updated: 1.3 -> 1.4 --- Log message: Reduce to 2 iterations to save time. --- Diffs of the changes: (+1 -1) Index: llvm-test/External/Namd/Makefile diff -u llvm-test/External/Namd/Makefile:1.3 llvm-test/External/Namd/Makefile:1.4 --- llvm-test/External/Namd/Makefile:1.3 Fri Oct 15 15:51:21 2004 +++ llvm-test/External/Namd/Makefile Fri Oct 15 17:23:00 2004 @@ -15,5 +15,5 @@ # RUNTIMELIMIT := 1000 -RUN_OPTIONS = --iterations 5 --input $(NAMD_ROOT)/apoa1.input +RUN_OPTIONS = --iterations 2 --input $(NAMD_ROOT)/apoa1.input include $(LEVEL)/MultiSource/Makefile.multisrc From lattner at cs.uiuc.edu Fri Oct 15 17:43:40 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 15 Oct 2004 17:43:40 -0500 Subject: [llvm-commits] CVS: llvm-www/img/ChrisPhoto.jpg Message-ID: <200410152243.RAA15985@apoc.cs.uiuc.edu> Changes in directory llvm-www/img: ChrisPhoto.jpg added (r1.1) --- Log message: Web pron --- Diffs of the changes: (+0 -0) Index: llvm-www/img/ChrisPhoto.jpg From lattner at cs.uiuc.edu Fri Oct 15 17:45:05 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 15 Oct 2004 17:45:05 -0500 Subject: [llvm-commits] CVS: llvm-www/Developers.html Message-ID: <200410152245.RAA16009@apoc.cs.uiuc.edu> Changes in directory llvm-www: Developers.html updated: 1.10 -> 1.11 --- Log message: Add a photo --- Diffs of the changes: (+2 -1) Index: llvm-www/Developers.html diff -u llvm-www/Developers.html:1.10 llvm-www/Developers.html:1.11 --- llvm-www/Developers.html:1.10 Fri Oct 15 12:07:06 2004 +++ llvm-www/Developers.html Fri Oct 15 17:44:55 2004 @@ -63,7 +63,8 @@ Chris Lattner - Sabre + + Sabre Reid Spencer From brukman at cs.uiuc.edu Fri Oct 15 18:09:01 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri, 15 Oct 2004 18:09:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Value.cpp Message-ID: <200410152309.SAA00350@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Value.cpp updated: 1.50 -> 1.51 --- Log message: Add a space between the type and name of value when printing error message --- Diffs of the changes: (+1 -1) Index: llvm/lib/VMCore/Value.cpp diff -u llvm/lib/VMCore/Value.cpp:1.50 llvm/lib/VMCore/Value.cpp:1.51 --- llvm/lib/VMCore/Value.cpp:1.50 Wed Sep 1 17:55:37 2004 +++ llvm/lib/VMCore/Value.cpp Fri Oct 15 18:08:50 2004 @@ -49,7 +49,7 @@ // a // if (Uses.begin() != Uses.end()) { - std::cerr << "While deleting: " << *Ty << "%" << Name << "\n"; + std::cerr << "While deleting: " << *Ty << " %" << Name << "\n"; for (use_const_iterator I = Uses.begin(), E = Uses.end(); I != E; ++I) std::cerr << "Use still stuck around after Def is destroyed:" << **I << "\n"; From lattner at cs.uiuc.edu Fri Oct 15 18:22:28 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 15 Oct 2004 18:22:28 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Makefile Message-ID: <200410152322.SAA22028@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode: Makefile updated: 1.4 -> 1.5 --- Log message: There is no reason not to build these in parallel --- Diffs of the changes: (+2 -1) Index: llvm/lib/Bytecode/Makefile diff -u llvm/lib/Bytecode/Makefile:1.4 llvm/lib/Bytecode/Makefile:1.5 --- llvm/lib/Bytecode/Makefile:1.4 Tue Jun 29 18:21:16 2004 +++ llvm/lib/Bytecode/Makefile Fri Oct 15 18:22:15 2004 @@ -6,8 +6,9 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL = ../.. -DIRS = Reader Writer +PARALLEL_DIRS = Reader Writer include $(LEVEL)/Makefile.common From brukman at cs.uiuc.edu Fri Oct 15 18:22:59 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Fri, 15 Oct 2004 18:22:59 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200410152322.SAA00694@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.97 -> 1.98 --- Log message: Fix hyphenation and quoting style for great justice --- Diffs of the changes: (+1 -1) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.97 llvm/tools/opt/opt.cpp:1.98 --- llvm/tools/opt/opt.cpp:1.97 Wed Sep 1 17:55:40 2004 +++ llvm/tools/opt/opt.cpp Fri Oct 15 18:22:48 2004 @@ -122,7 +122,7 @@ std::cerr << "WARNING: It looks like you're attempting to print out a " << "bytecode file. I'm\ngoing to pretend you didn't ask me to do" << " this (for your own good). If you\nREALLY want to taste LLVM" - << " bytecode first hand, you can force output with the\n'-f'" + << " bytecode first-hand, you can force output with the\n`-f'" << " option.\n\n"; NoOutput = true; } From lattner at cs.uiuc.edu Fri Oct 15 18:52:19 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 15 Oct 2004 18:52:19 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Instructions.h InstrTypes.h Message-ID: <200410152352.SAA31291@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instructions.h updated: 1.3 -> 1.4 InstrTypes.h updated: 1.40 -> 1.41 --- Log message: Move the implementation of the clone method for these classes to Instructions.cpp, so that a vtable is not emitted into every translation unit that uses the classes. --- Diffs of the changes: (+19 -25) Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.3 llvm/include/llvm/Instructions.h:1.4 --- llvm/include/llvm/Instructions.h:1.3 Thu Jul 29 07:17:34 2004 +++ llvm/include/llvm/Instructions.h Fri Oct 15 18:52:05 2004 @@ -94,9 +94,7 @@ BasicBlock *InsertAtEnd) : AllocationInst(Ty, ArraySize, Malloc, Name, InsertAtEnd) {} - virtual Instruction *clone() const { - return new MallocInst(*this); - } + virtual MallocInst *clone() const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const MallocInst *) { return true; } @@ -126,9 +124,7 @@ BasicBlock *InsertAtEnd) : AllocationInst(Ty, ArraySize, Alloca, Name, InsertAtEnd) {} - virtual Instruction *clone() const { - return new AllocaInst(*this); - } + virtual AllocaInst *clone() const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const AllocaInst *) { return true; } @@ -154,7 +150,7 @@ explicit FreeInst(Value *Ptr, Instruction *InsertBefore = 0); FreeInst(Value *Ptr, BasicBlock *InsertAfter); - virtual Instruction *clone() const { return new FreeInst(Operands[0]); } + virtual FreeInst *clone() const; virtual bool mayWriteToMemory() const { return true; } @@ -199,7 +195,7 @@ /// void setVolatile(bool V) { Volatile = V; } - virtual Instruction *clone() const { return new LoadInst(*this); } + virtual LoadInst *clone() const; virtual bool mayWriteToMemory() const { return isVolatile(); } @@ -248,7 +244,7 @@ /// void setVolatile(bool V) { Volatile = V; } - virtual Instruction *clone() const { return new StoreInst(*this); } + virtual StoreInst *clone() const; virtual bool mayWriteToMemory() const { return true; } @@ -301,7 +297,7 @@ GetElementPtrInst(Value *Ptr, Value *Idx0, Value *Idx1, const std::string &Name, BasicBlock *InsertAtEnd); - virtual Instruction *clone() const { return new GetElementPtrInst(*this); } + virtual GetElementPtrInst *clone() const; // getType - Overload to return most specific pointer type... inline const PointerType *getType() const { @@ -434,7 +430,7 @@ init(S); } - virtual Instruction *clone() const { return new CastInst(*this); } + virtual CastInst *clone() const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const CastInst *) { return true; } @@ -482,7 +478,7 @@ explicit CallInst(Value *F, const std::string &Name, BasicBlock *InsertAtEnd); - virtual Instruction *clone() const { return new CallInst(*this); } + virtual CallInst *clone() const; bool mayWriteToMemory() const { return true; } // FIXME: These methods should be inline once we eliminate @@ -540,7 +536,7 @@ return static_cast(Instruction::getOpcode()); } - virtual Instruction *clone() const { return new ShiftInst(*this); } + virtual ShiftInst *clone() const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ShiftInst *) { return true; } @@ -593,7 +589,7 @@ return static_cast(Instruction::getOpcode()); } - virtual Instruction *clone() const { return new SelectInst(*this); } + virtual SelectInst *clone() const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SelectInst *) { return true; } @@ -639,7 +635,7 @@ const Type *getArgType() const { return ArgTy; } - virtual Instruction *clone() const { return new VANextInst(*this); } + virtual VANextInst *clone() const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const VANextInst *) { return true; } @@ -680,7 +676,7 @@ init(List); } - virtual Instruction *clone() const { return new VAArgInst(*this); } + virtual VAArgInst *clone() const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const VAArgInst *) { return true; } @@ -712,7 +708,7 @@ : Instruction(Ty, Instruction::PHI, Name, InsertAtEnd) { } - virtual Instruction *clone() const { return new PHINode(*this); } + virtual PHINode *clone() const; /// getNumIncomingValues - Return the number of incoming edges /// @@ -840,7 +836,7 @@ : TerminatorInst(Instruction::Ret, InsertAtEnd) { } - virtual Instruction *clone() const { return new ReturnInst(*this); } + virtual ReturnInst *clone() const; inline const Value *getReturnValue() const { return Operands.size() ? Operands[0].get() : 0; @@ -907,7 +903,7 @@ init(IfTrue, IfFalse, Cond); } - virtual Instruction *clone() const { return new BranchInst(*this); } + virtual BranchInst *clone() const; inline bool isUnconditional() const { return Operands.size() == 1; } inline bool isConditional() const { return Operands.size() == 3; } @@ -982,7 +978,7 @@ init(Value, Default); } - virtual Instruction *clone() const { return new SwitchInst(*this); } + virtual SwitchInst *clone() const; // Accessor Methods for Switch stmt // @@ -1090,7 +1086,7 @@ const std::vector &Params, const std::string &Name, BasicBlock *InsertAtEnd); - virtual Instruction *clone() const { return new InvokeInst(*this); } + virtual InvokeInst *clone() const; bool mayWriteToMemory() const { return true; } @@ -1171,7 +1167,7 @@ : TerminatorInst(Instruction::Unwind, InsertAtEnd) { } - virtual Instruction *clone() const { return new UnwindInst(); } + virtual UnwindInst *clone() const; virtual const BasicBlock *getSuccessor(unsigned idx) const { assert(0 && "UnwindInst has no successors!"); Index: llvm/include/llvm/InstrTypes.h diff -u llvm/include/llvm/InstrTypes.h:1.40 llvm/include/llvm/InstrTypes.h:1.41 --- llvm/include/llvm/InstrTypes.h:1.40 Sun Jun 20 00:02:56 2004 +++ llvm/include/llvm/InstrTypes.h Fri Oct 15 18:52:05 2004 @@ -162,9 +162,7 @@ return static_cast(Instruction::getOpcode()); } - virtual Instruction *clone() const { - return create(getOpcode(), Operands[0], Operands[1]); - } + virtual BinaryOperator *clone() const; /// swapOperands - Exchange the two operands to this instruction. /// This instruction is safe to use on any binary instruction and From lattner at cs.uiuc.edu Fri Oct 15 18:53:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 15 Oct 2004 18:53:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp Message-ID: <200410152353.SAA31659@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Instructions.cpp updated: 1.3 -> 1.4 --- Log message: Move the implementation of the instructions clone methods to this file so that the vtables for these classes are only instantiated in this translation unit, not in every xlation unit they are used. --- Diffs of the changes: (+30 -0) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.3 llvm/lib/VMCore/Instructions.cpp:1.4 --- llvm/lib/VMCore/Instructions.cpp:1.3 Fri Aug 20 01:00:57 2004 +++ llvm/lib/VMCore/Instructions.cpp Fri Oct 15 18:52:53 2004 @@ -802,3 +802,33 @@ assert(idx*2 < Operands.size() && "Successor index out of range!!!"); Operands.erase(Operands.begin()+idx*2, Operands.begin()+(idx+1)*2); } + + +// Define these methods here so vtables don't get emitted into every translation +// unit that uses these classes. + +GetElementPtrInst *GetElementPtrInst::clone() const { + return new GetElementPtrInst(*this); +} + +BinaryOperator *BinaryOperator::clone() const { + return create(getOpcode(), Operands[0], Operands[1]); +} + +MallocInst *MallocInst::clone() const { return new MallocInst(*this); } +AllocaInst *AllocaInst::clone() const { return new AllocaInst(*this); } +FreeInst *FreeInst::clone() const { return new FreeInst(Operands[0]); } +LoadInst *LoadInst::clone() const { return new LoadInst(*this); } +StoreInst *StoreInst::clone() const { return new StoreInst(*this); } +CastInst *CastInst::clone() const { return new CastInst(*this); } +CallInst *CallInst::clone() const { return new CallInst(*this); } +ShiftInst *ShiftInst::clone() const { return new ShiftInst(*this); } +SelectInst *SelectInst::clone() const { return new SelectInst(*this); } +VANextInst *VANextInst::clone() const { return new VANextInst(*this); } +VAArgInst *VAArgInst::clone() const { return new VAArgInst(*this); } +PHINode *PHINode::clone() const { return new PHINode(*this); } +ReturnInst *ReturnInst::clone() const { return new ReturnInst(*this); } +BranchInst *BranchInst::clone() const { return new BranchInst(*this); } +SwitchInst *SwitchInst::clone() const { return new SwitchInst(*this); } +InvokeInst *InvokeInst::clone() const { return new InvokeInst(*this); } +UnwindInst *UnwindInst::clone() const { return new UnwindInst(); } From lattner at cs.uiuc.edu Fri Oct 15 19:29:44 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 15 Oct 2004 19:29:44 -0500 Subject: [llvm-commits] CVS: llvm/docs/BytecodeFormat.html Message-ID: <200410160029.TAA21039@apoc.cs.uiuc.edu> Changes in directory llvm/docs: BytecodeFormat.html updated: 1.31 -> 1.32 --- Log message: None of these have actually been implemented yet. --- Diffs of the changes: (+6 -4) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.31 llvm/docs/BytecodeFormat.html:1.32 --- llvm/docs/BytecodeFormat.html:1.31 Fri Aug 27 02:59:37 2004 +++ llvm/docs/BytecodeFormat.html Fri Oct 15 19:29:30 2004 @@ -45,7 +45,7 @@
    • Version Differences
        -
      1. Version 1.3 Differences From 1.4
      2. +
      3. Version 1.2 Differences From 1.3
      4. Version 1.1 Differences From 1.2
      5. Version 1.0 Differences From 1.1
      6. @@ -1673,9 +1673,11 @@

    + + @@ -1801,7 +1803,7 @@ Reid Spencer and Chris Lattner
    The LLVM Compiler Infrastructure
    -Last modified: $Date: 2004/08/27 07:59:37 $ +Last modified: $Date: 2004/10/16 00:29:30 $ From alkis at cs.uiuc.edu Fri Oct 15 21:38:17 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Fri, 15 Oct 2004 21:38:17 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/OperandStack.h OperandStack.cpp Locals.h Locals.cpp Message-ID: <200410160238.VAA02082@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: OperandStack.h added (r1.1) OperandStack.cpp added (r1.1) Locals.h added (r1.1) Locals.cpp added (r1.1) --- Log message: Add OperandStack and Locals abstractions for use wit hthe upcoming changes to the java bytecode to LLVM compiler. --- Diffs of the changes: (+179 -0) Index: llvm-java/lib/Compiler/OperandStack.h diff -c /dev/null llvm-java/lib/Compiler/OperandStack.h:1.1 *** /dev/null Fri Oct 15 21:38:17 2004 --- llvm-java/lib/Compiler/OperandStack.h Fri Oct 15 21:38:07 2004 *************** *** 0 **** --- 1,49 ---- + //===-- OperandStack.h - Java operand stack ---------------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file contains the abstraction of a Java operand stack. We + // model the java operand stack as a stack of LLVM allocas. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_JAVA_OPERANDSTACK_H + #define LLVM_JAVA_OPERANDSTACK_H + + #include + #include + #include + + #include + + namespace llvm { + + class AllocaInst; + + } // namespace llvm + + namespace llvm { namespace Java { + + class OperandStack { + std::stack > TheStack; + + public: + /// @brief - Pushes the value \c value on the virtual operand + /// stack and appends any instructions to implement this to \c + /// insertAtEnd BasicBlock + void push(Value* value, BasicBlock* insertAtEnd); + + /// @brief - Pops a value from the virtual operand stack and + /// appends any instructions to implement this to \c insertAtEnd + /// BasicBlock + Value* pop(BasicBlock* insertAtEnd); + }; + + } } // namespace llvm::Java + + #endif//LLVM_JAVA_OPERANDSTACK_H Index: llvm-java/lib/Compiler/OperandStack.cpp diff -c /dev/null llvm-java/lib/Compiler/OperandStack.cpp:1.1 *** /dev/null Fri Oct 15 21:38:17 2004 --- llvm-java/lib/Compiler/OperandStack.cpp Fri Oct 15 21:38:07 2004 *************** *** 0 **** --- 1,36 ---- + //===-- OperandStack.cpp - Java operand stack -----------------------------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file contains the abstraction of a Java operand stack. We + // model the java operand stack as a stack of LLVM allocas. + // + //===----------------------------------------------------------------------===// + + #include "OperandStack.h" + #include + #include + #include + + using namespace llvm::Java; + + void OperandStack::push(Value* value, BasicBlock* insertAtEnd) + { + TheStack.push(new AllocaInst(value->getType(), + NULL, + "opStack" + utostr(TheStack.size()), + insertAtEnd)); + new StoreInst(value, TheStack.top(), false, insertAtEnd); + } + + llvm::Value* OperandStack::pop(BasicBlock* insertAtEnd) + { + Value* val = TheStack.top(); + TheStack.pop(); + return new LoadInst(val, "pop", false, insertAtEnd); + } Index: llvm-java/lib/Compiler/Locals.h diff -c /dev/null llvm-java/lib/Compiler/Locals.h:1.1 *** /dev/null Fri Oct 15 21:38:17 2004 --- llvm-java/lib/Compiler/Locals.h Fri Oct 15 21:38:07 2004 *************** *** 0 **** --- 1,50 ---- + //===-- Locals.h - Java locals ----------------------------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file contains the abstraction of Java locals. We model the + // locals as an array of lazily created allocas. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_JAVA_LOCALS_H + #define LLVM_JAVA_LOCALS_H + + #include + #include + + namespace llvm { + + class AllocaInst; + class BasicBlock; + class Value; + + } // namespace llvm + + namespace llvm { namespace Java { + + class Locals { + std::vector TheLocals; + + public: + explicit Locals(unsigned maxLocals); + + /// @brief - Stores the value \c value on the \c i'th local + /// variable and appends any instructions to implement this to \c + /// insertAtEnd BasicBlock + void store(unsigned i, Value* value, BasicBlock* insertAtEnd); + + /// @brief - Loads the value of the \c i'th local variable and + /// appends any instructions to implement this to \c insertAtEnd + /// BasicBlock + Value* load(unsigned i, BasicBlock* insertAtEnd); + }; + + } } // namespace llvm::Java + + #endif//LLVM_JAVA_LOCALS_H Index: llvm-java/lib/Compiler/Locals.cpp diff -c /dev/null llvm-java/lib/Compiler/Locals.cpp:1.1 *** /dev/null Fri Oct 15 21:38:17 2004 --- llvm-java/lib/Compiler/Locals.cpp Fri Oct 15 21:38:07 2004 *************** *** 0 **** --- 1,44 ---- + //===-- Locals.h - Java locals ----------------------------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file contains the abstraction of Java locals. We model the + // locals as an array of lazily created allocas. + // + //===----------------------------------------------------------------------===// + + #include "Locals.h" + #include + #include + #include + + using namespace llvm::Java; + + Locals::Locals(unsigned maxLocals) + : TheLocals(maxLocals) + { + + } + + void Locals::store(unsigned i, Value* value, BasicBlock* insertAtEnd) + { + if (!TheLocals[i] || + TheLocals[i]->getType()->getElementType() != value->getType()) + TheLocals[i] = new AllocaInst(value->getType(), + NULL, + "local" + utostr(i), + insertAtEnd); + + new StoreInst(value, TheLocals[i], false, insertAtEnd); + } + + llvm::Value* Locals::load(unsigned i, BasicBlock* insertAtEnd) + { + assert(TheLocals[i] && "Attempt to load a non initialized global!"); + return new LoadInst(TheLocals[i], "load", false, insertAtEnd); + } From lattner at cs.uiuc.edu Sat Oct 16 11:07:24 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 11:07:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <200410161607.LAA27842@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: BasicAliasAnalysis.cpp updated: 1.53 -> 1.54 --- Log message: Be more careful about looking for constants when we really want constantint's. --- Diffs of the changes: (+8 -10) Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.53 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.54 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.53 Fri Sep 3 13:19:51 2004 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Sat Oct 16 11:07:10 2004 @@ -452,7 +452,7 @@ bool AllAreZeros = true; for (unsigned i = UnequalOper; i != MaxOperands; ++i) - if (!isa(GEP1Ops[i]) || + if (!isa(GEP1Ops[i]) || !cast(GEP1Ops[i])->isNullValue()) { AllAreZeros = false; break; @@ -478,8 +478,8 @@ const Value *G2Oper = GEP2Ops[FirstConstantOper]; if (G1Oper != G2Oper) // Found non-equal constant indexes... - if (Constant *G1OC = dyn_cast(const_cast(G1Oper))) - if (Constant *G2OC = dyn_cast(const_cast(G2Oper))) { + if (Constant *G1OC = dyn_cast(const_cast(G1Oper))) + if (Constant *G2OC = dyn_cast(const_cast(G2Oper))){ if (G1OC->getType() != G2OC->getType()) { // Sign extend both operands to long. G1OC = ConstantExpr::getSignExtend(G1OC, Type::LongTy); @@ -489,8 +489,8 @@ } if (G1OC != G2OC) { - // Make sure they are comparable (ie, not constant expressions)... - // and make sure the GEP with the smaller leading constant is GEP1. + // Make sure they are comparable (ie, not constant expressions), and + // make sure the GEP with the smaller leading constant is GEP1. Constant *Compare = ConstantExpr::getSetGT(G1OC, G2OC); if (ConstantBool *CV = dyn_cast(Compare)) { if (CV->getValue()) // If they are comparable and G2 > G1 @@ -555,11 +555,9 @@ // offset that each of the GEP's is reaching. To do this, we have to convert // all variable references to constant references. To do this, we convert the // initial equal sequence of variables into constant zeros to start with. - for (unsigned i = 0; i != FirstConstantOper; ++i) { - if (!isa(GEP1Ops[i]) || isa(GEP1Ops[i]) || - !isa(GEP2Ops[i]) || isa(GEP2Ops[i])) + for (unsigned i = 0; i != FirstConstantOper; ++i) + if (!isa(GEP1Ops[i]) || !isa(GEP2Ops[i])) GEP1Ops[i] = GEP2Ops[i] = Constant::getNullValue(Type::UIntTy); - } // We know that GEP1Ops[FirstConstantOper] & GEP2Ops[FirstConstantOper] are ok @@ -569,7 +567,7 @@ const Value *Op2 = i < GEP2Ops.size() ? GEP2Ops[i] : 0; // If they are equal, use a zero index... if (Op1 == Op2 && BasePtr1Ty == BasePtr2Ty) { - if (!isa(Op1) || isa(Op1)) + if (!isa(Op1)) GEP1Ops[i] = GEP2Ops[i] = Constant::getNullValue(Op1->getType()); // Otherwise, just keep the constants we have. } else { From lattner at cs.uiuc.edu Sat Oct 16 11:37:56 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 11:37:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9InstrForest.h Message-ID: <200410161637.LAA02990@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9InstrForest.h updated: 1.1 -> 1.2 --- Log message: Fix file header --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/SparcV9/SparcV9InstrForest.h diff -u llvm/lib/Target/SparcV9/SparcV9InstrForest.h:1.1 llvm/lib/Target/SparcV9/SparcV9InstrForest.h:1.2 --- llvm/lib/Target/SparcV9/SparcV9InstrForest.h:1.1 Wed Aug 4 02:29:16 2004 +++ llvm/lib/Target/SparcV9/SparcV9InstrForest.h Sat Oct 16 11:37:42 2004 @@ -1,4 +1,4 @@ -//===- SparcV9InstrForest.cpp - SparcV9 BURG Instruction Selector Trees ---===// +//===- SparcV9InstrForest.h - SparcV9 BURG Instruction Selector Trees -----===// // // The LLVM Compiler Infrastructure // From lattner at cs.uiuc.edu Sat Oct 16 12:13:09 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 12:13:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/Makefile Message-ID: <200410161713.MAA15350@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: Makefile updated: 1.47 -> 1.48 --- Log message: Add a missing dependency --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/SparcV9/Makefile diff -u llvm/lib/Target/SparcV9/Makefile:1.47 llvm/lib/Target/SparcV9/Makefile:1.48 --- llvm/lib/Target/SparcV9/Makefile:1.47 Sun Oct 10 18:36:09 2004 +++ llvm/lib/Target/SparcV9/Makefile Sat Oct 16 12:12:55 2004 @@ -23,7 +23,7 @@ SparcV9.burg.in1 : $(SourceDir)/SparcV9.burg.in $(CXX) -E -I$(LLVM_SRC_ROOT)/include $(DEBUG_FLAG) -x c++ $< | $(SED) '/^#/d' | $(SED) 's/Ydefine/#define/' > $@ -SparcV9.burm : SparcV9.burg.in1 +SparcV9.burm : SparcV9.burg.in1 $(LLVM_SRC_ROOT)/include/llvm/Instruction.def $(CXX) -E -I$(LLVM_SRC_ROOT)/include $(DEBUG_FLAG) -x c++ $< | $(SED) '/^#/d' | $(SED) 's/^Xinclude/#include/' | $(SED) 's/^Xdefine/#define/' > $@ SparcV9.burm.cpp: SparcV9.burm From lattner at cs.uiuc.edu Sat Oct 16 13:04:09 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:04:09 -0500 Subject: [llvm-commits] CVS: llvm/docs/BytecodeFormat.html Message-ID: <200410161804.NAA18179@apoc.cs.uiuc.edu> Changes in directory llvm/docs: BytecodeFormat.html updated: 1.32 -> 1.33 --- Log message: Add missing 'Instruction Opcodes' bullet to TOC Update for changes in LLVM 1.4 bytecode format. --- Diffs of the changes: (+101 -39) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.32 llvm/docs/BytecodeFormat.html:1.33 --- llvm/docs/BytecodeFormat.html:1.32 Fri Oct 15 19:29:30 2004 +++ llvm/docs/BytecodeFormat.html Sat Oct 16 13:03:55 2004 @@ -40,12 +40,13 @@
  • Function Definition
  • Compaction Table
  • Instruction List
  • +
  • Instruction Opcodes
  • Symbol Table
  • Version Differences
      - +
    1. Version 1.3 Differences From 1.4
    2. Version 1.2 Differences From 1.3
    3. Version 1.1 Differences From 1.2
    4. Version 1.0 Differences From 1.1
    5. @@ -934,8 +935,8 @@ definitions occurring in the module. - zlist(uint24_vbr) - A zero terminated list of function types + zlist(funcfield) + A zero terminated list of function definitions occurring in the module. @@ -958,6 +959,7 @@ + @@ -1011,6 +1013,36 @@ + + + +
      +

      Functions are written using an uint32_vbr +that encodes information about the function and a set of flags.

      + +

      The table below provides the bit layout of the uint32_vbr that describes the function.

      + + + + + + + + + + + + + + + + +
      TypeDescription
      bit(0-4)Reserved for future use. Currently set to 00001.
      bit(5-)Type slot number of type for the function.
      + +
      +
      @@ -1114,8 +1146,13 @@ href="#uint32_vbr">uint32_vbr encoded value slot numbers to the constant field values of the structure. -

      When the number of operands to the constant is non-zero, we have a -constant expression and its field format is provided in the table below.

      + +

      When the number of operands to the constant is one, we have an 'undef' value +of the specified type.

      + +

      When the number of operands to the constant is greater than one, we have a +constant expression and its field format is provided in the table below, and the +number is equal to the number of operands+1.

      @@ -1466,7 +1503,7 @@ - +

      Instructions encode an opcode that identifies the kind of instruction. Opcodes are an enumerated integer value. The specific values used depend on @@ -1491,41 +1528,42 @@

      + - - - - - + + + + + - - - + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + +
      Switch311.0
      Invoke411.0
      Unwind511.0
      Unreachable611.4
      Binary Operators
      Add611.0
      Sub711.0
      Mul811.0
      Div911.0
      Rem1011.0
      Add711.0
      Sub811.0
      Mul911.0
      Div1011.0
      Rem1111.0
      Logical Operators
      And1111.0
      Or1211.0
      Xor1311.0
      And1211.0
      Or1311.0
      Xor1411.0
      Binary Comparison Operators
      SetEQ1411.0
      SetNE1511.0
      SetLE1611.0
      SetGE1711.0
      SetLT1811.0
      SetGT1911.0
      SetEQ1511.0
      SetNE1611.0
      SetLE1711.0
      SetGE1811.0
      SetLT1911.0
      SetGT2011.0
      Memory Operators
      Malloc2011.0
      Free2111.0
      Alloca2211.0
      Load2311.0
      Store2411.0
      GetElementPtr2511.0
      Malloc2111.0
      Free2211.0
      Alloca2311.0
      Load2411.0
      Store2511.0
      GetElementPtr2611.0
      Other Operators
      PHI2611.0
      Cast2711.0
      Call2811.0
      Shl2911.0
      Shr3011.0
      VANext3111.0
      VAArg3211.0
      Select3321.2
      UserOp13411.0
      UserOp23511.0
      PHI2711.0
      Cast2811.0
      Call2911.0
      Shl3011.0
      Shr3111.0
      VANext3211.0
      VAArg3311.0
      Select3421.2
      UserOp13511.0
      UserOp23611.0
      @@ -1672,11 +1710,33 @@ describes the differences between that version and the one that follows.

      + - + 1.4 + +
      Unreachable Instruction
      +
      +

      The LLVM Unreachable instruction + was added in version 1.4 of LLVM. This caused all instruction numbers after + it to shift down by one.

      +
      + +
      Function Flags
      +
      +

      LLVM bytecode versions prior to 1.4 did not include the 5 bit offset + in the function list in the Module Global Info block.

      +
      + +
      Function Flags
      +
      +

      LLVM bytecode versions prior to 1.4 did not include the 'undef' constant + value, which affects the encoding of Constant + Fields.

      +
      + + +
      Type Derives From Value

      In version 1.2, the Type class in the LLVM IR derives from the Value @@ -1803,7 +1865,7 @@ Reid Spencer and Chris Lattner
      The LLVM Compiler Infrastructure
      -Last modified: $Date: 2004/10/16 00:29:30 $ +Last modified: $Date: 2004/10/16 18:03:55 $ From lattner at cs.uiuc.edu Sat Oct 16 13:04:24 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:04:24 -0500 Subject: [llvm-commits] CVS: llvm/docs/LangRef.html Message-ID: <200410161804.NAA18196@apoc.cs.uiuc.edu> Changes in directory llvm/docs: LangRef.html updated: 1.75 -> 1.76 --- Log message: Document unreachable instruction --- Diffs of the changes: (+55 -16) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.75 llvm/docs/LangRef.html:1.76 --- llvm/docs/LangRef.html:1.75 Mon Sep 27 16:51:25 2004 +++ llvm/docs/LangRef.html Sat Oct 16 13:04:13 2004 @@ -51,6 +51,7 @@

    6. 'switch' Instruction
    7. 'invoke' Instruction
    8. 'unwind' Instruction
    9. +
    10. 'unreachable' Instruction
  • Binary Operations @@ -753,8 +754,9 @@

    There are five different terminator instructions: the 'ret' instruction, the 'br' instruction, the 'switch' instruction, -the 'invoke' instruction, and the 'unwind' instruction.

    +the 'invoke' instruction, the 'unwind' instruction, and the 'unreachable' instruction.

    + + + + +
    + +
    Syntax:
    +
    +  unwind
    +
    + +
    Overview:
    + +

    The 'unwind' instruction unwinds the stack, continuing control flow +at the first callee in the dynamic call stack which used an invoke instruction to perform the call. This is +primarily used to implement exception handling.

    + +
    Semantics:
    + +

    The 'unwind' intrinsic causes execution of the current function to +immediately halt. The dynamic call stack is then searched for the first invoke instruction on the call stack. Once found, +execution continues at the "exceptional" destination block specified by the +invoke instruction. If there is no invoke instruction in the +dynamic call chain, undefined behavior results.

    +
    + + + + +
    +
    Syntax:
    -
      unwind
    +
    +  unreachable
    +
    +
    Overview:
    -

    The 'unwind' instruction unwinds the stack, continuing -control flow at the first callee in the dynamic call stack which used -an invoke instruction to perform the -call. This is primarily used to implement exception handling.

    -
    Semantics:
    -

    The 'unwind' intrinsic causes execution of the current -function to immediately halt. The dynamic call stack is then searched -for the first invoke instruction on -the call stack. Once found, execution continues at the "exceptional" -destination block specified by the invoke instruction. If -there is no invoke instruction in the dynamic call chain, -undefined behavior results.

    + +

    The 'unreachable' instruction has no defined semantics. This +instruction is used to inform the optimizer that a particular portion of the +code is not reachable. This can be used to indicate that the code after a +no-return function cannot be reached, and other facts.

    + +
    Semantics:
    + +

    The 'unreachable' instruction has no defined semantics.

    + + +
    @@ -2658,7 +2697,7 @@ Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/09/27 21:51:25 $ + Last modified: $Date: 2004/10/16 18:04:13 $ From lattner at cs.uiuc.edu Sat Oct 16 13:06:18 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:06:18 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Value.h Message-ID: <200410161806.NAA18235@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Value.h updated: 1.64 -> 1.65 --- Log message: Add new UndefValueVal type --- Diffs of the changes: (+6 -4) Index: llvm/include/llvm/Value.h diff -u llvm/include/llvm/Value.h:1.64 llvm/include/llvm/Value.h:1.65 --- llvm/include/llvm/Value.h:1.64 Thu Sep 23 09:49:45 2004 +++ llvm/include/llvm/Value.h Sat Oct 16 13:06:07 2004 @@ -126,6 +126,7 @@ BasicBlockVal, // This is an instance of BasicBlock FunctionVal, // This is an instance of Function GlobalVariableVal, // This is an instance of GlobalVariable + UndefValueVal, // This is an instance of UndefValue ConstantExprVal, // This is an instance of ConstantExpr ConstantAggregateZeroVal, // This is an instance of ConstantAggregateNull SimpleConstantVal, // This is some other type of Constant @@ -189,11 +190,12 @@ // the subtype header files to test to see if the value is a subclass... // template <> inline bool isa_impl(const Value &Val) { - return Val.getValueType() == Value::ConstantExprVal || - Val.getValueType() == Value::SimpleConstantVal || - Val.getValueType() == Value::ConstantAggregateZeroVal || + return Val.getValueType() == Value::SimpleConstantVal || Val.getValueType() == Value::FunctionVal || - Val.getValueType() == Value::GlobalVariableVal; + Val.getValueType() == Value::GlobalVariableVal || + Val.getValueType() == Value::ConstantExprVal || + Val.getValueType() == Value::ConstantAggregateZeroVal || + Val.getValueType() == Value::UndefValueVal; } template <> inline bool isa_impl(const Value &Val) { return Val.getValueType() == Value::ArgumentVal; From lattner at cs.uiuc.edu Sat Oct 16 13:06:18 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:06:18 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Instruction.def Message-ID: <200410161806.NAA18238@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instruction.def updated: 1.13 -> 1.14 --- Log message: Add new unreachable instruction --- Diffs of the changes: (+45 -44) Index: llvm/include/llvm/Instruction.def diff -u llvm/include/llvm/Instruction.def:1.13 llvm/include/llvm/Instruction.def:1.14 --- llvm/include/llvm/Instruction.def:1.13 Thu Mar 11 23:50:53 2004 +++ llvm/include/llvm/Instruction.def Sat Oct 16 13:05:37 2004 @@ -80,60 +80,61 @@ // instructions for it to be a well formed basic block. // FIRST_TERM_INST ( 1) -HANDLE_TERM_INST ( 1, Ret , ReturnInst) -HANDLE_TERM_INST ( 2, Br , BranchInst) -HANDLE_TERM_INST ( 3, Switch, SwitchInst) -HANDLE_TERM_INST ( 4, Invoke, InvokeInst) -HANDLE_TERM_INST ( 5, Unwind, UnwindInst) - LAST_TERM_INST ( 5) +HANDLE_TERM_INST ( 1, Ret , ReturnInst) +HANDLE_TERM_INST ( 2, Br , BranchInst) +HANDLE_TERM_INST ( 3, Switch , SwitchInst) +HANDLE_TERM_INST ( 4, Invoke , InvokeInst) +HANDLE_TERM_INST ( 5, Unwind , UnwindInst) +HANDLE_TERM_INST ( 6, Unreachable, UnreachableInst) + LAST_TERM_INST ( 6) // Standard binary operators... - FIRST_BINARY_INST( 6) -HANDLE_BINARY_INST( 6, Add , BinaryOperator) -HANDLE_BINARY_INST( 7, Sub , BinaryOperator) -HANDLE_BINARY_INST( 8, Mul , BinaryOperator) -HANDLE_BINARY_INST( 9, Div , BinaryOperator) -HANDLE_BINARY_INST(10, Rem , BinaryOperator) + FIRST_BINARY_INST( 7) +HANDLE_BINARY_INST( 7, Add , BinaryOperator) +HANDLE_BINARY_INST( 8, Sub , BinaryOperator) +HANDLE_BINARY_INST( 9, Mul , BinaryOperator) +HANDLE_BINARY_INST(10, Div , BinaryOperator) +HANDLE_BINARY_INST(11, Rem , BinaryOperator) // Logical operators... -HANDLE_BINARY_INST(11, And , BinaryOperator) -HANDLE_BINARY_INST(12, Or , BinaryOperator) -HANDLE_BINARY_INST(13, Xor , BinaryOperator) +HANDLE_BINARY_INST(12, And , BinaryOperator) +HANDLE_BINARY_INST(13, Or , BinaryOperator) +HANDLE_BINARY_INST(14, Xor , BinaryOperator) // Binary comparison operators... -HANDLE_BINARY_INST(14, SetEQ , SetCondInst) -HANDLE_BINARY_INST(15, SetNE , SetCondInst) -HANDLE_BINARY_INST(16, SetLE , SetCondInst) -HANDLE_BINARY_INST(17, SetGE , SetCondInst) -HANDLE_BINARY_INST(18, SetLT , SetCondInst) -HANDLE_BINARY_INST(19, SetGT , SetCondInst) - LAST_BINARY_INST(19) +HANDLE_BINARY_INST(15, SetEQ , SetCondInst) +HANDLE_BINARY_INST(16, SetNE , SetCondInst) +HANDLE_BINARY_INST(17, SetLE , SetCondInst) +HANDLE_BINARY_INST(18, SetGE , SetCondInst) +HANDLE_BINARY_INST(19, SetLT , SetCondInst) +HANDLE_BINARY_INST(20, SetGT , SetCondInst) + LAST_BINARY_INST(20) // Memory operators... - FIRST_MEMORY_INST(20) -HANDLE_MEMORY_INST(20, Malloc, MallocInst) // Heap management instructions -HANDLE_MEMORY_INST(21, Free , FreeInst ) -HANDLE_MEMORY_INST(22, Alloca, AllocaInst) // Stack management -HANDLE_MEMORY_INST(23, Load , LoadInst ) // Memory manipulation instrs -HANDLE_MEMORY_INST(24, Store , StoreInst ) -HANDLE_MEMORY_INST(25, GetElementPtr, GetElementPtrInst) - LAST_MEMORY_INST(25) + FIRST_MEMORY_INST(21) +HANDLE_MEMORY_INST(21, Malloc, MallocInst) // Heap management instructions +HANDLE_MEMORY_INST(22, Free , FreeInst ) +HANDLE_MEMORY_INST(23, Alloca, AllocaInst) // Stack management +HANDLE_MEMORY_INST(24, Load , LoadInst ) // Memory manipulation instrs +HANDLE_MEMORY_INST(25, Store , StoreInst ) +HANDLE_MEMORY_INST(26, GetElementPtr, GetElementPtrInst) + LAST_MEMORY_INST(26) // Other operators... - FIRST_OTHER_INST(26) -HANDLE_OTHER_INST(26, PHI , PHINode ) // PHI node instruction -HANDLE_OTHER_INST(27, Cast , CastInst ) // Type cast -HANDLE_OTHER_INST(28, Call , CallInst ) // Call a function - -HANDLE_OTHER_INST(29, Shl , ShiftInst ) // Shift operations -HANDLE_OTHER_INST(30, Shr , ShiftInst ) -HANDLE_OTHER_INST(31, VANext , VANextInst ) // vanext instruction -HANDLE_OTHER_INST(32, VAArg , VAArgInst ) // vaarg instruction -HANDLE_OTHER_INST(33, Select , SelectInst ) // select instruction - -HANDLE_OTHER_INST(34, UserOp1, Instruction) // May be used internally in a pass -HANDLE_OTHER_INST(35, UserOp2, Instruction) - LAST_OTHER_INST(35) + FIRST_OTHER_INST(27) +HANDLE_OTHER_INST(27, PHI , PHINode ) // PHI node instruction +HANDLE_OTHER_INST(28, Cast , CastInst ) // Type cast +HANDLE_OTHER_INST(29, Call , CallInst ) // Call a function + +HANDLE_OTHER_INST(30, Shl , ShiftInst ) // Shift operations +HANDLE_OTHER_INST(31, Shr , ShiftInst ) +HANDLE_OTHER_INST(32, VANext , VANextInst ) // vanext instruction +HANDLE_OTHER_INST(33, VAArg , VAArgInst ) // vaarg instruction +HANDLE_OTHER_INST(34, Select , SelectInst ) // select instruction + +HANDLE_OTHER_INST(35, UserOp1, Instruction) // May be used internally in a pass +HANDLE_OTHER_INST(36, UserOp2, Instruction) + LAST_OTHER_INST(36) #undef FIRST_TERM_INST #undef HANDLE_TERM_INST From lattner at cs.uiuc.edu Sat Oct 16 13:06:34 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:06:34 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/InstVisitor.h Message-ID: <200410161806.NAA18250@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: InstVisitor.h updated: 1.31 -> 1.32 --- Log message: Add support for the unreachable instruction --- Diffs of the changes: (+1 -0) Index: llvm/include/llvm/Support/InstVisitor.h diff -u llvm/include/llvm/Support/InstVisitor.h:1.31 llvm/include/llvm/Support/InstVisitor.h:1.32 --- llvm/include/llvm/Support/InstVisitor.h:1.31 Sun May 23 15:54:39 2004 +++ llvm/include/llvm/Support/InstVisitor.h Sat Oct 16 13:06:23 2004 @@ -156,6 +156,7 @@ RetTy visitSwitchInst(SwitchInst &I) { DELEGATE(TerminatorInst);} RetTy visitInvokeInst(InvokeInst &I) { DELEGATE(TerminatorInst);} RetTy visitUnwindInst(UnwindInst &I) { DELEGATE(TerminatorInst);} + RetTy visitUnreachableInst(UnreachableInst &I) { DELEGATE(TerminatorInst);} RetTy visitSetCondInst(SetCondInst &I) { DELEGATE(BinaryOperator);} RetTy visitMallocInst(MallocInst &I) { DELEGATE(AllocationInst);} RetTy visitAllocaInst(AllocaInst &I) { DELEGATE(AllocationInst);} From lattner at cs.uiuc.edu Sat Oct 16 13:06:35 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:06:35 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Instructions.h Message-ID: <200410161806.NAA18254@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instructions.h updated: 1.4 -> 1.5 --- Log message: Add new UnreachableInst class --- Diffs of the changes: (+37 -0) Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.4 llvm/include/llvm/Instructions.h:1.5 --- llvm/include/llvm/Instructions.h:1.4 Fri Oct 15 18:52:05 2004 +++ llvm/include/llvm/Instructions.h Sat Oct 16 13:05:54 2004 @@ -1187,6 +1187,43 @@ } }; +//===----------------------------------------------------------------------===// +// UnreachableInst Class +//===----------------------------------------------------------------------===// + +//===--------------------------------------------------------------------------- +/// UnreachableInst - This function has undefined behavior. In particular, the +/// presence of this instruction indicates some higher level knowledge that the +/// end of the block cannot be reached. +/// +struct UnreachableInst : public TerminatorInst { + UnreachableInst(Instruction *InsertBefore = 0) + : TerminatorInst(Instruction::Unreachable, InsertBefore) { + } + UnreachableInst(BasicBlock *InsertAtEnd) + : TerminatorInst(Instruction::Unreachable, InsertAtEnd) { + } + + virtual UnreachableInst *clone() const; + + virtual const BasicBlock *getSuccessor(unsigned idx) const { + assert(0 && "UnreachableInst has no successors!"); + abort(); + return 0; + } + virtual void setSuccessor(unsigned idx, BasicBlock *NewSucc); + virtual unsigned getNumSuccessors() const { return 0; } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const UnreachableInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::Unreachable; + } + static inline bool classof(const Value *V) { + return isa(V) && classof(cast(V)); + } +}; + } // End llvm namespace #endif From lattner at cs.uiuc.edu Sat Oct 16 13:06:36 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:06:36 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Constants.h Message-ID: <200410161806.NAA18260@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.59 -> 1.60 --- Log message: Add new UndefValue class --- Diffs of the changes: (+31 -0) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.59 llvm/include/llvm/Constants.h:1.60 --- llvm/include/llvm/Constants.h:1.59 Tue Oct 12 23:44:53 2004 +++ llvm/include/llvm/Constants.h Sat Oct 16 13:05:25 2004 @@ -626,6 +626,37 @@ } }; + +//===----------------------------------------------------------------------===// +/// UndefValue - 'undef' values are things that do not have specified contents. +/// These are used for a variety of purposes, including global variable +/// initializers and operands to instructions. 'undef' values can occur with +/// any type. +/// +class UndefValue : public Constant { + friend struct ConstantCreator; + UndefValue(const UndefValue &); // DO NOT IMPLEMENT +protected: + UndefValue(const Type *T) : Constant(T, UndefValueVal) {} +public: + /// get() - Static factory methods - Return an 'undef' object of the specified + /// type. + /// + static UndefValue *get(const Type *T); + + /// isNullValue - Return true if this is the value that would be returned by + /// getNullValue. + virtual bool isNullValue() const { return false; } + + virtual void destroyConstant(); + + /// Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const UndefValue *) { return true; } + static bool classof(const Value *V) { + return V->getValueType() == UndefValueVal; + } +}; + } // End llvm namespace #endif From lattner at cs.uiuc.edu Sat Oct 16 13:06:21 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:06:21 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Constant.h Message-ID: <200410161806.NAA18242@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constant.h updated: 1.17 -> 1.18 --- Log message: UndefValue's are constants --- Diffs of the changes: (+2 -1) Index: llvm/include/llvm/Constant.h diff -u llvm/include/llvm/Constant.h:1.17 llvm/include/llvm/Constant.h:1.18 --- llvm/include/llvm/Constant.h:1.17 Tue Aug 3 21:43:00 2004 +++ llvm/include/llvm/Constant.h Sat Oct 16 13:05:10 2004 @@ -69,7 +69,8 @@ V->getValueType() == Value::ConstantExprVal || V->getValueType() == Value::ConstantAggregateZeroVal || V->getValueType() == Value::FunctionVal || - V->getValueType() == Value::GlobalVariableVal; + V->getValueType() == Value::GlobalVariableVal || + V->getValueType() == Value::UndefValueVal; } /// replaceUsesOfWithOnConstant - This method is a special form of From lattner at cs.uiuc.edu Sat Oct 16 13:06:54 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:06:54 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h Message-ID: <200410161806.NAA18269@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms/Utils: UnifyFunctionExitNodes.h updated: 1.17 -> 1.18 --- Log message: Add support for the unreachable instruction --- Diffs of the changes: (+4 -3) Index: llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h diff -u llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:1.17 llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:1.18 --- llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:1.17 Tue Nov 11 16:41:31 2003 +++ llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h Sat Oct 16 13:06:43 2004 @@ -23,18 +23,19 @@ namespace llvm { struct UnifyFunctionExitNodes : public FunctionPass { - BasicBlock *ReturnBlock, *UnwindBlock; + BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock; public: UnifyFunctionExitNodes() : ReturnBlock(0), UnwindBlock(0) {} // We can preserve non-critical-edgeness when we unify function exit nodes virtual void getAnalysisUsage(AnalysisUsage &AU) const; - // getReturn|UnwindBlock - Return the new single (or nonexistant) return or - // unwind basic blocks in the CFG. + // getReturn|Unwind|UnreachableBlock - Return the new single (or nonexistant) + // return, unwind, or unreachable basic blocks in the CFG. // BasicBlock *getReturnBlock() const { return ReturnBlock; } BasicBlock *getUnwindBlock() const { return UnwindBlock; } + BasicBlock *getUnreachableBlock() const { return UnreachableBlock; } virtual bool runOnFunction(Function &F); }; From lattner at cs.uiuc.edu Sat Oct 16 13:07:57 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:07:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Message-ID: <200410161807.NAA18291@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.107 -> 1.108 --- Log message: Implement UndefValue class --- Diffs of the changes: (+45 -0) Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.107 llvm/lib/VMCore/Constants.cpp:1.108 --- llvm/lib/VMCore/Constants.cpp:1.107 Mon Oct 11 17:52:25 2004 +++ llvm/lib/VMCore/Constants.cpp Sat Oct 16 13:07:16 2004 @@ -1098,6 +1098,51 @@ } +//---- UndefValue::get() implementation... +// + +namespace llvm { + // UndefValue does not take extra "value" argument... + template + struct ConstantCreator { + static UndefValue *create(const Type *Ty, const ValType &V) { + return new UndefValue(Ty); + } + }; + + template<> + struct ConvertConstantType { + static void convert(UndefValue *OldC, const Type *NewTy) { + // Make everyone now use a constant of the new type. + Constant *New = UndefValue::get(NewTy); + assert(New != OldC && "Didn't replace constant??"); + OldC->uncheckedReplaceAllUsesWith(New); + OldC->destroyConstant(); // This constant is now dead, destroy it. + } + }; +} + +static ValueMap UndefValueConstants; + +static char getValType(UndefValue *) { + return 0; +} + + +UndefValue *UndefValue::get(const Type *Ty) { + return UndefValueConstants.getOrCreate(Ty, 0); +} + +// destroyConstant - Remove the constant from the constant table. +// +void UndefValue::destroyConstant() { + UndefValueConstants.remove(this); + destroyConstantImpl(); +} + + + + //---- ConstantExpr::get() implementations... // typedef std::pair > ExprMapKeyType; From lattner at cs.uiuc.edu Sat Oct 16 13:08:17 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:08:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Instruction.cpp Instructions.cpp Linker.cpp Message-ID: <200410161808.NAA18309@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.162 -> 1.163 Instruction.cpp updated: 1.39 -> 1.40 Instructions.cpp updated: 1.4 -> 1.5 Linker.cpp updated: 1.86 -> 1.87 --- Log message: Add support for undef and unreachable --- Diffs of the changes: (+14 -1) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.162 llvm/lib/VMCore/AsmWriter.cpp:1.163 --- llvm/lib/VMCore/AsmWriter.cpp:1.162 Tue Sep 14 00:43:23 2004 +++ llvm/lib/VMCore/AsmWriter.cpp Sat Oct 16 13:08:06 2004 @@ -518,6 +518,9 @@ } else if (isa(CV)) { Out << "null"; + } else if (isa(CV)) { + Out << "undef"; + } else if (const ConstantExpr *CE = dyn_cast(CV)) { Out << CE->getOpcodeName() << " ("; Index: llvm/lib/VMCore/Instruction.cpp diff -u llvm/lib/VMCore/Instruction.cpp:1.39 llvm/lib/VMCore/Instruction.cpp:1.40 --- llvm/lib/VMCore/Instruction.cpp:1.39 Mon Oct 11 17:21:39 2004 +++ llvm/lib/VMCore/Instruction.cpp Sat Oct 16 13:08:06 2004 @@ -88,6 +88,7 @@ case Switch: return "switch"; case Invoke: return "invoke"; case Unwind: return "unwind"; + case Unreachable: return "unreachable"; // Standard binary operators... case Add: return "add"; Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.4 llvm/lib/VMCore/Instructions.cpp:1.5 --- llvm/lib/VMCore/Instructions.cpp:1.4 Fri Oct 15 18:52:53 2004 +++ llvm/lib/VMCore/Instructions.cpp Sat Oct 16 13:08:06 2004 @@ -249,6 +249,14 @@ } //===----------------------------------------------------------------------===// +// UnreachableInst Implementation +//===----------------------------------------------------------------------===// + +void UnreachableInst::setSuccessor(unsigned idx, BasicBlock *NewSucc) { + assert(0 && "UnreachableInst has no successors!"); +} + +//===----------------------------------------------------------------------===// // BranchInst Implementation //===----------------------------------------------------------------------===// @@ -832,3 +840,4 @@ SwitchInst *SwitchInst::clone() const { return new SwitchInst(*this); } InvokeInst *InvokeInst::clone() const { return new InvokeInst(*this); } UnwindInst *UnwindInst::clone() const { return new UnwindInst(); } +UnreachableInst *UnreachableInst::clone() const { return new UnreachableInst();} Index: llvm/lib/VMCore/Linker.cpp diff -u llvm/lib/VMCore/Linker.cpp:1.86 llvm/lib/VMCore/Linker.cpp:1.87 --- llvm/lib/VMCore/Linker.cpp:1.86 Mon Oct 4 21:28:11 2004 +++ llvm/lib/VMCore/Linker.cpp Sat Oct 16 13:08:06 2004 @@ -310,7 +310,7 @@ Operands[i] = cast(RemapOperand(CPS->getOperand(i), LocalMap, GlobalMap)); Result = ConstantStruct::get(cast(CPS->getType()), Operands); - } else if (isa(CPV)) { + } else if (isa(CPV) || isa(CPV)) { Result = const_cast(CPV); } else if (isa(CPV)) { Result = cast(RemapOperand(CPV, LocalMap, GlobalMap)); From lattner at cs.uiuc.edu Sat Oct 16 13:09:11 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:09:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200410161809.NAA18320@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.24 -> 1.25 --- Log message: Add support for the undef value. Implement a new optimization based on globals that are initialized with undef. When promoting malloc to a global, start out initialized to undef --- Diffs of the changes: (+56 -22) Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.24 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.25 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.24 Thu Oct 14 14:53:50 2004 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Sat Oct 16 13:09:00 2004 @@ -33,6 +33,8 @@ Statistic<> NumMarked ("globalopt", "Number of globals marked constant"); Statistic<> NumSRA ("globalopt", "Number of aggregate globals broken " "into scalars"); + Statistic<> NumSubstitute("globalopt", + "Number of globals with initializers stored into them"); Statistic<> NumDeleted ("globalopt", "Number of globals deleted"); Statistic<> NumFnDeleted("globalopt", "Number of functions deleted"); Statistic<> NumGlobUses ("globalopt", "Number of global uses devirtualized"); @@ -223,8 +225,7 @@ if (IdxV < CA->getNumOperands()) return CA->getOperand(IdxV); } else if (ConstantPacked *CP = dyn_cast(Agg)) { if (IdxV < CP->getNumOperands()) return CP->getOperand(IdxV); - } else if (ConstantAggregateZero *CAZ = - dyn_cast(Agg)) { + } else if (isa(Agg)) { if (const StructType *STy = dyn_cast(Agg->getType())) { if (IdxV < STy->getNumElements()) return Constant::getNullValue(STy->getElementType(IdxV)); @@ -232,6 +233,14 @@ dyn_cast(Agg->getType())) { return Constant::getNullValue(STy->getElementType()); } + } else if (isa(Agg)) { + if (const StructType *STy = dyn_cast(Agg->getType())) { + if (IdxV < STy->getNumElements()) + return UndefValue::get(STy->getElementType(IdxV)); + } else if (const SequentialType *STy = + dyn_cast(Agg->getType())) { + return UndefValue::get(STy->getElementType()); + } } return 0; } @@ -263,11 +272,11 @@ if (LoadInst *LI = dyn_cast(U)) { // Replace the load with the initializer. LI->replaceAllUsesWith(Init); - LI->getParent()->getInstList().erase(LI); + LI->eraseFromParent(); Changed = true; } else if (StoreInst *SI = dyn_cast(U)) { // Store must be unreachable or storing Init into the global. - SI->getParent()->getInstList().erase(SI); + SI->eraseFromParent(); Changed = true; } else if (ConstantExpr *CE = dyn_cast(U)) { if (CE->getOpcode() == Instruction::GetElementPtr) { @@ -287,13 +296,13 @@ for (Value::use_iterator GUI = GEP->use_begin(), E = GEP->use_end(); GUI != E;) if (StoreInst *SI = dyn_cast(*GUI++)) { - SI->getParent()->getInstList().erase(SI); + SI->eraseFromParent(); Changed = true; } } if (GEP->use_empty()) { - GEP->getParent()->getInstList().erase(GEP); + GEP->eraseFromParent(); Changed = true; } } else if (Constant *C = dyn_cast(U)) { @@ -402,7 +411,7 @@ GEP->replaceAllUsesWith(NewPtr); if (GetElementPtrInst *GEPI = dyn_cast(GEP)) - GEPI->getParent()->getInstList().erase(GEPI); + GEPI->eraseFromParent(); else cast(GEP)->destroyConstant(); } @@ -509,7 +518,7 @@ ConstantExpr::getCast(NewV, CI->getType())); if (CI->use_empty()) { Changed = true; - CI->getParent()->getInstList().erase(CI); + CI->eraseFromParent(); } } else if (GetElementPtrInst *GEPI = dyn_cast(I)) { // Should handle GEP here. @@ -525,7 +534,7 @@ ConstantExpr::getGetElementPtr(NewV, Indices)); if (GEPI->use_empty()) { Changed = true; - GEPI->getParent()->getInstList().erase(GEPI); + GEPI->eraseFromParent(); } } } @@ -562,7 +571,7 @@ while (!Loads.empty()) { LoadInst *L = Loads.back(); if (L->use_empty()) { - L->getParent()->getInstList().erase(L); + L->eraseFromParent(); Changed = true; } else { AllLoadsGone = false; @@ -576,7 +585,7 @@ DEBUG(std::cerr << " *** GLOBAL NOW DEAD!\n"); CleanupConstantGlobalUsers(GV, 0); if (GV->use_empty()) { - GV->getParent()->getGlobalList().erase(GV); + GV->eraseFromParent(); ++NumDeleted; } Changed = true; @@ -598,7 +607,7 @@ AtBegin = true; else --UI; - I->getParent()->getInstList().erase(I); + I->eraseFromParent(); if (AtBegin) UI = V->use_begin(); else @@ -630,12 +639,13 @@ Value *NewGEP = new GetElementPtrInst(NewMI, Indices, NewMI->getName()+".el0", MI); MI->replaceAllUsesWith(NewGEP); - MI->getParent()->getInstList().erase(MI); + MI->eraseFromParent(); MI = NewMI; } - // Create the new global variable. - Constant *Init = Constant::getNullValue(MI->getAllocatedType()); + // Create the new global variable. The contents of the malloc'd memory is + // undefined, so initialize with an undef value. + Constant *Init = UndefValue::get(MI->getAllocatedType()); GlobalVariable *NewGV = new GlobalVariable(MI->getAllocatedType(), false, GlobalValue::InternalLinkage, Init, GV->getName()+".body"); @@ -643,7 +653,7 @@ // Anything that used the malloc now uses the global directly. MI->replaceAllUsesWith(NewGV); - MI->getParent()->getInstList().erase(MI); + MI->eraseFromParent(); Constant *RepValue = NewGV; if (NewGV->getType() != GV->getType()->getElementType()) @@ -653,14 +663,14 @@ while (!GV->use_empty()) if (LoadInst *LI = dyn_cast(GV->use_back())) { LI->replaceAllUsesWith(RepValue); - LI->getParent()->getInstList().erase(LI); + LI->eraseFromParent(); } else { StoreInst *SI = cast(GV->use_back()); - SI->getParent()->getInstList().erase(SI); + SI->eraseFromParent(); } // Now the GV is dead, nuke it. - GV->getParent()->getGlobalList().erase(GV); + GV->eraseFromParent(); // To further other optimizations, loop over all users of NewGV and try to // constant prop them. This will promote GEP instructions with constant @@ -740,7 +750,7 @@ if (GV->use_empty()) { DEBUG(std::cerr << "GLOBAL DEAD: " << *GV); - GV->getParent()->getGlobalList().erase(GV); + GV->eraseFromParent(); ++NumDeleted; return true; } @@ -757,7 +767,7 @@ // If the global is dead now, delete it. if (GV->use_empty()) { - GV->getParent()->getGlobalList().erase(GV); + GV->eraseFromParent(); ++NumDeleted; Changed = true; } @@ -774,7 +784,7 @@ if (GV->use_empty()) { DEBUG(std::cerr << " *** Marking constant allowed us to simplify " "all users and delete global!\n"); - GV->getParent()->getGlobalList().erase(GV); + GV->eraseFromParent(); ++NumDeleted; } @@ -787,6 +797,30 @@ return true; } } else if (GS.StoredType == GlobalStatus::isStoredOnce) { + // If the initial value for the global was an undef value, and if only one + // other value was stored into it, we can just change the initializer to + // be an undef value, then delete all stores to the global. This allows + // us to mark it constant. + if (isa(GV->getInitializer()) && + isa(GS.StoredOnceValue)) { + // Change the initial value here. + GV->setInitializer(cast(GS.StoredOnceValue)); + + // Clean up any obviously simplifiable users now. + CleanupConstantGlobalUsers(GV, GV->getInitializer()); + + if (GV->use_empty()) { + DEBUG(std::cerr << " *** Substituting initializer allowed us to " + "simplify all users and delete global!\n"); + GV->eraseFromParent(); + ++NumDeleted; + } else { + GVI = GV; + } + ++NumSubstitute; + return true; + } + // Try to optimize globals based on the knowledge that only one value // (besides its initializer) is ever stored to the global. if (OptimizeOnceStoredGlobal(GV, GS.StoredOnceValue, GVI, From lattner at cs.uiuc.edu Sat Oct 16 13:09:52 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:09:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/SCCP.cpp Message-ID: <200410161809.NAA18338@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: SCCP.cpp updated: 1.103 -> 1.104 --- Log message: Handle undef values as undefined on the constant lattice ignore unreachable instructions --- Diffs of the changes: (+6 -3) Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.103 llvm/lib/Transforms/Scalar/SCCP.cpp:1.104 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.103 Sat Oct 9 14:30:36 2004 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Sat Oct 16 13:09:41 2004 @@ -174,9 +174,11 @@ inline InstVal &getValueState(Value *V) { hash_map::iterator I = ValueState.find(V); if (I != ValueState.end()) return I->second; // Common case, in the map - - if (Constant *CPV = dyn_cast(V)) { // Constants are constant - ValueState[CPV].markConstant(CPV); + + if (isa(V)) { + // Nothing to do, remain undefined. + } else if (Constant *CPV = dyn_cast(V)) { + ValueState[CPV].markConstant(CPV); // Constants are constant } else if (isa(V)) { // Arguments are overdefined ValueState[V].markOverdefined(); } @@ -236,6 +238,7 @@ visitTerminatorInst(I); } void visitUnwindInst (TerminatorInst &I) { /*returns void*/ } + void visitUnreachableInst(TerminatorInst &I) { /*returns void*/ } void visitAllocationInst(Instruction &I) { markOverdefined(&I); } void visitVANextInst (Instruction &I) { markOverdefined(&I); } void visitVAArgInst (Instruction &I) { markOverdefined(&I); } From lattner at cs.uiuc.edu Sat Oct 16 13:10:06 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:10:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp Message-ID: <200410161810.NAA18345@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.81 -> 1.82 --- Log message: Add note --- Diffs of the changes: (+1 -0) Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.81 llvm/lib/Transforms/Scalar/ADCE.cpp:1.82 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.81 Sun Sep 19 23:43:14 2004 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Sat Oct 16 13:09:25 2004 @@ -234,6 +234,7 @@ } } else if (I->mayWriteToMemory() || isa(I) || isa(I)) { + // Unreachable instructions are not marked intrinsically live here. markInstructionLive(I); } else if (isInstructionTriviallyDead(I)) { // Remove the instruction from it's basic block... From lattner at cs.uiuc.edu Sat Oct 16 13:10:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:10:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/ValueMapper.cpp Message-ID: <200410161810.NAA18369@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: ValueMapper.cpp updated: 1.18 -> 1.19 --- Log message: Add support for UndefValue --- Diffs of the changes: (+2 -1) Index: llvm/lib/Transforms/Utils/ValueMapper.cpp diff -u llvm/lib/Transforms/Utils/ValueMapper.cpp:1.18 llvm/lib/Transforms/Utils/ValueMapper.cpp:1.19 --- llvm/lib/Transforms/Utils/ValueMapper.cpp:1.18 Thu Aug 12 21:43:19 2004 +++ llvm/lib/Transforms/Utils/ValueMapper.cpp Sat Oct 16 13:10:31 2004 @@ -31,7 +31,8 @@ if (Constant *C = const_cast(dyn_cast(V))) { if (isa(C) || isa(C) || - isa(C) || isa(C)) + isa(C) || isa(C) || + isa(C)) return VMSlot = C; // Primitive constants map directly else if (ConstantArray *CA = dyn_cast(C)) { for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i) { From lattner at cs.uiuc.edu Sat Oct 16 13:10:47 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:10:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200410161810.NAA18373@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.70 -> 1.71 --- Log message: When promoting mem2reg, make uninitialized values become undef isntead of 0. --- Diffs of the changes: (+9 -9) Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.70 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.71 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.70 Sun Sep 19 13:51:51 2004 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sat Oct 16 13:10:06 2004 @@ -17,7 +17,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Utils/PromoteMemToReg.h" -#include "llvm/Constant.h" +#include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" #include "llvm/Instructions.h" @@ -288,7 +288,7 @@ // std::vector Values(Allocas.size()); for (unsigned i = 0, e = Allocas.size(); i != e; ++i) - Values[i] = Constant::getNullValue(Allocas[i]->getAllocatedType()); + Values[i] = UndefValue::get(Allocas[i]->getAllocatedType()); // Walks all basic blocks in the function performing the SSA rename algorithm // and inserting the phi nodes we marked as necessary @@ -307,7 +307,7 @@ // Just delete the users now. // if (!A->use_empty()) - A->replaceAllUsesWith(Constant::getNullValue(A->getType())); + A->replaceAllUsesWith(UndefValue::get(A->getType())); if (AST) AST->deleteValue(A); A->getParent()->getInstList().erase(A); } @@ -356,9 +356,9 @@ // entries inserted into every PHI nodes for the block. for (unsigned i = 0, e = PNs.size(); i != e; ++i) if (PHINode *PN = PNs[i]) { - Value *NullVal = Constant::getNullValue(PN->getType()); + Value *UndefVal = UndefValue::get(PN->getType()); for (unsigned pred = 0, e = Preds.size(); pred != e; ++pred) - PN->addIncoming(NullVal, Preds[pred]); + PN->addIncoming(UndefVal, Preds[pred]); } } } @@ -414,7 +414,7 @@ Instruction *U = cast(AI->use_back()); if (LoadInst *LI = dyn_cast(U)) { // Must be a load of uninitialized value. - LI->replaceAllUsesWith(Constant::getNullValue(AI->getAllocatedType())); + LI->replaceAllUsesWith(UndefValue::get(AI->getAllocatedType())); if (AST && isa(LI->getType())) AST->deleteValue(LI); } else { @@ -423,8 +423,8 @@ } BB->getInstList().erase(U); } else { - // Uses of the uninitialized memory location shall get zero... - Value *CurVal = Constant::getNullValue(AI->getAllocatedType()); + // Uses of the uninitialized memory location shall get undef. + Value *CurVal = UndefValue::get(AI->getAllocatedType()); for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) { Instruction *Inst = I++; @@ -473,7 +473,7 @@ if (AIt != CurValues.end()) { // Loads just returns the "current value"... if (AIt->second == 0) // Uninitialized value?? - AIt->second =Constant::getNullValue(AIt->first->getAllocatedType()); + AIt->second = UndefValue::get(AIt->first->getAllocatedType()); LI->replaceAllUsesWith(AIt->second); if (AST && isa(LI->getType())) AST->deleteValue(LI); From lattner at cs.uiuc.edu Sat Oct 16 13:11:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:11:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp Message-ID: <200410161811.NAA18377@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: UnifyFunctionExitNodes.cpp updated: 1.31 -> 1.32 --- Log message: Add support for unreachable --- Diffs of the changes: (+23 -3) Index: llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp diff -u llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.31 llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.32 --- llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.31 Thu Jul 29 07:17:33 2004 +++ llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp Sat Oct 16 13:10:19 2004 @@ -46,13 +46,16 @@ // std::vector ReturningBlocks; std::vector UnwindingBlocks; + std::vector UnreachableBlocks; for(Function::iterator I = F.begin(), E = F.end(); I != E; ++I) if (isa(I->getTerminator())) ReturningBlocks.push_back(I); else if (isa(I->getTerminator())) UnwindingBlocks.push_back(I); + else if (isa(I->getTerminator())) + UnreachableBlocks.push_back(I); - // Handle unwinding blocks first... + // Handle unwinding blocks first. if (UnwindingBlocks.empty()) { UnwindBlock = 0; } else if (UnwindingBlocks.size() == 1) { @@ -64,12 +67,29 @@ for (std::vector::iterator I = UnwindingBlocks.begin(), E = UnwindingBlocks.end(); I != E; ++I) { BasicBlock *BB = *I; - BB->getInstList().pop_back(); // Remove the return insn + BB->getInstList().pop_back(); // Remove the unwind insn new BranchInst(UnwindBlock, BB); } } - // Now handle return blocks... + // Then unreachable blocks. + if (UnreachableBlocks.empty()) { + UnreachableBlock = 0; + } else if (UnreachableBlocks.size() == 1) { + UnreachableBlock = UnreachableBlocks.front(); + } else { + UnreachableBlock = new BasicBlock("UnifiedUnreachableBlock", &F); + new UnreachableInst(UnreachableBlock); + + for (std::vector::iterator I = UnreachableBlocks.begin(), + E = UnreachableBlocks.end(); I != E; ++I) { + BasicBlock *BB = *I; + BB->getInstList().pop_back(); // Remove the unreachable inst. + new BranchInst(UnreachableBlock, BB); + } + } + + // Now handle return blocks. if (ReturningBlocks.empty()) { ReturnBlock = 0; return false; // No blocks return From lattner at cs.uiuc.edu Sat Oct 16 13:11:48 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:11:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200410161811.NAA18400@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.267 -> 1.268 --- Log message: Optimize instructions involving undef values. For example X+undef == undef. --- Diffs of the changes: (+126 -28) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.267 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.268 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.267 Mon Oct 11 23:52:52 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sat Oct 16 13:11:37 2004 @@ -121,6 +121,7 @@ Instruction *visitAllocationInst(AllocationInst &AI); Instruction *visitFreeInst(FreeInst &FI); Instruction *visitLoadInst(LoadInst &LI); + Instruction *visitStoreInst(StoreInst &SI); Instruction *visitBranchInst(BranchInst &BI); Instruction *visitSwitchInst(SwitchInst &SI); @@ -216,15 +217,15 @@ } // getComplexity: Assign a complexity or rank value to LLVM Values... -// 0 -> Constant, 1 -> Other, 2 -> Argument, 2 -> Unary, 3 -> OtherInst +// 0 -> undef, 1 -> Const, 2 -> Other, 3 -> Arg, 3 -> Unary, 4 -> OtherInst static unsigned getComplexity(Value *V) { if (isa(V)) { if (BinaryOperator::isNeg(V) || BinaryOperator::isNot(V)) - return 2; - return 3; + return 3; + return 4; } - if (isa(V)) return 2; - return isa(V) ? 0 : 1; + if (isa(V)) return 3; + return isa(V) ? (isa(V) ? 0 : 1) : 2; } // isOnlyUse - Return true if this instruction will be deleted if we stop using @@ -559,6 +560,10 @@ Value *LHS = I.getOperand(0), *RHS = I.getOperand(1); if (Constant *RHSC = dyn_cast(RHS)) { + // X + undef -> undef + if (isa(RHS)) + return ReplaceInstUsesWith(I, RHS); + // X + 0 --> X if (!I.getType()->isFloatingPoint() && // -0 + +0 = +0, so it's not a noop RHSC->isNullValue()) @@ -691,6 +696,11 @@ if (Value *V = dyn_castNegVal(Op1)) return BinaryOperator::createAdd(Op0, V); + if (isa(Op0)) + return ReplaceInstUsesWith(I, Op0); // undef - X -> undef + if (isa(Op1)) + return ReplaceInstUsesWith(I, Op1); // X - undef -> undef + if (ConstantInt *C = dyn_cast(Op0)) { // Replace (-1 - A) with (~A)... if (C->isAllOnesValue()) @@ -823,6 +833,9 @@ bool Changed = SimplifyCommutative(I); Value *Op0 = I.getOperand(0); + if (isa(I.getOperand(1))) // undef * X -> 0 + return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); + // Simplify mul instructions with a constant RHS... if (Constant *Op1 = dyn_cast(I.getOperand(1))) { if (ConstantInt *CI = dyn_cast(Op1)) { @@ -919,6 +932,11 @@ } Instruction *InstCombiner::visitDiv(BinaryOperator &I) { + if (isa(I.getOperand(0))) // undef / X -> 0 + return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); + if (isa(I.getOperand(1))) + return ReplaceInstUsesWith(I, I.getOperand(1)); // X / undef -> undef + if (ConstantInt *RHS = dyn_cast(I.getOperand(1))) { // div X, 1 == X if (RHS->equalsInt(1)) @@ -974,6 +992,11 @@ return &I; } + if (isa(I.getOperand(0))) // undef % X -> 0 + return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); + if (isa(I.getOperand(1))) + return ReplaceInstUsesWith(I, I.getOperand(1)); // X % undef -> undef + if (ConstantInt *RHS = dyn_cast(I.getOperand(1))) { if (RHS->equalsInt(1)) // X % 1 == 0 return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); @@ -1331,6 +1354,9 @@ bool Changed = SimplifyCommutative(I); Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); + if (isa(Op1)) // X & undef -> 0 + return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); + // and X, X = X and X, 0 == 0 if (Op0 == Op1 || Op1 == Constant::getNullValue(I.getType())) return ReplaceInstUsesWith(I, Op1); @@ -1475,6 +1501,10 @@ bool Changed = SimplifyCommutative(I); Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); + if (isa(Op1)) + return ReplaceInstUsesWith(I, // X | undef -> -1 + ConstantIntegral::getAllOnesValue(I.getType())); + // or X, X = X or X, 0 == X if (Op0 == Op1 || Op1 == Constant::getNullValue(I.getType())) return ReplaceInstUsesWith(I, Op0); @@ -1652,6 +1682,9 @@ bool Changed = SimplifyCommutative(I); Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); + if (isa(Op1)) + return ReplaceInstUsesWith(I, Op1); // X ^ undef -> undef + // xor X, X = 0, even if X is nested in a sequence of Xor's. if (Instruction *Result = AssociativeOpt(I, XorSelf(Op1))) { assert(Result == &I && "AssociativeOpt didn't work?"); @@ -1823,6 +1856,9 @@ if (Op0 == Op1) return ReplaceInstUsesWith(I, ConstantBool::get(isTrueWhenEqual(I))); + if (isa(Op1)) // X setcc undef -> undef + return ReplaceInstUsesWith(I, UndefValue::get(Type::BoolTy)); + // setcc , 0 - Global/Stack value addresses are never null! if (isa(Op1) && (isa(Op0) || isa(Op0))) @@ -2478,6 +2514,19 @@ Op0 == Constant::getNullValue(Op0->getType())) return ReplaceInstUsesWith(I, Op0); + if (isa(Op0)) { // undef >>s X -> undef + if (!isLeftShift && I.getType()->isSigned()) + return ReplaceInstUsesWith(I, Op1); + else // undef << X -> 0 AND undef >>u X -> 0 + return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); + } + if (isa(Op1)) { + if (isLeftShift || I.getType()->isUnsigned()) + return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); + else + return ReplaceInstUsesWith(I, Op0); // X >>s undef -> X + } + // shr int -1, X = -1 (for any arithmetic shift rights of ~0) if (!isLeftShift) if (ConstantSInt *CSI = dyn_cast(Op0)) @@ -2736,6 +2785,9 @@ if (CI.getType() == Src->getType()) return ReplaceInstUsesWith(CI, Src); + if (isa(Src)) // cast undef -> undef + return ReplaceInstUsesWith(CI, UndefValue::get(CI.getType())); + // If casting the result of another cast instruction, try to eliminate this // one! // @@ -2935,6 +2987,17 @@ if (TrueVal == FalseVal) return ReplaceInstUsesWith(SI, TrueVal); + if (isa(TrueVal)) // select C, undef, X -> X + return ReplaceInstUsesWith(SI, FalseVal); + if (isa(FalseVal)) // select C, X, undef -> X + return ReplaceInstUsesWith(SI, TrueVal); + if (isa(CondVal)) { // select undef, X, Y -> X or Y + if (isa(TrueVal)) + return ReplaceInstUsesWith(SI, TrueVal); + else + return ReplaceInstUsesWith(SI, FalseVal); + } + if (SI.getType() == Type::BoolTy) if (ConstantBool *C = dyn_cast(TrueVal)) { if (C == ConstantBool::True) { @@ -3092,7 +3155,6 @@ // CallInst simplification // Instruction *InstCombiner::visitCallInst(CallInst &CI) { - // Intrinsics cannot occur in an invoke, so handle them here instead of in // visitCallSite. if (MemIntrinsic *MI = dyn_cast(&CI)) { @@ -3147,6 +3209,17 @@ if (transformConstExprCastCall(CS)) return 0; Value *Callee = CS.getCalledValue(); + + if (isa(Callee) || isa(Callee)) + // This instruction is not reachable, just remove it. Eventually, this + // should get turned into an unreachable instruction. + if (!isa(CS.getInstruction())) { // Don't hack the CFG! + if (!CS.getInstruction()->use_empty()) + CS.getInstruction()-> + replaceAllUsesWith(UndefValue::get(CS.getInstruction()->getType())); + return EraseInstFromFunction(*CS.getInstruction()); + } + const PointerType *PTy = cast(Callee->getType()); const FunctionType *FTy = cast(PTy->getElementType()); if (FTy->isVarArg()) { @@ -3307,6 +3380,7 @@ // PHINode simplification // Instruction *InstCombiner::visitPHINode(PHINode &PN) { + // FIXME: hasConstantValue should ignore undef values! if (Value *V = hasConstantValue(&PN)) return ReplaceInstUsesWith(PN, V); @@ -3363,6 +3437,9 @@ if (GEP.getNumOperands() == 1) return ReplaceInstUsesWith(GEP, PtrOp); + if (isa(GEP.getOperand(0))) + return ReplaceInstUsesWith(GEP, UndefValue::get(GEP.getType())); + bool HasZeroPointerIndex = false; if (Constant *C = dyn_cast(GEP.getOperand(1))) HasZeroPointerIndex = C->isNullValue(); @@ -3601,6 +3678,8 @@ // Now make everything use the getelementptr instead of the original // allocation. return ReplaceInstUsesWith(AI, V); + } else if (isa(AI.getArraySize())) { + return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType())); } // If alloca'ing a zero byte object, replace the alloca with a null pointer. @@ -3625,7 +3704,8 @@ // If we have 'free null' delete the instruction. This can happen in stl code // when lots of inlining happens. - if (isa(Op)) + // FIXME: free undef should be xformed into an 'unreachable' instruction. + if (isa(Op) || isa(Op)) return EraseInstFromFunction(FI); return 0; @@ -3652,6 +3732,8 @@ C = CS->getOperand(CU->getValue()); } else if (isa(C)) { C = Constant::getNullValue(STy->getElementType(CU->getValue())); + } else if (isa(C)) { + C = UndefValue::get(STy->getElementType(CU->getValue())); } else { return 0; } @@ -3662,6 +3744,8 @@ C = CA->getOperand(CI->getRawValue()); else if (isa(C)) C = Constant::getNullValue(ATy->getElementType()); + else if (isa(C)) + C = UndefValue::get(ATy->getElementType()); else return 0; } else { @@ -3725,26 +3809,29 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) { Value *Op = LI.getOperand(0); - if (Constant *C = dyn_cast(Op)) - if (C->isNullValue() && !LI.isVolatile()) // load null -> 0 - return ReplaceInstUsesWith(LI, Constant::getNullValue(LI.getType())); - - // Instcombine load (constant global) into the value loaded... - if (GlobalVariable *GV = dyn_cast(Op)) - if (GV->isConstant() && !GV->isExternal()) - return ReplaceInstUsesWith(LI, GV->getInitializer()); - - // Instcombine load (constantexpr_GEP global, 0, ...) into the value loaded... - if (ConstantExpr *CE = dyn_cast(Op)) - if (CE->getOpcode() == Instruction::GetElementPtr) { - if (GlobalVariable *GV = dyn_cast(CE->getOperand(0))) - if (GV->isConstant() && !GV->isExternal()) - if (Constant *V = GetGEPGlobalInitializer(GV->getInitializer(), CE)) - return ReplaceInstUsesWith(LI, V); - } else if (CE->getOpcode() == Instruction::Cast) { - if (Instruction *Res = InstCombineLoadCast(*this, LI)) - return Res; - } + if (Constant *C = dyn_cast(Op)) { + if ((C->isNullValue() || isa(C)) && + !LI.isVolatile()) // load null -> undef + // FIXME: this should become an unreachable instruction + return ReplaceInstUsesWith(LI, UndefValue::get(LI.getType())); + + // Instcombine load (constant global) into the value loaded. + if (GlobalVariable *GV = dyn_cast(Op)) + if (GV->isConstant() && !GV->isExternal()) + return ReplaceInstUsesWith(LI, GV->getInitializer()); + + // Instcombine load (constantexpr_GEP global, 0, ...) into the value loaded. + if (ConstantExpr *CE = dyn_cast(Op)) + if (CE->getOpcode() == Instruction::GetElementPtr) { + if (GlobalVariable *GV = dyn_cast(CE->getOperand(0))) + if (GV->isConstant() && !GV->isExternal()) + if (Constant *V = GetGEPGlobalInitializer(GV->getInitializer(), CE)) + return ReplaceInstUsesWith(LI, V); + } else if (CE->getOpcode() == Instruction::Cast) { + if (Instruction *Res = InstCombineLoadCast(*this, LI)) + return Res; + } + } // load (cast X) --> cast (load X) iff safe if (CastInst *CI = dyn_cast(Op)) @@ -3832,6 +3919,17 @@ return 0; } +Instruction *InstCombiner::visitStoreInst(StoreInst &SI) { + if (isa(SI.getOperand(1)) || + isa(SI.getOperand(1))) { + // FIXME: This should become an unreachable instruction. + return EraseInstFromFunction(SI); + } + + + return 0; +} + Instruction *InstCombiner::visitBranchInst(BranchInst &BI) { // Change br (not X), label True, label False to: br X, label False, True @@ -3877,7 +3975,7 @@ if (ConstantInt *AddRHS = dyn_cast(I->getOperand(1))) { // change 'switch (X+4) case 1:' into 'switch (X) case -3' for (unsigned i = 2, e = SI.getNumOperands(); i != e; i += 2) - SI.setOperand(i, ConstantExpr::getSub(cast(SI.getOperand(i)), + SI.setOperand(i,ConstantExpr::getSub(cast(SI.getOperand(i)), AddRHS)); SI.setOperand(0, I->getOperand(0)); WorkList.push_back(I); From lattner at cs.uiuc.edu Sat Oct 16 13:12:23 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:12:23 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200410161812.NAA18417@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.201 -> 1.202 --- Log message: Add support for unreachable and undef --- Diffs of the changes: (+10 -2) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.201 llvm/lib/Target/CBackend/Writer.cpp:1.202 --- llvm/lib/Target/CBackend/Writer.cpp:1.201 Mon Oct 11 10:50:40 2004 +++ llvm/lib/Target/CBackend/Writer.cpp Sat Oct 16 13:12:13 2004 @@ -174,6 +174,7 @@ void visitUnwindInst(UnwindInst &I) { assert(0 && "Lowerinvoke pass didn't work!"); } + void visitUnreachableInst(UnreachableInst &I); void visitPHINode(PHINode &I); void visitBinaryOperator(Instruction &I); @@ -521,6 +522,9 @@ << *CE << "\n"; abort(); } + } else if (isa(CPV) && CPV->getType()->isFirstClassType()) { + Out << "0"; + return; } switch (CPV->getType()->getTypeID()) { @@ -606,7 +610,7 @@ } case Type::ArrayTyID: - if (isa(CPV)) { + if (isa(CPV) || isa(CPV)) { const ArrayType *AT = cast(CPV->getType()); Out << "{"; if (AT->getNumElements()) { @@ -625,7 +629,7 @@ break; case Type::StructTyID: - if (isa(CPV)) { + if (isa(CPV) || isa(CPV)) { const StructType *ST = cast(CPV->getType()); Out << "{"; if (ST->getNumElements()) { @@ -1205,6 +1209,10 @@ Out << " }\n"; } +void CWriter::visitUnreachableInst(UnreachableInst &I) { + Out << " /*UNREACHABLE*/\n"; +} + bool CWriter::isGotoCodeNecessary(BasicBlock *From, BasicBlock *To) { /// FIXME: This should be reenabled, but loop reordering safe!! return true; From lattner at cs.uiuc.edu Sat Oct 16 13:13:16 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:13:16 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelSimple.cpp Message-ID: <200410161813.NAA18433@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelSimple.cpp updated: 1.287 -> 1.288 --- Log message: Teach the X86 backend about unreachable and undef. Among other things, we now compile: 'foo() {}' into "ret" instead of "mov EAX, 0; ret" --- Diffs of the changes: (+15 -1) Index: llvm/lib/Target/X86/X86ISelSimple.cpp diff -u llvm/lib/Target/X86/X86ISelSimple.cpp:1.287 llvm/lib/Target/X86/X86ISelSimple.cpp:1.288 --- llvm/lib/Target/X86/X86ISelSimple.cpp:1.287 Fri Oct 15 00:05:29 2004 +++ llvm/lib/Target/X86/X86ISelSimple.cpp Sat Oct 16 13:13:05 2004 @@ -175,6 +175,7 @@ // Control flow operators void visitReturnInst(ReturnInst &RI); void visitBranchInst(BranchInst &BI); + void visitUnreachableInst(UnreachableInst &UI) {} struct ValueRecord { Value *Val; @@ -447,7 +448,20 @@ void X86ISel::copyConstantToRegister(MachineBasicBlock *MBB, MachineBasicBlock::iterator IP, Constant *C, unsigned R) { - if (ConstantExpr *CE = dyn_cast(C)) { + if (isa(C)) { + switch (getClassB(C->getType())) { + case cFP: + // FIXME: SHOULD TEACH STACKIFIER ABOUT UNDEF VALUES! + BuildMI(*MBB, IP, X86::FLD0, 0, R); + return; + case cLong: + BuildMI(*MBB, IP, X86::IMPLICIT_DEF, 0, R+1); + // FALL THROUGH + default: + BuildMI(*MBB, IP, X86::IMPLICIT_DEF, 0, R); + return; + } + } else if (ConstantExpr *CE = dyn_cast(C)) { unsigned Class = 0; switch (CE->getOpcode()) { case Instruction::GetElementPtr: From lattner at cs.uiuc.edu Sat Oct 16 13:13:58 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:13:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Message-ID: <200410161813.NAA18450@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32ISelSimple.cpp updated: 1.91 -> 1.92 --- Log message: ADd support for undef and unreachable --- Diffs of the changes: (+8 -4) Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.91 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.92 --- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.91 Thu Oct 14 19:50:19 2004 +++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Sat Oct 16 13:13:47 2004 @@ -237,9 +237,10 @@ // Visitation methods for various instructions. These methods simply emit // fixed PowerPC code for each instruction. - // Control flow operators + // Control flow operators. void visitReturnInst(ReturnInst &RI); void visitBranchInst(BranchInst &BI); + void visitUnreachableInst(UnreachableInst &UI) {} struct ValueRecord { Value *Val; @@ -575,6 +576,10 @@ void PPC32ISel::copyConstantToRegister(MachineBasicBlock *MBB, MachineBasicBlock::iterator IP, Constant *C, unsigned R) { + if (isa(C)) { + BuildMI(*MBB, IP, PPC::IMPLICIT_DEF, 0, R); + return; + } if (C->getType()->isIntegral()) { unsigned Class = getClassB(C->getType()); @@ -2117,9 +2122,8 @@ // xor X, -1 -> not X if (Opcode == 4) { - ConstantSInt *CSI = dyn_cast(Op1); - ConstantUInt *CUI = dyn_cast(Op1); - if ((CSI && CSI->isAllOnesValue()) || (CUI && CUI->isAllOnesValue())) { + ConstantInt *CI = dyn_cast(Op1); + if (CI && CI->isAllOnesValue()) { BuildMI(*MBB, IP, PPC::NOR, 2, DestReg).addReg(Op0Reg).addReg(Op0Reg); return; } From lattner at cs.uiuc.edu Sat Oct 16 13:14:21 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:14:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp SparcV9BurgISel.cpp SparcV9PreSelection.cpp Message-ID: <200410161814.NAA18467@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9AsmPrinter.cpp updated: 1.122 -> 1.123 SparcV9BurgISel.cpp updated: 1.9 -> 1.10 SparcV9PreSelection.cpp updated: 1.40 -> 1.41 --- Log message: Add support for undef and unreachable --- Diffs of the changes: (+29 -8) Index: llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp diff -u llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.122 llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.123 --- llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.122 Fri Sep 10 13:01:45 2004 +++ llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp Sat Oct 16 13:14:09 2004 @@ -315,7 +315,7 @@ if (const GlobalValue* GV = dyn_cast(CV)) { O << getID(GV) << "\n"; - } else if (isa(CV)) { + } else if (isa(CV) || isa(CV)) { // Null pointer value O << "0\n"; } else if (const ConstantExpr* CE = dyn_cast(CV)) { @@ -482,7 +482,7 @@ S += utostr(CI->getValue()); else if (const ConstantFP *CFP = dyn_cast(CV)) S += ftostr(CFP->getValue()); - else if (isa(CV)) + else if (isa(CV) || isa(CV)) S += "0"; else if (const ConstantExpr *CE = dyn_cast(CV)) S += ConstantExprToString(CE, target); @@ -750,7 +750,9 @@ if (GV->hasExternalLinkage()) O << "\t.global\t" << getID(GV) << "\n"; - if (GV->hasInitializer() && ! GV->getInitializer()->isNullValue()) { + if (GV->hasInitializer() && + !(GV->getInitializer()->isNullValue() || + isa(GV->getInitializer()))) { printConstant(GV->getInitializer(), getID(GV)); } else { O << "\t.align\t" << TypeToAlignment(GV->getType()->getElementType(), @@ -769,7 +771,8 @@ assert(GI->hasInitializer()); if (GI->isConstant()) enterSection(ReadOnlyData); // read-only, initialized data - else if (GI->getInitializer()->isNullValue()) + else if (GI->getInitializer()->isNullValue() || + isa(GI->getInitializer())) enterSection(ZeroInitRWData); // read-write zero data else enterSection(InitRWData); // read-write non-zero data Index: llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp diff -u llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp:1.9 llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp:1.10 --- llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp:1.9 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp Sat Oct 16 13:14:10 2004 @@ -397,9 +397,13 @@ } else if (Constant *CPV = dyn_cast(operand)) { if (isa(CPV)) opTreeNode = new VRegNode(operand); - else + else if (isa(CPV)) { + opTreeNode = new + ConstantNode(Constant::getNullValue(CPV->getType())); + } else { // Create a leaf node for a constant opTreeNode = new ConstantNode(CPV); + } } else { // Create a leaf node for the virtual register opTreeNode = new VRegNode(operand); @@ -541,7 +545,7 @@ } // ConstantPointerNull: it's really just a big, shiny version of zero. - if (const ConstantPointerNull *CPN = dyn_cast(V)) { + if (isa(V)) { isValidConstant = true; return 0; } @@ -565,6 +569,9 @@ double fC = CFP->getValue(); C = (destType->isSigned()? (uint64_t) (int64_t) fC : (uint64_t) fC); + } else if (isa(V)) { + isValidConstant = true; + C = 0; } // Now if a valid value was found, convert it to destType. @@ -839,7 +846,8 @@ if (I->getOpcode() >= MaxConstantsTable.size()) // user-defined op (or bug!) return true; - if (isa(CV)) // can always use %g0 + // can always use %g0 + if (isa(CV) || isa(CV)) return false; if (isa(I)) // Switch instructions will be lowered! @@ -1561,7 +1569,8 @@ /// IsZero - Check for a constant 0. /// static inline bool IsZero(Value* idx) { - return (idx == ConstantSInt::getNullValue(idx->getType())); + return (isa(idx) && cast(idx)->isNullValue()) || + isa(idx); } /// FoldGetElemChain - Fold a chain of GetElementPtr instructions containing Index: llvm/lib/Target/SparcV9/SparcV9PreSelection.cpp diff -u llvm/lib/Target/SparcV9/SparcV9PreSelection.cpp:1.40 llvm/lib/Target/SparcV9/SparcV9PreSelection.cpp:1.41 --- llvm/lib/Target/SparcV9/SparcV9PreSelection.cpp:1.40 Wed Aug 4 02:29:40 2004 +++ llvm/lib/Target/SparcV9/SparcV9PreSelection.cpp Sat Oct 16 13:14:10 2004 @@ -55,6 +55,15 @@ void visitCallInst(CallInst &I); void visitPHINode(PHINode &PN); + void visitBasicBlock(BasicBlock &BB) { + if (isa(BB.getTerminator())) { + BB.getInstList().pop_back(); + const Type *RetTy = BB.getParent()->getReturnType(); + Value *RetVal = RetTy == Type::VoidTy ? 0 : UndefValue::get(RetTy); + new ReturnInst(RetVal, &BB); + } + } + // Helper functions for visiting operands of every instruction // // visitOperands() works on every operand in [firstOp, lastOp-1]. From lattner at cs.uiuc.edu Sat Oct 16 13:15:26 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:15:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/PostDominators.cpp Message-ID: <200410161815.NAA18489@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: PostDominators.cpp updated: 1.49 -> 1.50 --- Log message: Add support for unreachable --- Diffs of the changes: (+1 -2) Index: llvm/lib/Analysis/PostDominators.cpp diff -u llvm/lib/Analysis/PostDominators.cpp:1.49 llvm/lib/Analysis/PostDominators.cpp:1.50 --- llvm/lib/Analysis/PostDominators.cpp:1.49 Thu Oct 14 09:59:16 2004 +++ llvm/lib/Analysis/PostDominators.cpp Sat Oct 16 13:15:15 2004 @@ -40,8 +40,7 @@ for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) { Doms[I]; // Initialize to empty - if (isa(I->getTerminator()) || - isa(I->getTerminator())) + if (succ_begin(I) == succ_end(I)) Roots.push_back(I); } From lattner at cs.uiuc.edu Sat Oct 16 13:16:12 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:16:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp Message-ID: <200410161816.NAA18499@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/DataStructure: Local.cpp updated: 1.113 -> 1.114 --- Log message: Add support for undef --- Diffs of the changes: (+3 -0) Index: llvm/lib/Analysis/DataStructure/Local.cpp diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.113 llvm/lib/Analysis/DataStructure/Local.cpp:1.114 --- llvm/lib/Analysis/DataStructure/Local.cpp:1.113 Wed Oct 6 14:29:13 2004 +++ llvm/lib/Analysis/DataStructure/Local.cpp Sat Oct 16 13:16:01 2004 @@ -246,6 +246,9 @@ } else if (ConstantIntegral *CI = dyn_cast(C)) { // Random constants are unknown mem return NH = createNode()->setUnknownNodeMarker(); + } else if (isa(C)) { + ScalarMap.erase(V); + return 0; } else { assert(0 && "Unknown constant type!"); } From lattner at cs.uiuc.edu Sat Oct 16 13:16:30 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:16:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp Message-ID: <200410161816.NAA18509@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: Andersens.cpp updated: 1.8 -> 1.9 --- Log message: Add support --- Diffs of the changes: (+1 -0) Index: llvm/lib/Analysis/IPA/Andersens.cpp diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.8 llvm/lib/Analysis/IPA/Andersens.cpp:1.9 --- llvm/lib/Analysis/IPA/Andersens.cpp:1.8 Sun Sep 19 23:45:09 2004 +++ llvm/lib/Analysis/IPA/Andersens.cpp Sat Oct 16 13:16:19 2004 @@ -652,6 +652,7 @@ case Instruction::Br: case Instruction::Switch: case Instruction::Unwind: + case Instruction::Unreachable: case Instruction::Free: case Instruction::Shl: case Instruction::Shr: From lattner at cs.uiuc.edu Sat Oct 16 13:17:24 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:17:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.l ParserInternals.h llvmAsmParser.y Message-ID: <200410161817.NAA18525@apoc.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: Lexer.l updated: 1.54 -> 1.55 ParserInternals.h updated: 1.38 -> 1.39 llvmAsmParser.y updated: 1.204 -> 1.205 --- Log message: Parse undef and unreachable --- Diffs of the changes: (+24 -4) Index: llvm/lib/AsmParser/Lexer.l diff -u llvm/lib/AsmParser/Lexer.l:1.54 llvm/lib/AsmParser/Lexer.l:1.55 --- llvm/lib/AsmParser/Lexer.l:1.54 Tue Sep 14 00:43:23 2004 +++ llvm/lib/AsmParser/Lexer.l Sat Oct 16 13:17:13 2004 @@ -188,6 +188,7 @@ implementation { return IMPLEMENTATION; } zeroinitializer { return ZEROINITIALIZER; } \.\.\. { return DOTDOTDOT; } +undef { return UNDEF; } null { return NULL_TOK; } to { return TO; } except { RET_TOK(TermOpVal, Unwind, UNWIND); } @@ -247,7 +248,7 @@ switch { RET_TOK(TermOpVal, Switch, SWITCH); } invoke { RET_TOK(TermOpVal, Invoke, INVOKE); } unwind { RET_TOK(TermOpVal, Unwind, UNWIND); } - +unreachable { RET_TOK(TermOpVal, Unreachable, UNREACHABLE); } malloc { RET_TOK(MemOpVal, Malloc, MALLOC); } alloca { RET_TOK(MemOpVal, Alloca, ALLOCA); } Index: llvm/lib/AsmParser/ParserInternals.h diff -u llvm/lib/AsmParser/ParserInternals.h:1.38 llvm/lib/AsmParser/ParserInternals.h:1.39 --- llvm/lib/AsmParser/ParserInternals.h:1.38 Wed Sep 1 17:55:35 2004 +++ llvm/lib/AsmParser/ParserInternals.h Sat Oct 16 13:17:13 2004 @@ -72,7 +72,7 @@ struct ValID { enum { NumberVal, NameVal, ConstSIntVal, ConstUIntVal, ConstFPVal, ConstNullVal, - ConstantVal, + ConstUndefVal, ConstantVal, } Type; union { @@ -108,6 +108,10 @@ ValID D; D.Type = ConstNullVal; return D; } + static ValID createUndef() { + ValID D; D.Type = ConstUndefVal; return D; + } + static ValID create(Constant *Val) { ValID D; D.Type = ConstantVal; D.ConstantValue = Val; return D; } @@ -130,6 +134,7 @@ case NameVal : return Name; case ConstFPVal : return ftostr(ConstPoolFP); case ConstNullVal : return "null"; + case ConstUndefVal : return "undef"; case ConstUIntVal : case ConstSIntVal : return std::string("%") + itostr(ConstPool64); case ConstantVal: @@ -152,6 +157,7 @@ case ConstUIntVal: return UConstPool64 < V.UConstPool64; case ConstFPVal: return ConstPoolFP < V.ConstPoolFP; case ConstNullVal: return false; + case ConstUndefVal: return false; case ConstantVal: return ConstantValue < V.ConstantValue; default: assert(0 && "Unknown value type!"); return false; } Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.204 llvm/lib/AsmParser/llvmAsmParser.y:1.205 --- llvm/lib/AsmParser/llvmAsmParser.y:1.204 Fri Oct 8 21:18:58 2004 +++ llvm/lib/AsmParser/llvmAsmParser.y Sat Oct 16 13:17:13 2004 @@ -298,6 +298,9 @@ ThrowException("Cannot create a a non pointer null!"); return ConstantPointerNull::get(cast(Ty)); + case ValID::ConstUndefVal: // Is it an undef value? + return UndefValue::get(Ty); + case ValID::ConstantVal: // Fully resolved constant? if (D.ConstantValue->getType() != Ty) ThrowException("Constant expression type different from required type!"); @@ -908,12 +911,12 @@ %token IMPLEMENTATION ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK %token DECLARE GLOBAL CONSTANT VOLATILE -%token TO DOTDOTDOT NULL_TOK CONST INTERNAL LINKONCE WEAK APPENDING +%token TO DOTDOTDOT NULL_TOK UNDEF CONST INTERNAL LINKONCE WEAK APPENDING %token OPAQUE NOT EXTERNAL TARGET TRIPLE ENDIAN POINTERSIZE LITTLE BIG %token DEPLIBS // Basic Block Terminating Operators -%token RET BR SWITCH INVOKE UNWIND +%token RET BR SWITCH INVOKE UNWIND UNREACHABLE // Binary Operators %type ArithmeticOps LogicalOps SetCondOps // Binops Subcatagories @@ -1221,6 +1224,10 @@ $$ = ConstantPointerNull::get(PTy); delete $1; } + | Types UNDEF { + $$ = UndefValue::get($1->get()); + delete $1; + } | Types SymbolicValueRef { const PointerType *Ty = dyn_cast($1->get()); if (Ty == 0) @@ -1687,6 +1694,9 @@ | NULL_TOK { $$ = ValID::createNull(); } + | UNDEF { + $$ = ValID::createUndef(); + } | '<' ConstVector '>' { // Nonempty unsized packed vector const Type *ETy = (*$2)[0]->getType(); int NumElements = $2->size(); @@ -1858,6 +1868,9 @@ } | UNWIND { $$ = new UnwindInst(); + } + | UNREACHABLE { + $$ = new UnreachableInst(); }; From lattner at cs.uiuc.edu Sat Oct 16 13:18:24 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:18:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Reader.h Message-ID: <200410161818.NAA18540@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.133 -> 1.134 Reader.h updated: 1.14 -> 1.15 --- Log message: Add support for undef, unreachable, and function flags --- Diffs of the changes: (+82 -22) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.133 llvm/lib/Bytecode/Reader/Reader.cpp:1.134 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.133 Wed Oct 13 20:39:18 2004 +++ llvm/lib/Bytecode/Reader/Reader.cpp Sat Oct 16 13:18:13 2004 @@ -68,7 +68,8 @@ /// Throw an error if we've read past the end of the current block inline void BytecodeReader::checkPastBlockEnd(const char * block_name) { if (At > BlockEnd) - error(std::string("Attempt to read past the end of ") + block_name + " block."); + error(std::string("Attempt to read past the end of ") + block_name + + " block."); } /// Align the buffer position to a 32 bit boundary @@ -347,7 +348,8 @@ } // Check the function level types first... - TypeListTy::iterator I = std::find(FunctionTypes.begin(), FunctionTypes.end(), Ty); + TypeListTy::iterator I = std::find(FunctionTypes.begin(), + FunctionTypes.end(), Ty); if (I != FunctionTypes.end()) return Type::FirstDerivedTyID + ModuleTypes.size() + @@ -628,6 +630,15 @@ // Declare the resulting instruction we'll build. Instruction *Result = 0; + // If this is a bytecode format that did not include the unreachable + // instruction, bump up all opcodes numbers to make space. + if (hasNoUnreachableInst) { + if (Opcode >= Instruction::Unreachable && + Opcode < 62) { + ++Opcode; + } + } + // Handle binary operators if (Opcode >= Instruction::BinaryOpsBegin && Opcode < Instruction::BinaryOpsEnd && Oprnds.size() == 2) @@ -895,10 +906,13 @@ break; } case Instruction::Unwind: - if (Oprnds.size() != 0) - error("Invalid unwind instruction!"); + if (Oprnds.size() != 0) error("Invalid unwind instruction!"); Result = new UnwindInst(); break; + case Instruction::Unreachable: + if (Oprnds.size() != 0) error("Invalid unreachable instruction!"); + Result = new UnreachableInst(); + break; } // end switch(Opcode) unsigned TypeSlot; @@ -1268,12 +1282,20 @@ // // 0 if not expr; numArgs if is expr unsigned isExprNumArgs = read_vbr_uint(); - + if (isExprNumArgs) { + // 'undef' is encoded with 'exprnumargs' == 1. + if (!hasNoUndefValue) + if (--isExprNumArgs == 0) + return UndefValue::get(getType(TypeID)); + // FIXME: Encoding of constant exprs could be much more compact! std::vector ArgVec; ArgVec.reserve(isExprNumArgs); unsigned Opcode = read_vbr_uint(); + + // Bytecode files before LLVM 1.4 need have a missing terminator inst. + if (hasNoUnreachableInst) Opcode++; // Read the slot number and types of each of the arguments for (unsigned i = 0; i != isExprNumArgs; ++i) { @@ -1834,36 +1856,42 @@ } // Read the function objects for all of the functions that are coming - unsigned FnSignature = 0; - if (read_typeid(FnSignature)) - error("Invalid function type (type type) found"); + unsigned FnSignature = read_vbr_uint(); + + if (hasNoFlagsForFunctions) + FnSignature = (FnSignature << 5) + 1; - while (FnSignature != Type::VoidTyID) { // List is terminated by Void - const Type *Ty = getType(FnSignature); + // List is terminated by VoidTy. + while ((FnSignature >> 5) != Type::VoidTyID) { + const Type *Ty = getType(FnSignature >> 5); if (!isa(Ty) || !isa(cast(Ty)->getElementType())) { error("Function not a pointer to function type! Ty = " + Ty->getDescription()); - // FIXME: what should Ty be if handler continues? } // We create functions by passing the underlying FunctionType to create... const FunctionType* FTy = cast(cast(Ty)->getElementType()); + // Insert the place hodler Function* Func = new Function(FTy, GlobalValue::InternalLinkage, "", TheModule); - insertValue(Func, FnSignature, ModuleValues); + insertValue(Func, FnSignature >> 5, ModuleValues); + + // Flags are not used yet. + //unsigned Flags = FnSignature & 31; // Save this for later so we know type of lazily instantiated functions FunctionSignatureList.push_back(Func); if (Handler) Handler->handleFunctionDeclaration(Func); - // Get Next function signature - if (read_typeid(FnSignature)) - error("Invalid function type (type type) found"); + // Get the next function signature. + FnSignature = read_vbr_uint(); + if (hasNoFlagsForFunctions) + FnSignature = (FnSignature << 5) + 1; } // Now that the function signature list is set up, reverse it so that we can @@ -1929,6 +1957,9 @@ hasInconsistentBBSlotNums = false; hasVBRByteTypes = false; hasUnnecessaryModuleBlockId = false; + hasNoUndefValue = false; + hasNoFlagsForFunctions = false; + hasNoUnreachableInst = false; switch (RevisionNum) { case 0: // LLVM 1.0, 1.1 (Released) @@ -1990,24 +2021,41 @@ // FALL THROUGH case 4: // 1.3.1 (Not Released) - // In version 4, basic blocks have a minimum index of 0 whereas all the + // In version 4, we did not support the 'undef' constant. + hasNoUndefValue = true; + + // In version 4 and above, we did not include space for flags for functions + // in the module info block. + hasNoFlagsForFunctions = true; + + // In version 4 and above, we did not include the 'unreachable' instruction + // in the opcode numbering in the bytecode file. + hasNoUnreachableInst = true; + + // FALL THROUGH + + case 5: // 1.x.x (Not Released) + // FIXME: NONE of this is implemented yet! + break; + + // In version 5, basic blocks have a minimum index of 0 whereas all the // other primitives have a minimum index of 1 (because 0 is the "null" // value. In version 5, we made this consistent. hasInconsistentBBSlotNums = true; - // In version 4, the types SByte and UByte were encoded as vbr_uint so that + // In version 5, the types SByte and UByte were encoded as vbr_uint so that // signed values > 63 and unsigned values >127 would be encoded as two // bytes. In version 5, they are encoded directly in a single byte. hasVBRByteTypes = true; - // In version 4, modules begin with a "Module Block" which encodes a 4-byte + // In version 5, modules begin with a "Module Block" which encodes a 4-byte // integer value 0x01 to identify the module block. This is unnecessary and // removed in version 5. hasUnnecessaryModuleBlockId = true; // FALL THROUGH - case 5: // LLVM 1.4 (Released) + case 6: // LLVM 1.4 (Released) break; default: error("Unknown bytecode version number: " + itostr(RevisionNum)); Index: llvm/lib/Bytecode/Reader/Reader.h diff -u llvm/lib/Bytecode/Reader/Reader.h:1.14 llvm/lib/Bytecode/Reader/Reader.h:1.15 --- llvm/lib/Bytecode/Reader/Reader.h:1.14 Wed Oct 13 20:49:34 2004 +++ llvm/lib/Bytecode/Reader/Reader.h Sat Oct 16 13:18:13 2004 @@ -298,17 +298,29 @@ /// alignment of bytecode fields was done away with completely. bool hasAlignment; - // In version 4, basic blocks have a minimum index of 0 whereas all the + // In version 4 and earlier, the bytecode format did not support the 'undef' + // constant. + bool hasNoUndefValue; + + // In version 4 and earlier, the bytecode format did not save space for flags + // in the global info block for functions. + bool hasNoFlagsForFunctions; + + // In version 4 and earlier, there was no opcode space reserved for the + // unreachable instruction. + bool hasNoUnreachableInst; + + // In version 5, basic blocks have a minimum index of 0 whereas all the // other primitives have a minimum index of 1 (because 0 is the "null" // value. In version 5, we made this consistent. bool hasInconsistentBBSlotNums; - // In version 4, the types SByte and UByte were encoded as vbr_uint so that + // In version 5, the types SByte and UByte were encoded as vbr_uint so that // signed values > 63 and unsigned values >127 would be encoded as two // bytes. In version 5, they are encoded directly in a single byte. bool hasVBRByteTypes; - // In version 4, modules begin with a "Module Block" which encodes a 4-byte + // In version 5, modules begin with a "Module Block" which encodes a 4-byte // integer value 0x01 to identify the module block. This is unnecessary and // removed in version 5. bool hasUnnecessaryModuleBlockId; From lattner at cs.uiuc.edu Sat Oct 16 13:18:27 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:18:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200410161818.NAA18546@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.83 -> 1.84 --- Log message: Add support for undef, unreachable, and function flags --- Diffs of the changes: (+17 -14) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.83 llvm/lib/Bytecode/Writer/Writer.cpp:1.84 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.83 Wed Oct 13 21:31:35 2004 +++ llvm/lib/Bytecode/Writer/Writer.cpp Sat Oct 16 13:18:16 2004 @@ -35,7 +35,7 @@ /// so that the reader can distinguish which format of the bytecode file has /// been written. /// @brief The bytecode version number -const unsigned BCVersionNum = 4; +const unsigned BCVersionNum = 5; static RegisterPass X("emitbytecode", "Bytecode Writer"); @@ -294,7 +294,7 @@ if (const ConstantExpr *CE = dyn_cast(CPV)) { // FIXME: Encoding of constant exprs could be much more compact! assert(CE->getNumOperands() > 0 && "ConstantExpr with 0 operands"); - output_vbr(CE->getNumOperands()); // flags as an expr + output_vbr(1+CE->getNumOperands()); // flags as an expr output_vbr(CE->getOpcode()); // flags as an expr for (User::const_op_iterator OI = CE->op_begin(); OI != CE->op_end(); ++OI){ @@ -305,6 +305,9 @@ output_typeid((unsigned)Slot); } return; + } else if (isa(CPV)) { + output_vbr(1U); // 1 -> UndefValue constant. + return; } else { output_vbr(0U); // flag as not a ConstantExpr } @@ -752,8 +755,7 @@ bool hasNoEndianness = M->getEndianness() == Module::AnyEndianness; bool hasNoPointerSize = M->getPointerSize() == Module::AnyPointerSize; - // Output the version identifier... we are currently on bytecode version #2, - // which corresponds to LLVM v1.3. + // Output the version identifier and other information. unsigned Version = (BCVersionNum << 4) | (unsigned)isBigEndian | (hasLongPointers << 1) | (hasNoEndianness << 2) | @@ -851,7 +853,7 @@ if (isFunction) // Output the type plane before any constants! - outputTypes( Table.getModuleTypeLevel() ); + outputTypes(Table.getModuleTypeLevel()); else // Output module-level string constants before any other constants. outputConstantStrings(); @@ -898,7 +900,7 @@ // bit5+ = Slot # for type unsigned oSlot = ((unsigned)Slot << 5) | (getEncodedLinkage(I) << 2) | (I->hasInitializer() << 1) | (unsigned)I->isConstant(); - output_vbr(oSlot ); + output_vbr(oSlot); // If we have an initializer, output it now. if (I->hasInitializer()) { @@ -909,22 +911,23 @@ } output_typeid((unsigned)Table.getSlot(Type::VoidTy)); - // Output the types of the functions in this module... + // Output the types of the functions in this module. for (Module::const_iterator I = M->begin(), End = M->end(); I != End; ++I) { int Slot = Table.getSlot(I->getType()); - assert(Slot != -1 && "Module const pool is broken!"); + assert(Slot != -1 && "Module slot calculator is broken!"); assert(Slot >= Type::FirstDerivedTyID && "Derived type not in range!"); - output_typeid((unsigned)Slot); + assert(((Slot << 5) >> 5) == Slot && "Slot # too big!"); + unsigned ID = (Slot << 5) + 1; + output_vbr(ID); } - output_typeid((unsigned)Table.getSlot(Type::VoidTy)); + output_vbr((unsigned)Table.getSlot(Type::VoidTy) << 5); - // Put out the list of dependent libraries for the Module + // Emit the list of dependent libraries for the Module. Module::lib_iterator LI = M->lib_begin(); Module::lib_iterator LE = M->lib_end(); - output_vbr( unsigned(LE - LI) ); // Put out the number of dependent libraries - for ( ; LI != LE; ++LI ) { + output_vbr(unsigned(LE - LI)); // Emit the number of dependent libraries. + for (; LI != LE; ++LI) output(*LI); - } // Output the target triple from the module output(M->getTargetTriple()); From lattner at cs.uiuc.edu Sat Oct 16 13:19:19 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:19:19 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp Message-ID: <200410161819.NAA18558@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.10 -> 1.11 --- Log message: Add support for undef --- Diffs of the changes: (+2 -2) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.10 llvm/lib/CodeGen/AsmPrinter.cpp:1.11 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.10 Mon Aug 23 19:26:11 2004 +++ llvm/lib/CodeGen/AsmPrinter.cpp Sat Oct 16 13:19:08 2004 @@ -55,7 +55,7 @@ // Print out the specified constant, without a storage class. Only the // constants valid in constant expressions can occur here. void AsmPrinter::emitConstantValueOnly(const Constant *CV) { - if (CV->isNullValue()) + if (CV->isNullValue() || isa(CV)) O << "0"; else if (const ConstantBool *CB = dyn_cast(CV)) { assert(CB == ConstantBool::True); @@ -171,7 +171,7 @@ void AsmPrinter::emitGlobalConstant(const Constant *CV) { const TargetData &TD = TM.getTargetData(); - if (CV->isNullValue()) { + if (CV->isNullValue() || isa(CV)) { emitZeros(TD.getTypeSize(CV->getType())); return; } else if (const ConstantArray *CVA = dyn_cast(CV)) { From lattner at cs.uiuc.edu Sat Oct 16 13:19:37 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:19:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200410161819.NAA18568@apoc.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine: ExecutionEngine.cpp updated: 1.59 -> 1.60 --- Log message: Add support for undef --- Diffs of the changes: (+3 -1) Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.59 llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.60 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.59 Wed Sep 1 17:55:35 2004 +++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp Sat Oct 16 13:19:26 2004 @@ -440,7 +440,9 @@ // specified memory location... // void ExecutionEngine::InitializeMemory(const Constant *Init, void *Addr) { - if (Init->getType()->isFirstClassType()) { + if (isa(Init)) { + return; + } else if (Init->getType()->isFirstClassType()) { GenericValue Val = getConstantValue(Init); StoreValueToMemory(Val, (GenericValue*)Addr, Init->getType()); return; From lattner at cs.uiuc.edu Sat Oct 16 13:20:11 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:20:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Message-ID: <200410161820.NAA18581@apoc.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Execution.cpp updated: 1.133 -> 1.134 --- Log message: Add support for unreachable --- Diffs of the changes: (+5 -0) Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.133 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.134 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.133 Wed Sep 15 12:06:41 2004 +++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Sat Oct 16 13:20:00 2004 @@ -616,6 +616,11 @@ SwitchToNewBasicBlock(cast(Inst)->getUnwindDest(), InvokingSF); } +void Interpreter::visitUnreachableInst(UnreachableInst &I) { + std::cerr << "ERROR: Program executed an 'unreachable' instruction!\n"; + abort(); +} + void Interpreter::visitBranchInst(BranchInst &I) { ExecutionContext &SF = ECStack.back(); BasicBlock *Dest; From lattner at cs.uiuc.edu Sat Oct 16 13:21:44 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:21:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h Message-ID: <200410161821.NAA18605@apoc.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Interpreter.h updated: 1.66 -> 1.67 --- Log message: Add support for unreachable --- Diffs of the changes: (+1 -0) Index: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h diff -u llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:1.66 llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:1.67 --- llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:1.66 Wed Sep 1 17:55:35 2004 +++ llvm/lib/ExecutionEngine/Interpreter/Interpreter.h Sat Oct 16 13:21:33 2004 @@ -145,6 +145,7 @@ void visitCallInst(CallInst &I) { visitCallSite (CallSite (&I)); } void visitInvokeInst(InvokeInst &I) { visitCallSite (CallSite (&I)); } void visitUnwindInst(UnwindInst &I); + void visitUnreachableInst(UnreachableInst &I); void visitShl(ShiftInst &I); void visitShr(ShiftInst &I); From lattner at cs.uiuc.edu Sat Oct 16 13:22:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:22:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Makefile Message-ID: <200410161822.NAA18615@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target: Makefile updated: 1.17 -> 1.18 --- Log message: Fix fix fix --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/Makefile diff -u llvm/lib/Target/Makefile:1.17 llvm/lib/Target/Makefile:1.18 --- llvm/lib/Target/Makefile:1.17 Tue Sep 14 20:34:25 2004 +++ llvm/lib/Target/Makefile Sat Oct 16 13:21:50 2004 @@ -1,4 +1,4 @@ -##===- lib/Target/Makefile ------------------------------*- Makefile -*-===## +#===- lib/Target/Makefile ------------------------------*- Makefile -*-===## # # The LLVM Compiler Infrastructure # From lattner at cs.uiuc.edu Sat Oct 16 13:24:25 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:24:25 -0500 Subject: [llvm-commits] CVS: llvm/test/Feature/undefined.ll unreachable.ll Message-ID: <200410161824.NAA18635@apoc.cs.uiuc.edu> Changes in directory llvm/test/Feature: undefined.ll added (r1.1) unreachable.ll added (r1.1) --- Log message: testcases for undefined and unreachable --- Diffs of the changes: (+28 -0) Index: llvm/test/Feature/undefined.ll diff -c /dev/null llvm/test/Feature/undefined.ll:1.1 *** /dev/null Sat Oct 16 13:24:22 2004 --- llvm/test/Feature/undefined.ll Sat Oct 16 13:24:11 2004 *************** *** 0 **** --- 1,15 ---- + + %X = global int undef + + implementation + + declare int "atoi"(sbyte *) + + int %test() { + ret int undef + } + + int %test2() { + %X = add int undef, 1 + ret int %X + } Index: llvm/test/Feature/unreachable.ll diff -c /dev/null llvm/test/Feature/unreachable.ll:1.1 *** /dev/null Sat Oct 16 13:24:25 2004 --- llvm/test/Feature/unreachable.ll Sat Oct 16 13:24:11 2004 *************** *** 0 **** --- 1,13 ---- + + implementation + + declare void %bar() + + int %foo() { ;; Calling this function has undefined behavior + unreachable + } + + double %xyz() { + call void %bar() + unreachable ;; Bar must not return. + } From lattner at cs.uiuc.edu Sat Oct 16 13:24:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:24:43 -0500 Subject: [llvm-commits] CVS: llvm/utils/vim/llvm.vim Message-ID: <200410161824.NAA18648@apoc.cs.uiuc.edu> Changes in directory llvm/utils/vim: llvm.vim updated: 1.12 -> 1.13 --- Log message: Add support for undef and unreachable --- Diffs of the changes: (+2 -2) Index: llvm/utils/vim/llvm.vim diff -u llvm/utils/vim/llvm.vim:1.12 llvm/utils/vim/llvm.vim:1.13 --- llvm/utils/vim/llvm.vim:1.12 Tue Sep 28 16:45:54 2004 +++ llvm/utils/vim/llvm.vim Sat Oct 16 13:24:32 2004 @@ -21,14 +21,14 @@ syn keyword llvmStatement setne seteq setlt setgt setle setge syn keyword llvmStatement phi call cast to select shl shr vaarg vanext -syn keyword llvmStatement ret br switch invoke unwind +syn keyword llvmStatement ret br switch invoke unwind unreachable syn keyword llvmStatement malloc alloca free load store getelementptr syn keyword llvmStatement begin end true false zeroinitializer syn keyword llvmStatement declare global constant const syn keyword llvmStatement internal uninitialized external implementation syn keyword llvmStatement linkonce weak appending -syn keyword llvmStatement null to except target endian pointersize deplibs +syn keyword llvmStatement undef null to except target endian pointersize deplibs syn keyword llvmStatement big little volatile "syn match llvmFunction /%[a-zA-Z\$._\-][a-zA-Z\$._\-0-9]*/ From lattner at cs.uiuc.edu Sat Oct 16 13:24:45 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:24:45 -0500 Subject: [llvm-commits] CVS: llvm/utils/emacs/llvm-mode.el Message-ID: <200410161824.NAA18654@apoc.cs.uiuc.edu> Changes in directory llvm/utils/emacs: llvm-mode.el updated: 1.14 -> 1.15 --- Log message: Add support for undef and unreachable --- Diffs of the changes: (+2 -2) Index: llvm/utils/emacs/llvm-mode.el diff -u llvm/utils/emacs/llvm-mode.el:1.14 llvm/utils/emacs/llvm-mode.el:1.15 --- llvm/utils/emacs/llvm-mode.el:1.14 Tue Sep 28 16:46:18 2004 +++ llvm/utils/emacs/llvm-mode.el Sat Oct 16 13:24:35 2004 @@ -25,7 +25,7 @@ ;; Hex constants '("0x[0-9A-Fa-f]+" . font-lock-preprocessor-face) ;; Keywords - '("begin\\|end\\|true\\|false\\|zeroinitializer\\|declare\\|global\\|constant\\|const\\|internal\\|linkonce\\|weak\\|appending\\|uninitialized\\|implementation\\|\\.\\.\\.\\|null\\|to\\|except\\|not\\|target\\|endian\\|little\\|big\\|pointersize\\|deplibs\\|volatile" . font-lock-keyword-face) + '("begin\\|end\\|true\\|false\\|zeroinitializer\\|declare\\|global\\|constant\\|const\\|internal\\|linkonce\\|weak\\|appending\\|uninitialized\\|implementation\\|\\.\\.\\.\\|null\\|undef\\|to\\|except\\|not\\|target\\|endian\\|little\\|big\\|pointersize\\|deplibs\\|volatile" . font-lock-keyword-face) ;; Types '("void\\|bool\\|sbyte\\|ubyte\\|u?short\\|u?int\\|u?long\\|float\\|double\\|type\\|label\\|opaque" . font-lock-type-face) ;; Arithmetic and Logical Operators @@ -33,7 +33,7 @@ ;; Special instructions '("phi\\|call\\|cast\\|select\\|to\\|shl\\|shr\\|vaarg\\|vanext" . font-lock-keyword-face) ;; Control instructions - '("ret\\|br\\|switch\\|invoke\\|unwind" . font-lock-keyword-face) + '("ret\\|br\\|switch\\|invoke\\|unwind\\|unreachable" . font-lock-keyword-face) ;; Memory operators '("malloc\\|alloca\\|free\\|load\\|store\\|getelementptr" . font-lock-keyword-face) ) From lattner at cs.uiuc.edu Sat Oct 16 13:27:10 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:27:10 -0500 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs Message-ID: <200410161827.NAA18668@apoc.cs.uiuc.edu> Changes in directory llvm-test: Makefile.programs updated: 1.138 -> 1.139 --- Log message: Fix broken project support for TEST reports --- Diffs of the changes: (+2 -2) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.138 llvm-test/Makefile.programs:1.139 --- llvm-test/Makefile.programs:1.138 Wed Oct 13 13:51:43 2004 +++ llvm-test/Makefile.programs Sat Oct 16 13:26:56 2004 @@ -529,9 +529,9 @@ TestMakefile := $(wildcard $(PROGDIR)/TEST.$(TEST).Makefile) \ $(wildcard $(LLVM_SRC_ROOT)/projects/*/test/TEST.$(TEST).Makefile) TestReport := $(wildcard $(PROGDIR)/TEST.$(TEST).report) \ - $(wildcard $(BUILD_SRC_ROOT)/projects/*/test/TEST.$(TEST).report) + $(wildcard $(LLVM_SRC_ROOT)/projects/*/test/TEST.$(TEST).report) TestGnuPlot := $(wildcard $(PROGDIR)/TEST.$(TEST).gnuplot) \ - $(wildcard $(BUILD_SRC_ROOT)/projects/*/test/TEST.$(TEST).gnuplot) + $(wildcard $(LLVM_SRC_ROOT)/projects/*/test/TEST.$(TEST).gnuplot) ifneq ($(strip $(TestMakefile)),) -include $(TestMakefile) else From lattner at cs.uiuc.edu Sat Oct 16 13:28:12 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:28:12 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/GlobalOpt/undef-init.llx Message-ID: <200410161828.NAA18683@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/GlobalOpt: undef-init.llx added (r1.1) --- Log message: New testcase --- Diffs of the changes: (+18 -0) Index: llvm/test/Regression/Transforms/GlobalOpt/undef-init.llx diff -c /dev/null llvm/test/Regression/Transforms/GlobalOpt/undef-init.llx:1.1 *** /dev/null Sat Oct 16 13:28:11 2004 --- llvm/test/Regression/Transforms/GlobalOpt/undef-init.llx Sat Oct 16 13:28:01 2004 *************** *** 0 **** --- 1,18 ---- + ; RUN: llvm-as < %s | opt -globalopt | llvm-dis | not grep store + + %llvm.global_ctors = appending global [1 x { int, void ()* }] [ { int, void ()* } { int 65535, void ()* %_GLOBAL__I__Z3foov } ] ; <[1 x { int, void ()* }]*> [#uses=0] + %X.0 = internal global int undef ; [#uses=2] + + implementation ; Functions: + + int %_Z3foov() { + entry: + %tmp.1 = load int* %X.0 ; [#uses=1] + ret int %tmp.1 + } + + internal void %_GLOBAL__I__Z3foov() { + entry: + store int 1, int* %X.0 + ret void + } From lattner at cs.uiuc.edu Sat Oct 16 13:29:29 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:29:29 -0500 Subject: [llvm-commits] CVS: llvm-www/demo/index.cgi Message-ID: <200410161829.NAA18703@apoc.cs.uiuc.edu> Changes in directory llvm-www/demo: index.cgi updated: 1.30 -> 1.31 --- Log message: hilight new keywords --- Diffs of the changes: (+2 -2) Index: llvm-www/demo/index.cgi diff -u llvm-www/demo/index.cgi:1.30 llvm-www/demo/index.cgi:1.31 --- llvm-www/demo/index.cgi:1.30 Fri Oct 15 12:16:58 2004 +++ llvm-www/demo/index.cgi Sat Oct 16 13:29:18 2004 @@ -5,7 +5,7 @@ # doing remote web JO99C compilations. (It could still be used for that # purpose, though the two scripts have diverged somewhat.) # -# Last modified $Date: 2004/10/15 17:16:58 $ +# Last modified $Date: 2004/10/16 18:29:18 $ # use CGI; @@ -87,7 +87,7 @@ sub syntaxHighlightLLVM { my ($input) = @_; $input =~ s@\b(void|bool|sbyte|ubyte|short|ushort|int|uint|long|ulong|float|double|type|label|opaque)\b@$1@g; - $input =~ s@\b(add|sub|mul|div|rem|and|or|xor|setne|seteq|setlt|setgt|setle|setge|phi|call|cast|to|shl|shr|vaarg|vanext|ret|br|switch|invoke|unwind|malloc|alloca|free|load|store|getelementptr|begin|end|true|false|declare|global|constant|const|internal|uninitialized|external|implementation|linkonce|weak|appending|null|to|except|not|target|endian|pointersize|big|little|volatile|deplibs)\b@$1@g; + $input =~ s@\b(add|sub|mul|div|rem|and|or|xor|setne|seteq|setlt|setgt|setle|setge|phi|call|cast|to|shl|shr|vaarg|vanext|ret|br|switch|invoke|unwind|unreachable|malloc|alloca|free|load|store|getelementptr|begin|end|true|false|declare|global|constant|const|internal|uninitialized|external|implementation|linkonce|weak|appending|null|undef|to|except|not|target|endian|pointersize|big|little|volatile|deplibs)\b@$1@g; return $input; } From lattner at cs.uiuc.edu Sat Oct 16 13:36:11 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:36:11 -0500 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200410161836.NAA18745@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.243 -> 1.244 --- Log message: Update release notes --- Diffs of the changes: (+11 -6) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.243 llvm/docs/ReleaseNotes.html:1.244 --- llvm/docs/ReleaseNotes.html:1.243 Sat Oct 9 14:37:02 2004 +++ llvm/docs/ReleaseNotes.html Sat Oct 16 13:35:57 2004 @@ -73,8 +73,7 @@

    At this time, LLVM is known to correctly compile and run all C & C++ SPEC CPU95 & 2000 benchmarks, the Olden benchmarks, and the Ptrdist -benchmarks, and many other programs. LLVM now also works -with a broad variety of C++ programs.

    +benchmarks, and many other C and C++ programs.

    @@ -86,9 +85,15 @@
      -
    1. move test/Programs out of the main llvm - tree
    2. -
    3. +
    4. The test/Programs hierarchyhas + been moved out of the main LLVM tree into a separate CVS repo and + tarball.
    5. +
    6. LLVM now optimizes global variables significantly more than it did + before.
    7. +
    8. LLVM now includes the new 'undef' value and unreachable instruction, + which give the optimizer more information about the behavior of the + program.
    @@ -619,7 +624,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/10/09 19:37:02 $ + Last modified: $Date: 2004/10/16 18:35:57 $ From lattner at cs.uiuc.edu Sat Oct 16 13:56:16 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 13:56:16 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200410161856.NAA19239@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.134 -> 1.135 --- Log message: Do not erroneously accept revision 6 bytecode files when the format hasn't been defined yet! --- Diffs of the changes: (+2 -5) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.134 llvm/lib/Bytecode/Reader/Reader.cpp:1.135 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.134 Sat Oct 16 13:18:13 2004 +++ llvm/lib/Bytecode/Reader/Reader.cpp Sat Oct 16 13:56:02 2004 @@ -2031,12 +2031,13 @@ // In version 4 and above, we did not include the 'unreachable' instruction // in the opcode numbering in the bytecode file. hasNoUnreachableInst = true; + break; // FALL THROUGH case 5: // 1.x.x (Not Released) - // FIXME: NONE of this is implemented yet! break; + // FIXME: NONE of this is implemented yet! // In version 5, basic blocks have a minimum index of 0 whereas all the // other primitives have a minimum index of 1 (because 0 is the "null" @@ -2053,10 +2054,6 @@ // removed in version 5. hasUnnecessaryModuleBlockId = true; - // FALL THROUGH - - case 6: // LLVM 1.4 (Released) - break; default: error("Unknown bytecode version number: " + itostr(RevisionNum)); } From brukman at cs.uiuc.edu Sat Oct 16 14:14:09 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Sat, 16 Oct 2004 14:14:09 -0500 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200410161914.OAA31866@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.244 -> 1.245 --- Log message: * Add a space between words * Wrap at 80 cols --- Diffs of the changes: (+4 -4) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.244 llvm/docs/ReleaseNotes.html:1.245 --- llvm/docs/ReleaseNotes.html:1.244 Sat Oct 16 13:35:57 2004 +++ llvm/docs/ReleaseNotes.html Sat Oct 16 14:13:58 2004 @@ -85,7 +85,7 @@
      -
    1. The test/Programs hierarchyhas +
    2. The test/Programs hierarchy has been moved out of the main LLVM tree into a separate CVS repo and tarball.
    3. LLVM now optimizes global variables significantly more than it did @@ -107,8 +107,8 @@ @@ -624,7 +624,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/10/16 18:35:57 $ + Last modified: $Date: 2004/10/16 19:13:58 $ From lattner at cs.uiuc.edu Sat Oct 16 14:44:36 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 14:44:36 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/getelementptr.ll Message-ID: <200410161944.OAA20171@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: getelementptr.ll updated: 1.13 -> 1.14 --- Log message: New testcase, rework testcases to fail if there are any gep's other than those involving %B instead of allowing any geps except %A's. --- Diffs of the changes: (+10 -3) Index: llvm/test/Regression/Transforms/InstCombine/getelementptr.ll diff -u llvm/test/Regression/Transforms/InstCombine/getelementptr.ll:1.13 llvm/test/Regression/Transforms/InstCombine/getelementptr.ll:1.14 --- llvm/test/Regression/Transforms/InstCombine/getelementptr.ll:1.13 Fri Feb 27 23:26:06 2004 +++ llvm/test/Regression/Transforms/InstCombine/getelementptr.ll Sat Oct 16 14:44:23 2004 @@ -1,6 +1,6 @@ ; The %A getelementptr instruction should be eliminated here -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep getelementptr | not grep '%A ' +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep -v '%B' | not grep getelementptr %Global = constant [10 x sbyte] c"helloworld" @@ -27,10 +27,11 @@ ret int* %B } -sbyte * %foo5() { +void %foo5(sbyte %B) { ; This should be turned into a constexpr instead of being an instruction %A = getelementptr [10 x sbyte]* %Global, long 0, long 4 - ret sbyte* %A + store sbyte %B, sbyte* %A + ret void } int* %foo6() { @@ -51,3 +52,9 @@ %B = cast int* %A to sbyte* ret sbyte * %B } + +int %test9() { + %A = getelementptr {int, double}* null, int 0, uint 1 + %B = cast double* %A to int + ret int %B +} From lattner at cs.uiuc.edu Sat Oct 16 14:45:11 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 14:45:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200410161945.OAA20292@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.268 -> 1.269 --- Log message: Implement InstCombine/getelementptr.ll:test9, which is the source of many ugly and giant constnat exprs in some programs. --- Diffs of the changes: (+18 -0) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.268 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.269 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.268 Sat Oct 16 13:11:37 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sat Oct 16 14:44:59 2004 @@ -4018,6 +4018,24 @@ // Instruction isn't dead, see if we can constant propagate it... if (Constant *C = ConstantFoldInstruction(I)) { + if (isa(I) && + cast(I->getOperand(0))->isNullValue() && + !isa(C)) { + // If this is a constant expr gep that is effectively computing an + // "offsetof", fold it into 'cast int X to T*' instead of 'gep 0, 0, 12' + bool isFoldableGEP = true; + for (unsigned i = 1, e = I->getNumOperands(); i != e; ++i) + if (!isa(I->getOperand(i))) + isFoldableGEP = false; + if (isFoldableGEP) { + uint64_t Offset = TD->getIndexedOffset(I->getOperand(0)->getType(), + std::vector(I->op_begin()+1, I->op_end())); + C = ConstantUInt::get(Type::ULongTy, Offset); + C = ConstantUInt::getCast(C, TD->getIntPtrType()); + C = ConstantExpr::getCast(C, I->getType()); + } + } + // Add operands to the worklist... AddUsesToWorkList(*I); ReplaceInstUsesWith(*I, C); From lattner at cs.uiuc.edu Sat Oct 16 14:46:46 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 14:46:46 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200410161946.OAA20804@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.269 -> 1.270 --- Log message: Kill the bogon that slipped into my buffer before I committed. --- Diffs of the changes: (+1 -1) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.269 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.270 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.269 Sat Oct 16 14:44:59 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sat Oct 16 14:46:33 2004 @@ -4031,7 +4031,7 @@ uint64_t Offset = TD->getIndexedOffset(I->getOperand(0)->getType(), std::vector(I->op_begin()+1, I->op_end())); C = ConstantUInt::get(Type::ULongTy, Offset); - C = ConstantUInt::getCast(C, TD->getIntPtrType()); + C = ConstantExpr::getCast(C, TD->getIntPtrType()); C = ConstantExpr::getCast(C, I->getType()); } } From natebegeman at mac.com Sat Oct 16 15:44:07 2004 From: natebegeman at mac.com (Nate Begeman) Date: Sat, 16 Oct 2004 15:44:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp PowerPCInstrInfo.td Message-ID: <200410162044.PAA21805@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32ISelSimple.cpp updated: 1.92 -> 1.93 PowerPCInstrInfo.td updated: 1.37 -> 1.38 --- Log message: Finally fix one of the oldest FIXMEs in the PowerPC backend: correctly flag rotate left word immediate then mask insert (rlwimi) as a two-address instruction, and update the ISel usage of the instruction accordingly. This will allow us to properly schedule rlwimi, and use it to efficiently codegen bitfield operations. --- Diffs of the changes: (+12 -12) Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.92 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.93 --- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.92 Sat Oct 16 13:13:47 2004 +++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Sat Oct 16 15:43:29 2004 @@ -2550,25 +2550,23 @@ // Longs, as usual, are handled specially... if (Class == cLong) { // If we have a constant shift, we can generate much more efficient code - // than otherwise... - // + // than for a variable shift by using the rlwimi instruction. if (ConstantUInt *CUI = dyn_cast(ShiftAmount)) { unsigned Amount = CUI->getValue(); if (Amount < 32) { + unsigned TempReg = makeAnotherReg(ResultTy); if (isLeftShift) { - // FIXME: RLWIMI is a use-and-def of DestReg+1, but that violates SSA - BuildMI(*MBB, IP, PPC::RLWINM, 4, DestReg).addReg(SrcReg) + BuildMI(*MBB, IP, PPC::RLWINM, 4, TempReg).addReg(SrcReg) .addImm(Amount).addImm(0).addImm(31-Amount); - BuildMI(*MBB, IP, PPC::RLWIMI, 5).addReg(DestReg).addReg(SrcReg+1) - .addImm(Amount).addImm(32-Amount).addImm(31); + BuildMI(*MBB, IP, PPC::RLWIMI, 5, DestReg).addReg(TempReg) + .addReg(SrcReg+1).addImm(Amount).addImm(32-Amount).addImm(31); BuildMI(*MBB, IP, PPC::RLWINM, 4, DestReg+1).addReg(SrcReg+1) .addImm(Amount).addImm(0).addImm(31-Amount); } else { - // FIXME: RLWIMI is a use-and-def of DestReg, but that violates SSA - BuildMI(*MBB, IP, PPC::RLWINM, 4, DestReg+1).addReg(SrcReg+1) + BuildMI(*MBB, IP, PPC::RLWINM, 4, TempReg).addReg(SrcReg+1) .addImm(32-Amount).addImm(Amount).addImm(31); - BuildMI(*MBB, IP, PPC::RLWIMI, 5).addReg(DestReg+1).addReg(SrcReg) - .addImm(32-Amount).addImm(0).addImm(Amount-1); + BuildMI(*MBB, IP, PPC::RLWIMI, 5, DestReg+1).addReg(TempReg) + .addReg(SrcReg).addImm(32-Amount).addImm(0).addImm(Amount-1); BuildMI(*MBB, IP, PPC::RLWINM, 4, DestReg).addReg(SrcReg) .addImm(32-Amount).addImm(Amount).addImm(31); } Index: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.37 llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.38 --- llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.37 Thu Oct 7 17:30:03 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Sat Oct 16 15:43:38 2004 @@ -412,9 +412,11 @@ // M-Form instructions. rotate and mask instructions. // +let isTwoAddress = 1 in { def RLWIMI : MForm_2<20, 0, 0, 0, - (ops GPRC:$rA, GPRC:$rS, u5imm:$SH, u5imm:$MB, u5imm:$ME), - "rlwimi $rA, $rS, $SH, $MB, $ME">; + (ops GPRC:$rA, GPRC:$rSi, GPRC:$rS, u5imm:$SH, u5imm:$MB, + u5imm:$ME), "rlwimi $rA, $rS, $SH, $MB, $ME">; +} def RLWINM : MForm_2<21, 0, 0, 0, (ops GPRC:$rA, GPRC:$rS, u5imm:$SH, u5imm:$MB, u5imm:$ME), "rlwinm $rA, $rS, $SH, $MB, $ME">; From lattner at cs.uiuc.edu Sat Oct 16 18:28:18 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 18:28:18 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200410162328.SAA22066@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.270 -> 1.271 --- Log message: Fix a type violation --- Diffs of the changes: (+1 -1) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.270 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.271 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.270 Sat Oct 16 14:46:33 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sat Oct 16 18:28:04 2004 @@ -2516,7 +2516,7 @@ if (isa(Op0)) { // undef >>s X -> undef if (!isLeftShift && I.getType()->isSigned()) - return ReplaceInstUsesWith(I, Op1); + return ReplaceInstUsesWith(I, Op0); else // undef << X -> 0 AND undef >>u X -> 0 return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); } From lattner at cs.uiuc.edu Sat Oct 16 18:31:45 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 18:31:45 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp Message-ID: <200410162331.SAA22713@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.64 -> 1.65 --- Log message: Implement constant folding of undef values. --- Diffs of the changes: (+54 -4) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.64 llvm/lib/VMCore/ConstantFolding.cpp:1.65 --- llvm/lib/VMCore/ConstantFolding.cpp:1.64 Mon Oct 11 17:52:25 2004 +++ llvm/lib/VMCore/ConstantFolding.cpp Sat Oct 16 18:31:32 2004 @@ -486,7 +486,8 @@ static DirectFPRules DoubleR; if (isa(V1) || isa(V2) || - isa(V1) || isa(V2)) + isa(V1) || isa(V2) || + isa(V1) || isa(V2)) return EmptyR; switch (V1->getType()->getTypeID()) { @@ -525,15 +526,14 @@ if (V->getType() == DestTy) return (Constant*)V; // Cast of a global address to boolean is always true. - if (const GlobalValue *GV = dyn_cast(V)) + if (const GlobalValue *GV = dyn_cast(V)) { if (DestTy == Type::BoolTy) // FIXME: When we support 'external weak' references, we have to prevent // this transformation from happening. In the meantime we avoid folding // any cast of an external symbol. if (!GV->isExternal()) return ConstantBool::True; - - if (const ConstantExpr *CE = dyn_cast(V)) + } else if (const ConstantExpr *CE = dyn_cast(V)) { if (CE->getOpcode() == Instruction::Cast) { Constant *Op = const_cast(CE->getOperand(0)); // Try to not produce a cast of a cast, which is almost always redundant. @@ -561,6 +561,9 @@ if (isAllNull) return ConstantExpr::getCast(CE->getOperand(0), DestTy); } + } else if (isa(V)) { + return UndefValue::get(DestTy); + } // Check to see if we are casting an array of X to a pointer to X. If so, use // a GEP to get to the first element of the array instead of a cast! @@ -600,6 +603,10 @@ return const_cast(V1); else if (Cond == ConstantBool::False) return const_cast(V2); + + if (isa(V1)) return const_cast(V2); + if (isa(V2)) return const_cast(V1); + if (isa(Cond)) return const_cast(V1); return 0; } @@ -865,6 +872,49 @@ break; } + if (isa(V1) || isa(V2)) { + switch (Opcode) { + case Instruction::Add: + case Instruction::Sub: + case Instruction::SetEQ: + case Instruction::SetNE: + case Instruction::SetLT: + case Instruction::SetLE: + case Instruction::SetGT: + case Instruction::SetGE: + case Instruction::Xor: + return UndefValue::get(V1->getType()); + + case Instruction::Mul: + case Instruction::And: + return Constant::getNullValue(V1->getType()); + case Instruction::Div: + case Instruction::Rem: + if (!isa(V2)) // undef/X -> 0 + return Constant::getNullValue(V1->getType()); + return const_cast(V2); // X/undef -> undef + case Instruction::Or: // X|undef -> -1 + return ConstantInt::getAllOnesValue(V1->getType()); + case Instruction::Shr: + if (!isa(V2)) { + if (V1->getType()->isSigned()) + return const_cast(V1); // undef >>s X -> undef + // undef >>u X -> 0 + } else if (isa(V1)) { + return const_cast(V1); // undef >> undef -> undef + } else { + if (V1->getType()->isSigned()) + return const_cast(V1); // X >>s undef -> X + // X >>u undef -> 0 + } + return Constant::getNullValue(V1->getType()); + + case Instruction::Shl: + // undef << X -> 0 X << undef -> 0 + return Constant::getNullValue(V1->getType()); + } + } + if (const ConstantExpr *CE1 = dyn_cast(V1)) { if (const ConstantExpr *CE2 = dyn_cast(V2)) { // There are many possible foldings we could do here. We should probably From reid at x10sys.com Sat Oct 16 19:18:32 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:18:32 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libc/string.c Message-ID: <200410170018.TAA24117@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libc: string.c updated: 1.8 -> 1.9 --- Log message: Make sure that for systems where the string functions are actually macros that we undefine the macro before using its name in the definition. This can happen on Linux if _GNU_SOURCE is defined. --- Diffs of the changes: (+24 -0) Index: llvm/runtime/GCCLibraries/libc/string.c diff -u llvm/runtime/GCCLibraries/libc/string.c:1.8 llvm/runtime/GCCLibraries/libc/string.c:1.9 --- llvm/runtime/GCCLibraries/libc/string.c:1.8 Fri Feb 20 14:15:47 2004 +++ llvm/runtime/GCCLibraries/libc/string.c Sat Oct 16 19:17:54 2004 @@ -7,12 +7,18 @@ #include #include +#ifdef strlen +#undef strlen +#endif size_t strlen(const char *Str) { size_t Count = 0; while (*Str) { ++Count; ++Str; } return Count; } +#ifdef strdup +#undef strdup +#endif char *strdup(const char *str) { size_t Len = strlen(str); char *Result = (char*)malloc((Len+1)*sizeof(char)); @@ -20,6 +26,9 @@ return Result; } +#ifdef strndup +#undef strndup +#endif char *strndup(const char *str, size_t n) { size_t Len = strlen(str); if (Len > n) Len = n; @@ -29,24 +38,36 @@ return Result; } +#ifdef strcpy +#undef strcpy +#endif char *strcpy(char *s1, const char *s2) { char *dest = s1; while ((*s1++ = *s2++)); return dest; } +#ifdef strncpy +#undef strncpy +#endif char *strncpy(char *s1, const char *s2, size_t n) { char *dest = s1; while (n-- && (*s1++ = *s2++)); return dest; } +#ifdef strcat +#undef strcat +#endif char *strcat(char *s1, const char *s2) { strcpy(s1+strlen(s1), s2); return s1; } +#ifdef strcmp +#undef strcmp +#endif /* Compare S1 and S2, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. */ @@ -136,6 +157,9 @@ } #endif +#ifdef memcpy +#undef memcpy +#endif void *memcpy(void *dstpp, const void *srcpp, size_t len) { char *dstp = (char*)dstpp; char *srcp = (char*) srcpp; From reid at x10sys.com Sat Oct 16 19:21:20 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:21:20 -0500 Subject: [llvm-commits] CVS: llvm/runtime/Makefile.am Message-ID: <200410170021.TAA24187@zion.cs.uiuc.edu> Changes in directory llvm/runtime: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake. --- Diffs of the changes: (+13 -0) Index: llvm/runtime/Makefile.am diff -c /dev/null llvm/runtime/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:21:01 2004 --- llvm/runtime/Makefile.am Sat Oct 16 19:20:42 2004 *************** *** 0 **** --- 1,13 ---- + #===-- runtime/Makefile.am -- Makefile For Runtime Libs ----*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + + SUBDIRS = GC GCCLibraries libdummy libpng libprofile libtrace zlib + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:23:08 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:23:08 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/Makefile.am Message-ID: <200410170023.TAA24247@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/GCCLibraries/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:22:40 2004 --- llvm/runtime/GCCLibraries/Makefile.am Sat Oct 16 19:22:21 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/GCCLibraries/Makefile.am --------------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + + SUBDIRS = crtend libc libcurses libg libgcc libgdbm libm libmalloc libpthread \ + libtermcap libucb libutempter libutil + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:23:17 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:23:17 -0500 Subject: [llvm-commits] CVS: llvm/runtime/libprofile/Makefile.am Message-ID: <200410170023.TAA24251@zion.cs.uiuc.edu> Changes in directory llvm/runtime/libprofile: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+16 -0) Index: llvm/runtime/libprofile/Makefile.am diff -c /dev/null llvm/runtime/libprofile/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:22:40 2004 --- llvm/runtime/libprofile/Makefile.am Sat Oct 16 19:22:30 2004 *************** *** 0 **** --- 1,16 ---- + #===-- runtime/libprofile/Makefile.am ----------------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libprofile.a + libprofile_a_SOURCES = BasicBlockTracing.c BlockProfiling.c CommonProfiling.c \ + EdgeProfiling.c FunctionProfiling.c Profiling.h + + EXPORTED_SYMBOL_LIST = exported_symbols.lst + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:23:17 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:23:17 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GC/Makefile.am Message-ID: <200410170023.TAA24254@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GC: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+15 -0) Index: llvm/runtime/GC/Makefile.am diff -c /dev/null llvm/runtime/GC/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:22:40 2004 --- llvm/runtime/GC/Makefile.am Sat Oct 16 19:22:30 2004 *************** *** 0 **** --- 1,15 ---- + #===-- runtime/GC/Makefile.am ------------------------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + SUBDIRS = SemiSpace + + EXTRA_DIST = gc_exported_symbols.lst GCInterface.h + + include $(top_srcdir)/Makefile_config + From reid at x10sys.com Sat Oct 16 19:23:18 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:23:18 -0500 Subject: [llvm-commits] CVS: llvm/runtime/libdummy/Makefile.am Message-ID: <200410170023.TAA24266@zion.cs.uiuc.edu> Changes in directory llvm/runtime/libdummy: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/libdummy/Makefile.am diff -c /dev/null llvm/runtime/libdummy/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:22:40 2004 --- llvm/runtime/libdummy/Makefile.am Sat Oct 16 19:22:30 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/libdummy/Makefile.am ------------------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libdummy.a + libdummy_a_SOURCES = dummylib.c + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:23:18 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:23:18 -0500 Subject: [llvm-commits] CVS: llvm/runtime/libtrace/Makefile.am Message-ID: <200410170023.TAA24263@zion.cs.uiuc.edu> Changes in directory llvm/runtime/libtrace: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/libtrace/Makefile.am diff -c /dev/null llvm/runtime/libtrace/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:22:40 2004 --- llvm/runtime/libtrace/Makefile.am Sat Oct 16 19:22:30 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/libtrace/Makefile.am ------------------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libtrace.a + libtrace_a_SOURCES = tracelib.c tracelib.h + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:23:17 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:23:17 -0500 Subject: [llvm-commits] CVS: llvm/runtime/libpng/Makefile.am Message-ID: <200410170023.TAA24257@zion.cs.uiuc.edu> Changes in directory llvm/runtime/libpng: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+20 -0) Index: llvm/runtime/libpng/Makefile.am diff -c /dev/null llvm/runtime/libpng/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:22:40 2004 --- llvm/runtime/libpng/Makefile.am Sat Oct 16 19:22:30 2004 *************** *** 0 **** --- 1,20 ---- + #===-- runtime/libpng/Makefile.am --------------------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libpng.a + libpng_a_SOURCES = example.c png.c pngerror.c pnggccrd.c pngget.c pngmem.c \ + pngpread.c pngread.c pngrio.c pngrtran.c pngrutil.c \ + pngset.c pngtest.c pngtrans.c pngvcrd.c pngwio.c pngwrite.c \ + pngwtran.c pngwutil.c + + CPPFLAGS = -I../zlib + + BYTECODE_LIBRARY = libpng.a + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:23:18 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:23:18 -0500 Subject: [llvm-commits] CVS: llvm/runtime/zlib/Makefile.am Message-ID: <200410170023.TAA24260@zion.cs.uiuc.edu> Changes in directory llvm/runtime/zlib: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+20 -0) Index: llvm/runtime/zlib/Makefile.am diff -c /dev/null llvm/runtime/zlib/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:22:40 2004 --- llvm/runtime/zlib/Makefile.am Sat Oct 16 19:22:30 2004 *************** *** 0 **** --- 1,20 ---- + #===-- runtime/zlib/Makefile.am ----------------------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libz.a + libz_a_SOURCES = adler32.c compress.c crc32.c crc32.h deflate.c deflate.h \ + gzio.c infback.c inffast.c inffast.h inffixed.h \ + inflate.c inflate.h inftrees.c inftrees.h trees.c \ + trees.h uncompr.c zconf.h zlib.h zutil.c zutil.h + + CPPFLAGS = -DNO_DUMMY_DECL=1 + + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:25:01 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:01 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/crtend/Makefile.am Message-ID: <200410170025.TAA24376@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/crtend: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+62 -0) Index: llvm/runtime/GCCLibraries/crtend/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/crtend/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GCCLibraries/crtend/Makefile.am Sat Oct 16 19:24:15 2004 *************** *** 0 **** --- 1,62 ---- + #===-- runtime/GCCLibraries/crtend/Makefile.am -------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + ##===- runtime/GCCLibraries/crtend/Makefile ----------------*- Makefile -*-===## + # + # The LLVM Compiler Infrastructure + # + # This file was developed by the LLVM research group and is distributed under + # the University of Illinois Open Source License. See LICENSE.TXT for details. + # + ##===----------------------------------------------------------------------===## + # + # This directory contains the C and C++ runtime libraries for the LLVM GCC + # front-ends. See the README.txt file for more details. + # + # Since this archive has strange requirements, we use almost all custom rules + # for building it. + # + ##===----------------------------------------------------------------------===## + + include $(top_srcdir)/Makefile_config + + AggregateLib := $(BCDIR)/libcrtend.a + ComponentLibs := comp_main.bc comp_genericeh.bc comp_sjljeh.bc + + ## We build libcrtend.a from the four components described in the README. + $(AggregateLib) : $(BCDIR) $(ComponentLibs) + @echo Building final libcrtend.a file from bytecode components + $(AR) cr $(BCDIR)/libcrtend.a $(ComponentLibs) + + all-am: $(AggregateLib) + + clean-am: clean-crtend + $(RM) -f $(AggregateLib) *.bc + + install-am: install-crtend + $(INSTALL_DATA) '$(AggregateLib)' $(DESTDIR)$(libdir) + + MainObj := crtend.bc listend.bc + GenericEHObj := Exception.bc + SJLJEHObj := SJLJ-Exception.bc + + # __main and ctor/dtor support component + comp_main.bc: $(MainObj) + @echo Linking $(notdir $@) component... + $(LLVMGCCLD) -link-as-library -internalize-public-api-file=$(srcdir)/comp_main.lst $(MainObj) -o $@ + + # Generic exception handling support runtime. + comp_genericeh.bc: $(GenericEHObj) + @echo Linking $(notdir $@) component... + $(LLVMGCCLD) -link-as-library -internalize-public-api-file=$(srcdir)/comp_genericeh.lst $(GenericEHObj) -o $@ + + # setjmp/longjmp exception handling support runtime. + comp_sjljeh.bc: $(SJLJEHObj) + @echo Linking $(notdir $@) component... + $(LLVMGCCLD) -link-as-library -internalize-public-api-file=$(srcdir)/comp_sjljeh.lst $(SJLJEHObj) -o $@ From reid at x10sys.com Sat Oct 16 19:25:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:13 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libpthread/Makefile.am Message-ID: <200410170025.TAA24381@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libpthread: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/GCCLibraries/libpthread/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/libpthread/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GCCLibraries/libpthread/Makefile.am Sat Oct 16 19:24:24 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/GCCLibraries/libpthread/Makefile.am ---------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libpthread.a + libpthread_a_SOURCES = pthread.c + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:25:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:13 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libutempter/Makefile.am Message-ID: <200410170025.TAA24380@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libutempter: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/GCCLibraries/libutempter/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/libutempter/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GCCLibraries/libutempter/Makefile.am Sat Oct 16 19:24:24 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/GCCLibraries/libutempter/Makefile.am --------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libutempter.a + libutempter_a_SOURCES = dummy.c + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:25:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:13 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libutil/Makefile.am Message-ID: <200410170025.TAA24403@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libutil: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/GCCLibraries/libutil/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/libutil/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GCCLibraries/libutil/Makefile.am Sat Oct 16 19:24:24 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/GCCLibraries/libutil/Makefile.am ------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libutil.a + libutil_a_SOURCES = dummy.c + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:25:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:13 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libucb/Makefile.am Message-ID: <200410170025.TAA24379@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libucb: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/GCCLibraries/libucb/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/libucb/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GCCLibraries/libucb/Makefile.am Sat Oct 16 19:24:24 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/GCCLibraries/libucb/Makefile.am -------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libucb.a + libucb_a_SOURCES = dummy.c + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:25:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:13 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libgcc/Makefile.am Message-ID: <200410170025.TAA24391@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libgcc: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/GCCLibraries/libgcc/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/libgcc/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GCCLibraries/libgcc/Makefile.am Sat Oct 16 19:24:24 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/GCCLibraries/libgcc/Makefile.am -------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libgcc.a + libgcc_a_SOURCES = eprintf.c + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:25:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:13 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libtermcap/Makefile.am Message-ID: <200410170025.TAA24388@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libtermcap: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/GCCLibraries/libtermcap/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/libtermcap/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GCCLibraries/libtermcap/Makefile.am Sat Oct 16 19:24:24 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/GCCLibraries/libtermcap/Makefile.am ---------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libtermcap.a + libtermcap_a_SOURCES = dummy.c + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:25:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:13 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libc/Makefile.am Message-ID: <200410170025.TAA24390@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libc: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/GCCLibraries/libc/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/libc/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GCCLibraries/libc/Makefile.am Sat Oct 16 19:24:24 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/GCCLibraries/libc/Makefile.am ---------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libc.a + libc_a_SOURCES = atox.c io.c memory.c qsort.c string.c + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:25:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:13 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libmalloc/Makefile.am Message-ID: <200410170025.TAA24400@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libmalloc: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/GCCLibraries/libmalloc/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/libmalloc/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GCCLibraries/libmalloc/Makefile.am Sat Oct 16 19:24:24 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/GCCLibraries/libmalloc/Makefile.am ----------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libmalloc.a + libmalloc_a_SOURCES = dummy.c + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:25:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:13 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libgdbm/Makefile.am Message-ID: <200410170025.TAA24402@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libgdbm: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/GCCLibraries/libgdbm/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/libgdbm/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GCCLibraries/libgdbm/Makefile.am Sat Oct 16 19:24:24 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/GCCLibraries/libgdbm/Makefile.am ------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libgdbm.a + libgdbm_a_SOURCES = temp.c + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:25:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:13 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libm/Makefile.am Message-ID: <200410170025.TAA24389@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libm: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/GCCLibraries/libm/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/libm/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GCCLibraries/libm/Makefile.am Sat Oct 16 19:24:24 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/GCCLibraries/libm/Makefile.am ---------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libm.a + libm_a_SOURCES = temp.c + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:25:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:13 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libg/Makefile.am Message-ID: <200410170025.TAA24415@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libg: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/GCCLibraries/libg/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/libg/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GCCLibraries/libg/Makefile.am Sat Oct 16 19:24:24 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/GCCLibraries/libg/Makefile.am ---------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libg.a + libg_a_SOURCES = temp.c + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:25:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:13 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GC/SemiSpace/Makefile.am Message-ID: <200410170025.TAA24412@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GC/SemiSpace: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+17 -0) Index: llvm/runtime/GC/SemiSpace/Makefile.am diff -c /dev/null llvm/runtime/GC/SemiSpace/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GC/SemiSpace/Makefile.am Sat Oct 16 19:24:24 2004 *************** *** 0 **** --- 1,17 ---- + #===-- runtime/GC/SemiSpace/Makefile.am --------------------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libGCSemiSpace.a + libGCSemiSpace_a_SOURCES = semispace.c + + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + EXPORTED_SYMBOL_FILE = $(srcdir)/../gc_exported_symbols.lst + + include $(top_srcdir)/Makefile_config From reid at x10sys.com Sat Oct 16 19:25:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 16 Oct 2004 19:25:13 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libcurses/Makefile.am Message-ID: <200410170025.TAA24401@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libcurses: Makefile.am added (r1.1) --- Log message: Initial Makefile.am for building with automake --- Diffs of the changes: (+14 -0) Index: llvm/runtime/GCCLibraries/libcurses/Makefile.am diff -c /dev/null llvm/runtime/GCCLibraries/libcurses/Makefile.am:1.1 *** /dev/null Sat Oct 16 19:24:34 2004 --- llvm/runtime/GCCLibraries/libcurses/Makefile.am Sat Oct 16 19:24:24 2004 *************** *** 0 **** --- 1,14 ---- + #===-- runtime/GCCLibraries/libcurses/Makefile.am ----------*- Makefile -*--===# + # + # The LLVM Compiler Infrastructure + # + # This file was developed by Reid Spencer and is distributed under the + # University of Illinois Open Source License. See LICENSE.TXT for details. + # + #===------------------------------------------------------------------------===# + + lib_LIBRARIES = libcurses.a + libcurses_a_SOURCES = dummy.c + BYTECODE_LIBRARY = $(lib_LIBRARIES) + + include $(top_srcdir)/Makefile_config From lattner at cs.uiuc.edu Sat Oct 16 21:44:58 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 21:44:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp Message-ID: <200410170244.VAA26470@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9AsmPrinter.cpp updated: 1.123 -> 1.124 --- Log message: I forgot that sparc no longer uses the shared asmwriter. Give it support for undef. --- Diffs of the changes: (+4 -2) Index: llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp diff -u llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.123 llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.124 --- llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.123 Sat Oct 16 13:14:09 2004 +++ llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp Sat Oct 16 21:44:45 2004 @@ -323,7 +323,9 @@ O << ConstantExprToString(CE, TM) << "\n"; } else if (CV->getType()->isPrimitiveType()) { // Check primitive types last - if (CV->getType()->isFloatingPoint()) { + if (isa(CV)) { + O << "0\n"; + } else if (CV->getType()->isFloatingPoint()) { // FP Constants are printed as integer constants to avoid losing // precision... double Val = cast(CV)->getValue(); @@ -385,7 +387,7 @@ } assert(sizeSoFar == cvsLayout->StructSize && "Layout of constant struct may be incorrect!"); - } else if (isa(CV)) { + } else if (isa(CV) || isa(CV)) { PrintZeroBytesToPad(TM.getTargetData().getTypeSize(CV->getType())); } else printSingleConstantValue(CV); From lattner at cs.uiuc.edu Sat Oct 16 21:49:21 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 21:49:21 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-db/llvm-db.cpp Message-ID: <200410170249.VAA29449@apoc.cs.uiuc.edu> Changes in directory llvm/tools/llvm-db: llvm-db.cpp updated: 1.6 -> 1.7 --- Log message: Reid added --version to the CommandLine lib. Don't conflict with it. --- Diffs of the changes: (+1 -4) Index: llvm/tools/llvm-db/llvm-db.cpp diff -u llvm/tools/llvm-db/llvm-db.cpp:1.6 llvm/tools/llvm-db/llvm-db.cpp:1.7 --- llvm/tools/llvm-db/llvm-db.cpp:1.6 Wed Sep 1 17:55:37 2004 +++ llvm/tools/llvm-db/llvm-db.cpp Sat Oct 16 21:49:08 2004 @@ -41,7 +41,6 @@ cl::value_desc("directory")); // Command line options specific to the llvm-db debugger driver - cl::opt Version("version", cl::desc("Print version number and quit")); cl::opt Quiet("quiet", cl::desc("Do not print introductory messages")); cl::alias QA1("silent", cl::desc("Alias for -quiet"), cl::aliasopt(Quiet)); cl::alias QA2("q", cl::desc("Alias for -quiet"), cl::aliasopt(Quiet)); @@ -55,10 +54,8 @@ " llvm source-level debugger\n"); sys::PrintStackTraceOnErrorSignal(); - if (Version || !Quiet) { + if (!Quiet) std::cout << "llvm-db: The LLVM source-level debugger\n"; - if (Version) return 1; - } // Merge Inputfile and InputArgs into the InputArgs list... if (!InputFile.empty() && InputArgs.empty()) From lattner at cs.uiuc.edu Sat Oct 16 23:02:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 16 Oct 2004 23:02:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp Message-ID: <200410170402.XAA31876@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.65 -> 1.66 --- Log message: Fix constant folding relational operators with undef operands. --- Diffs of the changes: (+4 -7) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.65 llvm/lib/VMCore/ConstantFolding.cpp:1.66 --- llvm/lib/VMCore/ConstantFolding.cpp:1.65 Sat Oct 16 18:31:32 2004 +++ llvm/lib/VMCore/ConstantFolding.cpp Sat Oct 16 23:01:51 2004 @@ -830,7 +830,9 @@ // If we successfully folded the expression, return it now. if (C) return C; - if (SetCondInst::isRelational(Opcode)) + if (SetCondInst::isRelational(Opcode)) { + if (isa(V1) || isa(V2)) + return UndefValue::get(Type::BoolTy); switch (evaluateRelation(V1, V2)) { default: assert(0 && "Unknown relational!"); case Instruction::BinaryOpsEnd: @@ -871,17 +873,12 @@ if (Opcode == Instruction::SetNE) return ConstantBool::True; break; } + } if (isa(V1) || isa(V2)) { switch (Opcode) { case Instruction::Add: case Instruction::Sub: - case Instruction::SetEQ: - case Instruction::SetNE: - case Instruction::SetLT: - case Instruction::SetLE: - case Instruction::SetGT: - case Instruction::SetGE: case Instruction::Xor: return UndefValue::get(V1->getType()); From natebegeman at mac.com Sun Oct 17 00:19:57 2004 From: natebegeman at mac.com (Nate Begeman) Date: Sun, 17 Oct 2004 00:19:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Message-ID: <200410170519.AAA28747@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32ISelSimple.cpp updated: 1.93 -> 1.94 --- Log message: Implement bitfield insert by recognizing the following pattern: 1. optional shift left 2. and x, immX 3. and y, immY 4. or z, x, y ==> rlwimi z, x, y, shift, mask begin, mask end where immX == ~immY and immX is a run of set bits. This transformation fires 32 times on voronoi, once on espresso, and probably several dozen times on external benchmarks such as gcc. To put this in terms of actual code generated for struct B { unsigned a : 3; unsigned b : 2; }; void storeA (struct B *b, int v) { b->a = v;} void storeB (struct B *b, int v) { b->b = v;} Old: _storeA: rlwinm r2, r4, 0, 29, 31 lwz r4, 0(r3) rlwinm r4, r4, 0, 0, 28 or r2, r4, r2 stw r2, 0(r3) blr _storeB: rlwinm r2, r4, 3, 0, 28 rlwinm r2, r2, 0, 27, 28 lwz r4, 0(r3) rlwinm r4, r4, 0, 29, 26 or r2, r2, r4 stw r2, 0(r3) blr New: _storeA: lwz r2, 0(r3) rlwimi r2, r4, 0, 29, 31 stw r2, 0(r3) blr _storeB: lwz r2, 0(r3) rlwimi r2, r4, 3, 27, 28 stw r2, 0(r3) blr --- Diffs of the changes: (+111 -5) Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.93 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.94 --- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.93 Sat Oct 16 15:43:29 2004 +++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Sun Oct 17 00:19:20 2004 @@ -32,7 +32,7 @@ using namespace llvm; namespace { - Statistic<> NumHiAndLo("ppc-codegen", "Number of 32b imms not loaded"); + Statistic<> Bitfields("ppc-codegen", "Number of bitfield inserts"); /// TypeClass - Used by the PowerPC backend to group LLVM types by their basic /// PPC Representation. @@ -100,6 +100,18 @@ base(b), index(i), offset(o) {} }; + /// RlwimiRec - This struct is for recording the necessary information to + /// emit a PowerPC rlwimi instruction for a bitfield insert rather than + /// a sequence of shifts and ands, followed by an or. + struct RlwimiRec { + unsigned Shift; + unsigned MB, ME; + Value *Op0, *Op1; + RlwimiRec() : Shift(0), MB(0), ME(0), Op0(0), Op1(0) {} + RlwimiRec(unsigned s, unsigned b, unsigned e, Value *y, Value *z) : + Shift(s), MB(b), ME(e), Op0(y), Op1(z) {} + }; + // External functions used in the Module Function *fmodfFn, *fmodFn, *__cmpdi2Fn, *__moddi3Fn, *__divdi3Fn, *__umoddi3Fn, *__udivdi3Fn, *__fixsfdiFn, *__fixdfdiFn, *__fixunssfdiFn, @@ -117,6 +129,11 @@ // GEPMap - Mapping between basic blocks and GEP definitions std::map GEPMap; + + // RlwimiMap - Mapping between BinaryOperand (Or) instructions and info + // needed to properly emit a rlwimi instruction in its place. + std::map RlwimiMap; + std::vector SkipList; // A Reg to hold the base address used for global loads and stores, and a // flag to set whether or not we need to emit it for this function. @@ -199,6 +216,8 @@ RegMap.clear(); MBBMap.clear(); AllocaMap.clear(); + RlwimiMap.clear(); + SkipList.clear(); F = 0; // We always build a machine code representation for the function return true; @@ -319,6 +338,12 @@ Value *Src, const Type *DestTy, unsigned TargetReg); + /// emitBitfieldInsert - return true if we were able to fold the sequence of + /// instructions starting with AndI into a bitfield insert. + bool PPC32ISel::emitBitfieldInsert(BinaryOperator *AndI, + unsigned ShlAmount, + Value *InsertOp); + /// emitBinaryConstOperation - Used by several functions to emit simple /// arithmetic and logical operations with constants on a register rather /// than a Value. @@ -334,6 +359,7 @@ /// void emitSimpleBinaryOperation(MachineBasicBlock *BB, MachineBasicBlock::iterator IP, + BinaryOperator *BO, Value *Op0, Value *Op1, unsigned OperatorClass, unsigned TargetReg); @@ -2000,7 +2026,18 @@ Value *Op0 = B.getOperand(0), *Op1 = B.getOperand(1); unsigned Class = getClassB(B.getType()); - emitSimpleBinaryOperation(BB, MI, Op0, Op1, OperatorClass, DestReg); + if (std::find(SkipList.begin(), SkipList.end(), &B) != SkipList.end()) + return; + + RlwimiRec r = RlwimiMap[&B]; + if (0 != r.Op0) { + unsigned Op0Reg = getReg(r.Op0, BB, MI); + unsigned Op1Reg = getReg(r.Op1, BB, MI); + BuildMI(*BB, MI, PPC::RLWIMI, 5, DestReg).addReg(Op1Reg) + .addReg(Op0Reg).addImm(r.Shift).addImm(r.MB).addImm(r.ME); + } else { + emitSimpleBinaryOperation(BB, MI, &B, Op0, Op1, OperatorClass, DestReg); + } } /// emitBinaryFPOperation - This method handles emission of floating point @@ -2097,6 +2134,56 @@ return false; } +/// emitBitfieldInsert - return true if we were able to fold the sequence of +/// instructions starting with AndI into a bitfield insert. +bool PPC32ISel::emitBitfieldInsert(BinaryOperator *AndI, unsigned ShlAmount, + Value *InsertOp) { + if (AndI->hasOneUse()) { + ConstantInt *CI_1 = dyn_cast(AndI->getOperand(1)); + BinaryOperator *OrI = dyn_cast(*(AndI->use_begin())); + if (CI_1 && OrI && OrI->getOpcode() == Instruction::Or) { + Value *Op0 = OrI->getOperand(0); + Value *Op1 = OrI->getOperand(1); + BinaryOperator *AndI_2; + // Whichever operand our initial And instruction is to the Or instruction, + // Look at the other operand to determine if it is also an And instruction + if (AndI == Op0) { + AndI_2 = dyn_cast(Op1); + } else if (AndI == Op1) { + AndI_2 = dyn_cast(Op0); + std::swap(Op0, Op1); + } else { + assert(0 && "And instruction not used in Or!"); + } + // Verify that the second operand to the Or is an And with one use + if (AndI_2 && AndI_2->hasOneUse() + && AndI_2->getOpcode() == Instruction::And) { + // Check to see if this And instruction also has a constant int operand. + // If it does, then we can replace this sequence of instructions with an + // insert if the sum of the two ConstantInts has all bits set, and + // one is a run of ones (which implies the other is as well). + ConstantInt *CI_2 = dyn_cast(AndI_2->getOperand(1)); + if (CI_2) { + unsigned Imm1 = CI_1->getRawValue(); + unsigned Imm2 = CI_2->getRawValue(); + if (Imm1 + Imm2 == 0xFFFFFFFF) { + unsigned MB, ME; + if (isRunOfOnes(Imm1, MB, ME)) { + ++Bitfields; + SkipList.push_back(AndI); + SkipList.push_back(AndI_2); + RlwimiMap[OrI] = RlwimiRec(ShlAmount, MB, ME, + InsertOp, AndI_2->getOperand(0)); + return true; + } + } + } + } + } + } + return false; +} + /// emitBinaryConstOperation - Implement simple binary operators for integral /// types with a constant operand. Opcode is one of: 0 for Add, 1 for Sub, /// 2 for And, 3 for Or, 4 for Xor, and 5 for Subtract-From. @@ -2164,7 +2251,6 @@ .addZImm(Op1->getRawValue() >> 16); } else if ((Opcode < 2 && WontSignExtend) || Opcode == 3 || Opcode == 4) { unsigned TmpReg = makeAnotherReg(Op1->getType()); - ++NumHiAndLo; if (Opcode < 2) { BuildMI(*MBB, IP, ImmOpTab[1][Opcode], 2, TmpReg).addReg(Op0Reg) .addSImm(Op1->getRawValue() >> 16); @@ -2188,6 +2274,7 @@ /// void PPC32ISel::emitSimpleBinaryOperation(MachineBasicBlock *MBB, MachineBasicBlock::iterator IP, + BinaryOperator *BO, Value *Op0, Value *Op1, unsigned OperatorClass, unsigned DestReg) { @@ -2235,6 +2322,9 @@ // Special case: op Reg, if (ConstantInt *CI = dyn_cast(Op1)) if (Class != cLong) { + if (OperatorClass == 2 && emitBitfieldInsert(BO, 0, Op0)) + return; + unsigned Op0r = getReg(Op0, MBB, IP); emitBinaryConstOperation(MBB, IP, Op0r, CI, OperatorClass, DestReg); return; @@ -2543,12 +2633,12 @@ Value *Op, Value *ShiftAmount, bool isLeftShift, const Type *ResultTy, unsigned DestReg) { - unsigned SrcReg = getReg (Op, MBB, IP); bool isSigned = ResultTy->isSigned (); unsigned Class = getClass (ResultTy); // Longs, as usual, are handled specially... if (Class == cLong) { + unsigned SrcReg = getReg (Op, MBB, IP); // If we have a constant shift, we can generate much more efficient code // than for a variable shift by using the rlwimi instruction. if (ConstantUInt *CUI = dyn_cast(ShiftAmount)) { @@ -2685,7 +2775,22 @@ // The shift amount is constant, guaranteed to be a ubyte. Get its value. assert(CUI->getType() == Type::UByteTy && "Shift amount not a ubyte?"); unsigned Amount = CUI->getValue(); - + + // If this is a left shift with one use, and that use is an And instruction, + // then attempt to emit a bitfield insert. + if (isLeftShift) { + User *U = Op->use_back(); + if (U->hasOneUse()) { + Value *V = *(U->use_begin()); + BinaryOperator *BO = dyn_cast(V); + if (BO && BO->getOpcode() == Instruction::And) { + if (emitBitfieldInsert(BO, Amount, Op)) + return; + } + } + } + + unsigned SrcReg = getReg (Op, MBB, IP); if (isLeftShift) { BuildMI(*MBB, IP, PPC::RLWINM, 4, DestReg).addReg(SrcReg) .addImm(Amount).addImm(0).addImm(31-Amount); @@ -2698,6 +2803,7 @@ } } } else { // The shift amount is non-constant. + unsigned SrcReg = getReg (Op, MBB, IP); unsigned ShiftAmountReg = getReg (ShiftAmount, MBB, IP); if (isLeftShift) { From lattner at cs.uiuc.edu Sun Oct 17 00:38:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 00:38:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9.burg.in Message-ID: <200410170538.AAA01646@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9.burg.in updated: 1.13 -> 1.14 --- Log message: All of these labels are off by one now that the unreachable instruction exists --- Diffs of the changes: (+21 -21) Index: llvm/lib/Target/SparcV9/SparcV9.burg.in diff -u llvm/lib/Target/SparcV9/SparcV9.burg.in:1.13 llvm/lib/Target/SparcV9/SparcV9.burg.in:1.14 --- llvm/lib/Target/SparcV9/SparcV9.burg.in:1.13 Wed Aug 4 02:29:16 2004 +++ llvm/lib/Target/SparcV9/SparcV9.burg.in Sun Oct 17 00:37:47 2004 @@ -51,16 +51,16 @@ * The last one is the bitwise Not(val) == XOR val, 11..1. * Note that it is also a binary operator, not unary. */ -%term BAnd=111 -%term BOr=112 -%term BXor=113 -%term BNot=213 +%term BAnd=112 +%term BOr=113 +%term BXor=114 +%term BNot=214 /* The next one is the boolean Not(val) == bool XOR val, true * Note that it is also a binary operator, not unary. */ -%term Not=313 +%term Not=314 -%term SetCC=114 /* use this to match all SetCC instructions */ +%term SetCC=115 /* use this to match all SetCC instructions */ /* %term SetEQ=13 */ /* %term SetNE=14 */ /* %term SetLE=15 */ @@ -70,28 +70,28 @@ %term Malloc=MallocOPCODE %term Free=FreeOPCODE %term Alloca=AllocaOPCODE -%term AllocaN=122 /* alloca with arg N */ +%term AllocaN=123 /* alloca with arg N */ %term Load=LoadOPCODE %term Store=StoreOPCODE %term GetElemPtr=GetElementPtrOPCODE -%term GetElemPtrIdx=125 /* getElemPtr with index vector */ +%term GetElemPtrIdx=126 /* getElemPtr with index vector */ %term Phi=PHIOPCODE %term Cast=CastOPCODE /* cast that will be ignored. others are made explicit */ -%term ToBoolTy=127 -%term ToUByteTy=128 -%term ToSByteTy=129 -%term ToUShortTy=130 -%term ToShortTy=131 -%term ToUIntTy=132 -%term ToIntTy=133 -%term ToULongTy=134 -%term ToLongTy=135 -%term ToFloatTy=136 -%term ToDoubleTy=137 -%term ToArrayTy=138 -%term ToPointerTy=139 +%term ToBoolTy=128 +%term ToUByteTy=129 +%term ToSByteTy=130 +%term ToUShortTy=131 +%term ToShortTy=132 +%term ToUIntTy=133 +%term ToIntTy=134 +%term ToULongTy=135 +%term ToLongTy=136 +%term ToFloatTy=137 +%term ToDoubleTy=138 +%term ToArrayTy=139 +%term ToPointerTy=140 %term Call=CallOPCODE %term Shl=ShlOPCODE From lattner at cs.uiuc.edu Sun Oct 17 01:10:54 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 01:10:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelSimple.cpp Message-ID: <200410170610.BAA30367@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelSimple.cpp updated: 1.288 -> 1.289 --- Log message: fold: %X = and Y, constantint %Z = setcc %X, 0 instead of emitting: and %EAX, 3 test %EAX, %EAX je .LBBfoo2_2 # UnifiedReturnBlock We now emit: test %EAX, 3 je .LBBfoo2_2 # UnifiedReturnBlock This triggers 581 times on 176.gcc for example. --- Diffs of the changes: (+46 -3) Index: llvm/lib/Target/X86/X86ISelSimple.cpp diff -u llvm/lib/Target/X86/X86ISelSimple.cpp:1.288 llvm/lib/Target/X86/X86ISelSimple.cpp:1.289 --- llvm/lib/Target/X86/X86ISelSimple.cpp:1.288 Sat Oct 16 13:13:05 2004 +++ llvm/lib/Target/X86/X86ISelSimple.cpp Sun Oct 17 01:10:40 2004 @@ -925,10 +925,10 @@ // The arguments are already supposed to be of the same type. const Type *CompTy = Op0->getType(); unsigned Class = getClassB(CompTy); - unsigned Op0r = getReg(Op0, MBB, IP); // Special case handling of: cmp R, i if (isa(Op1)) { + unsigned Op0r = getReg(Op0, MBB, IP); if (OpNum < 2) // seteq/setne -> test BuildMI(*MBB, IP, X86::TEST32rr, 2).addReg(Op0r).addReg(Op0r); else @@ -946,6 +946,29 @@ // can't handle unsigned comparisons against zero unless they are == or // !=. These should have been strength reduced already anyway. if (Op1v == 0 && (CompTy->isSigned() || OpNum < 2)) { + + // If this is a comparison against zero and the LHS is an and of a + // register with a constant, use the test to do the and. + if (Instruction *Op0I = dyn_cast(Op0)) + if (Op0I->getOpcode() == Instruction::And && Op0->hasOneUse() && + isa(Op0I->getOperand(1))) { + static const unsigned TESTTab[] = { + X86::TEST8ri, X86::TEST16ri, X86::TEST32ri + }; + + // Emit test X, i + unsigned LHS = getReg(Op0I->getOperand(0), MBB, IP); + unsigned Imm = + cast(Op0I->getOperand(1))->getRawValue(); + BuildMI(*MBB, IP, TESTTab[Class], 2).addReg(LHS).addImm(Imm); + + std::cerr << "FOLDED SETCC and AND!\n"; + if (OpNum == 2) return 6; // Map jl -> js + if (OpNum == 3) return 7; // Map jg -> jns + return OpNum; + } + + unsigned Op0r = getReg(Op0, MBB, IP); static const unsigned TESTTab[] = { X86::TEST8rr, X86::TEST16rr, X86::TEST32rr }; @@ -960,9 +983,11 @@ X86::CMP8ri, X86::CMP16ri, X86::CMP32ri }; + unsigned Op0r = getReg(Op0, MBB, IP); BuildMI(*MBB, IP, CMPTab[Class], 2).addReg(Op0r).addImm(Op1v); return OpNum; } else { + unsigned Op0r = getReg(Op0, MBB, IP); assert(Class == cLong && "Unknown integer class!"); unsigned LowCst = CI->getRawValue(); unsigned HiCst = CI->getRawValue() >> 32; @@ -1009,6 +1034,8 @@ } } + unsigned Op0r = getReg(Op0, MBB, IP); + // Special case handling of comparison against +/- 0.0 if (ConstantFP *CFP = dyn_cast(Op1)) if (CFP->isExactlyValue(+0.0) || CFP->isExactlyValue(-0.0)) { @@ -1975,6 +2002,23 @@ Value *Op0 = B.getOperand(0), *Op1 = B.getOperand(1); unsigned Class = getClassB(B.getType()); + // If this is AND X, C, and it is only used by a setcc instruction, it will + // be folded. There is no need to emit this instruction. + if (B.hasOneUse() && OperatorClass == 2 && isa(Op1)) + if (Class == cByte || Class == cShort || Class == cInt) { + Instruction *Use = cast(B.use_back()); + if (isa(Use) && + Use->getOperand(1) == Constant::getNullValue(B.getType())) { + switch (getSetCCNumber(Use->getOpcode())) { + case 0: + case 1: + return; + default: + if (B.getType()->isSigned()) return; + } + } + } + // Special case: op Reg, load [mem] if (isa(Op0) && !isa(Op1) && Class != cLong && Op0->hasOneUse() && @@ -2860,7 +2904,7 @@ unsigned SrcReg = getReg (Op, MBB, IP); bool isSigned = ResultTy->isSigned (); unsigned Class = getClass (ResultTy); - + static const unsigned ConstantOperand[][4] = { { X86::SHR8ri, X86::SHR16ri, X86::SHR32ri, X86::SHRD32rri8 }, // SHR { X86::SAR8ri, X86::SAR16ri, X86::SAR32ri, X86::SHRD32rri8 }, // SAR @@ -2915,7 +2959,6 @@ } } else { unsigned TmpReg = makeAnotherReg(Type::IntTy); - if (!isLeftShift && isSigned) { // If this is a SHR of a Long, then we need to do funny sign extension // stuff. TmpReg gets the value to use as the high-part if we are From lattner at cs.uiuc.edu Sun Oct 17 02:16:46 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 02:16:46 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.cpp Message-ID: <200410170716.CAA22636@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86AsmPrinter.cpp updated: 1.125 -> 1.126 --- Log message: Give the asmprinter the ability to print memrefs with a constant pool index, index reg and scale --- Diffs of the changes: (+41 -26) Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.125 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.126 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.125 Thu Oct 14 23:44:53 2004 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Sun Oct 17 02:16:32 2004 @@ -312,26 +312,34 @@ void X86IntelAsmPrinter::printMemReference(const MachineInstr *MI, unsigned Op){ assert(isMem(MI, Op) && "Invalid memory reference!"); - if (MI->getOperand(Op).isFrameIndex()) { - O << "[frame slot #" << MI->getOperand(Op).getFrameIndex(); - if (MI->getOperand(Op+3).getImmedValue()) - O << " + " << MI->getOperand(Op+3).getImmedValue(); + const MachineOperand &BaseReg = MI->getOperand(Op); + int ScaleVal = MI->getOperand(Op+1).getImmedValue(); + const MachineOperand &IndexReg = MI->getOperand(Op+2); + const MachineOperand &DispSpec = MI->getOperand(Op+3); + + if (BaseReg.isFrameIndex()) { + O << "[frame slot #" << BaseReg.getFrameIndex(); + if (DispSpec.getImmedValue()) + O << " + " << DispSpec.getImmedValue(); O << "]"; return; - } else if (MI->getOperand(Op).isConstantPoolIndex()) { + } else if (BaseReg.isConstantPoolIndex()) { O << "[.CPI" << CurrentFnName << "_" - << MI->getOperand(Op).getConstantPoolIndex(); - if (MI->getOperand(Op+3).getImmedValue()) - O << " + " << MI->getOperand(Op+3).getImmedValue(); + << BaseReg.getConstantPoolIndex(); + + if (IndexReg.getReg()) { + O << " + "; + if (ScaleVal != 1) + O << ScaleVal << "*"; + printOp(IndexReg); + } + + if (DispSpec.getImmedValue()) + O << " + " << DispSpec.getImmedValue(); O << "]"; return; } - const MachineOperand &BaseReg = MI->getOperand(Op); - int ScaleVal = MI->getOperand(Op+1).getImmedValue(); - const MachineOperand &IndexReg = MI->getOperand(Op+2); - const MachineOperand &DispSpec = MI->getOperand(Op+3); - O << "["; bool NeedPlus = false; if (BaseReg.getReg()) { @@ -520,25 +528,32 @@ void X86ATTAsmPrinter::printMemReference(const MachineInstr *MI, unsigned Op){ assert(isMem(MI, Op) && "Invalid memory reference!"); - if (MI->getOperand(Op).isFrameIndex()) { - O << "[frame slot #" << MI->getOperand(Op).getFrameIndex(); - if (MI->getOperand(Op+3).getImmedValue()) - O << " + " << MI->getOperand(Op+3).getImmedValue(); + const MachineOperand &BaseReg = MI->getOperand(Op); + int ScaleVal = MI->getOperand(Op+1).getImmedValue(); + const MachineOperand &IndexReg = MI->getOperand(Op+2); + const MachineOperand &DispSpec = MI->getOperand(Op+3); + + if (BaseReg.isFrameIndex()) { + O << "[frame slot #" << BaseReg.getFrameIndex(); + if (DispSpec.getImmedValue()) + O << " + " << DispSpec.getImmedValue(); O << "]"; return; - } else if (MI->getOperand(Op).isConstantPoolIndex()) { + } else if (BaseReg.isConstantPoolIndex()) { O << ".CPI" << CurrentFnName << "_" - << MI->getOperand(Op).getConstantPoolIndex(); - if (MI->getOperand(Op+3).getImmedValue()) - O << " + " << MI->getOperand(Op+3).getImmedValue(); + << BaseReg.getConstantPoolIndex(); + if (DispSpec.getImmedValue()) + O << "+" << DispSpec.getImmedValue(); + if (IndexReg.getReg()) { + O << "(,"; + printOp(IndexReg); + if (ScaleVal != 1) + O << "," << ScaleVal; + O << ")"; + } return; } - const MachineOperand &BaseReg = MI->getOperand(Op); - int ScaleVal = MI->getOperand(Op+1).getImmedValue(); - const MachineOperand &IndexReg = MI->getOperand(Op+2); - const MachineOperand &DispSpec = MI->getOperand(Op+3); - if (DispSpec.isGlobalAddress()) { printOp(DispSpec, true); } else { From lattner at cs.uiuc.edu Sun Oct 17 02:49:58 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 02:49:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp Message-ID: <200410170749.CAA28738@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.66 -> 1.67 --- Log message: Unify handling of constant pool indexes with the other code paths, allowing us to use index registers for CPI's --- Diffs of the changes: (+17 -17) Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.66 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.67 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.66 Thu Oct 14 23:53:13 2004 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Sun Oct 17 02:49:45 2004 @@ -385,24 +385,24 @@ DispVal = Op3.getImmedValue(); } - if (MI.getOperand(Op).isConstantPoolIndex()) { + const MachineOperand &Base = MI.getOperand(Op); + const MachineOperand &Scale = MI.getOperand(Op+1); + const MachineOperand &IndexReg = MI.getOperand(Op+2); + + unsigned BaseReg = 0; + + if (Base.isConstantPoolIndex()) { // Emit a direct address reference [disp32] where the displacement of the // constant pool entry is controlled by the MCE. assert(!GV && "Constant Pool reference cannot be relative to global!"); - MCE.emitByte(ModRMByte(0, RegOpcodeField, 5)); - unsigned Index = MI.getOperand(Op).getConstantPoolIndex(); - unsigned Address = MCE.getConstantPoolEntryAddress(Index); - MCE.emitWord(Address+DispVal); - return; + DispVal += MCE.getConstantPoolEntryAddress(Base.getConstantPoolIndex()); + } else { + BaseReg = Base.getReg(); } - const MachineOperand &BaseReg = MI.getOperand(Op); - const MachineOperand &Scale = MI.getOperand(Op+1); - const MachineOperand &IndexReg = MI.getOperand(Op+2); - // Is a SIB byte needed? - if (IndexReg.getReg() == 0 && BaseReg.getReg() != X86::ESP) { - if (BaseReg.getReg() == 0) { // Just a displacement? + if (IndexReg.getReg() == 0 && BaseReg != X86::ESP) { + if (BaseReg == 0) { // Just a displacement? // Emit special case [disp32] encoding MCE.emitByte(ModRMByte(0, RegOpcodeField, 5)); if (GV) @@ -410,7 +410,7 @@ else emitConstant(DispVal, 4); } else { - unsigned BaseRegNo = getX86RegNum(BaseReg.getReg()); + unsigned BaseRegNo = getX86RegNum(BaseReg); if (GV) { // Emit the most general non-SIB encoding: [REG+disp32] MCE.emitByte(ModRMByte(2, RegOpcodeField, BaseRegNo)); @@ -434,7 +434,7 @@ bool ForceDisp32 = false; bool ForceDisp8 = false; - if (BaseReg.getReg() == 0) { + if (BaseReg == 0) { // If there is no base register, we emit the special case SIB byte with // MOD=0, BASE=5, to JUST get the index, scale, and displacement. MCE.emitByte(ModRMByte(0, RegOpcodeField, 4)); @@ -443,7 +443,7 @@ // Emit the normal disp32 encoding... MCE.emitByte(ModRMByte(2, RegOpcodeField, 4)); ForceDisp32 = true; - } else if (DispVal == 0 && BaseReg.getReg() != X86::EBP) { + } else if (DispVal == 0 && BaseReg != X86::EBP) { // Emit no displacement ModR/M byte MCE.emitByte(ModRMByte(0, RegOpcodeField, 4)); } else if (isDisp8(DispVal)) { @@ -459,13 +459,13 @@ static const unsigned SSTable[] = { ~0, 0, 1, ~0, 2, ~0, ~0, ~0, 3 }; unsigned SS = SSTable[Scale.getImmedValue()]; - if (BaseReg.getReg() == 0) { + if (BaseReg == 0) { // Handle the SIB byte for the case where there is no base. The // displacement has already been output. assert(IndexReg.getReg() && "Index register must be specified!"); emitSIBByte(SS, getX86RegNum(IndexReg.getReg()), 5); } else { - unsigned BaseRegNo = getX86RegNum(BaseReg.getReg()); + unsigned BaseRegNo = getX86RegNum(BaseReg); unsigned IndexRegNo; if (IndexReg.getReg()) IndexRegNo = getX86RegNum(IndexReg.getReg()); From lattner at cs.uiuc.edu Sun Oct 17 03:01:42 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 03:01:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelSimple.cpp Message-ID: <200410170801.DAA29289@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelSimple.cpp updated: 1.289 -> 1.290 --- Log message: Rewrite support for cast uint -> FP. In particular, we used to compile this: double %test(uint %X) { %tmp.1 = cast uint %X to double ; [#uses=1] ret double %tmp.1 } into: test: sub %ESP, 8 mov %EAX, DWORD PTR [%ESP + 12] mov %ECX, 0 mov DWORD PTR [%ESP], %EAX mov DWORD PTR [%ESP + 4], %ECX fild QWORD PTR [%ESP] add %ESP, 8 ret ... which basically zero extends to 8 bytes, then does an fild for an 8-byte signed int. Now we generate this: test: sub %ESP, 4 mov %EAX, DWORD PTR [%ESP + 8] mov DWORD PTR [%ESP], %EAX fild DWORD PTR [%ESP] shr %EAX, 31 fadd DWORD PTR [.CPItest_0 + 4*%EAX] add %ESP, 4 ret .section .rodata .align 4 .CPItest_0: .quad 5728578726015270912 This does a 32-bit signed integer load, then adds in an offset if the sign bit of the integer was set. It turns out that this is substantially faster than the preceeding sequence. Consider this testcase: unsigned a[2]={1,2}; volatile double G; void main() { int i; for (i=0; i<100000000; ++i ) G += a[i&1]; } On zion (a P4 Xeon, 3Ghz), this patch speeds up the testcase from 2.140s to 0.94s. On apoc, an athlon MP 2100+, this patch speeds up the testcase from 1.72s to 1.34s. Note that the program takes 2.5s/1.97s on zion/apoc with GCC 3.3 -O3 -fomit-frame-pointer. --- Diffs of the changes: (+23 -14) Index: llvm/lib/Target/X86/X86ISelSimple.cpp diff -u llvm/lib/Target/X86/X86ISelSimple.cpp:1.289 llvm/lib/Target/X86/X86ISelSimple.cpp:1.290 --- llvm/lib/Target/X86/X86ISelSimple.cpp:1.289 Sun Oct 17 01:10:40 2004 +++ llvm/lib/Target/X86/X86ISelSimple.cpp Sun Oct 17 03:01:28 2004 @@ -3404,17 +3404,8 @@ PromoteType = Type::IntTy; PromoteOpcode = X86::MOVZX32rr16; break; - case Type::UIntTyID: { - // Make a 64 bit temporary... and zero out the top of it... - unsigned TmpReg = makeAnotherReg(Type::LongTy); - BuildMI(*BB, IP, X86::MOV32rr, 1, TmpReg).addReg(SrcReg); - BuildMI(*BB, IP, X86::MOV32ri, 1, TmpReg+1).addImm(0); - SrcTy = Type::LongTy; - SrcClass = cLong; - SrcReg = TmpReg; - break; - } case Type::ULongTyID: + case Type::UIntTyID: // Don't fild into the read destination. DestReg = makeAnotherReg(Type::DoubleTy); break; @@ -3449,10 +3440,28 @@ { 0/*byte*/, X86::FILD16m, X86::FILD32m, 0/*FP*/, X86::FILD64m }; addFrameReference(BuildMI(*BB, IP, Op2[SrcClass], 5, DestReg), FrameIdx); - // We need special handling for unsigned 64-bit integer sources. If the - // input number has the "sign bit" set, then we loaded it incorrectly as a - // negative 64-bit number. In this case, add an offset value. - if (SrcTy == Type::ULongTy) { + if (SrcTy == Type::UIntTy) { + // If this is a cast from uint -> double, we need to be careful about if + // the "sign" bit is set. If so, we don't want to make a negative number, + // we want to make a positive number. Emit code to add an offset if the + // sign bit is set. + + // Compute whether the sign bit is set by shifting the reg right 31 bits. + unsigned IsNeg = makeAnotherReg(Type::IntTy); + BuildMI(BB, X86::SHR32ri, 2, IsNeg).addReg(SrcReg).addImm(31); + + // Create a CP value that has the offset in one word and 0 in the other. + static ConstantInt *TheOffset = ConstantUInt::get(Type::ULongTy, + 0x4f80000000000000ULL); + unsigned CPI = F->getConstantPool()->getConstantPoolIndex(TheOffset); + BuildMI(BB, X86::FADD32m, 5, RealDestReg).addReg(DestReg) + .addConstantPoolIndex(CPI).addZImm(4).addReg(IsNeg).addSImm(0); + + } else if (SrcTy == Type::ULongTy) { + // We need special handling for unsigned 64-bit integer sources. If the + // input number has the "sign bit" set, then we loaded it incorrectly as a + // negative 64-bit number. In this case, add an offset value. + // Emit a test instruction to see if the dynamic input value was signed. BuildMI(*BB, IP, X86::TEST32rr, 2).addReg(SrcReg+1).addReg(SrcReg+1); From reid at x10sys.com Sun Oct 17 09:57:02 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 17 Oct 2004 09:57:02 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.am Message-ID: <200410171457.JAA30341@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.am updated: 1.1 -> 1.2 --- Log message: Add runtime directory, include Makefile_rules --- Diffs of the changes: (+2 -2) Index: llvm/Makefile.am diff -u llvm/Makefile.am:1.1 llvm/Makefile.am:1.2 --- llvm/Makefile.am:1.1 Sun Oct 10 14:13:03 2004 +++ llvm/Makefile.am Sun Oct 17 09:56:15 2004 @@ -7,9 +7,9 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -SUBDIRS = lib/System lib/Support utils lib tools +SUBDIRS = lib/System lib/Support utils lib tools runtime EXTRA_DIST = CREDITS.txt LICENSE.txt llvm.spec README.txt include docs autoconf From reid at x10sys.com Sun Oct 17 09:57:49 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 17 Oct 2004 09:57:49 -0500 Subject: [llvm-commits] CVS: llvm/Makefile_rules Message-ID: <200410171457.JAA30361@zion.cs.uiuc.edu> Changes in directory llvm: Makefile_rules updated: 1.1 -> 1.2 --- Log message: Support bytecode generation, GenCodeEmitter, etc. --- Diffs of the changes: (+92 -28) Index: llvm/Makefile_rules diff -u llvm/Makefile_rules:1.1 llvm/Makefile_rules:1.2 --- llvm/Makefile_rules:1.1 Wed Oct 13 06:39:51 2004 +++ llvm/Makefile_rules Sun Oct 17 09:57:12 2004 @@ -10,15 +10,21 @@ # # LLVM Specific C/C++ compiler flags # +# Locations of built programs/libraries +LDIR := $(top_builddir)/$(BUILDMODE)/lib +BDIR := $(top_builddir)/$(BUILDMODE)/bin +DDIR := $(top_builddir)/$(BUILDMODE)/data +EDIR := $(top_builddir)/$(BUILDMODE)/etc +BCDIR := $(top_builddir)/$(BUILDMODE)/bclib + +CXXFLAGS := +CFLAGS := + LLVM_COMMONFLAGS := -Wall -W -Wwrite-strings -Wno-unused -Wcast-align -LLVM_CXXFLAGS := -LLVM_CFLAGS := -LLVM_CPPFLAGS := \ - -I. \ - -I$(srcdir) \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ - -D_RENTRANT -D_GNU_SOURCE -D__STDC_LIMIT_MACROS +LLVM_CXXFLAGS := $(LLVM_COMMONFLAGS) +LLVM_CFLAGS := $(LLVM_COMMONFLAGS) +LLVM_CPPFLAGS := -I. -I$(srcdir) -I$(top_srcdir)/include \ + -I$(top_builddir)/include -D_RENTRANT -D_GNU_SOURCE -D__STDC_LIMIT_MACROS ifeq ($(BUILDMODE),Profile) LLVM_CPPFLAGS += -DNDEBUG @@ -36,10 +42,12 @@ endif endif -LDIR = $(top_builddir)/$(BUILDMODE)/lib -BDIR = $(top_builddir)/$(BUILDMODE)/bin -DDIR = $(top_builddir)/$(BUILDMODE)/data -EDIR = $(top_builddir)/$(BUILDMODE)/etc +# Set up the standard automake variables +# +AM_CPPFLAGS = $(LLVM_CPPFLAGS) +AM_CXXFLAGS = $(LLVM_COMMONFLAGS) $(LLVM_CXXFLAGS) +AM_CFLAGS = $(LLVM_COMMONFLAGS) $(LLVM_CFLAGS) +AM_LDFLAGS = -L$(LDIR) # Required tool definitions as macros so they can be overridden LINKLIB := ${LIBTOOL} --tag=CXX --mode=link $(CXX) -o @@ -47,20 +55,17 @@ BURG := $(top_builddir)/utils/Burg/burg$(EXEEXT) RunBurg := $(BURG) -I TBLGEN := $(top_builddir)/utils/TableGen/TableGen$(EXEEXT) -LGCCLDPROG := $(top_builddir)/tools/gccld/gccld$(EXEEXT) -# Set up the standard automake variables -# -AM_CPPFLAGS = $(LLVM_CPPFLAGS) -AM_CXXFLAGS = $(LLVM_COMMONFLAGS) $(LLVM_CXXFLAGS) -AM_CFLAGS = $(LLVM_COMMONFLAGS) $(LLVM_CFLAGS) -AM_LDFLAGS = -L$(LDIR) +LLVMGCC := PATH=$(BDIR):$(PATH) $(LLVMGCCDIR)/bin/gcc +LLVMGXX := PATH=$(BDIR):$(PATH) $(LLVMGCCDIR)/bin/g++ +LLVMAS := $(BDIR)/llvm-as$(EXEEXT) +LLVMGCCLD := $(BDIR)/gccld$(EXEEXT) # LLVM GNU Make Function macros -GETOBJ = $(patsubst %,$(LDIR)/LLVM%.o,$(1)) -GETLIB = $(patsubst %,-lLLVM%,$(1)) -GETOBJS = $(foreach I,$(1) $(2) $(3) $(4) $(5) $(6) $(7) $(8) $(9) $(10),$(call GETOBJ,$(I))) -GETLIBS = $(foreach I,$(1) $(2) $(3) $(4) $(5) $(6) $(7) $(8) $(9) $(10),$(call GETLIB,$(I))) +GETOBJ = $(patsubst %,$(LDIR)/LLVM%.o,$(1)) +GETLIB = $(patsubst %,-lLLVM%,$(1)) +GETOBJS = $(foreach I,$(1) $(2) $(3) $(4) $(5) $(6) $(7) $(8) $(9) $(10),$(call GETOBJ,$(I))) +GETLIBS = $(foreach I,$(1) $(2) $(3) $(4) $(5) $(6) $(7) $(8) $(9) $(10),$(call GETLIB,$(I))) # LLVM Rules @@ -68,8 +73,11 @@ lib_LINKS_TO_MAKE = $(foreach L,$(lib_LIBRARIES),$(patsubst lib%.a,$(LDIR)/lib%.a,$(L))) all-am : $(lib_LINKS_TO_MAKE) -$(LDIR)/lib%.a : lib%.a - cwd=`pwd` ; cd $(LDIR) ; $(LN) -s $${cwd}/$* . +$(LDIR)/lib%.a : $(LDIR) lib%.a + cwd=`pwd` ; cd $(LDIR) ; $(RM) -f lib$*.a ; $(LN) -s $${cwd}/lib$*.a . + +$(LDIR): + $(MKDIR) $(LDIR) endif ifdef bin_PROGRAMS @@ -77,8 +85,12 @@ all-am : $(bin_LINKS_TO_MAKE) -$(BDIR)/% : % - cwd=`pwd` ; cd $(BDIR) ; $(LN) -s $${cwd}/$* . +$(BDIR)/% : $(BDIR) % + cwd=`pwd` ; cd $(BDIR) ; $(RM) -f $* ; $(LN) -s $${cwd}/$* . + +$(BDIR): + $(MKDIR) $(BDIR) + endif ifdef PRELINK @@ -91,11 +103,48 @@ $(PRELINK_LIB_NAME) : $(PRELINK_OBJECTS) $(LIBTOOL) --mode=link $(CXX) -o $(PRELINK_LIB_NAME) $(PRELINK_OBJECTS) - clean-am: clean-relink clean-relink: $(RM) -f $(PRELINK_LIB_NAME) + +install-am: install-prelink + +install-prelink: + @${ECHO} ======= Installing $(PRELINK) library ======= + $(INSTALL_DATA) '$(PRELINK_LIB_NAME)' $(DESTDIR)$(libdir) + +endif + +ifdef BYTECODE_LIBRARY + BCL_LIB_NAME = $(BCDIR)/$(patsubst lib%.a,%.bc,$(BYTECODE_LIBRARY)) + BCL_VAR_NAME = $(patsubst lib%.a,lib%_a,$(BYTECODE_LIBRARY))_OBJECTS + BCL_OBJECTS = $(patsubst %.o,%.bc,$($(BCL_VAR_NAME))) + + LinkBCLib := $(LLVMGCC) -shared -nostdlib + ifdef EXPORTED_SYMBOL_LIST + LinkBCLib += -Xlinker -internalize-public-api-list=$(EXPORTED_SYMBOL_LIST) + else + LinkBCLib += -Xlinker -disable-internalize + endif + +all-am: $(BCDIR) $(BCL_LIB_NAME) + +$(BCL_LIB_NAME) : $(BCL_OBJECTS) + $(LinkBCLib) -o $@ $(BCL_OBJECTS) $(LibSubDirs) $(LibLinkOpts) + +$(BCDIR): + $(MKDIR) $(BCDIR) + +clean-am: clean-bcl + +clean-bcl: + $(RM) -f $(BCL_LIB_NAME) *.bc + +install-am: install-bcl +intall-bcl: + $(INSTALL_DATA) '$(BCL_LIB_NAME)' $(DESTDIR)$(libdir) + endif %.cpp: %.l @@ -123,6 +172,17 @@ @# If the files were not updated, don't leave them lying around... @$(RM) -f $*.tab.c $*.tab.h +%.bc : %.cpp + @${ECHO} "Compiling $*.cpp to bytecode" + $(VERB) $(LLVMGXX) $(AM_CPPFLAGS) $(AM_CXXFLAGS) -c $< -o $@ + +%.bc : %.c + @${ECHO} "Compiling $*.c to bytecode" + $(VERB) $(LLVMGCC) $(AM_CPPFLAGS) $(AM_CFLAGS) -c $< -o $@ + +%.bc : %.ll + @${ECHO} "Compiling $*.ll to bytecode" + $(VERB) $(LLVMAS) $< -f -o $@ %GenRegisterNames.inc : %.td @echo "Building $< register names with tblgen" @@ -160,4 +220,8 @@ @echo "Building $< instruction selector with tblgen" $(VERB) $(TBLGEN) -I $(srcdir) $< -gen-instr-selector -o $@ +%GenCodeEmitter.inc:: %.td $(TDFILES) $(TBLGEN) + @echo "Building $< code emitter with tblgen" + $(VERB) $(TBLGEN) -I $(srcdir) $< -gen-emitter -o $@ + TDFILES = $(wildcard $(srcdir)/*.td ) $(srcdir)/../Target.td From reid at x10sys.com Sun Oct 17 09:58:38 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 17 Oct 2004 09:58:38 -0500 Subject: [llvm-commits] CVS: llvm/configure_am Message-ID: <200410171458.JAA30382@zion.cs.uiuc.edu> Changes in directory llvm: configure_am updated: 1.2 -> 1.3 --- Log message: Add runtime directories --- Diffs of the changes: (+316 -33) Index: llvm/configure_am diff -u llvm/configure_am:1.2 llvm/configure_am:1.3 --- llvm/configure_am:1.2 Wed Oct 13 06:56:07 2004 +++ llvm/configure_am Sun Oct 17 09:58:01 2004 @@ -4110,7 +4110,222 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then - for ac_prog in gcc + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; 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_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +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_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; 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_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +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_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; 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_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +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_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; 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_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +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_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; 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_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +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 + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 @@ -4152,7 +4367,7 @@ fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in gcc + for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4195,6 +4410,8 @@ CC=$ac_ct_CC fi +fi + test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 @@ -5862,7 +6079,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5865 "configure"' > conftest.$ac_ext + echo '#line 6082 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6736,7 +6953,7 @@ # Provide some information about the compiler. -echo "$as_me:6739:" \ +echo "$as_me:6956:" \ "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 @@ -7793,11 +8010,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7796: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8013: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7800: \$? = $ac_status" >&5 + echo "$as_me:8017: \$? = $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 @@ -8036,11 +8253,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8039: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8256: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8043: \$? = $ac_status" >&5 + echo "$as_me:8260: \$? = $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 @@ -8096,11 +8313,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8099: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8316: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8103: \$? = $ac_status" >&5 + echo "$as_me:8320: \$? = $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 @@ -10281,7 +10498,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:12792: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12579: \$? = $ac_status" >&5 + echo "$as_me:12796: \$? = $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 @@ -12632,11 +12849,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12635: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12852: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12639: \$? = $ac_status" >&5 + echo "$as_me:12856: \$? = $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 @@ -13993,7 +14210,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:15148: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14935: \$? = $ac_status" >&5 + echo "$as_me:15152: \$? = $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 @@ -14988,11 +15205,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14991: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15208: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14995: \$? = $ac_status" >&5 + echo "$as_me:15212: \$? = $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 @@ -17027,11 +17244,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17030: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17247: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17034: \$? = $ac_status" >&5 + echo "$as_me:17251: \$? = $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 @@ -17270,11 +17487,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17273: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17490: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17277: \$? = $ac_status" >&5 + echo "$as_me:17494: \$? = $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 @@ -17330,11 +17547,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17333: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17550: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17337: \$? = $ac_status" >&5 + echo "$as_me:17554: \$? = $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 @@ -19515,7 +19732,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < Changes in directory llvm/autoconf: configure.am updated: 1.4 -> 1.5 --- Log message: Add runtime directories --- Diffs of the changes: (+23 -1) Index: llvm/autoconf/configure.am diff -u llvm/autoconf/configure.am:1.4 llvm/autoconf/configure.am:1.5 --- llvm/autoconf/configure.am:1.4 Wed Oct 13 06:53:12 2004 +++ llvm/autoconf/configure.am Sun Oct 17 09:58:49 2004 @@ -508,7 +508,6 @@ AC_CONFIG_FILES([lib/Bytecode/Writer/Makefile]) AC_CONFIG_FILES([lib/Bytecode/Archive/Makefile]) AC_CONFIG_FILES([lib/CodeGen/Makefile]) -AC_CONFIG_FILES([lib/CodeGen/ModuloScheduling/Makefile]) AC_CONFIG_FILES([lib/CodeGen/SelectionDAG/Makefile]) AC_CONFIG_FILES([lib/Debugger/Makefile]) AC_CONFIG_FILES([lib/ExecutionEngine/Interpreter/Makefile]) @@ -522,6 +521,7 @@ AC_CONFIG_FILES([lib/Target/SparcV9/Makefile]) AC_CONFIG_FILES([lib/Target/SparcV9/InstrSched/Makefile]) AC_CONFIG_FILES([lib/Target/SparcV9/LiveVar/Makefile]) +AC_CONFIG_FILES([lib/Target/SparcV9/ModuloScheduling/Makefile]) AC_CONFIG_FILES([lib/Target/SparcV9/RegAlloc/Makefile]) AC_CONFIG_FILES([lib/Target/X86/Makefile]) AC_CONFIG_FILES([lib/Transforms/Hello/Makefile]) @@ -557,6 +557,28 @@ AC_CONFIG_FILES([tools/opt/Makefile]) AC_CONFIG_FILES([tools/llvm-ld/Makefile]) AC_CONFIG_FILES([tools/llvm-stub/Makefile]) +AC_CONFIG_FILES([runtime/Makefile]) +AC_CONFIG_FILES([runtime/GC/Makefile]) +AC_CONFIG_FILES([runtime/GC/SemiSpace/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/crtend/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/libc/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/libcurses/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/libg/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/libgcc/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/libgdbm/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/libm/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/libmalloc/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/libpthread/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/libtermcap/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/libucb/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/libutempter/Makefile]) +AC_CONFIG_FILES([runtime/GCCLibraries/libutil/Makefile]) +AC_CONFIG_FILES([runtime/libdummy/Makefile]) +AC_CONFIG_FILES([runtime/libpng/Makefile]) +AC_CONFIG_FILES([runtime/libprofile/Makefile]) +AC_CONFIG_FILES([runtime/libtrace/Makefile]) +AC_CONFIG_FILES([runtime/zlib/Makefile]) dnl Make a link from lib/System/platform to lib/System/$llvm_platform_type dnl This helps the #inclusion of the system specific include files From reid at x10sys.com Sun Oct 17 10:00:16 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 17 Oct 2004 10:00:16 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/Makefile.am Message-ID: <200410171500.KAA30456@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: Makefile.am updated: 1.2 -> 1.3 --- Log message: PPC32GenCodeEmitter instead of PowerPCGenCodeEmitter --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/PowerPC/Makefile.am diff -u llvm/lib/Target/PowerPC/Makefile.am:1.2 llvm/lib/Target/PowerPC/Makefile.am:1.3 --- llvm/lib/Target/PowerPC/Makefile.am:1.2 Wed Oct 13 06:46:51 2004 +++ llvm/lib/Target/PowerPC/Makefile.am Sun Oct 17 09:59:38 2004 @@ -14,8 +14,8 @@ BUILT_SOURCES = \ PowerPCGenInstrNames.inc \ PowerPCGenRegisterNames.inc \ - PowerPCGenCodeEmitter.inc \ PowerPCGenAsmWriter.inc \ + PPC32GenCodeEmitter.inc \ PPC32GenRegisterInfo.h.inc \ PPC32GenRegisterInfo.inc \ PPC32GenInstrInfo.inc \ From reid at x10sys.com Sun Oct 17 10:01:03 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 17 Oct 2004 10:01:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/LiveVar/Makefile.am Message-ID: <200410171501.KAA30484@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/LiveVar: Makefile.am updated: 1.2 -> 1.3 --- Log message: Consolidate the definitions --- Diffs of the changes: (+2 -3) Index: llvm/lib/Target/SparcV9/LiveVar/Makefile.am diff -u llvm/lib/Target/SparcV9/LiveVar/Makefile.am:1.2 llvm/lib/Target/SparcV9/LiveVar/Makefile.am:1.3 --- llvm/lib/Target/SparcV9/LiveVar/Makefile.am:1.2 Wed Oct 13 06:46:51 2004 +++ llvm/lib/Target/SparcV9/LiveVar/Makefile.am Sun Oct 17 10:00:26 2004 @@ -11,11 +11,10 @@ lib_LIBRARIES = libLLVMSparcV9LiveVar.a -MYSOURCES = \ +libLLVMSparcV9LiveVar_a_SOURCES = \ BBLiveVar.cpp \ FunctionLiveVarInfo.cpp \ ValueSet.cpp -libLLVMSparcV9LiveVar_a_SOURCES = $(MYSOURCES) -PRELINK=libLLVMSparcV9LiveVar.a +PRELINK = $(lib_LIBRARIES) From reid at x10sys.com Sun Oct 17 10:01:49 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 17 Oct 2004 10:01:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/ModuloScheduling/Makefile.am Message-ID: <200410171501.KAA30504@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9/ModuloScheduling: Makefile.am updated: 1.1 -> 1.2 --- Log message: Make the library name SparcV9 specific --- Diffs of the changes: (+4 -4) Index: llvm/lib/Target/SparcV9/ModuloScheduling/Makefile.am diff -u llvm/lib/Target/SparcV9/ModuloScheduling/Makefile.am:1.1 llvm/lib/Target/SparcV9/ModuloScheduling/Makefile.am:1.2 --- llvm/lib/Target/SparcV9/ModuloScheduling/Makefile.am:1.1 Sun Oct 10 15:42:38 2004 +++ llvm/lib/Target/SparcV9/ModuloScheduling/Makefile.am Sun Oct 17 10:01:12 2004 @@ -7,13 +7,13 @@ # #===------------------------------------------------------------------------===# -include $(top_srcdir)/Makefile.rules.am +include $(top_srcdir)/Makefile_config -libexec_PROGRAMS = LLVMModuloScheduling.o +lib_LIBRARIES = libLLVMSparcV9ModuloScheduling.a -LLVMModuloScheduling_o_SOURCES = \ +libLLVMSparcV9ModuloScheduling_a_SOURCES = \ ModuloScheduling.cpp \ MSchedGraph.cpp \ MSSchedule.cpp -LIBS= +PRELINK = $(lib_LIBRARIES) From reid at x10sys.com Sun Oct 17 10:02:37 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 17 Oct 2004 10:02:37 -0500 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/crtend/Makefile.am Message-ID: <200410171502.KAA30526@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/crtend: Makefile.am updated: 1.1 -> 1.2 --- Log message: Add missing targets for install/clean --- Diffs of the changes: (+4 -0) Index: llvm/runtime/GCCLibraries/crtend/Makefile.am diff -u llvm/runtime/GCCLibraries/crtend/Makefile.am:1.1 llvm/runtime/GCCLibraries/crtend/Makefile.am:1.2 --- llvm/runtime/GCCLibraries/crtend/Makefile.am:1.1 Sat Oct 16 19:24:15 2004 +++ llvm/runtime/GCCLibraries/crtend/Makefile.am Sun Oct 17 10:01:59 2004 @@ -37,9 +37,13 @@ all-am: $(AggregateLib) clean-am: clean-crtend + +clean-crtend: $(RM) -f $(AggregateLib) *.bc install-am: install-crtend + +install-crtend: $(INSTALL_DATA) '$(AggregateLib)' $(DESTDIR)$(libdir) MainObj := crtend.bc listend.bc From reid at x10sys.com Sun Oct 17 10:03:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 17 Oct 2004 10:03:24 -0500 Subject: [llvm-commits] CVS: llvm/runtime/zlib/Makefile.in Message-ID: <200410171503.KAA30545@zion.cs.uiuc.edu> Changes in directory llvm/runtime/zlib: Makefile.in updated: 1.1 -> 1.2 --- Log message: Update to reflect building zlib for LLVM --- Diffs of the changes: (+673 -151) Index: llvm/runtime/zlib/Makefile.in diff -u llvm/runtime/zlib/Makefile.in:1.1 llvm/runtime/zlib/Makefile.in:1.2 --- llvm/runtime/zlib/Makefile.in:1.1 Fri Feb 6 10:36:32 2004 +++ llvm/runtime/zlib/Makefile.in Sun Oct 17 10:02:47 2004 @@ -1,154 +1,676 @@ -# Makefile for zlib -# Copyright (C) 1995-2003 Jean-loup Gailly. -# For conditions of distribution and use, see copyright notice in zlib.h - -# To compile and test, type: -# ./configure; make test -# The call of configure is optional if you don't have special requirements -# If you wish to build zlib as a shared library, use: ./configure -s - -# To use the asm code, type: -# cp contrib/asm?86/match.S ./match.S -# make LOC=-DASMV OBJA=match.o - -# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type: -# make install -# To install in $HOME instead of /usr/local, use: -# make install prefix=$HOME - -CC=cc - -CFLAGS=-O -#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 -#CFLAGS=-g -DDEBUG -#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ -# -Wstrict-prototypes -Wmissing-prototypes - -LDFLAGS=libz.a -LDSHARED=$(CC) -CPP=$(CC) -E - -LIBS=libz.a -SHAREDLIB=libz.so -SHAREDLIBV=libz.so.1.2.1 -SHAREDLIBM=libz.so.1 - -AR=ar rc -RANLIB=ranlib -TAR=tar -SHELL=/bin/sh -EXE= - -prefix = /usr/local -exec_prefix = ${prefix} -libdir = ${exec_prefix}/lib -includedir = ${prefix}/include -mandir = ${prefix}/share/man -man3dir = ${mandir}/man3 - -OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ - zutil.o inflate.o infback.o inftrees.o inffast.o - -OBJA = -# to use the asm code: make OBJA=match.o - -TEST_OBJS = example.o minigzip.o - -all: example$(EXE) minigzip$(EXE) - -check: test -test: all - @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ - echo hello world | ./minigzip | ./minigzip -d || \ - echo ' *** minigzip test FAILED ***' ; \ - if ./example; then \ - echo ' *** zlib test OK ***'; \ - else \ - echo ' *** zlib test FAILED ***'; \ - fi +# Makefile.in generated by automake 1.9.2 from Makefile.am. +# @configure_input@ -libz.a: $(OBJS) $(OBJA) - $(AR) $@ $(OBJS) $(OBJA) - -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 - -match.o: match.S - $(CPP) match.S > _match.s - $(CC) -c _match.s - mv _match.o match.o - rm -f _match.s - -$(SHAREDLIBV): $(OBJS) - $(LDSHARED) -o $@ $(OBJS) - rm -f $(SHAREDLIB) $(SHAREDLIBM) - ln -s $@ $(SHAREDLIB) - ln -s $@ $(SHAREDLIBM) - -example$(EXE): example.o $(LIBS) - $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) - -minigzip$(EXE): minigzip.o $(LIBS) - $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) - -install: $(LIBS) - - at if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi - - at if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi - - at if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi - - at if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi - cp zlib.h zconf.h $(includedir) - chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h - cp $(LIBS) $(libdir) - cd $(libdir); chmod 755 $(LIBS) - -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 - cd $(libdir); if test -f $(SHAREDLIBV); then \ - rm -f $(SHAREDLIB) $(SHAREDLIBM); \ - ln -s $(SHAREDLIBV) $(SHAREDLIB); \ - ln -s $(SHAREDLIBV) $(SHAREDLIBM); \ - (ldconfig || true) >/dev/null 2>&1; \ +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + at SET_MAKE@ + +#===-- runtime/zlib/Makefile.am ----------------------------*- Makefile -*--===# +# +# The LLVM Compiler Infrastructure +# +# This file was developed by Reid Spencer and is distributed under the +# University of Illinois Open Source License. See LICENSE.TXT for details. +# +#===------------------------------------------------------------------------===# + +#,===-- Makefile.rules.am - Common make rules for LLVM ------*- Makefile -*--===# +# +# The LLVM Compiler Infrastructure +# +# This file was developed by Reid Spencer and is distributed under the +# University of Illinois Open Source License. See LICENSE.TXT for details. +# +#===------------------------------------------------------------------------===# + +SOURCES = $(libz_a_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/Makefile_config ChangeLog +subdir = runtime/zlib +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/include/llvm/Config/config.h \ + $(top_builddir)/include/llvm/Support/DataTypes.h \ + $(top_builddir)/include/llvm/ADT/hash_map \ + $(top_builddir)/include/llvm/ADT/hash_set \ + $(top_builddir)/include/llvm/Support/ThreadSupport.h \ + $(top_builddir)/include/llvm/ADT/iterator +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLIBRARIES_INSTALL = $(INSTALL_DATA) +LIBRARIES = $(lib_LIBRARIES) +ARFLAGS = cru +libz_a_AR = $(AR) $(ARFLAGS) +libz_a_LIBADD = +am_libz_a_OBJECTS = adler32.$(OBJEXT) compress.$(OBJEXT) \ + crc32.$(OBJEXT) deflate.$(OBJEXT) gzio.$(OBJEXT) \ + infback.$(OBJEXT) inffast.$(OBJEXT) inflate.$(OBJEXT) \ + inftrees.$(OBJEXT) trees.$(OBJEXT) uncompr.$(OBJEXT) \ + zutil.$(OBJEXT) +libz_a_OBJECTS = $(am_libz_a_OBJECTS) +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libz_a_SOURCES) +DIST_SOURCES = $(libz_a_SOURCES) +CTAGS = ctags +DEJATOOL = $(PACKAGE) +RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir +EXPECT = expect +RUNTEST = runtest +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +INSTALL = @INSTALL@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ + +# Target hardware architecture +ARCH = @ARCH@ +ARCH_PPC_FALSE = @ARCH_PPC_FALSE@ +ARCH_PPC_TRUE = @ARCH_PPC_TRUE@ +ARCH_SPARC_FALSE = @ARCH_SPARC_FALSE@ +ARCH_SPARC_TRUE = @ARCH_SPARC_TRUE@ +ARCH_UNKNOWN_FALSE = @ARCH_UNKNOWN_FALSE@ +ARCH_UNKNOWN_TRUE = @ARCH_UNKNOWN_TRUE@ +ARCH_X86_FALSE = @ARCH_X86_FALSE@ +ARCH_X86_TRUE = @ARCH_X86_TRUE@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +BUILDMODE := @BUILDMODE@ + +# Path to the CC binary, which use used by testcases for native builds. +CC := @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = -DNO_DUMMY_DECL=1 + +# Path to the C++ compiler to use. This is an optional setting, which defaults +# to whatever your gmake defaults to. +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOT = @DOT@ +ECHO = echo +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_OPTIMIZED = @ENABLE_OPTIMIZED@ +ENABLE_PROFILED = @ENABLE_PROFILED@ + +# Endian-ness of the target +ENDIAN = @ENDIAN@ +ETAGS = @ETAGS@ +ETAGSFLAGS = @ETAGSFLAGS@ + +# Executable file extension for this platform. +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FLEX = @LEX@ +HAVE_BZIP2 = @HAVE_BZIP2@ +HAVE_ZLIB = @HAVE_ZLIB@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JIT = @JIT@ + +# Linker flags. +LDFLAGS = @LDFLAGS@ @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LLVMCC1 = @LLVMCC1@ +LLVMCC1PLUS = @LLVMCC1PLUS@ + +# Path to location for LLVM C/C++ front-end. You can modify this if you +# want to override the value set by configure. +LLVMGCCDIR := @LLVMGCCDIR@ +LLVM_BINDIR := @LLVM_BINDIR@ +LLVM_CONFIGTIME = @LLVM_CONFIGTIME@ +LLVM_DATADIR := @LLVM_DATADIR@ +LLVM_DOCSDIR := @LLVM_DOCSDIR@ +LLVM_ETCDIR := @LLVM_ETCDIR@ +LLVM_INCLUDEDIR := @LLVM_INCLUDEDIR@ +LLVM_INFODIR := @LLVM_INFODIR@ +LLVM_LIBDIR := @LLVM_LIBDIR@ +LLVM_MANDIR := @LLVM_MANDIR@ + +# Autoconf configured values +LLVM_PREFIX := @LLVM_PREFIX@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MMAP_FILE = @MMAP_FILE@ +OBJEXT = @OBJEXT@ + +# Target operating system for which LLVM will be compiled. +OS = @OS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ + +# Path to the Python interpreter +PYTHON := @PYTHON@ +QMTEST = @QMTEST@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ + +# Shared library extension for this platform. +SHLIBEXT = @SHLIBEXT@ +STRIP = @STRIP@ +VERSION = @VERSION@ + +# The pathnames of the Flex and Bison programs, respectively. +YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +ifGNUmake = @ifGNUmake@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +lib_LIBRARIES = libz.a +libz_a_SOURCES = adler32.c compress.c crc32.c crc32.h deflate.c deflate.h \ + gzio.c infback.c inffast.c inffast.h inffixed.h \ + inflate.c inflate.h inftrees.c inftrees.h trees.c \ + trees.h uncompr.c zconf.h zlib.h zutil.c zutil.h + +BYTECODE_LIBRARY = $(lib_LIBRARIES) + +# Options for all automake makefiles +ACLOCAL_AMFLAGS = -I autoconf -I autoconf/m4 --output=autoconf/aclocal.m4 +AUTOMAKE_OPTIONS = foreign dejagnu dist-zip nostdinc + +# Libraries needed by tools +TOOLLINKOPTS = @LIBS@ + +# Path to the library archiver program. +AR_PATH = @AR@ + +# Paths to miscellaneous programs. +RPWD = pwd +SED = sed +RM = rm +CP = cp +LN = ln +CMP = cmp +MKDIR = @abs_top_srcdir@/autoconf/mkinstalldirs +DATE = date +MV = mv +VERB := @ +IGNORE := true + +# Determine the target for which LLVM should generate code. +LLVMGCCARCH := @target@/3.4-llvm + +# Full pathnames of LLVM C/C++ front-end 'cc1' and 'cc1plus' binaries: +LCC1 = @LLVMCC1@ +LCC1XX = @LLVMCC1PLUS@ + +# Path to directory where object files should be stored during a build. +# Set OBJ_ROOT to "." if you do not want to use a separate place for +# object files. +OBJ_ROOT := . +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile_config $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign runtime/zlib/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign runtime/zlib/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLIBRARIES: $(lib_LIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + @$(POST_INSTALL) + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + p=$(am__strip_dir) \ + echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \ + $(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \ + else :; fi; \ + done + +uninstall-libLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLIBRARIES: + -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES) +libz.a: $(libz_a_OBJECTS) $(libz_a_DEPENDENCIES) + -rm -f libz.a + $(libz_a_AR) libz.a $(libz_a_OBJECTS) $(libz_a_LIBADD) + $(RANLIB) libz.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/adler32.Po at am__quote@ + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/compress.Po at am__quote@ + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/crc32.Po at am__quote@ + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/deflate.Po at am__quote@ + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gzio.Po at am__quote@ + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/infback.Po at am__quote@ + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/inffast.Po at am__quote@ + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/inflate.Po at am__quote@ + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/inftrees.Po at am__quote@ + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trees.Po at am__quote@ + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/uncompr.Po at am__quote@ + at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zutil.Po at am__quote@ + +.c.o: + at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ + at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi + at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ + at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + at am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: + at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ + at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi + at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ + at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + at am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ + at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi + at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ + at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ fi - cp zlib.3 $(man3dir) - chmod 644 $(man3dir)/zlib.3 -# The ranlib in install is needed on NeXTSTEP which checks file times -# ldconfig is for Linux - -uninstall: - cd $(includedir); \ - cd $(libdir); rm -f libz.a; \ - if test -f $(SHAREDLIBV); then \ - rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-DEJAGNU: site.exp + srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \ + EXPECT=$(EXPECT); export EXPECT; \ + runtest=$(RUNTEST); \ + if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ + l='$(DEJATOOL)'; for tool in $$l; do \ + $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \ + done; \ + else echo "WARNING: could not find \`runtest'" 1>&2; :;\ fi - cd $(man3dir); rm -f zlib.3 - -mostlyclean: clean -clean: - rm -f *.o *~ example$(EXE) minigzip$(EXE) \ - libz.* foo.gz so_locations \ - _match.s maketree contrib/infback9/*.o - -maintainer-clean: distclean -distclean: clean - cp -p Makefile.in Makefile - cp -p zconf.in.h zconf.h - rm -f .DS_Store - -tags: - etags *.[ch] - -depend: - makedepend -- $(CFLAGS) -- *.[ch] - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -adler32.o: zlib.h zconf.h -compress.o: zlib.h zconf.h -crc32.o: crc32.h zlib.h zconf.h -deflate.o: deflate.h zutil.h zlib.h zconf.h -example.o: zlib.h zconf.h -gzio.o: zutil.h zlib.h zconf.h -inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h -inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h -infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h -inftrees.o: zutil.h zlib.h zconf.h inftrees.h -minigzip.o: zlib.h zconf.h -trees.o: deflate.h zutil.h zlib.h zconf.h trees.h -uncompr.o: zlib.h zconf.h -zutil.o: zutil.h zlib.h zconf.h +site.exp: Makefile + @echo 'Making a new site.exp file...' + @echo '## these variables are automatically generated by make ##' >site.tmp + @echo '# Do not edit here. If you wish to override these values' >>site.tmp + @echo '# edit the last section' >>site.tmp + @echo 'set srcdir $(srcdir)' >>site.tmp + @echo "set objdir `pwd`" >>site.tmp + @echo 'set build_alias "$(build_alias)"' >>site.tmp + @echo 'set build_triplet $(build_triplet)' >>site.tmp + @echo 'set host_alias "$(host_alias)"' >>site.tmp + @echo 'set host_triplet $(host_triplet)' >>site.tmp + @echo 'set target_alias "$(target_alias)"' >>site.tmp + @echo 'set target_triplet $(target_triplet)' >>site.tmp + @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp + @test ! -f site.exp || \ + sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp + @-rm -f site.bak + @test ! -f site.exp || mv site.exp site.bak + @mv site.tmp site.exp + +distclean-DEJAGNU: + -rm -f site.exp site.bak + -l='$(DEJATOOL)'; for tool in $$l; do \ + rm -f $$tool.sum $$tool.log; \ + done + +distdir: $(DISTFILES) + $(mkdir_p) $(distdir)/../.. + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU +check: check-am +all-am: Makefile $(LIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-DEJAGNU distclean-compile \ + distclean-generic distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-libLIBRARIES + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-libLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-DEJAGNU check-am clean \ + clean-generic clean-libLIBRARIES clean-libtool ctags distclean \ + distclean-DEJAGNU distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-libLIBRARIES install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-libLIBRARIES + + +# These are options that can either be enabled here, or can be enabled on the +# make command line (ie, make ENABLE_PROFILING=1): + +# When ENABLE_OPTIMIZED is enabled, Release builds of all of the LLVM code are +# turned on, and Debug builds are turned off. +#ENABLE_OPTIMIZED = 1 + +# When ENABLE_PROFILING is enabled, the llvm source base is built with profile +# information to allow gprof to be used to get execution frequencies. +#ENABLE_PROFILING = 1 + +# This option tells the Makefiles to produce verbose output. +# It essentially prints the commands that make is executing +#VERBOSE = 1 + +# Include the rules. +# WARNING NOTE WARNING NOTE WARNING NOTE WARNING NOTE +# The inclusion of Makefile_rules MUST be done such that there is a space +# before "include". This prevents automake from processing the file and +# simply passes the inclusion on to GNU Make. The rules in Makefile_rules +# depend on this. DO NOT REMOVE THE SPACE BEFORE "include" + include $(top_srcdir)/Makefile_rules +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: From reid at x10sys.com Sun Oct 17 12:08:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 17 Oct 2004 12:08:07 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/config.h.in Message-ID: <200410171708.MAA30914@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: config.h.in updated: 1.31 -> 1.32 --- Log message: Add HAVE_BZLIB_H and HAVE_ZLIB_H tests. --- Diffs of the changes: (+6 -0) Index: llvm/include/llvm/Config/config.h.in diff -u llvm/include/llvm/Config/config.h.in:1.31 llvm/include/llvm/Config/config.h.in:1.32 --- llvm/include/llvm/Config/config.h.in:1.31 Mon Oct 4 12:48:37 2004 +++ llvm/include/llvm/Config/config.h.in Sun Oct 17 12:07:29 2004 @@ -24,6 +24,9 @@ /* Define if bzip2 library is available on this platform. */ #undef HAVE_BZIP2 +/* Define to 1 if you have the header file. */ +#undef HAVE_BZLIB_H + /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H @@ -203,6 +206,9 @@ /* Define if zlib library is available on this platform. */ #undef HAVE_ZLIB +/* Define to 1 if you have the header file. */ +#undef HAVE_ZLIB_H + /* Installation directory for binary executables */ #undef LLVM_BINDIR From lattner at cs.uiuc.edu Sun Oct 17 12:41:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 12:41:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelSimple.cpp Message-ID: <200410171741.MAA15542@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelSimple.cpp updated: 1.290 -> 1.291 --- Log message: Don't print stuff out from the code generator. This broke the JIT horribly last night. :) bork! --- Diffs of the changes: (+0 -1) Index: llvm/lib/Target/X86/X86ISelSimple.cpp diff -u llvm/lib/Target/X86/X86ISelSimple.cpp:1.290 llvm/lib/Target/X86/X86ISelSimple.cpp:1.291 --- llvm/lib/Target/X86/X86ISelSimple.cpp:1.290 Sun Oct 17 03:01:28 2004 +++ llvm/lib/Target/X86/X86ISelSimple.cpp Sun Oct 17 12:40:50 2004 @@ -962,7 +962,6 @@ cast(Op0I->getOperand(1))->getRawValue(); BuildMI(*MBB, IP, TESTTab[Class], 2).addReg(LHS).addImm(Imm); - std::cerr << "FOLDED SETCC and AND!\n"; if (OpNum == 2) return 6; // Map jl -> js if (OpNum == 3) return 7; // Map jg -> jns return OpNum; From lattner at cs.uiuc.edu Sun Oct 17 12:49:13 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 12:49:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200410171749.MAA16731@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.202 -> 1.203 --- Log message: The first hunk corrects a bug when printing undef null values. We would print 0->field, which is illegal. Now we print ((foo*)0)->field. The second hunk is an optimization to not print undefined phi values. --- Diffs of the changes: (+11 -6) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.202 llvm/lib/Target/CBackend/Writer.cpp:1.203 --- llvm/lib/Target/CBackend/Writer.cpp:1.202 Sat Oct 16 13:12:13 2004 +++ llvm/lib/Target/CBackend/Writer.cpp Sun Oct 17 12:48:59 2004 @@ -523,7 +523,9 @@ abort(); } } else if (isa(CPV) && CPV->getType()->isFirstClassType()) { - Out << "0"; + Out << "(("; + printType(Out, CPV->getType()); + Out << ")/*UNDEF*/0)"; return; } @@ -1234,11 +1236,14 @@ SI != E; ++SI) for (BasicBlock::iterator I = SI->begin(); isa(I); ++I) { PHINode *PN = cast(I); - // now we have to do the printing - Out << std::string(Indent, ' '); - Out << " " << Mang->getValueName(I) << "__PHI_TEMPORARY = "; - writeOperand(PN->getIncomingValue(PN->getBasicBlockIndex(CurBlock))); - Out << "; /* for PHI node */\n"; + // Now we have to do the printing. + Value *IV = PN->getIncomingValueForBlock(CurBlock); + if (!isa(IV)) { + Out << std::string(Indent, ' '); + Out << " " << Mang->getValueName(I) << "__PHI_TEMPORARY = "; + writeOperand(IV); + Out << "; /* for PHI node */\n"; + } } } From lattner at cs.uiuc.edu Sun Oct 17 16:22:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 16:22:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopSimplify.cpp Message-ID: <200410172122.QAA29593@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopSimplify.cpp updated: 1.51 -> 1.52 --- Log message: hasConstantValue will soon return instructions that don't dominate the PHI node, so prepare for this. --- Diffs of the changes: (+21 -16) Index: llvm/lib/Transforms/Scalar/LoopSimplify.cpp diff -u llvm/lib/Transforms/Scalar/LoopSimplify.cpp:1.51 llvm/lib/Transforms/Scalar/LoopSimplify.cpp:1.52 --- llvm/lib/Transforms/Scalar/LoopSimplify.cpp:1.51 Mon Sep 27 21:40:37 2004 +++ llvm/lib/Transforms/Scalar/LoopSimplify.cpp Sun Oct 17 16:22:29 2004 @@ -250,8 +250,11 @@ // Can we eliminate this phi node now? if (Value *V = hasConstantValue(PN)) { - PN->replaceAllUsesWith(V); - BB->getInstList().erase(PN); + if (!isa(V) || + getAnalysis().dominates(cast(V), PN)) { + PN->replaceAllUsesWith(V); + BB->getInstList().erase(PN); + } } } @@ -426,22 +429,24 @@ /// FindPHIToPartitionLoops - The first part of loop-nestification is to find a /// PHI node that tells us how to partition the loops. -static PHINode *FindPHIToPartitionLoops(Loop *L) { +static PHINode *FindPHIToPartitionLoops(Loop *L, DominatorSet &DS) { for (BasicBlock::iterator I = L->getHeader()->begin(); isa(I); ) { PHINode *PN = cast(I); ++I; - if (Value *V = hasConstantValue(PN)) { - // This is a degenerate PHI already, don't modify it! - PN->replaceAllUsesWith(V); - PN->getParent()->getInstList().erase(PN); - } else { - // Scan this PHI node looking for a use of the PHI node by itself. - for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) - if (PN->getIncomingValue(i) == PN && - L->contains(PN->getIncomingBlock(i))) - // We found something tasty to remove. - return PN; - } + if (Value *V = hasConstantValue(PN)) + if (!isa(V) || DS.dominates(cast(V), PN)) { + // This is a degenerate PHI already, don't modify it! + PN->replaceAllUsesWith(V); + PN->getParent()->getInstList().erase(PN); + continue; + } + + // Scan this PHI node looking for a use of the PHI node by itself. + for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) + if (PN->getIncomingValue(i) == PN && + L->contains(PN->getIncomingBlock(i))) + // We found something tasty to remove. + return PN; } return 0; } @@ -464,7 +469,7 @@ /// created. /// Loop *LoopSimplify::SeparateNestedLoop(Loop *L) { - PHINode *PN = FindPHIToPartitionLoops(L); + PHINode *PN = FindPHIToPartitionLoops(L, getAnalysis()); if (PN == 0) return 0; // No known way to partition. // Pull out all predecessors that have varying values in the loop. This From lattner at cs.uiuc.edu Sun Oct 17 16:22:49 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 16:22:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200410172122.QAA29599@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.271 -> 1.272 --- Log message: hasConstantValue will soon return instructions that don't dominate the PHI node, so prepare for this. --- Diffs of the changes: (+18 -4) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.271 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.272 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.271 Sat Oct 16 18:28:04 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sun Oct 17 16:22:38 2004 @@ -3364,7 +3364,7 @@ } AddUsersToWorkList(*Caller); } else { - NV = Constant::getNullValue(Caller->getType()); + NV = UndefValue::get(Caller->getType()); } } @@ -3380,9 +3380,23 @@ // PHINode simplification // Instruction *InstCombiner::visitPHINode(PHINode &PN) { - // FIXME: hasConstantValue should ignore undef values! - if (Value *V = hasConstantValue(&PN)) - return ReplaceInstUsesWith(PN, V); + if (Value *V = hasConstantValue(&PN)) { + // If V is an instruction, we have to be certain that it dominates PN. + // However, because we don't have dom info, we can't do a perfect job. + if (Instruction *I = dyn_cast(V)) { + // We know that the instruction dominates the PHI if there are no undef + // values coming in. + for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) + if (isa(PN.getIncomingValue(i))) { + std::cerr << "HAD TO DISABLE PHI ELIM IN IC!\n"; + V = 0; + break; + } + } + + if (V) + return ReplaceInstUsesWith(PN, V); + } // If the only user of this instruction is a cast instruction, and all of the // incoming values are constants, change this PHI to merge together the casted From lattner at cs.uiuc.edu Sun Oct 17 16:23:37 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 16:23:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/Local.cpp Message-ID: <200410172123.QAA29610@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: Local.cpp updated: 1.34 -> 1.35 --- Log message: Enhance hasConstantValue to ignore undef values in phi nodes. This allows it to think that PHI[4, undef] == 4. --- Diffs of the changes: (+3 -2) Index: llvm/lib/Transforms/Utils/Local.cpp diff -u llvm/lib/Transforms/Utils/Local.cpp:1.34 llvm/lib/Transforms/Utils/Local.cpp:1.35 --- llvm/lib/Transforms/Utils/Local.cpp:1.34 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/Utils/Local.cpp Sun Oct 17 16:23:26 2004 @@ -353,7 +353,8 @@ // Value *InVal = 0; for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) - if (PN->getIncomingValue(i) != PN) // Not the PHI node itself... + if (PN->getIncomingValue(i) != PN && // Not the PHI node itself... + !isa(PN->getIncomingValue(i))) if (InVal && PN->getIncomingValue(i) != InVal) return 0; // Not the same, bail out. else @@ -363,7 +364,7 @@ // that only has entries for itself. In this case, there is no entry into the // loop, so kill the PHI. // - if (InVal == 0) InVal = Constant::getNullValue(PN->getType()); + if (InVal == 0) InVal = UndefValue::get(PN->getType()); // All of the incoming values are the same, return the value now. return InVal; From lattner at cs.uiuc.edu Sun Oct 17 16:25:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 16:25:43 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/Mem2Reg/UndefValuesMerge.ll Message-ID: <200410172125.QAA29634@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/Mem2Reg: UndefValuesMerge.ll added (r1.1) --- Log message: New testcase, no PHI should be inserted. --- Diffs of the changes: (+14 -0) Index: llvm/test/Regression/Transforms/Mem2Reg/UndefValuesMerge.ll diff -c /dev/null llvm/test/Regression/Transforms/Mem2Reg/UndefValuesMerge.ll:1.1 *** /dev/null Sun Oct 17 16:25:42 2004 --- llvm/test/Regression/Transforms/Mem2Reg/UndefValuesMerge.ll Sun Oct 17 16:25:32 2004 *************** *** 0 **** --- 1,14 ---- + ; RUN: llvm-as < %s | opt -mem2reg | llvm-dis | not grep phi + + implementation + + int %testfunc(bool %C, int %i, sbyte %j) { + %I = alloca int + br bool %C, label %T, label %Cont + T: + store int %i, int* %I + br label %Cont + Cont: + %Y = load int* %I ;; %Y = phi %i, undef -> %Y = %i + ret int %Y + } From lattner at cs.uiuc.edu Sun Oct 17 16:26:07 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 16:26:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200410172126.QAA29642@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.71 -> 1.72 --- Log message: When inserting PHI nodes, don't insert any phi nodes that are obviously unneccesary. This allows us to delete several hundred phi nodes of the form PHI(x,x,x,undef) from 253.perlbmk and probably other programs as well. This implements Mem2Reg/UndefValuesMerge.ll --- Diffs of the changes: (+31 -10) Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.71 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.72 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.71 Sat Oct 16 13:10:06 2004 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sun Oct 17 16:25:56 2004 @@ -24,6 +24,7 @@ #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/AliasSetTracker.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Transforms/Utils/Local.h" #include "llvm/Support/CFG.h" #include "llvm/Support/StableBasicBlockNumbering.h" #include @@ -94,6 +95,12 @@ void run(); + /// dominates - Return true if BB1 dominates BB2 using the DT. + /// + bool dominates(BasicBlock *BB1, BasicBlock *BB2) const { + return DT[BB1]->dominates(DT[BB2]); + } + private: void MarkDominatingPHILive(BasicBlock *BB, unsigned AllocaNum, std::set &DeadPHINodes); @@ -316,7 +323,7 @@ // code. Unfortunately, there may be blocks which are not reachable, which // the renamer hasn't traversed. If this is the case, the PHI nodes may not // have incoming values for all predecessors. Loop over all PHI nodes we have - // created, inserting null constants if they are missing any incoming values. + // created, inserting undef values if they are missing any incoming values. // for (std::map >::iterator I = NewPhiNodes.begin(), E = NewPhiNodes.end(); I != E; ++I) { @@ -325,27 +332,41 @@ std::vector &PNs = I->second; assert(!PNs.empty() && "Empty PHI node list??"); + // Loop over all of the PHI nodes and see if there are any that we can get + // rid of because they merge all of the same incoming values. This can + // happen due to undef values coming into the PHI nodes. + PHINode *SomePHI = 0; + for (unsigned i = 0, e = PNs.size(); i != e; ++i) + if (PNs[i]) { + if (Value *V = hasConstantValue(PNs[i])) { + if (!isa(V) || + dominates(cast(V)->getParent(), I->first)) { + PNs[i]->replaceAllUsesWith(V); + PNs[i]->eraseFromParent(); + PNs[i] = 0; + } + } + if (PNs[i]) + SomePHI = PNs[i]; + } + // Only do work here if there the PHI nodes are missing incoming values. We // know that all PHI nodes that were inserted in a block will have the same // number of incoming values, so we can just check any PHI node. - PHINode *FirstPHI; - for (unsigned i = 0; (FirstPHI = PNs[i]) == 0; ++i) - /*empty*/; - - if (Preds.size() != FirstPHI->getNumIncomingValues()) { + if (SomePHI && Preds.size() != SomePHI->getNumIncomingValues()) { // Ok, now we know that all of the PHI nodes are missing entries for some // basic blocks. Start by sorting the incoming predecessors for efficient // access. std::sort(Preds.begin(), Preds.end()); - // Now we loop through all BB's which have entries in FirstPHI and remove + // Now we loop through all BB's which have entries in SomePHI and remove // them from the Preds list. - for (unsigned i = 0, e = FirstPHI->getNumIncomingValues(); i != e; ++i) { + for (unsigned i = 0, e = SomePHI->getNumIncomingValues(); i != e; ++i) { // Do a log(n) search of the Preds list for the entry we want. std::vector::iterator EntIt = std::lower_bound(Preds.begin(), Preds.end(), - FirstPHI->getIncomingBlock(i)); - assert(EntIt != Preds.end() && *EntIt == FirstPHI->getIncomingBlock(i)&& + SomePHI->getIncomingBlock(i)); + assert(EntIt != Preds.end() && *EntIt == SomePHI->getIncomingBlock(i)&& "PHI node has entry for a block which is not a predecessor!"); // Remove the entry From lattner at cs.uiuc.edu Sun Oct 17 16:31:47 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 16:31:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200410172131.QAA30286@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.272 -> 1.273 --- Log message: Remove printout, realize that instructions in the entry block dominate all other blocks. --- Diffs of the changes: (+6 -6) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.272 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.273 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.272 Sun Oct 17 16:22:38 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sun Oct 17 16:31:34 2004 @@ -3386,12 +3386,12 @@ if (Instruction *I = dyn_cast(V)) { // We know that the instruction dominates the PHI if there are no undef // values coming in. - for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) - if (isa(PN.getIncomingValue(i))) { - std::cerr << "HAD TO DISABLE PHI ELIM IN IC!\n"; - V = 0; - break; - } + if (I->getParent() != &I->getParent()->getParent()->front()) + for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) + if (isa(PN.getIncomingValue(i))) { + V = 0; + break; + } } if (V) From lattner at cs.uiuc.edu Sun Oct 17 16:55:09 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 16:55:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp Message-ID: <200410172155.QAA31414@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.66 -> 1.67 --- Log message: fold gep undef, ... -> undef This comes up many times in perlbmk and probably others. --- Diffs of the changes: (+8 -1) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.66 llvm/lib/VMCore/ConstantFolding.cpp:1.67 --- llvm/lib/VMCore/ConstantFolding.cpp:1.66 Sat Oct 16 23:01:51 2004 +++ llvm/lib/VMCore/ConstantFolding.cpp Sun Oct 17 16:54:55 2004 @@ -1011,8 +1011,15 @@ if (IdxList.size() == 0 || (IdxList.size() == 1 && cast(IdxList[0])->isNullValue())) return const_cast(C); - Constant *Idx0 = cast(IdxList[0]); + if (isa(C)) { + const Type *Ty = GetElementPtrInst::getIndexedType(C->getType(), IdxList, + true); + assert(Ty != 0 && "Invalid indices for GEP!"); + return UndefValue::get(PointerType::get(Ty)); + } + + Constant *Idx0 = cast(IdxList[0]); if (C->isNullValue()) { bool isNull = true; for (unsigned i = 0, e = IdxList.size(); i != e; ++i) From natebegeman at mac.com Sun Oct 17 18:02:12 2004 From: natebegeman at mac.com (Nate Begeman) Date: Sun, 17 Oct 2004 18:02:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp Message-ID: <200410172302.SAA32390@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PowerPCAsmPrinter.cpp updated: 1.62 -> 1.63 --- Log message: Generate correct stubs for weak-linked symbols --- Diffs of the changes: (+3 -2) Index: llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp:1.62 llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp:1.63 --- llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp:1.62 Tue Sep 21 23:40:25 2004 +++ llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp Sun Oct 17 18:01:34 2004 @@ -366,8 +366,9 @@ return; } - // External global variables need a non-lazily-resolved stub - if (GV->isExternal() && getTM().AddressTaken.count(GV)) { + // External or weakly linked global variables need non-lazily-resolved stubs + if ((GV->isExternal() || GV->hasWeakLinkage()) && + getTM().AddressTaken.count(GV)) { GVStubs.insert(Name); O << "L" << Name << "$non_lazy_ptr"; return; From natebegeman at mac.com Sun Oct 17 18:04:09 2004 From: natebegeman at mac.com (Nate Begeman) Date: Sun, 17 Oct 2004 18:04:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/ToolRunner.cpp Message-ID: <200410172304.SAA32435@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: ToolRunner.cpp updated: 1.30 -> 1.31 --- Log message: Pass -single_module option to gcc when linking dynamic libraries for use with bugpoint, so that we can bugpoint multiple .cp files --- Diffs of the changes: (+1 -0) Index: llvm/lib/Support/ToolRunner.cpp diff -u llvm/lib/Support/ToolRunner.cpp:1.30 llvm/lib/Support/ToolRunner.cpp:1.31 --- llvm/lib/Support/ToolRunner.cpp:1.30 Wed Sep 1 17:55:35 2004 +++ llvm/lib/Support/ToolRunner.cpp Sun Oct 17 18:03:32 2004 @@ -409,6 +409,7 @@ #if defined(sparc) || defined(__sparc__) || defined(__sparcv9) "-G", // Compile a shared library, `-G' for Sparc #elif (defined(__POWERPC__) || defined(__ppc__)) && defined(__APPLE__) + "-single_module", // link all source files into a single module "-dynamiclib", // `-dynamiclib' for MacOS X/PowerPC "-fno-common", // allow global vars w/o initializers to live "-undefined", // in data segment, rather than generating From lattner at cs.uiuc.edu Sun Oct 17 18:20:43 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 18:20:43 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll Message-ID: <200410172320.SAA03082@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/Inline: 2004-10-17-InlineFunctionWithoutReturn.ll added (r1.1) --- Log message: New testcase that crashes the inliner --- Diffs of the changes: (+10 -0) Index: llvm/test/Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll diff -c /dev/null llvm/test/Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll:1.1 *** /dev/null Sun Oct 17 18:20:39 2004 --- llvm/test/Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll Sun Oct 17 18:20:29 2004 *************** *** 0 **** --- 1,10 ---- + ; RUN: llvm-as < %s | opt -inline -disable-output + + int %test() { + unwind + } + + int %caller() { + %X = call int %test() + ret int %X + } From lattner at cs.uiuc.edu Sun Oct 17 18:21:18 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 18:21:18 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/InlineFunction.cpp Message-ID: <200410172321.SAA03234@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: InlineFunction.cpp updated: 1.27 -> 1.28 --- Log message: Fix Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll If a function had no return instruction in it, and the result of the inlined call instruction was used, we would crash. --- Diffs of the changes: (+8 -4) Index: llvm/lib/Transforms/Utils/InlineFunction.cpp diff -u llvm/lib/Transforms/Utils/InlineFunction.cpp:1.27 llvm/lib/Transforms/Utils/InlineFunction.cpp:1.28 --- llvm/lib/Transforms/Utils/InlineFunction.cpp:1.27 Wed Sep 15 12:06:42 2004 +++ llvm/lib/Transforms/Utils/InlineFunction.cpp Sun Oct 17 18:21:07 2004 @@ -16,7 +16,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Utils/Cloning.h" -#include "llvm/Constant.h" +#include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" #include "llvm/Instructions.h" @@ -316,12 +316,16 @@ ReturnBB->replaceAllUsesWith(AfterCallBB); // Delete the return instruction now and empty ReturnBB now. - Returns[0]->getParent()->getInstList().erase(Returns[0]); - Caller->getBasicBlockList().erase(ReturnBB); + Returns[0]->eraseFromParent(); + ReturnBB->eraseFromParent(); + } else if (!TheCall->use_empty()) { + // No returns, but something is using the return value of the call. Just + // nuke the result. + TheCall->replaceAllUsesWith(UndefValue::get(TheCall->getType())); } // Since we are now done with the Call/Invoke, we can delete it. - TheCall->getParent()->getInstList().erase(TheCall); + TheCall->eraseFromParent(); // We should always be able to fold the entry block of the function into the // single predecessor of the block... From lattner at cs.uiuc.edu Sun Oct 17 18:44:16 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 18:44:16 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/ADCE/unreachable-function.ll Message-ID: <200410172344.SAA06286@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/ADCE: unreachable-function.ll added (r1.1) --- Log message: New testcase that ADCE shouldn't crash on --- Diffs of the changes: (+5 -0) Index: llvm/test/Regression/Transforms/ADCE/unreachable-function.ll diff -c /dev/null llvm/test/Regression/Transforms/ADCE/unreachable-function.ll:1.1 *** /dev/null Sun Oct 17 18:44:12 2004 --- llvm/test/Regression/Transforms/ADCE/unreachable-function.ll Sun Oct 17 18:44:02 2004 *************** *** 0 **** --- 1,5 ---- + ; RUN: llvm-as < %s | opt -adce -disable-output + + void %test() { + unreachable + } From lattner at cs.uiuc.edu Sun Oct 17 18:45:17 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 18:45:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp Message-ID: <200410172345.SAA06329@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.82 -> 1.83 --- Log message: Getting ADCE to interact well with unreachable instructions seems like a nontrivial exercise that I'm not interested in tackling right now. Just punt and treat them like unwind's. This 'fixes' test/Regression/Transforms/ADCE/unreachable-function.ll --- Diffs of the changes: (+3 -2) Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.82 llvm/lib/Transforms/Scalar/ADCE.cpp:1.83 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.82 Sat Oct 16 13:09:25 2004 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Sun Oct 17 18:45:06 2004 @@ -233,8 +233,9 @@ markInstructionLive(I); } } else if (I->mayWriteToMemory() || isa(I) || - isa(I)) { - // Unreachable instructions are not marked intrinsically live here. + isa(I) || isa(I)) { + // FIXME: Unreachable instructions should not be marked intrinsically + // live here. markInstructionLive(I); } else if (isInstructionTriviallyDead(I)) { // Remove the instruction from it's basic block... From lattner at cs.uiuc.edu Sun Oct 17 18:49:22 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 18:49:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200410172349.SAA06898@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.203 -> 1.204 --- Log message: Print a semicolon for the unreacahble instruction. This fixes problems where C requires semicolons in some cases to indicate null statements. --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.203 llvm/lib/Target/CBackend/Writer.cpp:1.204 --- llvm/lib/Target/CBackend/Writer.cpp:1.203 Sun Oct 17 12:48:59 2004 +++ llvm/lib/Target/CBackend/Writer.cpp Sun Oct 17 18:49:11 2004 @@ -1212,7 +1212,7 @@ } void CWriter::visitUnreachableInst(UnreachableInst &I) { - Out << " /*UNREACHABLE*/\n"; + Out << " /*UNREACHABLE*/;\n"; } bool CWriter::isGotoCodeNecessary(BasicBlock *From, BasicBlock *To) { From lattner at cs.uiuc.edu Sun Oct 17 20:21:31 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 20:21:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Message-ID: <200410180121.UAA11481@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: PromoteMemoryToRegister.cpp updated: 1.72 -> 1.73 --- Log message: Fix a bug that occurs when the constant value is the result of an invoke. In particular, invoke ret values are only live in the normal dest of the invoke not in the unwind dest. --- Diffs of the changes: (+6 -5) Index: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp diff -u llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.72 llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.73 --- llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:1.72 Sun Oct 17 16:25:56 2004 +++ llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Sun Oct 17 20:21:17 2004 @@ -95,10 +95,12 @@ void run(); - /// dominates - Return true if BB1 dominates BB2 using the DT. + /// dominates - Return true if I1 dominates I2 using the DominatorTree. /// - bool dominates(BasicBlock *BB1, BasicBlock *BB2) const { - return DT[BB1]->dominates(DT[BB2]); + bool dominates(Instruction *I1, Instruction *I2) const { + if (InvokeInst *II = dyn_cast(I1)) + I1 = II->getNormalDest()->begin(); + return DT[I1->getParent()]->dominates(DT[I2->getParent()]); } private: @@ -339,8 +341,7 @@ for (unsigned i = 0, e = PNs.size(); i != e; ++i) if (PNs[i]) { if (Value *V = hasConstantValue(PNs[i])) { - if (!isa(V) || - dominates(cast(V)->getParent(), I->first)) { + if (!isa(V) || dominates(cast(V), PNs[i])) { PNs[i]->replaceAllUsesWith(V); PNs[i]->eraseFromParent(); PNs[i] = 0; From lattner at cs.uiuc.edu Sun Oct 17 20:48:45 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 20:48:45 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200410180148.UAA13482@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.273 -> 1.274 --- Log message: My friend the invoke instruction does not dominate all basic blocks if it occurs in the entry node of a function --- Diffs of the changes: (+2 -1) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.273 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.274 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.273 Sun Oct 17 16:31:34 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sun Oct 17 20:48:31 2004 @@ -3386,7 +3386,8 @@ if (Instruction *I = dyn_cast(V)) { // We know that the instruction dominates the PHI if there are no undef // values coming in. - if (I->getParent() != &I->getParent()->getParent()->front()) + if (I->getParent() != &I->getParent()->getParent()->front() || + isa(I)) for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) if (isa(PN.getIncomingValue(i))) { V = 0; From lattner at cs.uiuc.edu Sun Oct 17 21:59:23 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 21:59:23 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200410180259.VAA16178@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.274 -> 1.275 --- Log message: Turn things with obviously undefined semantics into 'store -> null' --- Diffs of the changes: (+34 -26) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.274 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.275 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.274 Sun Oct 17 20:48:31 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sun Oct 17 21:59:09 2004 @@ -121,7 +121,6 @@ Instruction *visitAllocationInst(AllocationInst &AI); Instruction *visitFreeInst(FreeInst &FI); Instruction *visitLoadInst(LoadInst &LI); - Instruction *visitStoreInst(StoreInst &SI); Instruction *visitBranchInst(BranchInst &BI); Instruction *visitSwitchInst(SwitchInst &SI); @@ -170,7 +169,7 @@ } else { // If we are replacing the instruction with itself, this must be in a // segment of unreachable code, so just clobber the instruction. - I.replaceAllUsesWith(Constant::getNullValue(I.getType())); + I.replaceAllUsesWith(UndefValue::get(I.getType())); return &I; } } @@ -3210,15 +3209,25 @@ Value *Callee = CS.getCalledValue(); - if (isa(Callee) || isa(Callee)) - // This instruction is not reachable, just remove it. Eventually, this - // should get turned into an unreachable instruction. - if (!isa(CS.getInstruction())) { // Don't hack the CFG! - if (!CS.getInstruction()->use_empty()) - CS.getInstruction()-> - replaceAllUsesWith(UndefValue::get(CS.getInstruction()->getType())); - return EraseInstFromFunction(*CS.getInstruction()); + if (isa(Callee) || isa(Callee)) { + // This instruction is not reachable, just remove it. We insert a store to + // undef so that we know that this code is not reachable, despite the fact + // that we can't modify the CFG here. + new StoreInst(ConstantBool::True, + UndefValue::get(PointerType::get(Type::BoolTy)), + CS.getInstruction()); + + if (!CS.getInstruction()->use_empty()) + CS.getInstruction()-> + replaceAllUsesWith(UndefValue::get(CS.getInstruction()->getType())); + + if (InvokeInst *II = dyn_cast(CS.getInstruction())) { + // Don't break the CFG, insert a dummy cond branch. + new BranchInst(II->getNormalDest(), II->getUnwindDest(), + ConstantBool::True, II); } + return EraseInstFromFunction(*CS.getInstruction()); + } const PointerType *PTy = cast(Callee->getType()); const FunctionType *FTy = cast(PTy->getElementType()); @@ -3717,10 +3726,17 @@ return &FI; } + // free undef -> unreachable. + if (isa(Op)) { + // Insert a new store to null because we cannot modify the CFG here. + new StoreInst(ConstantBool::True, + UndefValue::get(PointerType::get(Type::BoolTy)), &FI); + return EraseInstFromFunction(FI); + } + // If we have 'free null' delete the instruction. This can happen in stl code // when lots of inlining happens. - // FIXME: free undef should be xformed into an 'unreachable' instruction. - if (isa(Op) || isa(Op)) + if (isa(Op)) return EraseInstFromFunction(FI); return 0; @@ -3826,9 +3842,13 @@ if (Constant *C = dyn_cast(Op)) { if ((C->isNullValue() || isa(C)) && - !LI.isVolatile()) // load null -> undef - // FIXME: this should become an unreachable instruction + !LI.isVolatile()) { // load null/undef -> undef + // Insert a new store to null instruction before the load to indicate that + // this code is not reachable. We do this instead of inserting an + // unreachable instruction directly because we cannot modify the CFG. + new StoreInst(UndefValue::get(LI.getType()), C, &LI); return ReplaceInstUsesWith(LI, UndefValue::get(LI.getType())); + } // Instcombine load (constant global) into the value loaded. if (GlobalVariable *GV = dyn_cast(Op)) @@ -3934,18 +3954,6 @@ return 0; } -Instruction *InstCombiner::visitStoreInst(StoreInst &SI) { - if (isa(SI.getOperand(1)) || - isa(SI.getOperand(1))) { - // FIXME: This should become an unreachable instruction. - return EraseInstFromFunction(SI); - } - - - return 0; -} - - Instruction *InstCombiner::visitBranchInst(BranchInst &BI) { // Change br (not X), label True, label False to: br X, label False, True Value *X; From lattner at cs.uiuc.edu Sun Oct 17 22:01:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 22:01:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/SimplifyCFG.cpp Message-ID: <200410180301.WAA16205@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: SimplifyCFG.cpp updated: 1.11 -> 1.12 --- Log message: Turn store -> null/undef into the LLVM unreachable instruction! This simple change hacks off 10K of bytecode from perlbmk (.5%) even though the front-end is not generating them yet and we are not optimizing the resultant code. This isn't too bad. --- Diffs of the changes: (+27 -0) Index: llvm/lib/Transforms/Scalar/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.11 llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.12 --- llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.11 Wed Sep 1 17:55:36 2004 +++ llvm/lib/Transforms/Scalar/SimplifyCFG.cpp Sun Oct 17 22:00:50 2004 @@ -20,6 +20,8 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Utils/Local.h" +#include "llvm/Constants.h" +#include "llvm/Instructions.h" #include "llvm/Module.h" #include "llvm/Support/CFG.h" #include "llvm/Pass.h" @@ -45,6 +47,31 @@ if (Reachable.count(BB)) return false; Reachable.insert(BB); + // Do a quick scan of the basic block, turning any obviously unreachable + // instructions into LLVM unreachable insts. The instruction combining pass + // canonnicalizes unreachable insts into stores to null or undef. + for (BasicBlock::iterator BBI = BB->begin(), E = BB->end(); BBI != E; ++BBI) + if (StoreInst *SI = dyn_cast(BBI)) + if (isa(SI->getOperand(1)) || + isa(SI->getOperand(1))) { + // Loop over all of the successors, removing BB's entry from any PHI + // nodes. + for (succ_iterator I = succ_begin(BB), SE = succ_end(BB); I != SE; ++I) + (*I)->removePredecessor(BB); + + new UnreachableInst(SI); + std::cerr << "Inserted UNREACHABLE instruction!\n"; + + // All instructions after this are dead. + for (; BBI != E; ) { + if (!BBI->use_empty()) + BBI->replaceAllUsesWith(UndefValue::get(BBI->getType())); + BB->getInstList().erase(BBI++); + } + break; + } + + bool Changed = ConstantFoldTerminator(BB); for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI) MarkAliveBlocks(*SI, Reachable); From reid at x10sys.com Sun Oct 17 22:23:25 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 17 Oct 2004 22:23:25 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-db/Makefile.am Message-ID: <200410180323.WAA12457@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-db: Makefile.am updated: 1.2 -> 1.3 --- Log message: Actually link in all the analysis passes. --- Diffs of the changes: (+4 -4) Index: llvm/tools/llvm-db/Makefile.am diff -u llvm/tools/llvm-db/Makefile.am:1.2 llvm/tools/llvm-db/Makefile.am:1.3 --- llvm/tools/llvm-db/Makefile.am:1.2 Wed Oct 13 06:46:52 2004 +++ llvm/tools/llvm-db/Makefile.am Sun Oct 17 22:22:48 2004 @@ -38,10 +38,10 @@ # What the Sparc JIT requires ifdef ENABLE_SPARC_JIT - CPPFLAGS += -DENABLE_SPARC_JIT - THEOBJS += SparcV9 SparcV9InstrSched SparcV9LiveVar SparcV9RegAlloc - THEOBJS += ProfilePaths BCWriter - THELIBS += Instrument Transforms IPO IPA DataStructure +# CPPFLAGS += -DENABLE_SPARC_JIT +# THEOBJS += SparcV9 SparcV9InstrSched SparcV9LiveVar SparcV9RegAlloc +# THEOBJS += ProfilePaths BCWriter +# THELIBS += Instrument Transforms IPO IPA DataStructure endif llvm_db_LDADD = \ From reid at x10sys.com Sun Oct 17 22:26:59 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 17 Oct 2004 22:26:59 -0500 Subject: [llvm-commits] CVS: llvm/tools/gccas/Makefile.am Message-ID: <200410180326.WAA12501@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccas: Makefile.am updated: 1.2 -> 1.3 --- Log message: Remove extra comma. --- Diffs of the changes: (+1 -1) Index: llvm/tools/gccas/Makefile.am diff -u llvm/tools/gccas/Makefile.am:1.2 llvm/tools/gccas/Makefile.am:1.3 --- llvm/tools/gccas/Makefile.am:1.2 Wed Oct 13 06:46:52 2004 +++ llvm/tools/gccas/Makefile.am Sun Oct 17 22:26:21 2004 @@ -16,4 +16,4 @@ gccas_LDADD = \ $(call GETOBJS,AsmParser,BCWriter,Core) \ $(call GETLIBS,Transforms,IPO,IPA,ScalarOpts,Analysis,Target,TransformUtils) \ - $(call GETLIBS,,Support,System) + $(call GETLIBS,Support,System) From reid at x10sys.com Sun Oct 17 22:32:49 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 17 Oct 2004 22:32:49 -0500 Subject: [llvm-commits] CVS: llvm/tools/analyze/Makefile.am Message-ID: <200410180332.WAA12574@zion.cs.uiuc.edu> Changes in directory llvm/tools/analyze: Makefile.am updated: 1.2 -> 1.3 --- Log message: Actually link all the analysis passes and their dependencies. --- Diffs of the changes: (+4 -3) Index: llvm/tools/analyze/Makefile.am diff -u llvm/tools/analyze/Makefile.am:1.2 llvm/tools/analyze/Makefile.am:1.3 --- llvm/tools/analyze/Makefile.am:1.2 Wed Oct 13 06:46:51 2004 +++ llvm/tools/analyze/Makefile.am Sun Oct 17 22:32:12 2004 @@ -17,6 +17,7 @@ GraphPrinters.cpp analyze_LDADD = \ - $(call GETOBJS,AsmParser,BCReader,Core) \ - $(call GETLIBS,Analysis,IPA,DataStructure,ScalarOpts,Transforms,Target) \ - $(call GETLIBS,ScalarOpts,TransformUtils,Support,System) + $(call GETOBJS,AsmParser,BCReader,Analysis,IPA,DataStructure,ScalarOpts) \ + $(call GETLIBS,Transforms,Target,ScalarOpts,TransformUtils) \ + $(call GETOBJS,Core) \ + $(call GETLIBS,Support,System) From lattner at cs.uiuc.edu Sun Oct 17 23:06:55 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 23:06:55 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/SimplifyCFG/UnreachableEliminate.ll Message-ID: <200410180406.XAA19249@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/SimplifyCFG: UnreachableEliminate.ll added (r1.1) --- Log message: New testcase --- Diffs of the changes: (+29 -0) Index: llvm/test/Regression/Transforms/SimplifyCFG/UnreachableEliminate.ll diff -c /dev/null llvm/test/Regression/Transforms/SimplifyCFG/UnreachableEliminate.ll:1.1 *** /dev/null Sun Oct 17 23:06:51 2004 --- llvm/test/Regression/Transforms/SimplifyCFG/UnreachableEliminate.ll Sun Oct 17 23:06:41 2004 *************** *** 0 **** --- 1,29 ---- + ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep unreachable + + void %test1(bool %C, bool* %BP) { + br bool %C, label %T, label %F + T: + store bool %C, bool* %BP ;; dead + unreachable + F: + ret void + } + + void %test2() { + invoke void %test2() to label %N unwind label %U + U: + unreachable + N: + ret void + } + + int %test3(int %v) { + switch int %v, label %default [ int 1, label %U + int 2, label %T] + default: + ret int 1 + U: + unreachable + T: + ret int 2 + } From lattner at cs.uiuc.edu Sun Oct 17 23:07:32 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 23:07:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/SimplifyCFG.cpp Message-ID: <200410180407.XAA19257@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: SimplifyCFG.cpp updated: 1.54 -> 1.55 --- Log message: Simplify code by deleting instructions that preceed unreachable instructions. Simplify code by simplifying terminators that branch to blocks that start with an unreachable instruction. --- Diffs of the changes: (+101 -1) Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.54 llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.55 --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.54 Thu Oct 14 00:13:36 2004 +++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp Sun Oct 17 23:07:22 2004 @@ -21,7 +21,7 @@ #include #include #include - +#include using namespace llvm; // PropagatePredecessorsForPHIs - This gets "Succ" ready to have the @@ -916,6 +916,106 @@ return SimplifyCFG(BB) | true; } } + } else if (isa(BB->getTerminator())) { + // If there are any instructions immediately before the unreachable that can + // be removed, do so. + Instruction *Unreachable = BB->getTerminator(); + while (Unreachable != BB->begin()) { + BasicBlock::iterator BBI = Unreachable; + --BBI; + if (isa(BBI)) break; + // Delete this instruction + BB->getInstList().erase(BBI); + Changed = true; + } + + // If the unreachable instruction is the first in the block, take a gander + // at all of the predecessors of this instruction, and simplify them. + if (&BB->front() == Unreachable) { + std::vector Preds(pred_begin(BB), pred_end(BB)); + for (unsigned i = 0, e = Preds.size(); i != e; ++i) { + TerminatorInst *TI = Preds[i]->getTerminator(); + + if (BranchInst *BI = dyn_cast(TI)) { + if (BI->isUnconditional()) { + if (BI->getSuccessor(0) == BB) { + new UnreachableInst(TI); + TI->eraseFromParent(); + Changed = true; + } + } else { + if (BI->getSuccessor(0) == BB) { + new BranchInst(BI->getSuccessor(1), BI); + BI->eraseFromParent(); + } else if (BI->getSuccessor(1) == BB) { + new BranchInst(BI->getSuccessor(0), BI); + BI->eraseFromParent(); + Changed = true; + } + } + } else if (SwitchInst *SI = dyn_cast(TI)) { + for (unsigned i = 1, e = SI->getNumCases(); i != e; ++i) + if (SI->getSuccessor(i) == BB) { + SI->removeCase(i); + --i; --e; + Changed = true; + } + // If the default value is unreachable, figure out the most popular + // destination and make it the default. + if (SI->getSuccessor(0) == BB) { + std::map Popularity; + for (unsigned i = 1, e = SI->getNumCases(); i != e; ++i) + Popularity[SI->getSuccessor(i)]++; + + // Find the most popular block. + unsigned MaxPop = 0; + BasicBlock *MaxBlock = 0; + for (std::map::iterator + I = Popularity.begin(), E = Popularity.end(); I != E; ++I) { + if (I->second > MaxPop) { + MaxPop = I->second; + MaxBlock = I->first; + } + } + if (MaxBlock) { + // Make this the new default, allowing us to delete any explicit + // edges to it. + SI->setSuccessor(0, MaxBlock); + Changed = true; + + for (unsigned i = 1, e = SI->getNumCases(); i != e; ++i) + if (SI->getSuccessor(i) == MaxBlock) { + SI->removeCase(i); + --i; --e; + } + } + } + } else if (InvokeInst *II = dyn_cast(TI)) { + if (II->getUnwindDest() == BB) { + // Convert the invoke to a call instruction. This would be a good + // place to note that the call does not throw though. + BranchInst *BI = new BranchInst(II->getNormalDest(), II); + II->removeFromParent(); // Take out of symbol table + + // Insert the call now... + std::vector Args(II->op_begin()+3, II->op_end()); + CallInst *CI = new CallInst(II->getCalledValue(), Args, + II->getName(), BI); + // If the invoke produced a value, the Call does now instead. + II->replaceAllUsesWith(CI); + delete II; + Changed = true; + } + } + } + + // If this block is now dead, remove it. + if (pred_begin(BB) == pred_end(BB)) { + // We know there are no successors, so just nuke the block. + M->getBasicBlockList().erase(BB); + return true; + } + } } // Merge basic blocks into their predecessor if there is only one distinct From lattner at cs.uiuc.edu Sun Oct 17 23:15:59 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 23:15:59 -0500 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-representation.c llvm-representation.h Message-ID: <200410180415.XAA20219@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-representation.c updated: 1.10 -> 1.11 llvm-representation.h updated: 1.9 -> 1.10 --- Log message: Add ability to represent the unreachable instruction --- Diffs of the changes: (+3 -2) Index: llvm-gcc/gcc/llvm-representation.c diff -u llvm-gcc/gcc/llvm-representation.c:1.10 llvm-gcc/gcc/llvm-representation.c:1.11 --- llvm-gcc/gcc/llvm-representation.c:1.10 Tue Jul 6 23:19:38 2004 +++ llvm-gcc/gcc/llvm-representation.c Sun Oct 17 23:15:45 2004 @@ -372,6 +372,7 @@ case O_Switch: fprintf(F, "switch"); break; case O_Invoke: fprintf(F, "invoke"); break; case O_Unwind: fprintf(F, "unwind"); break; + case O_Unreachable: fprintf(F, "unreachable"); break; case O_Add: fprintf(F, "add"); break; case O_Sub: fprintf(F, "sub"); break; case O_Mul: fprintf(F, "mul"); break; Index: llvm-gcc/gcc/llvm-representation.h diff -u llvm-gcc/gcc/llvm-representation.h:1.9 llvm-gcc/gcc/llvm-representation.h:1.10 --- llvm-gcc/gcc/llvm-representation.h:1.9 Tue Jul 6 22:19:52 2004 +++ llvm-gcc/gcc/llvm-representation.h Sun Oct 17 23:15:45 2004 @@ -157,7 +157,7 @@ llvm_ilist_node(struct llvm_instruction, Instructions); enum InstOpcode { - O_Ret, O_Br, O_Switch, O_Invoke, O_Unwind, + O_Ret, O_Br, O_Switch, O_Invoke, O_Unwind, O_Unreachable, O_Add, O_Sub, O_Mul, O_Div, O_Rem, O_And, O_Or, O_Xor, O_SetEQ, O_SetNE, O_SetLE, O_SetGE, O_SetLT, O_SetGT, @@ -190,7 +190,7 @@ void llvm_instruction_print(llvm_instruction *I, FILE *F); void llvm_instruction_dump(llvm_instruction *I); -#define llvm_instruction_is_terminator(INST) ((INST)->Opcode <= O_Unwind) +#define llvm_instruction_is_terminator(INST) ((INST)->Opcode <= O_Unreachable) /* Helper functions */ llvm_instruction *create_alloca_inst(const char *Name, From lattner at cs.uiuc.edu Sun Oct 17 23:19:17 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 17 Oct 2004 23:19:17 -0500 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200410180419.XAA20494@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.51 -> 1.52 --- Log message: Start emitting the LLVM unreachable instruction after calls to noreturn functions and after calling the C++ terminate function in bad EH situations. --- Diffs of the changes: (+9 -17) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.51 llvm-gcc/gcc/llvm-expand.c:1.52 --- llvm-gcc/gcc/llvm-expand.c:1.51 Mon Oct 4 19:19:18 2004 +++ llvm-gcc/gcc/llvm-expand.c Sun Oct 17 23:19:04 2004 @@ -3042,20 +3042,12 @@ return D2V(Call)->Ty != VoidTy ? D2V(Call) : 0; } -/* llvm_expand_dummy_return - output a return instruction so that the optimizer - * knows that control flow doesn't reach here. Unless elide_new_block is set, - * this also adds a block immediately after the return. +/* llvm_expand_unreachable - output an unreachable instruction so that the + * optimizer knows that control flow doesn't reach here. Unless elide_new_block + * is set, this also adds a block immediately after the return. */ -static void llvm_expand_dummy_return(llvm_function *Fn, bool elide_new_block) { - llvm_type *RetTy = - GET_FUNCTION_TYPE_RETURN(GET_POINTER_TYPE_ELEMENT(G2V(Fn)->Ty)); - if (RetTy != VoidTy) { - llvm_instruction *Ret = llvm_instruction_new(VoidTy, "", O_Ret, 1); - Ret->Operands[0] = llvm_constant_get_null(RetTy); - append_inst(Fn, Ret); - } else { - append_inst(Fn, llvm_instruction_new(VoidTy, "", O_Ret, 0)); - } +static void llvm_expand_unreachable(llvm_function *Fn, bool elide_new_block) { + append_inst(Fn, llvm_instruction_new(VoidTy, "", O_Unreachable, 0)); if (!elide_new_block) { /* Start a new block so that if statements are emitted after the return, @@ -3128,11 +3120,11 @@ Result = llvm_expand_call_of(Fn, Callee, exp, DestLoc); /* If the function has the volatile bit set, then it is a "noreturn" function. - * Output a return right after the function to prevent LLVM from thinking that - * control flow will fall into the subsequent block. + * Output an unreachable instruction right after the function to prevent LLVM + * from thinking that control flow will fall into the subsequent block. */ if (TREE_CODE(fn) == ADDR_EXPR && TREE_THIS_VOLATILE(TREE_OPERAND(fn, 0))) { - llvm_expand_dummy_return(Fn, 0); + llvm_expand_unreachable(Fn, 0); } return Result; @@ -6916,7 +6908,7 @@ build_function_type(void_type_node, void_list_node))); append_inst(Fn, Call); - llvm_expand_dummy_return(Fn, 1); + llvm_expand_unreachable(Fn, 1); } /* Emitting all of these labels should have caused all of the goto fixups to From alkis at cs.uiuc.edu Sun Oct 17 23:57:56 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Sun, 17 Oct 2004 23:57:56 -0500 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200410180457.XAA13323@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.120 -> 1.121 --- Log message: Add back mistakenly removed code. --- Diffs of the changes: (+300 -0) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.120 llvm-java/lib/Compiler/Compiler.cpp:1.121 --- llvm-java/lib/Compiler/Compiler.cpp:1.120 Mon Oct 11 16:51:24 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Sun Oct 17 23:57:45 2004 @@ -1321,6 +1321,306 @@ new BranchInst(mapper_->getBBAt(t), mapper_->getBBAt(f), c, current_); } + void do_goto(unsigned target) { + new BranchInst(mapper_->getBBAt(target), current_); + } + + void do_jsr(unsigned target) { + assert(0 && "not implemented"); + } + + void do_ret(unsigned index) { + assert(0 && "not implemented"); + } + + void do_switch(unsigned defTarget, const SwitchCases& sw) { + Value* v = opStack_.top(); opStack_.pop(); + SwitchInst* in = new SwitchInst(v, mapper_->getBBAt(defTarget), current_); + for (unsigned i = 0, e = sw.size(); i != e; ++i) + in->addCase(ConstantSInt::get(Type::IntTy, sw[i].first), + mapper_->getBBAt(sw[i].second)); + } + + void do_ireturn() { do_return_common(); } + void do_lreturn() { do_return_common(); } + void do_freturn() { do_return_common(); } + void do_dreturn() { do_return_common(); } + void do_areturn() { do_return_common(); } + + void do_return_common() { + Value* v1 = opStack_.top(); opStack_.pop(); + new ReturnInst(v1, current_); + } + + void do_return() { + new ReturnInst(NULL, current_); + } + + void do_getstatic(unsigned index) { + Value* v = new LoadInst(getStaticField(index), TMP, current_); + opStack_.push(v); + } + + void do_putstatic(unsigned index) { + Value* v = opStack_.top(); opStack_.pop(); + Value* ptr = getStaticField(index); + const Type* fieldTy = cast(ptr->getType())->getElementType(); + if (v->getType() != fieldTy) + v = new CastInst(v, fieldTy, TMP, current_); + new StoreInst(v, ptr, current_); + } + + void do_getfield(unsigned index) { + Value* p = opStack_.top(); opStack_.pop(); + Value* v = new LoadInst(getField(index, p), TMP, current_); + opStack_.push(v); + } + + void do_putfield(unsigned index) { + Value* v = opStack_.top(); opStack_.pop(); + Value* p = opStack_.top(); opStack_.pop(); + new StoreInst(v, getField(index, p), current_); + } + + void makeCall(Value* fun, const std::vector params) { + const PointerType* funPtrTy = cast(fun->getType()); + const FunctionType* funTy = + cast(funPtrTy->getElementType()); + + if (funTy->getReturnType() == Type::VoidTy) + new CallInst(fun, params, "", current_); + else { + Value* r = new CallInst(fun, params, TMP, current_); + opStack_.push(r); + } + } + + std::vector getParams(FunctionType* funTy) { + unsigned numParams = funTy->getNumParams(); + std::vector params(numParams); + while (numParams--) { + Value* p = opStack_.top(); opStack_.pop(); + params[numParams] = + p->getType() == funTy->getParamType(numParams) ? + p : + new CastInst(p, funTy->getParamType(numParams), TMP, current_); + } + + return params; + } + + void do_invokevirtual(unsigned index) { + ConstantMethodRef* methodRef = cf_->getConstantMethodRef(index); + ConstantNameAndType* nameAndType = methodRef->getNameAndType(); + + ClassFile* cf = ClassFile::get(methodRef->getClass()->getName()->str()); + const ClassInfo& ci = getClassInfo(cf); + const VTableInfo& vi = getVTableInfo(cf); + + const std::string& className = cf->getThisClass()->getName()->str(); + const std::string& methodDescr = + nameAndType->getName()->str() + + nameAndType->getDescriptor()->str(); + + FunctionType* funTy = + cast(getType(nameAndType->getDescriptor(), ci.type)); + + std::vector params(getParams(funTy)); + + Value* objRef = params.front(); + objRef = new CastInst(objRef, PointerType::get(ci.type), + "this", current_); + Value* objBase = getField(cf, LLVM_JAVA_OBJECT_BASE, objRef); + Function* f = module_.getOrInsertFunction( + LLVM_JAVA_GETOBJECTCLASS, PointerType::get(VTableInfo::VTableTy), + objBase->getType(), NULL); + Value* vtable = new CallInst(f, objBase, TMP, current_); + vtable = new CastInst(vtable, PointerType::get(vi.vtable->getType()), + TMP, current_); + vtable = new LoadInst(vtable, className + "", current_); + std::vector indices(1, ConstantUInt::get(Type::UIntTy, 0)); + assert(vi.m2iMap.find(methodDescr) != vi.m2iMap.end() && + "could not find slot for virtual function!"); + unsigned vSlot = vi.m2iMap.find(methodDescr)->second; + indices.push_back(ConstantUInt::get(Type::UIntTy, vSlot)); + Value* vfunPtr = + new GetElementPtrInst(vtable, indices, TMP, current_); + Value* vfun = new LoadInst(vfunPtr, methodDescr, current_); + + makeCall(vfun, params); + } + + void do_invokespecial(unsigned index) { + ConstantMethodRef* methodRef = cf_->getConstantMethodRef(index); + ConstantNameAndType* nameAndType = methodRef->getNameAndType(); + + const std::string& className = methodRef->getClass()->getName()->str(); + const std::string& methodName = nameAndType->getName()->str(); + const std::string& methodDescr = + methodName + nameAndType->getDescriptor()->str(); + std::string funcName = className + '/' + methodDescr; + const ClassInfo& ci = getClassInfo(ClassFile::get(className)); + + // constructor calls are statically bound + if (methodName == "") { + FunctionType* funcTy = + cast(getType(nameAndType->getDescriptor(), ci.type)); + Function* function = module_.getOrInsertFunction(funcName, funcTy); + toCompileFunctions_.insert(function); + makeCall(function, getParams(funcTy)); + } + // otherwise we call the superclass' implementation of the method + else { + assert(0 && "not implemented"); + } + } + + void do_invokestatic(unsigned index) { + ConstantMethodRef* methodRef = cf_->getConstantMethodRef(index); + ConstantNameAndType* nameAndType = methodRef->getNameAndType(); + + std::string funcName = + methodRef->getClass()->getName()->str() + '/' + + nameAndType->getName()->str() + + nameAndType->getDescriptor()->str(); + + FunctionType* funcTy = + cast(getType(nameAndType->getDescriptor())); + Function* function = module_.getOrInsertFunction(funcName, funcTy); + toCompileFunctions_.insert(function); + makeCall(function, getParams(funcTy)); + } + + void do_invokeinterface(unsigned index) { + ConstantInterfaceMethodRef* methodRef = + cf_->getConstantInterfaceMethodRef(index); + ConstantNameAndType* nameAndType = methodRef->getNameAndType(); + + ClassFile* cf = ClassFile::get(methodRef->getClass()->getName()->str()); + const ClassInfo& ci = getClassInfo(cf); + const VTableInfo& vi = getVTableInfo(cf); + + const std::string& className = cf->getThisClass()->getName()->str(); + const std::string& methodDescr = + nameAndType->getName()->str() + + nameAndType->getDescriptor()->str(); + + FunctionType* funTy = + cast(getType(nameAndType->getDescriptor(), ci.type)); + + std::vector params(getParams(funTy)); + + Value* objRef = params.front(); + objRef = new CastInst(objRef, PointerType::get(ci.type), + "this", current_); + Value* objBase = getField(cf, LLVM_JAVA_OBJECT_BASE, objRef); + Function* f = module_.getOrInsertFunction( + LLVM_JAVA_GETOBJECTCLASS, PointerType::get(VTableInfo::VTableTy), + objBase->getType(), NULL); + Value* vtable = new CallInst(f, objBase, TMP, current_); + // get the interfaces array of vtables + std::vector indices(2, ConstantUInt::get(Type::UIntTy, 0)); + indices.push_back(ConstantUInt::get(Type::UIntTy, 3)); + Value* interfaceVTables = + new GetElementPtrInst(vtable, indices, TMP, current_); + interfaceVTables = new LoadInst(interfaceVTables, TMP, current_); + // get the actual interface vtable + indices.clear(); + indices.push_back(ConstantUInt::get(Type::UIntTy, ci.interfaceIdx)); + Value* interfaceVTable = + new GetElementPtrInst(interfaceVTables, indices, TMP, current_); + interfaceVTable = + new LoadInst(interfaceVTable, className + "", current_); + interfaceVTable = + new CastInst(interfaceVTable, vi.vtable->getType(), TMP, current_); + // get the function pointer + indices.resize(1); + assert(vi.m2iMap.find(methodDescr) != vi.m2iMap.end() && + "could not find slot for virtual function!"); + unsigned vSlot = vi.m2iMap.find(methodDescr)->second; + indices.push_back(ConstantUInt::get(Type::UIntTy, vSlot)); + Value* vfunPtr = + new GetElementPtrInst(interfaceVTable, indices, TMP, current_); + Value* vfun = new LoadInst(vfunPtr, methodDescr, current_); + + makeCall(vfun, params); + } + + void do_new(unsigned index) { + ConstantClass* classRef = cf_->getConstantClass(index); + ClassFile* cf = ClassFile::get(classRef->getName()->str()); + const ClassInfo& ci = getClassInfo(cf); + const VTableInfo& vi = getVTableInfo(cf); + + Value* objRef = new MallocInst(ci.type, + ConstantUInt::get(Type::UIntTy, 0), + TMP, current_); + Value* vtable = getField(cf, LLVM_JAVA_OBJECT_BASE, objRef); + vtable = new CastInst(vtable, PointerType::get(vi.vtable->getType()), + TMP, current_); + vtable = new StoreInst(vi.vtable, vtable, current_); + opStack_.push(objRef); + } + + void do_newarray(JType type) { + assert(0 && "not implemented"); + } + + void do_anewarray(unsigned index) { + assert(0 && "not implemented"); + } + + void do_arraylength() { + assert(0 && "not implemented"); + } + + void do_athrow() { + Value* objRef = opStack_.top(); opStack_.pop(); + objRef = new CastInst(objRef, PointerType::get(ClassInfo::ObjectBaseTy), + TMP, current_); + Function* f = module_.getOrInsertFunction( + LLVM_JAVA_THROW, Type::IntTy, objRef->getType(), NULL); + new CallInst(f, objRef, TMP, current_); + } + + void do_checkcast(unsigned index) { + do_dup(); + do_instanceof(index); + Value* r = opStack_.top(); opStack_.pop(); + Value* b = new SetCondInst(Instruction::SetEQ, + r, ConstantSInt::get(Type::IntTy, 1), + TMP, current_); + // FIXME: if b is false we must throw a ClassCast exception + } + + void do_instanceof(unsigned index) { + ConstantClass* classRef = cf_->getConstantClass(index); + ClassFile* cf = ClassFile::get(classRef->getName()->str()); + const VTableInfo& vi = getVTableInfo(cf); + + Value* objRef = opStack_.top(); opStack_.pop(); + Value* objBase = getField(cf, LLVM_JAVA_OBJECT_BASE, objRef); + Function* f = module_.getOrInsertFunction( + LLVM_JAVA_ISINSTANCEOF, Type::IntTy, + objBase->getType(), PointerType::get(VTableInfo::VTableTy), NULL); + Value* vtable = new CastInst(vi.vtable, + PointerType::get(VTableInfo::VTableTy), + TMP, current_); + Value* r = new CallInst(f, objBase, vtable, TMP, current_); + opStack_.push(r); + } + + void do_monitorenter() { + assert(0 && "not implemented"); + } + + void do_monitorexit() { + assert(0 && "not implemented"); + } + + void do_multianewarray(unsigned index, unsigned dims) { + assert(0 && "not implemented"); + } }; unsigned Compiler::ClassInfo::InterfaceCount = 0;