From nicholas at mxc.ca Mon Aug 2 00:23:03 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 02 Aug 2010 05:23:03 -0000 Subject: [llvm-commits] [llvm] r110021 - /llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Message-ID: <20100802052303.7B3DB2A6C12C@llvm.org> Author: nicholas Date: Mon Aug 2 00:23:03 2010 New Revision: 110021 URL: http://llvm.org/viewvc/llvm-project?rev=110021&view=rev Log: Work in progress. Start cleaning up MergeFunctions to look more like the rest of LLVM. The primary change here is to move the methods responsible for comparison into the new FunctionComparator object. Some comments added. There's more to do. Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=110021&r1=110020&r2=110021&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Mon Aug 2 00:23:03 2010 @@ -31,13 +31,8 @@ // the object they belong to. However, as long as it's only used for a lookup // and call, this is irrelevant, and we'd like to fold such implementations. // -// * use SCC to cut down on pair-wise comparisons and solve larger cycles. -// -// The current implementation loops over a pair-wise comparison of all -// functions in the program where the two functions in the pair are treated as -// assumed to be equal until proven otherwise. We could both use fewer -// comparisons and optimize more complex cases if we used strongly connected -// components of the call graph. +// * switch from n^2 pair-wise comparisons to an n-way comparison for each +// bucket. // // * be smarter about bitcast. // @@ -47,11 +42,12 @@ // other doesn't. We should learn to peer through bitcasts without imposing bad // performance properties. // -// * don't emit aliases for Mach-O. +// * emit aliases for ELF // -// Mach-O doesn't support aliases which means that we must avoid introducing -// them in the bitcode on architectures which don't support them, such as -// Mac OSX. There's a few approaches to this problem; +// ELF supports symbol aliases which are represented with GlobalAlias in the +// Module, and we could emit them in the case that the addresses don't need to +// be distinct. The problem is that not all object formats support equivalent +// functionality. There's a few approaches to this problem; // a) teach codegen to lower global aliases to thunks on platforms which don't // support them. // b) always emit thunks, and create a separate thunk-to-alias pass which @@ -85,28 +81,16 @@ STATISTIC(NumFunctionsMerged, "Number of functions merged"); namespace { - class MergeFunctions : public ModulePass { - public: + /// MergeFunctions finds functions which will generate identical machine code, + /// by considering all pointer types to be equivalent. Once identified, + /// MergeFunctions will fold them by replacing a call to one to a call to a + /// bitcast of the other. + /// + struct MergeFunctions : public ModulePass { static char ID; // Pass identification, replacement for typeid MergeFunctions() : ModulePass(&ID) {} bool runOnModule(Module &M); - - private: - bool isEquivalentGEP(const GetElementPtrInst *GEP1, - const GetElementPtrInst *GEP2); - - bool equals(const BasicBlock *BB1, const BasicBlock *BB2); - bool equals(const Function *F, const Function *G); - - bool compare(const Value *V1, const Value *V2); - - const Function *LHS, *RHS; - typedef DenseMap IDMap; - IDMap Map; - DenseMap Domains; - DenseMap DomainCount; - TargetData *TD; }; } @@ -120,8 +104,60 @@ // ===----------------------------------------------------------------------=== // Comparison of functions // ===----------------------------------------------------------------------=== +namespace { +class FunctionComparator { +public: + FunctionComparator(TargetData *TD, Function *F1, Function *F2) + : TD(TD), F1(F1), F2(F2) {} + + // Compare - test whether the two functions have equivalent behaviour. + bool Compare(); + +private: + // Compare - test whether two basic blocks have equivalent behaviour. + bool Compare(const BasicBlock *BB1, const BasicBlock *BB2); + + // getDomain - a value's domain is its parent function if it is specific to a + // function, or NULL otherwise. + const Function *getDomain(const Value *V) const; + + // Enumerate - Assign or look up previously assigned numbers for the two + // values, and return whether the numbers are equal. Numbers are assigned in + // the order visited. + bool Enumerate(const Value *V1, const Value *V2); + + // isEquivalentOperation - Compare two Instructions for equivalence, similar + // to Instruction::isSameOperationAs but with modifications to the type + // comparison. + bool isEquivalentOperation(const Instruction *I1, + const Instruction *I2) const; + + // isEquivalentGEP - Compare two GEPs for equivalent pointer arithmetic. + bool isEquivalentGEP(const GEPOperator *GEP1, const GEPOperator *GEP2); + bool isEquivalentGEP(const GetElementPtrInst *GEP1, + const GetElementPtrInst *GEP2) { + return isEquivalentGEP(cast(GEP1), cast(GEP2)); + } + + // isEquivalentType - Compare two Types, treating all pointer types as equal. + bool isEquivalentType(const Type *Ty1, const Type *Ty2) const; + + // The two functions undergoing comparison. + Function *F1, *F2; + + TargetData *TD; + + typedef DenseMap IDMap; + IDMap Map; + DenseMap Domains; + DenseMap DomainCount; +}; +} -static unsigned long hash(const Function *F) { +/// Compute a number which is guaranteed to be equal for two equivalent +/// functions, but is very likely to be different for different functions. This +/// needs to be computed as efficiently as possible. +static unsigned long ProfileFunction(const Function *F) { const FunctionType *FTy = F->getFunctionType(); FoldingSetNodeID ID; @@ -137,7 +173,8 @@ /// isEquivalentType - any two pointers are equivalent. Otherwise, standard /// type equivalence rules apply. -static bool isEquivalentType(const Type *Ty1, const Type *Ty2) { +bool FunctionComparator::isEquivalentType(const Type *Ty1, + const Type *Ty2) const { if (Ty1 == Ty2) return true; if (Ty1->getTypeID() != Ty2->getTypeID()) @@ -234,8 +271,8 @@ /// isEquivalentOperation - determine whether the two operations are the same /// except that pointer-to-A and pointer-to-B are equivalent. This should be /// kept in sync with Instruction::isSameOperationAs. -static bool -isEquivalentOperation(const Instruction *I1, const Instruction *I2) { +bool FunctionComparator::isEquivalentOperation(const Instruction *I1, + const Instruction *I2) const { if (I1->getOpcode() != I2->getOpcode() || I1->getNumOperands() != I2->getNumOperands() || !isEquivalentType(I1->getType(), I2->getType()) || @@ -287,18 +324,15 @@ return true; } -bool MergeFunctions::isEquivalentGEP(const GetElementPtrInst *GEP1, - const GetElementPtrInst *GEP2) { +/// isEquivalentGEP - determine whether two GEP operations perform the same +/// underlying arithmetic. +bool FunctionComparator::isEquivalentGEP(const GEPOperator *GEP1, + const GEPOperator *GEP2) { + // When we have target data, we can reduce the GEP down to the value in bytes + // added to the address. if (TD && GEP1->hasAllConstantIndices() && GEP2->hasAllConstantIndices()) { - SmallVector Indices1, Indices2; - for (GetElementPtrInst::const_op_iterator I = GEP1->idx_begin(), - E = GEP1->idx_end(); I != E; ++I) { - Indices1.push_back(*I); - } - for (GetElementPtrInst::const_op_iterator I = GEP2->idx_begin(), - E = GEP2->idx_end(); I != E; ++I) { - Indices2.push_back(*I); - } + SmallVector Indices1(GEP1->idx_begin(), GEP1->idx_end()); + SmallVector Indices2(GEP2->idx_begin(), GEP2->idx_end()); uint64_t Offset1 = TD->getIndexedOffset(GEP1->getPointerOperandType(), Indices1.data(), Indices1.size()); uint64_t Offset2 = TD->getIndexedOffset(GEP2->getPointerOperandType(), @@ -306,7 +340,6 @@ return Offset1 == Offset2; } - // Equivalent types aren't enough. if (GEP1->getPointerOperand()->getType() != GEP2->getPointerOperand()->getType()) return false; @@ -315,19 +348,38 @@ return false; for (unsigned i = 0, e = GEP1->getNumOperands(); i != e; ++i) { - if (!compare(GEP1->getOperand(i), GEP2->getOperand(i))) + if (!Enumerate(GEP1->getOperand(i), GEP2->getOperand(i))) return false; } return true; } -bool MergeFunctions::compare(const Value *V1, const Value *V2) { - if (V1 == LHS || V1 == RHS) - if (V2 == LHS || V2 == RHS) +/// getDomain - a value's domain is its parent function if it is specific to a +/// function, or NULL otherwise. +const Function *FunctionComparator::getDomain(const Value *V) const { + if (const Argument *A = dyn_cast(V)) { + return A->getParent(); + } else if (const BasicBlock *BB = dyn_cast(V)) { + return BB->getParent(); + } else if (const Instruction *I = dyn_cast(V)) { + return I->getParent()->getParent(); + } + return NULL; +} + +/// Enumerate - Compare two values used by the two functions under pair-wise +/// comparison. If this is the first time the values are seen, they're added to +/// the mapping so that we will detect mismatches on next use. +bool FunctionComparator::Enumerate(const Value *V1, const Value *V2) { + // Check for function @f1 referring to itself and function @f2 referring to + // itself, or referring to each other, or both referring to either of them. + // They're all equivalent if the two functions are otherwise equivalent. + if (V1 == F1 || V1 == F2) + if (V2 == F1 || V2 == F2) return true; - // TODO: constant expressions in terms of LHS and RHS + // TODO: constant expressions with GEP or references to F1 or F2. if (isa(V1)) return V1 == V2; @@ -340,28 +392,13 @@ // We enumerate constants globally and arguments, basic blocks or // instructions within the function they belong to. - const Function *Domain1 = NULL; - if (const Argument *A = dyn_cast(V1)) { - Domain1 = A->getParent(); - } else if (const BasicBlock *BB = dyn_cast(V1)) { - Domain1 = BB->getParent(); - } else if (const Instruction *I = dyn_cast(V1)) { - Domain1 = I->getParent()->getParent(); - } - - const Function *Domain2 = NULL; - if (const Argument *A = dyn_cast(V2)) { - Domain2 = A->getParent(); - } else if (const BasicBlock *BB = dyn_cast(V2)) { - Domain2 = BB->getParent(); - } else if (const Instruction *I = dyn_cast(V2)) { - Domain2 = I->getParent()->getParent(); - } + const Function *Domain1 = getDomain(V1); + const Function *Domain2 = getDomain(V2); + // The domains have to either be both NULL, or F1, F2. if (Domain1 != Domain2) - if (Domain1 != LHS && Domain1 != RHS) - if (Domain2 != LHS && Domain2 != RHS) - return false; + if (Domain1 != F1 && Domain1 != F2) + return false; IDMap &Map1 = Domains[Domain1]; unsigned long &ID1 = Map1[V1]; @@ -376,116 +413,114 @@ return ID1 == ID2; } -bool MergeFunctions::equals(const BasicBlock *BB1, const BasicBlock *BB2) { - BasicBlock::const_iterator FI = BB1->begin(), FE = BB1->end(); - BasicBlock::const_iterator GI = BB2->begin(), GE = BB2->end(); +// Compare - test whether two basic blocks have equivalent behaviour. +bool FunctionComparator::Compare(const BasicBlock *BB1, const BasicBlock *BB2) { + BasicBlock::const_iterator F1I = BB1->begin(), F1E = BB1->end(); + BasicBlock::const_iterator F2I = BB2->begin(), F2E = BB2->end(); do { - if (!compare(FI, GI)) + if (!Enumerate(F1I, F2I)) return false; - if (isa(FI) && isa(GI)) { - const GetElementPtrInst *GEP1 = cast(FI); - const GetElementPtrInst *GEP2 = cast(GI); + if (const GetElementPtrInst *GEP1 = dyn_cast(F1I)) { + const GetElementPtrInst *GEP2 = dyn_cast(F2I); + if (!GEP2) + return false; - if (!compare(GEP1->getPointerOperand(), GEP2->getPointerOperand())) + if (!Enumerate(GEP1->getPointerOperand(), GEP2->getPointerOperand())) return false; if (!isEquivalentGEP(GEP1, GEP2)) return false; } else { - if (!isEquivalentOperation(FI, GI)) + if (!isEquivalentOperation(F1I, F2I)) return false; - for (unsigned i = 0, e = FI->getNumOperands(); i != e; ++i) { - Value *OpF = FI->getOperand(i); - Value *OpG = GI->getOperand(i); + assert(F1I->getNumOperands() == F2I->getNumOperands()); + for (unsigned i = 0, e = F1I->getNumOperands(); i != e; ++i) { + Value *OpF1 = F1I->getOperand(i); + Value *OpF2 = F2I->getOperand(i); - if (!compare(OpF, OpG)) + if (!Enumerate(OpF1, OpF2)) return false; - if (OpF->getValueID() != OpG->getValueID() || - !isEquivalentType(OpF->getType(), OpG->getType())) + if (OpF1->getValueID() != OpF2->getValueID() || + !isEquivalentType(OpF1->getType(), OpF2->getType())) return false; } } - ++FI, ++GI; - } while (FI != FE && GI != GE); + ++F1I, ++F2I; + } while (F1I != F1E && F2I != F2E); - return FI == FE && GI == GE; + return F1I == F1E && F2I == F2E; } -bool MergeFunctions::equals(const Function *F, const Function *G) { +bool FunctionComparator::Compare() { // We need to recheck everything, but check the things that weren't included // in the hash first. - if (F->getAttributes() != G->getAttributes()) + if (F1->getAttributes() != F2->getAttributes()) return false; - if (F->hasGC() != G->hasGC()) + if (F1->hasGC() != F2->hasGC()) return false; - if (F->hasGC() && F->getGC() != G->getGC()) + if (F1->hasGC() && F1->getGC() != F2->getGC()) return false; - if (F->hasSection() != G->hasSection()) + if (F1->hasSection() != F2->hasSection()) return false; - if (F->hasSection() && F->getSection() != G->getSection()) + if (F1->hasSection() && F1->getSection() != F2->getSection()) return false; - if (F->isVarArg() != G->isVarArg()) + if (F1->isVarArg() != F2->isVarArg()) return false; // TODO: if it's internal and only used in direct calls, we could handle this // case too. - if (F->getCallingConv() != G->getCallingConv()) + if (F1->getCallingConv() != F2->getCallingConv()) return false; - if (!isEquivalentType(F->getFunctionType(), G->getFunctionType())) + if (!isEquivalentType(F1->getFunctionType(), F2->getFunctionType())) return false; - assert(F->arg_size() == G->arg_size() && + assert(F1->arg_size() == F2->arg_size() && "Identical functions have a different number of args."); - LHS = F; - RHS = G; - // Visit the arguments so that they get enumerated in the order they're // passed in. - for (Function::const_arg_iterator fi = F->arg_begin(), gi = G->arg_begin(), - fe = F->arg_end(); fi != fe; ++fi, ++gi) { - if (!compare(fi, gi)) + for (Function::const_arg_iterator f1i = F1->arg_begin(), + f2i = F2->arg_begin(), f1e = F1->arg_end(); f1i != f1e; ++f1i, ++f2i) { + if (!Enumerate(f1i, f2i)) llvm_unreachable("Arguments repeat"); } - SmallVector FBBs, GBBs; - SmallSet VisitedBBs; // in terms of F. - FBBs.push_back(&F->getEntryBlock()); - GBBs.push_back(&G->getEntryBlock()); - VisitedBBs.insert(FBBs[0]); - while (!FBBs.empty()) { - const BasicBlock *FBB = FBBs.pop_back_val(); - const BasicBlock *GBB = GBBs.pop_back_val(); - if (!compare(FBB, GBB) || !equals(FBB, GBB)) { - Domains.clear(); - DomainCount.clear(); - return false; - } - const TerminatorInst *FTI = FBB->getTerminator(); - const TerminatorInst *GTI = GBB->getTerminator(); - assert(FTI->getNumSuccessors() == GTI->getNumSuccessors()); - for (unsigned i = 0, e = FTI->getNumSuccessors(); i != e; ++i) { - if (!VisitedBBs.insert(FTI->getSuccessor(i))) + // We need to do an ordered walk since the actual ordering of the blocks in + // the linked list is immaterial. Our walk starts at the entry block for both + // functions, then takes each block from each terminator in order. As an + // artifact, this also means that unreachable blocks are ignored. + SmallVector F1BBs, F2BBs; + SmallSet VisitedBBs; // in terms of F1. + F1BBs.push_back(&F1->getEntryBlock()); + F2BBs.push_back(&F2->getEntryBlock()); + VisitedBBs.insert(F1BBs[0]); + while (!F1BBs.empty()) { + const BasicBlock *F1BB = F1BBs.pop_back_val(); + const BasicBlock *F2BB = F2BBs.pop_back_val(); + if (!Enumerate(F1BB, F2BB) || !Compare(F1BB, F2BB)) + return false; + const TerminatorInst *F1TI = F1BB->getTerminator(); + const TerminatorInst *F2TI = F2BB->getTerminator(); + assert(F1TI->getNumSuccessors() == F2TI->getNumSuccessors()); + for (unsigned i = 0, e = F1TI->getNumSuccessors(); i != e; ++i) { + if (!VisitedBBs.insert(F1TI->getSuccessor(i))) continue; - FBBs.push_back(FTI->getSuccessor(i)); - GBBs.push_back(GTI->getSuccessor(i)); + F1BBs.push_back(F1TI->getSuccessor(i)); + F2BBs.push_back(F2TI->getSuccessor(i)); } } - - Domains.clear(); - DomainCount.clear(); return true; } @@ -720,10 +755,10 @@ if (F->isDeclaration()) continue; - FnMap[hash(F)].push_back(F); + FnMap[ProfileFunction(F)].push_back(F); } - TD = getAnalysisIfAvailable(); + TargetData *TD = getAnalysisIfAvailable(); bool LocalChanged; do { @@ -736,7 +771,7 @@ for (int i = 0, e = FnVec.size(); i != e; ++i) { for (int j = i + 1; j != e; ++j) { - bool isEqual = equals(FnVec[i], FnVec[j]); + bool isEqual = FunctionComparator(TD, FnVec[i], FnVec[j]).Compare(); DEBUG(dbgs() << " " << FnVec[i]->getName() << (isEqual ? " == " : " != ") From daniel at zuster.org Mon Aug 2 00:43:46 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 02 Aug 2010 05:43:46 -0000 Subject: [llvm-commits] [llvm] r110022 - /llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Message-ID: <20100802054346.B4AD22A6C12C@llvm.org> Author: ddunbar Date: Mon Aug 2 00:43:46 2010 New Revision: 110022 URL: http://llvm.org/viewvc/llvm-project?rev=110022&view=rev Log: Fix a -Wreorder warning. Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=110022&r1=110021&r2=110022&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Mon Aug 2 00:43:46 2010 @@ -108,7 +108,7 @@ class FunctionComparator { public: FunctionComparator(TargetData *TD, Function *F1, Function *F2) - : TD(TD), F1(F1), F2(F2) {} + : F1(F1), F2(F2), TD(TD) {} // Compare - test whether the two functions have equivalent behaviour. bool Compare(); From ofv at wanadoo.es Mon Aug 2 01:00:15 2010 From: ofv at wanadoo.es (Oscar Fuentes) Date: Mon, 02 Aug 2010 06:00:15 -0000 Subject: [llvm-commits] [llvm] r110029 - in /llvm/trunk: cmake/modules/LLVMLibDeps.cmake lib/Analysis/ScalarEvolution.cpp lib/CodeGen/LiveInterval.cpp lib/CodeGen/MachineInstr.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Transforms/IPO/GlobalOpt.cpp lib/Transforms/Scalar/LoopStrengthReduce.cpp lib/VMCore/AsmWriter.cpp lib/VMCore/Constants.cpp unittests/VMCore/InstructionsTest.cpp Message-ID: <20100802060015.BD2C52A6C12C@llvm.org> Author: ofv Date: Mon Aug 2 01:00:15 2010 New Revision: 110029 URL: http://llvm.org/viewvc/llvm-project?rev=110029&view=rev Log: Prefix `next' iterator operation with `llvm::'. Fixes potential ambiguity problems on VS 2010. Patch by nobled! Modified: llvm/trunk/cmake/modules/LLVMLibDeps.cmake llvm/trunk/lib/Analysis/ScalarEvolution.cpp llvm/trunk/lib/CodeGen/LiveInterval.cpp llvm/trunk/lib/CodeGen/MachineInstr.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/lib/VMCore/AsmWriter.cpp llvm/trunk/lib/VMCore/Constants.cpp llvm/trunk/unittests/VMCore/InstructionsTest.cpp Modified: llvm/trunk/cmake/modules/LLVMLibDeps.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMLibDeps.cmake?rev=110029&r1=110028&r2=110029&view=diff ============================================================================== --- llvm/trunk/cmake/modules/LLVMLibDeps.cmake (original) +++ llvm/trunk/cmake/modules/LLVMLibDeps.cmake Mon Aug 2 01:00:15 2010 @@ -1,42 +1,44 @@ -set(MSVC_LIB_DEPS_LLVMARMAsmParser LLVMARMInfo LLVMMCParser LLVMSupport) -set(MSVC_LIB_DEPS_LLVMARMAsmPrinter LLVMARMCodeGen LLVMARMInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget) -set(MSVC_LIB_DEPS_LLVMARMCodeGen LLVMARMInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) +set(MSVC_LIB_DEPS_LLVMARMAsmParser LLVMARMCodeGen LLVMARMInfo LLVMMCParser LLVMSupport LLVMTarget) +set(MSVC_LIB_DEPS_LLVMARMAsmPrinter LLVMMC LLVMSupport) +set(MSVC_LIB_DEPS_LLVMARMCodeGen LLVMARMInfo LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMARMInfo LLVMSupport) -set(MSVC_LIB_DEPS_LLVMAlphaAsmPrinter LLVMAlphaInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget) +set(MSVC_LIB_DEPS_LLVMAlphaAsmPrinter LLVMAlphaCodeGen LLVMAlphaInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMAlphaCodeGen LLVMAlphaInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMAlphaInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMArchive LLVMBitReader LLVMCore LLVMSupport LLVMSystem) set(MSVC_LIB_DEPS_LLVMAsmParser LLVMCore LLVMSupport) -set(MSVC_LIB_DEPS_LLVMAsmPrinter LLVMAnalysis LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget) +set(MSVC_LIB_DEPS_LLVMAsmPrinter LLVMAnalysis LLVMCodeGen LLVMCore LLVMMC LLVMMCParser LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMBitReader LLVMCore LLVMSupport) -set(MSVC_LIB_DEPS_LLVMBitWriter LLVMCore LLVMSupport LLVMSystem) -set(MSVC_LIB_DEPS_LLVMBlackfinAsmPrinter LLVMAsmPrinter LLVMBlackfinInfo LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget) +set(MSVC_LIB_DEPS_LLVMBitWriter LLVMCore LLVMSupport) +set(MSVC_LIB_DEPS_LLVMBlackfinAsmPrinter LLVMAsmPrinter LLVMBlackfinCodeGen LLVMBlackfinInfo LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMBlackfinCodeGen LLVMBlackfinInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMBlackfinInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMCBackend LLVMAnalysis LLVMCBackendInfo LLVMCodeGen LLVMCore LLVMMC LLVMScalarOpts LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils LLVMipa) set(MSVC_LIB_DEPS_LLVMCBackendInfo LLVMSupport) -set(MSVC_LIB_DEPS_LLVMCellSPUAsmPrinter LLVMAsmPrinter LLVMCellSPUInfo LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget) +set(MSVC_LIB_DEPS_LLVMCellSPUAsmPrinter LLVMAsmPrinter LLVMCellSPUCodeGen LLVMCellSPUInfo LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMCellSPUCodeGen LLVMCellSPUInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMCellSPUInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMCodeGen LLVMAnalysis LLVMCore LLVMMC LLVMScalarOpts LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils) set(MSVC_LIB_DEPS_LLVMCore LLVMSupport LLVMSystem) set(MSVC_LIB_DEPS_LLVMCppBackend LLVMCore LLVMCppBackendInfo LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMCppBackendInfo LLVMSupport) +set(MSVC_LIB_DEPS_LLVMDebugger LLVMBitReader LLVMCore LLVMSupport LLVMSystem) set(MSVC_LIB_DEPS_LLVMExecutionEngine LLVMCore LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMInstCombine LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils) set(MSVC_LIB_DEPS_LLVMInstrumentation LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTransformUtils) set(MSVC_LIB_DEPS_LLVMInterpreter LLVMCodeGen LLVMCore LLVMExecutionEngine LLVMSupport LLVMSystem LLVMTarget) -set(MSVC_LIB_DEPS_LLVMJIT LLVMAnalysis LLVMCodeGen LLVMCore LLVMExecutionEngine LLVMMC LLVMSupport LLVMSystem LLVMTarget) +set(MSVC_LIB_DEPS_LLVMJIT LLVMCodeGen LLVMCore LLVMExecutionEngine LLVMMC LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMLinker LLVMArchive LLVMBitReader LLVMCore LLVMSupport LLVMSystem) set(MSVC_LIB_DEPS_LLVMMBlazeAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMBlazeCodeGen LLVMMBlazeInfo LLVMMC LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMMBlazeCodeGen LLVMCodeGen LLVMCore LLVMMBlazeInfo LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMMBlazeInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMMC LLVMSupport LLVMSystem) +set(MSVC_LIB_DEPS_LLVMMCDisassembler LLVMARMAsmParser LLVMARMCodeGen LLVMARMInfo LLVMAlphaAsmPrinter LLVMAlphaCodeGen LLVMAlphaInfo LLVMBlackfinAsmPrinter LLVMBlackfinCodeGen LLVMBlackfinInfo LLVMCBackend LLVMCBackendInfo LLVMCellSPUAsmPrinter LLVMCellSPUCodeGen LLVMCellSPUInfo LLVMCppBackend LLVMCppBackendInfo LLVMMBlazeAsmPrinter LLVMMBlazeCodeGen LLVMMBlazeInfo LLVMMC LLVMMCParser LLVMMSIL LLVMMSILInfo LLVMMSP430AsmPrinter LLVMMSP430CodeGen LLVMMSP430Info LLVMMipsAsmPrinter LLVMMipsCodeGen LLVMMipsInfo LLVMPIC16 LLVMPIC16AsmPrinter LLVMPIC16Info LLVMPowerPCAsmPrinter LLVMPowerPCCodeGen LLVMPowerPCInfo LLVMSparcAsmPrinter LLVMSparcCodeGen LLVMSparcInfo LLVMSupport LLVMSystem LLVMSystemZAsmPrinter LLVMSystemZCodeGen LLVMSystemZInfo LLVMX86AsmParser LLVMX86CodeGen LLVMX86Disassembler LLVMX86Info LLVMXCore LLVMXCoreAsmPrinter LLVMXCoreInfo) set(MSVC_LIB_DEPS_LLVMMCParser LLVMMC LLVMSupport) set(MSVC_LIB_DEPS_LLVMMSIL LLVMAnalysis LLVMCodeGen LLVMCore LLVMMSILInfo LLVMScalarOpts LLVMSupport LLVMTarget LLVMTransformUtils LLVMipa) set(MSVC_LIB_DEPS_LLVMMSILInfo LLVMSupport) -set(MSVC_LIB_DEPS_LLVMMSP430AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMSP430Info LLVMSupport LLVMTarget) +set(MSVC_LIB_DEPS_LLVMMSP430AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMSP430CodeGen LLVMMSP430Info LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMMSP430CodeGen LLVMCodeGen LLVMCore LLVMMC LLVMMSP430Info LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMMSP430Info LLVMSupport) set(MSVC_LIB_DEPS_LLVMMipsAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMipsCodeGen LLVMMipsInfo LLVMSupport LLVMTarget) @@ -45,28 +47,28 @@ set(MSVC_LIB_DEPS_LLVMPIC16 LLVMAnalysis LLVMCodeGen LLVMCore LLVMMC LLVMPIC16Info LLVMSelectionDAG LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMPIC16AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPIC16 LLVMPIC16Info LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMPIC16Info LLVMSupport) -set(MSVC_LIB_DEPS_LLVMPowerPCAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPowerPCInfo LLVMSupport LLVMTarget) +set(MSVC_LIB_DEPS_LLVMPowerPCAsmPrinter LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPowerPCCodeGen LLVMPowerPCInfo LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMPowerPCCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMPowerPCInfo LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMPowerPCInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMScalarOpts LLVMAnalysis LLVMCore LLVMInstCombine LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils) -set(MSVC_LIB_DEPS_LLVMSelectionDAG LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget) -set(MSVC_LIB_DEPS_LLVMSparcAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSparcInfo LLVMSupport LLVMTarget) +set(MSVC_LIB_DEPS_LLVMSelectionDAG LLVMAnalysis LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget) +set(MSVC_LIB_DEPS_LLVMSparcAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSparcCodeGen LLVMSparcInfo LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMSparcCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSparcInfo LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMSparcInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMSupport LLVMSystem) set(MSVC_LIB_DEPS_LLVMSystem ) -set(MSVC_LIB_DEPS_LLVMSystemZAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystemZInfo LLVMTarget) +set(MSVC_LIB_DEPS_LLVMSystemZAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystemZCodeGen LLVMSystemZInfo LLVMTarget) set(MSVC_LIB_DEPS_LLVMSystemZCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystemZInfo LLVMTarget) set(MSVC_LIB_DEPS_LLVMSystemZInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMTarget LLVMCore LLVMMC LLVMSupport) set(MSVC_LIB_DEPS_LLVMTransformUtils LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget LLVMipa) set(MSVC_LIB_DEPS_LLVMX86AsmParser LLVMMC LLVMMCParser LLVMSupport LLVMTarget LLVMX86Info) -set(MSVC_LIB_DEPS_LLVMX86AsmPrinter LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget LLVMX86CodeGen LLVMX86Info) -set(MSVC_LIB_DEPS_LLVMX86CodeGen LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget LLVMX86Info) +set(MSVC_LIB_DEPS_LLVMX86AsmPrinter LLVMMC LLVMSupport) +set(MSVC_LIB_DEPS_LLVMX86CodeGen LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget LLVMX86AsmPrinter LLVMX86Info) set(MSVC_LIB_DEPS_LLVMX86Disassembler LLVMMC LLVMSupport LLVMX86Info) set(MSVC_LIB_DEPS_LLVMX86Info LLVMSupport) set(MSVC_LIB_DEPS_LLVMXCore LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget LLVMXCoreInfo) -set(MSVC_LIB_DEPS_LLVMXCoreAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget LLVMXCoreInfo) +set(MSVC_LIB_DEPS_LLVMXCoreAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget LLVMXCore LLVMXCoreInfo) set(MSVC_LIB_DEPS_LLVMXCoreInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMipa LLVMAnalysis LLVMCore LLVMSupport LLVMSystem) -set(MSVC_LIB_DEPS_LLVMipo LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils LLVMipa) +set(MSVC_LIB_DEPS_LLVMipo LLVMAnalysis LLVMCore LLVMScalarOpts LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils LLVMipa) Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=110029&r1=110028&r2=110029&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 2 01:00:15 2010 @@ -251,7 +251,7 @@ OS << "("; for (op_iterator I = op_begin(), E = op_end(); I != E; ++I) { OS << **I; - if (next(I) != E) + if (llvm::next(I) != E) OS << OpStr; } OS << ")"; @@ -2805,7 +2805,7 @@ return getUnknown(GEP); const SCEV *TotalOffset = getConstant(IntPtrTy, 0); gep_type_iterator GTI = gep_type_begin(GEP); - for (GetElementPtrInst::op_iterator I = next(GEP->op_begin()), + for (GetElementPtrInst::op_iterator I = llvm::next(GEP->op_begin()), E = GEP->op_end(); I != E; ++I) { Value *Index = *I; Modified: llvm/trunk/lib/CodeGen/LiveInterval.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveInterval.cpp?rev=110029&r1=110028&r2=110029&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveInterval.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveInterval.cpp Mon Aug 2 01:00:15 2010 @@ -189,7 +189,7 @@ VNInfo *ValNo = I->valno; // Search for the first interval that we can't merge with. - Ranges::iterator MergeTo = next(I); + Ranges::iterator MergeTo = llvm::next(I); for (; MergeTo != ranges.end() && NewEnd >= MergeTo->end; ++MergeTo) { assert(MergeTo->valno == ValNo && "Cannot merge with differing values!"); } @@ -198,11 +198,11 @@ I->end = std::max(NewEnd, prior(MergeTo)->end); // Erase any dead ranges. - ranges.erase(next(I), MergeTo); + ranges.erase(llvm::next(I), MergeTo); // If the newly formed range now touches the range after it and if they have // the same value number, merge the two ranges into one range. - Ranges::iterator Next = next(I); + Ranges::iterator Next = llvm::next(I); if (Next != ranges.end() && Next->start <= I->end && Next->valno == ValNo) { I->end = Next->end; ranges.erase(Next); @@ -241,7 +241,7 @@ MergeTo->end = I->end; } - ranges.erase(next(MergeTo), next(I)); + ranges.erase(llvm::next(MergeTo), llvm::next(I)); return MergeTo; } @@ -351,7 +351,7 @@ I->end = Start; // Trim the old interval. // Insert the new one. - ranges.insert(next(I), LiveRange(End, OldEnd, ValNo)); + ranges.insert(llvm::next(I), LiveRange(End, OldEnd, ValNo)); } /// removeValNo - Remove all the ranges defined by the specified value#. Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=110029&r1=110028&r2=110029&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Mon Aug 2 01:00:15 2010 @@ -1338,7 +1338,7 @@ for (mmo_iterator i = memoperands_begin(), e = memoperands_end(); i != e; ++i) { OS << **i; - if (next(i) != e) + if (llvm::next(i) != e) OS << " "; } } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=110029&r1=110028&r2=110029&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Aug 2 01:00:15 2010 @@ -5898,7 +5898,7 @@ for (MachineSDNode::mmo_iterator i = MN->memoperands_begin(), e = MN->memoperands_end(); i != e; ++i) { OS << **i; - if (next(i) != e) + if (llvm::next(i) != e) OS << " "; } OS << ">"; Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=110029&r1=110028&r2=110029&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Mon Aug 2 01:00:15 2010 @@ -2078,7 +2078,7 @@ return false; // The first index must be zero. - ConstantInt *CI = dyn_cast(*next(CE->op_begin())); + ConstantInt *CI = dyn_cast(*llvm::next(CE->op_begin())); if (!CI || !CI->isZero()) return false; // The remaining indices must be compile-time known integers within the Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=110029&r1=110028&r2=110029&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Aug 2 01:00:15 2010 @@ -1083,7 +1083,7 @@ for (SmallVectorImpl::const_iterator I = Offsets.begin(), E = Offsets.end(); I != E; ++I) { OS << *I; - if (next(I) != E) + if (llvm::next(I) != E) OS << ','; } OS << '}'; @@ -1987,7 +1987,7 @@ for (SmallSetVector::const_iterator I = Strides.begin(), E = Strides.end(); I != E; ++I) for (SmallSetVector::const_iterator NewStrideIter = - next(I); NewStrideIter != E; ++NewStrideIter) { + llvm::next(I); NewStrideIter != E; ++NewStrideIter) { const SCEV *OldStride = *I; const SCEV *NewStride = *NewStrideIter; @@ -2300,7 +2300,7 @@ SmallVector InnerAddOps ( ((const SmallVector &)AddOps).begin(), J); InnerAddOps.append - (next(J), ((const SmallVector &)AddOps).end()); + (llvm::next(J), ((const SmallVector &)AddOps).end()); // Don't leave just a constant behind in a register if the constant could // be folded into an immediate field. Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=110029&r1=110028&r2=110029&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Mon Aug 2 01:00:15 2010 @@ -228,7 +228,7 @@ E = STy->element_end(); I != E; ++I) { OS << ' '; CalcTypeName(*I, TypeStack, OS); - if (next(I) == STy->element_end()) + if (llvm::next(I) == STy->element_end()) OS << ' '; else OS << ','; @@ -245,7 +245,7 @@ E = UTy->element_end(); I != E; ++I) { OS << ' '; CalcTypeName(*I, TypeStack, OS); - if (next(I) == UTy->element_end()) + if (llvm::next(I) == UTy->element_end()) OS << ' '; else OS << ','; Modified: llvm/trunk/lib/VMCore/Constants.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=110029&r1=110028&r2=110029&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Constants.cpp (original) +++ llvm/trunk/lib/VMCore/Constants.cpp Mon Aug 2 01:00:15 2010 @@ -724,7 +724,7 @@ if (getOpcode() != Instruction::GetElementPtr) return false; gep_type_iterator GEPI = gep_type_begin(this), E = gep_type_end(this); - User::const_op_iterator OI = next(this->op_begin()); + User::const_op_iterator OI = llvm::next(this->op_begin()); // Skip the first index, as it has no static limit. ++GEPI; Modified: llvm/trunk/unittests/VMCore/InstructionsTest.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/VMCore/InstructionsTest.cpp?rev=110029&r1=110028&r2=110029&view=diff ============================================================================== --- llvm/trunk/unittests/VMCore/InstructionsTest.cpp (original) +++ llvm/trunk/unittests/VMCore/InstructionsTest.cpp Mon Aug 2 01:00:15 2010 @@ -59,9 +59,9 @@ EXPECT_EQ(b0->getNumOperands(), 1U); EXPECT_NE(b0->op_begin(), b0->op_end()); - EXPECT_EQ(next(b0->op_begin()), b0->op_end()); + EXPECT_EQ(llvm::next(b0->op_begin()), b0->op_end()); - EXPECT_EQ(next(b0->op_begin()), b0->op_end()); + EXPECT_EQ(llvm::next(b0->op_begin()), b0->op_end()); const IntegerType* Int1 = IntegerType::get(C, 1); Constant* One = ConstantInt::get(Int1, 1, true); From kalle.raiskila at nokia.com Mon Aug 2 03:54:39 2010 From: kalle.raiskila at nokia.com (Kalle Raiskila) Date: Mon, 02 Aug 2010 08:54:39 -0000 Subject: [llvm-commits] [llvm] r110035 - in /llvm/trunk: lib/Target/CellSPU/SPUCallingConv.td lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUInstrInfo.td lib/Target/CellSPU/SPUMathInstr.td test/CodeGen/CellSPU/v2i32.ll Message-ID: <20100802085440.0609D2A6C12C@llvm.org> Author: kraiskil Date: Mon Aug 2 03:54:39 2010 New Revision: 110035 URL: http://llvm.org/viewvc/llvm-project?rev=110035&view=rev Log: Add preliminary v2i32 support for SPU backend. As there are no such registers in SPU, this support boils down to "emulating" them by duplicating instructions on the general purpose registers. This adds the most basic operations on v2i32: passing parameters, addition, subtraction, multiplication and a few others. Added: llvm/trunk/test/CodeGen/CellSPU/v2i32.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td Modified: llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td?rev=110035&r1=110034&r2=110035&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td Mon Aug 2 03:54:39 2010 @@ -37,7 +37,7 @@ //===----------------------------------------------------------------------===// def CCC_SPU : CallingConv<[ CCIfType<[i8, i16, i32, i64, i128, f32, f64, - v16i8, v8i16, v4i32, v4f32, v2i64, v2f64], + v16i8, v8i16, v4i32, v4f32, v2i64, v2f64, v2i32], CCAssignToReg<[R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=110035&r1=110034&r2=110035&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Aug 2 03:54:39 2010 @@ -1067,6 +1067,7 @@ case MVT::v4i32: case MVT::v8i16: case MVT::v16i8: + case MVT::v2i32: ArgRegClass = &SPU::VECREGRegClass; break; } @@ -1622,8 +1623,7 @@ return DAG.getNode(ISD::BUILD_VECTOR, dl, VT, T, T, T, T); } case MVT::v2i32: { - SDValue T = DAG.getConstant(unsigned(SplatBits), VT.getVectorElementType()); - return DAG.getNode(ISD::BUILD_VECTOR, dl, VT, T, T); + return SDValue(); } case MVT::v2i64: { return SPU::LowerV2I64Splat(VT, DAG, SplatBits, dl); @@ -1768,6 +1768,9 @@ } else if (EltVT == MVT::i16) { V2EltIdx0 = 8; maskVT = MVT::v8i16; + } else if (VecVT == MVT::v2i32 || VecVT == MVT::v2f32 ) { + V2EltIdx0 = 2; + maskVT = MVT::v4i32; } else if (EltVT == MVT::i32 || EltVT == MVT::f32) { V2EltIdx0 = 4; maskVT = MVT::v4i32; @@ -1847,6 +1850,15 @@ for (unsigned j = 0; j < BytesPerElement; ++j) ResultMask.push_back(DAG.getConstant(SrcElt*BytesPerElement+j,MVT::i8)); } + // For half vectors padd the mask with zeros for the second half. + // This is needed because mask is assumed to be full vector elsewhere in + // the SPU backend. + if(VecVT == MVT::v2i32 || VecVT == MVT::v2f32) + for( unsigned i = 0; i < 2; ++i ) + { + for (unsigned j = 0; j < BytesPerElement; ++j) + ResultMask.push_back(DAG.getConstant(0,MVT::i8)); + } SDValue VPermMask = DAG.getNode(ISD::BUILD_VECTOR, dl, MVT::v16i8, &ResultMask[0], ResultMask.size()); @@ -1877,6 +1889,7 @@ case MVT::v4f32: n_copies = 4; VT = MVT::f32; break; case MVT::v2i64: n_copies = 2; VT = MVT::i64; break; case MVT::v2f64: n_copies = 2; VT = MVT::f64; break; + case MVT::v2i32: n_copies = 2; VT = MVT::i32; break; } SDValue CValue = DAG.getConstant(CN->getZExtValue(), VT); @@ -1997,7 +2010,7 @@ // Variable index: Rotate the requested element into slot 0, then replicate // slot 0 across the vector EVT VecVT = N.getValueType(); - if (!VecVT.isSimple() || !VecVT.isVector() || !VecVT.is128BitVector()) { + if (!VecVT.isSimple() || !VecVT.isVector()) { report_fatal_error("LowerEXTRACT_VECTOR_ELT: Must have a simple, 128-bit" "vector type!"); } Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td?rev=110035&r1=110034&r2=110035&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td Mon Aug 2 03:54:39 2010 @@ -607,7 +607,7 @@ multiclass AddInstruction { def v4i32: AVecInst; def v16i8: AVecInst; - + def v2i32: AVecInst; def r32: ARegInst; } @@ -672,6 +672,12 @@ "sf\t$rT, $rA, $rB", IntegerOp, [(set (v4i32 VECREG:$rT), (sub (v4i32 VECREG:$rB), (v4i32 VECREG:$rA)))]>; +def SF2vec : RRForm<0b00000010000, (outs VECREG:$rT), + (ins VECREG:$rA, VECREG:$rB), + "sf\t$rT, $rA, $rB", IntegerOp, + [(set (v2i32 VECREG:$rT), (sub (v2i32 VECREG:$rB), (v2i32 VECREG:$rA)))]>; + + def SFr32 : RRForm<0b00000010000, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB), "sf\t$rT, $rA, $rB", IntegerOp, [(set R32C:$rT, (sub R32C:$rB, R32C:$rA))]>; @@ -829,6 +835,10 @@ MPYUInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB), [/* no pattern */]>; +def MPYUv2i32: + MPYUInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB), + [/* no pattern */]>; + def MPYUr16: MPYUInst<(outs R32C:$rT), (ins R16C:$rA, R16C:$rB), [(set R32C:$rT, (mul (zext R16C:$rA), (zext R16C:$rB)))]>; @@ -908,6 +918,10 @@ MPYHInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB), [/* no pattern */]>; +def MPYHv2i32: + MPYHInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB), + [/* no pattern */]>; + def MPYHr32: MPYHInst<(outs R32C:$rT), (ins R32C:$rA, R32C:$rB), [/* no pattern */]>; @@ -1561,6 +1575,9 @@ def : Pat<(v4i32 (SPUprefslot2vec R32C:$rA)), (ORv4i32_i32 R32C:$rA)>; +def : Pat<(v2i32 (SPUprefslot2vec R32C:$rA)), + (ORv4i32_i32 R32C:$rA)>; + def : Pat<(v2i64 (SPUprefslot2vec R64C:$rA)), (ORv2i64_i64 R64C:$rA)>; @@ -1582,6 +1599,9 @@ def : Pat<(SPUvec2prefslot (v4i32 VECREG:$rA)), (ORi32_v4i32 VECREG:$rA)>; +def : Pat<(SPUvec2prefslot (v2i32 VECREG:$rA)), + (ORi32_v4i32 VECREG:$rA)>; + def : Pat<(SPUvec2prefslot (v2i64 VECREG:$rA)), (ORi64_v2i64 VECREG:$rA)>; @@ -2123,6 +2143,8 @@ def v8i16_m32 : SHUFBVecInst; def v4i32 : SHUFBVecInst; def v4i32_m32 : SHUFBVecInst; + def v2i32 : SHUFBVecInst; + def v2i32_m32 : SHUFBVecInst; def v2i64 : SHUFBVecInst; def v2i64_m32 : SHUFBVecInst; Modified: llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td?rev=110035&r1=110034&r2=110035&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td Mon Aug 2 03:54:39 2010 @@ -39,7 +39,7 @@ (FSMBIv8i16 0xcccc))>; //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ -// v4i32, i32 multiply instruction sequence: +// v4i32, v2i32, i32 multiply instruction sequence: //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ def MPYv4i32: @@ -49,6 +49,14 @@ (v4i32 (MPYHv4i32 VECREG:$rB, VECREG:$rA)))), (v4i32 (MPYUv4i32 VECREG:$rA, VECREG:$rB)))>; +def MPYv2i32: + Pat<(mul (v2i32 VECREG:$rA), (v2i32 VECREG:$rB)), + (Av2i32 + (v2i32 (Av2i32 (v2i32 (MPYHv2i32 VECREG:$rA, VECREG:$rB)), + (v2i32 (MPYHv2i32 VECREG:$rB, VECREG:$rA)))), + (v2i32 (MPYUv2i32 VECREG:$rA, VECREG:$rB)))>; + + def MPYi32: Pat<(mul R32C:$rA, R32C:$rB), (Ar32 Added: llvm/trunk/test/CodeGen/CellSPU/v2i32.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/v2i32.ll?rev=110035&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/v2i32.ll (added) +++ llvm/trunk/test/CodeGen/CellSPU/v2i32.ll Mon Aug 2 03:54:39 2010 @@ -0,0 +1,57 @@ +;RUN: llc --march=cellspu %s -o - | FileCheck %s +%vec = type <2 x i32> + +define %vec @test_ret(%vec %param) +{ +;CHECK: bi $lr + ret %vec %param +} + +define %vec @test_add(%vec %param) +{ +;CHECK: a $3, $3, $3 + %1 = add %vec %param, %param +;CHECK: bi $lr + ret %vec %1 +} + +define %vec @test_sub(%vec %param) +{ +;CHECK: sf $3, $4, $3 + %1 = sub %vec %param, + +;CHECK: bi $lr + ret %vec %1 +} + +define %vec @test_mul(%vec %param) +{ +;CHECK: mpyu +;CHECK: mpyh +;CHECK: a +;CHECK: a $3 + %1 = mul %vec %param, %param + +;CHECK: bi $lr + ret %vec %1 +} + +define <2 x i32> @test_splat(i32 %param ) { +;TODO insertelement transforms to a PREFSLOT2VEC, that trasforms to the +; somewhat redundant: +;CHECK-NOT or $3, $3, $3 +;CHECK: lqa +;CHECK: shufb + %sv = insertelement <1 x i32> undef, i32 %param, i32 0 + %rv = shufflevector <1 x i32> %sv, <1 x i32> undef, <2 x i32> zeroinitializer +;CHECK: bi $lr + ret <2 x i32> %rv +} + +define i32 @test_extract() { +;CHECK: shufb $3 + %rv = extractelement <2 x i32> zeroinitializer, i32 undef ; [#uses=1] +;CHECK: bi $lr + ret i32 %rv +} + From resistor at mac.com Mon Aug 2 04:32:13 2010 From: resistor at mac.com (Owen Anderson) Date: Mon, 02 Aug 2010 09:32:13 -0000 Subject: [llvm-commits] [llvm] r110036 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp test/Transforms/InstCombine/bit-checks.ll Message-ID: <20100802093213.E6C5B2A6C12C@llvm.org> Author: resistor Date: Mon Aug 2 04:32:13 2010 New Revision: 110036 URL: http://llvm.org/viewvc/llvm-project?rev=110036&view=rev Log: Re-apply the infamous r108614, with a fix pointed out by Dirk Steinke. Added: llvm/trunk/test/Transforms/InstCombine/bit-checks.ll Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp?rev=110036&r1=110035&r2=110036&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp (original) +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp Mon Aug 2 04:32:13 2010 @@ -472,6 +472,22 @@ Value *NewOr = Builder->CreateOr(Val, Val2); return Builder->CreateICmp(LHSCC, NewOr, LHSCst); } + + // (icmp ne (A & C1), 0) & (icmp ne (A & C2), 0) --> + // (icmp eq (A & (C1|C2)), (C1|C2)) where C1 and C2 are non-zero POT + if (LHSCC == ICmpInst::ICMP_NE && LHSCst->isZero()) { + Value *Op1 = 0, *Op2 = 0; + ConstantInt *CI1 = 0, *CI2 = 0; + if (match(LHS->getOperand(0), m_And(m_Value(Op1), m_ConstantInt(CI1))) && + match(RHS->getOperand(0), m_And(m_Value(Op2), m_ConstantInt(CI2)))) { + if (Op1 == Op2 && !CI1->isZero() && !CI2->isZero() && + CI1->getValue().isPowerOf2() && CI2->getValue().isPowerOf2()) { + Constant *ConstOr = ConstantExpr::getOr(CI1, CI2); + Value *NewAnd = Builder->CreateAnd(Op1, ConstOr); + return Builder->CreateICmp(ICmpInst::ICMP_EQ, NewAnd, ConstOr); + } + } + } } // From here on, we only handle: @@ -1151,11 +1167,28 @@ ConstantInt *RHSCst = dyn_cast(RHS->getOperand(1)); if (LHSCst == 0 || RHSCst == 0) return 0; - // (icmp ne A, 0) | (icmp ne B, 0) --> (icmp ne (A|B), 0) - if (LHSCst == RHSCst && LHSCC == RHSCC && - LHSCC == ICmpInst::ICMP_NE && LHSCst->isZero()) { - Value *NewOr = Builder->CreateOr(Val, Val2); - return Builder->CreateICmp(LHSCC, NewOr, LHSCst); + if (LHSCst == RHSCst && LHSCC == RHSCC) { + // (icmp ne A, 0) | (icmp ne B, 0) --> (icmp ne (A|B), 0) + if (LHSCC == ICmpInst::ICMP_NE && LHSCst->isZero()) { + Value *NewOr = Builder->CreateOr(Val, Val2); + return Builder->CreateICmp(LHSCC, NewOr, LHSCst); + } + + // (icmp eq (A & C1), 0) | (icmp eq (A & C2), 0) --> + // (icmp ne (A & (C1|C2)), (C1|C2)) where C1 and C2 are non-zero POT + if (LHSCC == ICmpInst::ICMP_EQ && LHSCst->isZero()) { + Value *Op1 = 0, *Op2 = 0; + ConstantInt *CI1 = 0, *CI2 = 0; + if (match(LHS->getOperand(0), m_And(m_Value(Op1), m_ConstantInt(CI1))) && + match(RHS->getOperand(0), m_And(m_Value(Op2), m_ConstantInt(CI2)))) { + if (Op1 == Op2 && !CI1->isZero() && !CI2->isZero() && + CI1->getValue().isPowerOf2() && CI2->getValue().isPowerOf2()) { + Constant *ConstOr = ConstantExpr::getOr(CI1, CI2); + Value *NewAnd = Builder->CreateAnd(Op1, ConstOr); + return Builder->CreateICmp(ICmpInst::ICMP_NE, NewAnd, ConstOr); + } + } + } } // From here on, we only handle: Added: llvm/trunk/test/Transforms/InstCombine/bit-checks.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/bit-checks.ll?rev=110036&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/bit-checks.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/bit-checks.ll Mon Aug 2 04:32:13 2010 @@ -0,0 +1,26 @@ +; This test makes sure that these instructions are properly eliminated. +; +; RUN: opt < %s -instcombine -S | \ +; RUN: not grep {tobool} +; END. +define i32 @main(i32 %argc, i8** %argv) nounwind ssp { +entry: + %and = and i32 %argc, 1 ; [#uses=1] + %tobool = icmp ne i32 %and, 0 ; [#uses=1] + %and2 = and i32 %argc, 2 ; [#uses=1] + %tobool3 = icmp ne i32 %and2, 0 ; [#uses=1] + %or.cond = and i1 %tobool, %tobool3 ; [#uses=1] + %retval.0 = select i1 %or.cond, i32 2, i32 1 ; [#uses=1] + ret i32 %retval.0 +} + +define i32 @main2(i32 %argc, i8** nocapture %argv) nounwind readnone ssp { +entry: + %and = and i32 %argc, 1 ; [#uses=1] + %tobool = icmp eq i32 %and, 0 ; [#uses=1] + %and2 = and i32 %argc, 2 ; [#uses=1] + %tobool3 = icmp eq i32 %and2, 0 ; [#uses=1] + %or.cond = or i1 %tobool, %tobool3 ; [#uses=1] + %storemerge = select i1 %or.cond, i32 0, i32 1 ; [#uses=1] + ret i32 %storemerge +} \ No newline at end of file From kalle.raiskila at nokia.com Mon Aug 2 05:25:47 2010 From: kalle.raiskila at nokia.com (Kalle Raiskila) Date: Mon, 02 Aug 2010 10:25:47 -0000 Subject: [llvm-commits] [llvm] r110037 - in /llvm/trunk: lib/Target/CellSPU/SPUCallingConv.td lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUInstrInfo.td lib/Target/CellSPU/SPURegisterInfo.td test/CodeGen/CellSPU/v2f32.ll Message-ID: <20100802102547.480A32A6C12C@llvm.org> Author: kraiskil Date: Mon Aug 2 05:25:47 2010 New Revision: 110037 URL: http://llvm.org/viewvc/llvm-project?rev=110037&view=rev Log: Add preliminary v2f32 support for SPU. Like with v2i32, we just duplicate the instructions and operate on half vectors. Also reorder code in SPUInstrInfo.td for better coherency. Added: llvm/trunk/test/CodeGen/CellSPU/v2f32.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.td Modified: llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td?rev=110037&r1=110036&r2=110037&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUCallingConv.td Mon Aug 2 05:25:47 2010 @@ -28,7 +28,7 @@ CCIfType<[i128], CCAssignToReg<[R3]>>, CCIfType<[f32, f64], CCAssignToReg<[R3]>>, CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToReg<[R3]>>, - CCIfType<[v2i32], CCAssignToReg<[R3]>> + CCIfType<[v2i32, v2f32], CCAssignToReg<[R3]>> ]>; @@ -37,7 +37,7 @@ //===----------------------------------------------------------------------===// def CCC_SPU : CallingConv<[ CCIfType<[i8, i16, i32, i64, i128, f32, f64, - v16i8, v8i16, v4i32, v4f32, v2i64, v2f64, v2i32], + v16i8, v8i16, v4i32, v4f32, v2i64, v2f64, v2i32, v2f32], CCAssignToReg<[R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=110037&r1=110036&r2=110037&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Aug 2 05:25:47 2010 @@ -428,6 +428,7 @@ // "Odd size" vector classes that we're willing to support: addRegisterClass(MVT::v2i32, SPU::VECREGRegisterClass); + addRegisterClass(MVT::v2f32, SPU::VECREGRegisterClass); for (unsigned i = (unsigned)MVT::FIRST_VECTOR_VALUETYPE; i <= (unsigned)MVT::LAST_VECTOR_VALUETYPE; ++i) { @@ -1068,6 +1069,7 @@ case MVT::v8i16: case MVT::v16i8: case MVT::v2i32: + case MVT::v2f32: ArgRegClass = &SPU::VECREGRegClass; break; } Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td?rev=110037&r1=110036&r2=110037&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td Mon Aug 2 05:25:47 2010 @@ -3892,6 +3892,7 @@ multiclass SFPAdd { def v4f32: FAVecInst; + def v2f32: FAVecInst; def f32: FAInst<(outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB), [(set R32FP:$rT, (fadd R32FP:$rA, R32FP:$rB))]>; } @@ -3910,12 +3911,87 @@ multiclass SFPSub { def v4f32: FSVecInst; + def v2f32: FSVecInst; def f32: FSInst<(outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB), [(set R32FP:$rT, (fsub R32FP:$rA, R32FP:$rB))]>; } defm FS : SFPSub; +class FMInst pattern>: + RRForm<0b01100011010, OOL, IOL, + "fm\t$rT, $rA, $rB", SPrecFP, + pattern>; + +class FMVecInst: + FMInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB), + [(set (type VECREG:$rT), + (fmul (type VECREG:$rA), (type VECREG:$rB)))]>; + +multiclass SFPMul +{ + def v4f32: FMVecInst; + def v2f32: FMVecInst; + def f32: FMInst<(outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB), + [(set R32FP:$rT, (fmul R32FP:$rA, R32FP:$rB))]>; +} + +defm FM : SFPMul; + +// Floating point multiply and add +// e.g. d = c + (a * b) +def FMAv4f32: + RRRForm<0b0111, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC), + "fma\t$rT, $rA, $rB, $rC", SPrecFP, + [(set (v4f32 VECREG:$rT), + (fadd (v4f32 VECREG:$rC), + (fmul (v4f32 VECREG:$rA), (v4f32 VECREG:$rB))))]>; + +def FMAf32: + RRRForm<0b0111, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB, R32FP:$rC), + "fma\t$rT, $rA, $rB, $rC", SPrecFP, + [(set R32FP:$rT, (fadd R32FP:$rC, (fmul R32FP:$rA, R32FP:$rB)))]>; + +// FP multiply and subtract +// Subtracts value in rC from product +// res = a * b - c +def FMSv4f32 : + RRRForm<0b0111, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC), + "fms\t$rT, $rA, $rB, $rC", SPrecFP, + [(set (v4f32 VECREG:$rT), + (fsub (fmul (v4f32 VECREG:$rA), (v4f32 VECREG:$rB)), + (v4f32 VECREG:$rC)))]>; + +def FMSf32 : + RRRForm<0b0111, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB, R32FP:$rC), + "fms\t$rT, $rA, $rB, $rC", SPrecFP, + [(set R32FP:$rT, + (fsub (fmul R32FP:$rA, R32FP:$rB), R32FP:$rC))]>; + +// Floating Negative Mulitply and Subtract +// Subtracts product from value in rC +// res = fneg(fms a b c) +// = - (a * b - c) +// = c - a * b +// NOTE: subtraction order +// fsub a b = a - b +// fs a b = b - a? +def FNMSf32 : + RRRForm<0b1101, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB, R32FP:$rC), + "fnms\t$rT, $rA, $rB, $rC", SPrecFP, + [(set R32FP:$rT, (fsub R32FP:$rC, (fmul R32FP:$rA, R32FP:$rB)))]>; + +def FNMSv4f32 : + RRRForm<0b1101, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC), + "fnms\t$rT, $rA, $rB, $rC", SPrecFP, + [(set (v4f32 VECREG:$rT), + (fsub (v4f32 VECREG:$rC), + (fmul (v4f32 VECREG:$rA), + (v4f32 VECREG:$rB))))]>; + + + + // Floating point reciprocal estimate class FRESTInst: @@ -4041,72 +4117,6 @@ // status and control register read //-------------------------------------- -// Floating point multiply instructions -//-------------------------------------- - -def FMv4f32: - RRForm<0b00100011010, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB), - "fm\t$rT, $rA, $rB", SPrecFP, - [(set (v4f32 VECREG:$rT), (fmul (v4f32 VECREG:$rA), - (v4f32 VECREG:$rB)))]>; - -def FMf32 : - RRForm<0b01100011010, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB), - "fm\t$rT, $rA, $rB", SPrecFP, - [(set R32FP:$rT, (fmul R32FP:$rA, R32FP:$rB))]>; - -// Floating point multiply and add -// e.g. d = c + (a * b) -def FMAv4f32: - RRRForm<0b0111, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC), - "fma\t$rT, $rA, $rB, $rC", SPrecFP, - [(set (v4f32 VECREG:$rT), - (fadd (v4f32 VECREG:$rC), - (fmul (v4f32 VECREG:$rA), (v4f32 VECREG:$rB))))]>; - -def FMAf32: - RRRForm<0b0111, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB, R32FP:$rC), - "fma\t$rT, $rA, $rB, $rC", SPrecFP, - [(set R32FP:$rT, (fadd R32FP:$rC, (fmul R32FP:$rA, R32FP:$rB)))]>; - -// FP multiply and subtract -// Subtracts value in rC from product -// res = a * b - c -def FMSv4f32 : - RRRForm<0b0111, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC), - "fms\t$rT, $rA, $rB, $rC", SPrecFP, - [(set (v4f32 VECREG:$rT), - (fsub (fmul (v4f32 VECREG:$rA), (v4f32 VECREG:$rB)), - (v4f32 VECREG:$rC)))]>; - -def FMSf32 : - RRRForm<0b0111, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB, R32FP:$rC), - "fms\t$rT, $rA, $rB, $rC", SPrecFP, - [(set R32FP:$rT, - (fsub (fmul R32FP:$rA, R32FP:$rB), R32FP:$rC))]>; - -// Floating Negative Mulitply and Subtract -// Subtracts product from value in rC -// res = fneg(fms a b c) -// = - (a * b - c) -// = c - a * b -// NOTE: subtraction order -// fsub a b = a - b -// fs a b = b - a? -def FNMSf32 : - RRRForm<0b1101, (outs R32FP:$rT), (ins R32FP:$rA, R32FP:$rB, R32FP:$rC), - "fnms\t$rT, $rA, $rB, $rC", SPrecFP, - [(set R32FP:$rT, (fsub R32FP:$rC, (fmul R32FP:$rA, R32FP:$rB)))]>; - -def FNMSv4f32 : - RRRForm<0b1101, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC), - "fnms\t$rT, $rA, $rB, $rC", SPrecFP, - [(set (v4f32 VECREG:$rT), - (fsub (v4f32 VECREG:$rC), - (fmul (v4f32 VECREG:$rA), - (v4f32 VECREG:$rB))))]>; - -//-------------------------------------- // Floating Point Conversions // Signed conversions: def CSiFv4f32: Modified: llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.td?rev=110037&r1=110036&r2=110037&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.td Mon Aug 2 05:25:47 2010 @@ -394,7 +394,7 @@ // The SPU's registers as vector registers: def VECREG : RegisterClass<"SPU", - [v16i8,v8i16,v2i32,v4i32,v4f32,v2i64,v2f64], + [v16i8,v8i16,v2i32,v2f32,v4i32,v4f32,v2i64,v2f64], 128, [ /* volatile register */ Added: llvm/trunk/test/CodeGen/CellSPU/v2f32.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/v2f32.ll?rev=110037&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/v2f32.ll (added) +++ llvm/trunk/test/CodeGen/CellSPU/v2f32.ll Mon Aug 2 05:25:47 2010 @@ -0,0 +1,35 @@ +;RUN: llc --march=cellspu %s -o - | FileCheck %s +%vec = type <2 x float> + +define %vec @test_ret(%vec %param) +{ +;CHECK: bi $lr + ret %vec %param +} + +define %vec @test_add(%vec %param) +{ +;CHECK: fa $3, $3, $3 + %1 = fadd %vec %param, %param +;CHECK: bi $lr + ret %vec %1 +} + +define %vec @test_sub(%vec %param) +{ +;CHECK: fs $3, $3, $3 + %1 = fsub %vec %param, %param + +;CHECK: bi $lr + ret %vec %1 +} + +define %vec @test_mul(%vec %param) +{ +;CHECK: fm $3, $3, $3 + %1 = fmul %vec %param, %param + +;CHECK: bi $lr + ret %vec %1 +} + From kalle.raiskila at nokia.com Mon Aug 2 06:22:11 2010 From: kalle.raiskila at nokia.com (Kalle Raiskila) Date: Mon, 02 Aug 2010 11:22:11 -0000 Subject: [llvm-commits] [llvm] r110038 - in /llvm/trunk: lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUInstrInfo.td test/CodeGen/CellSPU/v2f32.ll Message-ID: <20100802112211.2B17F2A6C12C@llvm.org> Author: kraiskil Date: Mon Aug 2 06:22:10 2010 New Revision: 110038 URL: http://llvm.org/viewvc/llvm-project?rev=110038&view=rev Log: More SPU v2f32 stuff added: insertelement and shuffle. Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td llvm/trunk/test/CodeGen/CellSPU/v2f32.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=110038&r1=110037&r2=110038&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Aug 2 06:22:10 2010 @@ -1624,6 +1624,7 @@ SDValue T = DAG.getConstant(unsigned(SplatBits), VT.getVectorElementType()); return DAG.getNode(ISD::BUILD_VECTOR, dl, VT, T, T, T, T); } + case MVT::v2f32: case MVT::v2i32: { return SDValue(); } Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td?rev=110038&r1=110037&r2=110038&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td Mon Aug 2 06:22:10 2010 @@ -1584,6 +1584,9 @@ def : Pat<(v4f32 (SPUprefslot2vec R32FP:$rA)), (ORv4f32_f32 R32FP:$rA)>; +def : Pat<(v2f32 (SPUprefslot2vec R32FP:$rA)), + (ORv4f32_f32 R32FP:$rA)>; + def : Pat<(v2f64 (SPUprefslot2vec R64FP:$rA)), (ORv2f64_f64 R64FP:$rA)>; @@ -1608,6 +1611,9 @@ def : Pat<(SPUvec2prefslot (v4f32 VECREG:$rA)), (ORf32_v4f32 VECREG:$rA)>; +def : Pat<(SPUvec2prefslot (v2f32 VECREG:$rA)), + (ORf32_v4f32 VECREG:$rA)>; + def : Pat<(SPUvec2prefslot (v2f64 VECREG:$rA)), (ORf64_v2f64 VECREG:$rA)>; @@ -2150,6 +2156,8 @@ def v4f32 : SHUFBVecInst; def v4f32_m32 : SHUFBVecInst; + def v2f32 : SHUFBVecInst; + def v2f32_m32 : SHUFBVecInst; def v2f64 : SHUFBVecInst; def v2f64_m32 : SHUFBVecInst; Modified: llvm/trunk/test/CodeGen/CellSPU/v2f32.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/v2f32.ll?rev=110038&r1=110037&r2=110038&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/v2f32.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/v2f32.ll Mon Aug 2 06:22:10 2010 @@ -33,3 +33,13 @@ ret %vec %1 } +define %vec @test_splat(float %param ) { +;CHECK: lqa +;CHECK: shufb + %sv = insertelement <1 x float> undef, float %param, i32 0 + %rv = shufflevector <1 x float> %sv, <1 x float> undef, <2 x i32> zeroinitializer +;CHECK: bi $lr + ret %vec %rv +} + + From clattner at apple.com Mon Aug 2 12:11:08 2010 From: clattner at apple.com (Chris Lattner) Date: Mon, 2 Aug 2010 10:11:08 -0700 Subject: [llvm-commits] [llvm] r110035 - in /llvm/trunk: lib/Target/CellSPU/SPUCallingConv.td lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUInstrInfo.td lib/Target/CellSPU/SPUMathInstr.td test/CodeGen/CellSPU/v2i32.ll In-Reply-To: <20100802085440.0609D2A6C12C@llvm.org> References: <20100802085440.0609D2A6C12C@llvm.org> Message-ID: On Aug 2, 2010, at 1:54 AM, Kalle Raiskila wrote: > Author: kraiskil > Date: Mon Aug 2 03:54:39 2010 > New Revision: 110035 > > URL: http://llvm.org/viewvc/llvm-project?rev=110035&view=rev > Log: > Add preliminary v2i32 support for SPU backend. As there are no > such registers in SPU, this support boils down to "emulating" > them by duplicating instructions on the general purpose registers. > > This adds the most basic operations on v2i32: passing parameters, > addition, subtraction, multiplication and a few others. Instead of duplicating instructions like this, it is generally better to teach legalize to convert them to other types. Have you tried this? -Chris From stuart at apple.com Mon Aug 2 12:12:51 2010 From: stuart at apple.com (Stuart Hastings) Date: Mon, 02 Aug 2010 17:12:51 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Message-ID: <20100802171251.D446D2A6C12C@llvm.org> Author: stuart Date: Mon Aug 2 12:12:51 2010 New Revision: 110043 URL: http://llvm.org/viewvc/llvm-project?rev=110043&view=rev Log: Issue error instead of ICE. Radar 8246180. Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=110043&r1=110042&r2=110043&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Mon Aug 2 12:12:51 2010 @@ -2003,7 +2003,17 @@ objc_build_compound_setter_call (tree receiver, tree prop_ident, tree rhs) { tree temp, bind, comma_exp; - if (TREE_SIDE_EFFECTS (rhs)) + /* LLVM LOCAL begin 8246180 */ +#ifdef OBJCPLUS + if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE(rhs))) + error("setting a C++ non-POD object value is not implemented - assign the value to a temporary and use the temporary."); +#endif + if (TREE_SIDE_EFFECTS (rhs) +#ifdef OBJCPLUS + || TYPE_NEEDS_CONSTRUCTING (TREE_TYPE(rhs)) +#endif + /* LLVM LOCAL end 8246180 */ + ) { /* To allow for correct property assignment semantics and in accordance with C99 rules we generate: type temp; @@ -2021,10 +2031,7 @@ { tree type = TREE_TYPE (rhs); if (TYPE_NEEDS_CONSTRUCTING (type)) - { - comma_exp = temp; - error("setting a C++ non-POD object value is not implemented - assign the value to a temporary and use the temporary."); - } + comma_exp = temp; else comma_exp = build_modify_expr (temp, NOP_EXPR, rhs); } From stuart at apple.com Mon Aug 2 12:22:02 2010 From: stuart at apple.com (Stuart Hastings) Date: Mon, 2 Aug 2010 10:22:02 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c In-Reply-To: <20100802171251.D446D2A6C12C@llvm.org> References: <20100802171251.D446D2A6C12C@llvm.org> Message-ID: <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> On Aug 2, 2010, at 10:12 AM, Stuart Hastings wrote: > Author: stuart > Date: Mon Aug 2 12:12:51 2010 > New Revision: 110043 > > URL: http://llvm.org/viewvc/llvm-project?rev=110043&view=rev > Log: > Issue error instead of ICE. Radar 8246180. > > Modified: > llvm-gcc-4.2/trunk/gcc/objc/objc-act.c > > Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=110043&r1=110042&r2=110043&view=diff > ============================================================================== > --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) > +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Mon Aug 2 12:12:51 2010 > @@ -2003,7 +2003,17 @@ > objc_build_compound_setter_call (tree receiver, tree prop_ident, tree rhs) > { > tree temp, bind, comma_exp; > - if (TREE_SIDE_EFFECTS (rhs)) > + /* LLVM LOCAL begin 8246180 */ > +#ifdef OBJCPLUS > + if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE(rhs))) > + error("setting a C++ non-POD object value is not implemented - assign the value to a temporary and use the temporary."); > +#endif > + if (TREE_SIDE_EFFECTS (rhs) > +#ifdef OBJCPLUS > + || TYPE_NEEDS_CONSTRUCTING (TREE_TYPE(rhs)) > +#endif > + /* LLVM LOCAL end 8246180 */ > + ) > { > /* To allow for correct property assignment semantics > and in accordance with C99 rules we generate: type temp; > @@ -2021,10 +2031,7 @@ > { > tree type = TREE_TYPE (rhs); > if (TYPE_NEEDS_CONSTRUCTING (type)) > - { > - comma_exp = temp; > - error("setting a C++ non-POD object value is not implemented - assign the value to a temporary and use the temporary."); > - } > + comma_exp = temp; > else > comma_exp = build_modify_expr (temp, NOP_EXPR, rhs); > } I have a test case for this, but I'm not sure how to mark it for the test suite. The correct behavior for llvm-gcc is to issue the diagnostic (above), but clang should compile it without error (it does). Is there a way for a test case to XFAIL itself only for a particular front-end (e.g. llvm-gcc versus clang) ? Thanks, stuart From dpatel at apple.com Mon Aug 2 12:32:23 2010 From: dpatel at apple.com (Devang Patel) Date: Mon, 2 Aug 2010 10:32:23 -0700 Subject: [llvm-commits] [llvm] r107027 - in /llvm/trunk: lib/CodeGen/AsmPrinter/DwarfDebug.cpp lib/CodeGen/AsmPrinter/DwarfDebug.h test/FrontendC/2010-06-28-DbgLocalVar.c In-Reply-To: <6339CA4A-5120-4E56-91BD-D5ECBCBF0B28@gmail.com> References: <20100628182503.718AC2A6C12C@llvm.org> <6339CA4A-5120-4E56-91BD-D5ECBCBF0B28@gmail.com> Message-ID: On Jul 29, 2010, at 9:51 AM, Benjamin Kramer wrote: > > On 28.06.2010, at 20:25, Devang Patel wrote: > >> Author: dpatel >> Date: Mon Jun 28 13:25:03 2010 >> New Revision: 107027 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=107027&view=rev >> Log: >> Preserve deleted function's local variables' debug info. >> Radar 8122864. >> >> Added: >> llvm/trunk/test/FrontendC/2010-06-28-DbgLocalVar.c >> Modified: >> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp >> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h >> >> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=107027&r1=107026&r2=107027&view=diff >> ============================================================================== >> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) >> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Jun 28 13:25:03 2010 >> @@ -1386,6 +1386,7 @@ >> /// If there are global variables in this scope then create and insert >> /// DIEs for these variables. >> DIE *DwarfDebug::updateSubprogramScopeDIE(const MDNode *SPNode) { >> + ProcessedSPNodes.insert(SPNode); >> CompileUnit *SPCU = getCompileUnit(SPNode); >> DIE *SPDie = SPCU->getDIE(SPNode); >> assert(SPDie && "Unable to find subprogram DIE!"); >> @@ -2005,6 +2006,40 @@ >> /// >> void DwarfDebug::endModule() { >> if (!FirstCU) return; >> + const Module *M = MMI->getModule(); >> + if (NamedMDNode *AllSPs = M->getNamedMetadata("llvm.dbg.sp")) { >> + for (unsigned SI = 0, SE = AllSPs->getNumOperands(); SI != SE; ++SI) { >> + if (ProcessedSPNodes.count(AllSPs->getOperand(SI)) != 0) continue; >> + DISubprogram SP(AllSPs->getOperand(SI)); >> + if (!SP.Verify()) continue; >> + >> + // Collect info for variables that were optimized out. >> + StringRef FName = SP.getLinkageName(); >> + if (FName.empty()) >> + FName = SP.getName(); >> + NamedMDNode *NMD = >> + M->getNamedMetadata(Twine("llvm.dbg.lv.", getRealLinkageName(FName))); >> + if (!NMD) continue; >> + unsigned E = NMD->getNumOperands(); >> + if (!E) continue; >> + DbgScope *Scope = new DbgScope(NULL, DIDescriptor(SP), NULL); > > Hi Devang, > > valgrind says those DbgScopes are leaked: Indeed. Fixed. - Devang -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100802/10cd8e50/attachment.html From dpatel at apple.com Mon Aug 2 12:32:15 2010 From: dpatel at apple.com (Devang Patel) Date: Mon, 02 Aug 2010 17:32:15 -0000 Subject: [llvm-commits] [llvm] r110045 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Message-ID: <20100802173215.D809B2A6C12C@llvm.org> Author: dpatel Date: Mon Aug 2 12:32:15 2010 New Revision: 110045 URL: http://llvm.org/viewvc/llvm-project?rev=110045&view=rev Log: Free DbgScope created for dead functions. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=110045&r1=110044&r2=110045&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Aug 2 12:32:15 2010 @@ -2032,6 +2032,7 @@ void DwarfDebug::endModule() { if (!FirstCU) return; const Module *M = MMI->getModule(); + DenseMap DeadFnScopeMap; if (NamedMDNode *AllSPs = M->getNamedMetadata("llvm.dbg.sp")) { for (unsigned SI = 0, SE = AllSPs->getNumOperands(); SI != SE; ++SI) { if (ProcessedSPNodes.count(AllSPs->getOperand(SI)) != 0) continue; @@ -2049,6 +2050,7 @@ unsigned E = NMD->getNumOperands(); if (!E) continue; DbgScope *Scope = new DbgScope(NULL, DIDescriptor(SP), NULL); + DeadFnScopeMap[SP] = Scope; for (unsigned I = 0; I != E; ++I) { DIVariable DV(NMD->getOperand(I)); if (!DV.Verify()) continue; @@ -2140,6 +2142,8 @@ // Emit info into a debug str section. emitDebugStr(); + // clean up. + DeleteContainerSeconds(DeadFnScopeMap); for (DenseMap::iterator I = CUMap.begin(), E = CUMap.end(); I != E; ++I) delete I->second; From ofv at wanadoo.es Mon Aug 2 13:36:53 2010 From: ofv at wanadoo.es (Oscar Fuentes) Date: Mon, 02 Aug 2010 18:36:53 -0000 Subject: [llvm-commits] [llvm] r110055 - /llvm/trunk/cmake/modules/LLVMLibDeps.cmake Message-ID: <20100802183653.EBFB52A6C12C@llvm.org> Author: ofv Date: Mon Aug 2 13:36:53 2010 New Revision: 110055 URL: http://llvm.org/viewvc/llvm-project?rev=110055&view=rev Log: Updated LLVMLibDeps.cmake. Modified: llvm/trunk/cmake/modules/LLVMLibDeps.cmake Modified: llvm/trunk/cmake/modules/LLVMLibDeps.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMLibDeps.cmake?rev=110055&r1=110054&r2=110055&view=diff ============================================================================== --- llvm/trunk/cmake/modules/LLVMLibDeps.cmake (original) +++ llvm/trunk/cmake/modules/LLVMLibDeps.cmake Mon Aug 2 13:36:53 2010 @@ -23,7 +23,6 @@ set(MSVC_LIB_DEPS_LLVMCore LLVMSupport LLVMSystem) set(MSVC_LIB_DEPS_LLVMCppBackend LLVMCore LLVMCppBackendInfo LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMCppBackendInfo LLVMSupport) -set(MSVC_LIB_DEPS_LLVMDebugger LLVMBitReader LLVMCore LLVMSupport LLVMSystem) set(MSVC_LIB_DEPS_LLVMExecutionEngine LLVMCore LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMInstCombine LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils) set(MSVC_LIB_DEPS_LLVMInstrumentation LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTransformUtils) From gohman at apple.com Mon Aug 2 13:50:07 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 02 Aug 2010 18:50:07 -0000 Subject: [llvm-commits] [llvm] r110056 - in /llvm/trunk/lib/Analysis: RegionInfo.cpp RegionPrinter.cpp Message-ID: <20100802185007.136662A6C12C@llvm.org> Author: djg Date: Mon Aug 2 13:50:06 2010 New Revision: 110056 URL: http://llvm.org/viewvc/llvm-project?rev=110056&view=rev Log: Fix namespace polution. Modified: llvm/trunk/lib/Analysis/RegionInfo.cpp llvm/trunk/lib/Analysis/RegionPrinter.cpp Modified: llvm/trunk/lib/Analysis/RegionInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionInfo.cpp?rev=110056&r1=110055&r2=110056&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/RegionInfo.cpp (original) +++ llvm/trunk/lib/Analysis/RegionInfo.cpp Mon Aug 2 13:50:06 2010 @@ -29,9 +29,9 @@ // Always verify if expensive checking is enabled. #ifdef XDEBUG -bool VerifyRegionInfo = true; +static bool VerifyRegionInfo = true; #else -bool VerifyRegionInfo = false; +static bool VerifyRegionInfo = false; #endif static cl::opt Modified: llvm/trunk/lib/Analysis/RegionPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionPrinter.cpp?rev=110056&r1=110055&r2=110056&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/RegionPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/RegionPrinter.cpp Mon Aug 2 13:50:06 2010 @@ -151,6 +151,8 @@ INITIALIZE_PASS(RegionPrinter, "dot-regions", "Print regions of function to 'dot' file", true, true); +namespace { + struct RegionOnlyPrinter : public DOTGraphTraitsPrinter { static char ID; @@ -158,6 +160,8 @@ DOTGraphTraitsPrinter("reg", &ID) {} }; +} + char RegionOnlyPrinter::ID = 0; INITIALIZE_PASS(RegionOnlyPrinter, "dot-regions-only", "Print regions of function to 'dot' file " From echristo at apple.com Mon Aug 2 13:49:16 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 2 Aug 2010 11:49:16 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c In-Reply-To: <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> References: <20100802171251.D446D2A6C12C@llvm.org> <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> Message-ID: > > > I have a test case for this, but I'm not sure how to mark it for the test suite. The correct behavior for llvm-gcc is to issue the diagnostic (above), but clang should compile it without error (it does). > > Is there a way for a test case to XFAIL itself only for a particular front-end (e.g. llvm-gcc versus clang) ? #if __clang__ ? -eric From ofv at wanadoo.es Mon Aug 2 14:00:34 2010 From: ofv at wanadoo.es (Oscar Fuentes) Date: Mon, 02 Aug 2010 19:00:34 -0000 Subject: [llvm-commits] [llvm] r110057 - /llvm/trunk/CMakeLists.txt Message-ID: <20100802190034.C33AB2A6C12C@llvm.org> Author: ofv Date: Mon Aug 2 14:00:34 2010 New Revision: 110057 URL: http://llvm.org/viewvc/llvm-project?rev=110057&view=rev Log: Lets the CMake GUI show a list of possible values for LLVM_USE_CRT Patch by nobled! Modified: llvm/trunk/CMakeLists.txt Modified: llvm/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=110057&r1=110056&r2=110057&view=diff ============================================================================== --- llvm/trunk/CMakeLists.txt (original) +++ llvm/trunk/CMakeLists.txt Mon Aug 2 14:00:34 2010 @@ -222,6 +222,9 @@ MTd) set(LLVM_USE_CRT "" CACHE STRING "Specify VC++ CRT to use for debug/release configurations.") + # Lets the GUI show a drop-down list of possible values, including + # an empty string as the default: + set_property(CACHE LLVM_USE_CRT PROPERTY STRINGS "";${MSVC_CRT}) add_llvm_definitions( -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS ) add_llvm_definitions( -D_SCL_SECURE_NO_WARNINGS -DCRT_NONSTDC_NO_WARNINGS ) add_llvm_definitions( -D_SCL_SECURE_NO_DEPRECATE ) From stuart at apple.com Mon Aug 2 14:28:04 2010 From: stuart at apple.com (Stuart Hastings) Date: Mon, 2 Aug 2010 12:28:04 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c In-Reply-To: References: <20100802171251.D446D2A6C12C@llvm.org> <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> Message-ID: <7CC17A93-795A-40D2-8E08-B4D1AFEF26A8@apple.com> On Aug 2, 2010, at 11:49 AM, Eric Christopher wrote: >> >> >> I have a test case for this, but I'm not sure how to mark it for the test suite. The correct behavior for llvm-gcc is to issue the diagnostic (above), but clang should compile it without error (it does). >> >> Is there a way for a test case to XFAIL itself only for a particular front-end (e.g. llvm-gcc versus clang) ? > > #if __clang__ ? > > -eric Hrm. Well, I guess I could make the test break itself when compiled with clang. You're suggesting #if __clang__ BOGUS XLERB HERE; #endif ? However, it wont' be the same diagnostic as llvm-gcc, so I can't have the test check for the (llvm-gcc only) diagnostic I want. (Perhaps I mis-insterpreted your suggestion?) Thank you, stuart From echristo at apple.com Mon Aug 2 15:13:08 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 2 Aug 2010 13:13:08 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c In-Reply-To: <7CC17A93-795A-40D2-8E08-B4D1AFEF26A8@apple.com> References: <20100802171251.D446D2A6C12C@llvm.org> <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> <7CC17A93-795A-40D2-8E08-B4D1AFEF26A8@apple.com> Message-ID: <9340F438-AB28-4030-BF1F-035B2CF4662E@apple.com> On Aug 2, 2010, at 12:28 PM, Stuart Hastings wrote: > > On Aug 2, 2010, at 11:49 AM, Eric Christopher wrote: > >>> >>> >>> I have a test case for this, but I'm not sure how to mark it for the test suite. The correct behavior for llvm-gcc is to issue the diagnostic (above), but clang should compile it without error (it does). >>> >>> Is there a way for a test case to XFAIL itself only for a particular front-end (e.g. llvm-gcc versus clang) ? >> >> #if __clang__ ? >> >> -eric > > Hrm. Well, I guess I could make the test break itself when compiled with clang. You're suggesting > > #if __clang__ > BOGUS XLERB HERE; > #endif > > ? > > However, it wont' be the same diagnostic as llvm-gcc, so I can't have the test check for the (llvm-gcc only) diagnostic I want. > > (Perhaps I mis-insterpreted your suggestion?) // dg-compile #if __clang__ test #else same test but checks for { dg-error ... } #endif is what I was meaning. -eric From ofv at wanadoo.es Mon Aug 2 15:48:01 2010 From: ofv at wanadoo.es (Oscar Fuentes) Date: Mon, 02 Aug 2010 20:48:01 -0000 Subject: [llvm-commits] [llvm] r110060 - /llvm/trunk/cmake/modules/LLVMConfig.cmake Message-ID: <20100802204801.CE6062A6C12C@llvm.org> Author: ofv Date: Mon Aug 2 15:48:01 2010 New Revision: 110060 URL: http://llvm.org/viewvc/llvm-project?rev=110060&view=rev Log: explicit_map_components_to_libraries now does not complain when there is a dependence on an LLVM target that is not included on the build. When LLVM_TARGETS_TO_BUILD didn't include all the targets, the function emitted an error like "Library LLVMArmParser not found in list of llvm libraries." Modified: llvm/trunk/cmake/modules/LLVMConfig.cmake Modified: llvm/trunk/cmake/modules/LLVMConfig.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMConfig.cmake?rev=110060&r1=110059&r2=110060&view=diff ============================================================================== --- llvm/trunk/cmake/modules/LLVMConfig.cmake (original) +++ llvm/trunk/cmake/modules/LLVMConfig.cmake Mon Aug 2 15:48:01 2010 @@ -16,6 +16,24 @@ endfunction(get_system_libs) +function(is_llvm_target_library library return_var) + # Sets variable `return_var' to ON if `library' corresponds to a + # LLVM supported target. To OFF if it doesn't. + set(${return_var} OFF PARENT_SCOPE) + string(TOUPPER "${library}" capitalized_lib) + string(TOUPPER "${LLVM_ALL_TARGETS}" targets) + foreach(t ${targets}) + if( capitalized_lib STREQUAL "LLVM${t}CODEGEN" OR + capitalized_lib STREQUAL "LLVM${t}ASMPARSER" OR + capitalized_lib STREQUAL "LLVM${t}DISASSEMBLER" OR + capitalized_lib STREQUAL "LLVM${t}INFO" ) + set(${return_var} ON PARENT_SCOPE) + break() + endif() + endforeach() +endfunction(is_llvm_target_library) + + macro(llvm_config executable) explicit_llvm_config(${executable} ${ARGN}) endmacro(llvm_config) @@ -87,7 +105,13 @@ string(TOUPPER "${c}" capitalized) list(FIND capitalized_libs ${capitalized} idx) if( idx LESS 0 ) - message(FATAL_ERROR "Library ${c} not found in list of llvm libraries.") + # The library is unkown. Maybe is an ommitted target? + is_llvm_target_library(${c} iltl_result) + if( iltl_result ) + break() + else() + message(FATAL_ERROR "Library ${c} not found in list of llvm libraries.") + endif() endif( idx LESS 0 ) list(GET llvm_libs ${idx} canonical_lib) list(REMOVE_ITEM result ${canonical_lib}) From ofv at wanadoo.es Mon Aug 2 16:10:45 2010 From: ofv at wanadoo.es (Oscar Fuentes) Date: Mon, 02 Aug 2010 23:10:45 +0200 Subject: [llvm-commits] [llvm] r110060 - /llvm/trunk/cmake/modules/LLVMConfig.cmake In-Reply-To: <93BA7591-BA11-418B-8966-059435143DD2@apple.com> (Tom Care's message of "Mon, 2 Aug 2010 14:07:58 -0700") References: <20100802204801.CE6062A6C12C@llvm.org> <93BA7591-BA11-418B-8966-059435143DD2@apple.com> Message-ID: <87eiegbu0a.fsf@telefonica.net> Tom Care writes: > Thanks Oscar :) Hold on. The fix is not correct. From dirty at apple.com Mon Aug 2 16:18:12 2010 From: dirty at apple.com (Cameron Esfahani) Date: Mon, 2 Aug 2010 14:18:12 -0700 Subject: [llvm-commits] COFF patch In-Reply-To: References: Message-ID: <251EC26C-1362-458A-93DC-7512D8AC5939@apple.com> On Jul 31, 2010, at 1:02 AM, Michael Spencer wrote: > On Thu, Jul 29, 2010 at 7:56 PM, Cameron Esfahani wrote: >> My first patch, so please be gentle... >> >> This fixes a problem I was seeing with the COFF back end. All of the string data was getting put into one data fragment, and so none of the fixup references were correct. > > Can you post a test case so I can take a look? I'm not quite sure what > the problem is. But I know this isn't the best way to fix the problem. > Here's a reproducible case: http://pastebin.com/NCActA1d Build it with: clang -ccc-host-triple i686-pc-win32 -c -integrated-as -o HelloWorld.o HelloWorld.c. If you dump HelloWorld.o, you'll see that the symbol table entries for L_.str2, L_.str1 and L_.str have values of 0. Enclosed is, what I believe to be, a better fix for this problem. Instead of allocating a new data fragment for each new label, just make sure to account for the symbol's offset within the fragment when creating the symbol table value. This patch is based on revision 110062. I also noticed that the comment for Code in MCInstFragment was incorrect. I attempted to fix it, but it's probably horribly wrong... >> I also made sure the TimeDateStamp in the COFF header had a correct value. > > This is right. > >> I also fixed a spot in MCFragment where Offset wasn't being properly initialized. >> >> This patch was generated against revision 109821. > > Also, was this change required to get it to work? The SymbolTableIndex > should be set down on line 674. > > @@ -578,12 +580,13 @@ void WinCOFFObjectWriter::RecordRelocation(const > MCAssembler &Asm, > FixedValue = Target.getConstant(); > > COFFRelocation Reloc; > > Reloc.Data.VirtualAddress = Layout.getFragmentOffset(Fragment); > Reloc.Symb = coff_symbol; > + Reloc.Data.SymbolTableIndex = 0; > > Reloc.Data.VirtualAddress += Fixup.getOffset(); > > switch (Fixup.getKind()) { > case FirstTargetFixupKind: // reloc_pcrel_4byte > Reloc.Data.Type = COFF::IMAGE_REL_I386_REL32; > > - Michael Spencer The Reloc.Data.SymbolTableIndex = 0 line was required because of this warning: /usr/include/c++/4.2.1/ext/new_allocator.h: In member function ?virtual void::WinCOFFObjectWriter::RecordRelocation(const llvm::MCAssembler&, const llvm::MCAsmLayout&, const llvm::MCFragment*, const llvm::MCFixup&, llvm::MCValue, uint64_t&)?: /usr/include/c++/4.2.1/ext/new_allocator.h:107: warning: ?Reloc.::COFFRelocation::Data.llvm::COFF::relocation::SymbolTableIndex? is used uninitialized in this function WinCOFFObjectWriter.cpp:582: note: ?Reloc.::COFFRelocation::Data.llvm::COFF::relocation::SymbolTableIndex? was declared here -------------- next part -------------- A non-text attachment was scrubbed... Name: COFFfragment2.patch Type: application/octet-stream Size: 2529 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100802/2347c510/attachment.obj -------------- next part -------------- Cameron Esfahani dirty at apple.com "You only live once, and the way I live, once is enough" Frank Sinatra From ofv at wanadoo.es Mon Aug 2 16:24:12 2010 From: ofv at wanadoo.es (Oscar Fuentes) Date: Mon, 02 Aug 2010 21:24:12 -0000 Subject: [llvm-commits] [llvm] r110065 - /llvm/trunk/cmake/modules/LLVMConfig.cmake Message-ID: <20100802212412.F03542A6C12C@llvm.org> Author: ofv Date: Mon Aug 2 16:24:12 2010 New Revision: 110065 URL: http://llvm.org/viewvc/llvm-project?rev=110065&view=rev Log: Improve discrimination of unknown libraries from ignored targets on LLVMConfig. Modified: llvm/trunk/cmake/modules/LLVMConfig.cmake Modified: llvm/trunk/cmake/modules/LLVMConfig.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMConfig.cmake?rev=110065&r1=110064&r2=110065&view=diff ============================================================================== --- llvm/trunk/cmake/modules/LLVMConfig.cmake (original) +++ llvm/trunk/cmake/modules/LLVMConfig.cmake Mon Aug 2 16:24:12 2010 @@ -23,8 +23,10 @@ string(TOUPPER "${library}" capitalized_lib) string(TOUPPER "${LLVM_ALL_TARGETS}" targets) foreach(t ${targets}) - if( capitalized_lib STREQUAL "LLVM${t}CODEGEN" OR + if( capitalized_lib STREQUAL "LLVM${t}" OR + capitalized_lib STREQUAL "LLVM${t}CODEGEN" OR capitalized_lib STREQUAL "LLVM${t}ASMPARSER" OR + capitalized_lib STREQUAL "LLVM${t}ASMPRINTER" OR capitalized_lib STREQUAL "LLVM${t}DISASSEMBLER" OR capitalized_lib STREQUAL "LLVM${t}INFO" ) set(${return_var} ON PARENT_SCOPE) @@ -104,22 +106,24 @@ list(GET expanded_components 0 c) string(TOUPPER "${c}" capitalized) list(FIND capitalized_libs ${capitalized} idx) + set(add_it ON) if( idx LESS 0 ) # The library is unkown. Maybe is an ommitted target? is_llvm_target_library(${c} iltl_result) - if( iltl_result ) - break() - else() + if( NOT iltl_result ) message(FATAL_ERROR "Library ${c} not found in list of llvm libraries.") endif() + set(add_it OFF) endif( idx LESS 0 ) list(GET llvm_libs ${idx} canonical_lib) list(REMOVE_ITEM result ${canonical_lib}) - list(APPEND result ${canonical_lib}) foreach(c ${MSVC_LIB_DEPS_${canonical_lib}}) list(REMOVE_ITEM expanded_components ${c}) endforeach() - list(APPEND expanded_components ${MSVC_LIB_DEPS_${canonical_lib}}) + if( add_it ) + list(APPEND result ${canonical_lib}) + list(APPEND expanded_components ${MSVC_LIB_DEPS_${canonical_lib}}) + endif() list(REMOVE_AT expanded_components 0) list(LENGTH expanded_components lst_size) endwhile( 0 LESS ${lst_size} ) From isanbard at gmail.com Mon Aug 2 17:06:08 2010 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 02 Aug 2010 22:06:08 -0000 Subject: [llvm-commits] [llvm] r110069 - /llvm/trunk/lib/CodeGen/OptimizeExts.cpp Message-ID: <20100802220608.5E32B2A6C12C@llvm.org> Author: void Date: Mon Aug 2 17:06:08 2010 New Revision: 110069 URL: http://llvm.org/viewvc/llvm-project?rev=110069&view=rev Log: Early exit and reduce indentation. No functionality change. Modified: llvm/trunk/lib/CodeGen/OptimizeExts.cpp Modified: llvm/trunk/lib/CodeGen/OptimizeExts.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizeExts.cpp?rev=110069&r1=110068&r2=110069&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/OptimizeExts.cpp (original) +++ llvm/trunk/lib/CodeGen/OptimizeExts.cpp Mon Aug 2 17:06:08 2010 @@ -78,119 +78,120 @@ /// ignore all debug uses. bool OptimizeExts::OptimizeInstr(MachineInstr *MI, MachineBasicBlock *MBB, SmallPtrSet &LocalMIs) { - bool Changed = false; LocalMIs.insert(MI); unsigned SrcReg, DstReg, SubIdx; - if (TII->isCoalescableExtInstr(*MI, SrcReg, DstReg, SubIdx)) { - if (TargetRegisterInfo::isPhysicalRegister(DstReg) || - TargetRegisterInfo::isPhysicalRegister(SrcReg)) - return false; - - MachineRegisterInfo::use_nodbg_iterator UI = MRI->use_nodbg_begin(SrcReg); - if (++UI == MRI->use_nodbg_end()) - // No other uses. - return false; - - // Ok, the source has other uses. See if we can replace the other uses - // with use of the result of the extension. - SmallPtrSet ReachedBBs; - UI = MRI->use_nodbg_begin(DstReg); - for (MachineRegisterInfo::use_nodbg_iterator UE = MRI->use_nodbg_end(); - UI != UE; ++UI) - ReachedBBs.insert(UI->getParent()); - - bool ExtendLife = true; - // Uses that are in the same BB of uses of the result of the instruction. - SmallVector Uses; - // Uses that the result of the instruction can reach. - SmallVector ExtendedUses; + if (!TII->isCoalescableExtInstr(*MI, SrcReg, DstReg, SubIdx)) + return false; - UI = MRI->use_nodbg_begin(SrcReg); - for (MachineRegisterInfo::use_nodbg_iterator UE = MRI->use_nodbg_end(); - UI != UE; ++UI) { - MachineOperand &UseMO = UI.getOperand(); - MachineInstr *UseMI = &*UI; - if (UseMI == MI) - continue; - if (UseMI->isPHI()) { - ExtendLife = false; - continue; - } - - // It's an error to translate this: - // - // %reg1025 = %reg1024 - // ... - // %reg1026 = SUBREG_TO_REG 0, %reg1024, 4 - // - // into this: - // - // %reg1025 = %reg1024 - // ... - // %reg1027 = COPY %reg1025:4 - // %reg1026 = SUBREG_TO_REG 0, %reg1027, 4 - // - // The problem here is that SUBREG_TO_REG is there to assert that an - // implicit zext occurs. It doesn't insert a zext instruction. If we allow - // the COPY here, it will give us the value after the , - // not the original value of %reg1024 before . - if (UseMI->getOpcode() == TargetOpcode::SUBREG_TO_REG) - continue; + if (TargetRegisterInfo::isPhysicalRegister(DstReg) || + TargetRegisterInfo::isPhysicalRegister(SrcReg)) + return false; + + MachineRegisterInfo::use_nodbg_iterator UI = MRI->use_nodbg_begin(SrcReg); + if (++UI == MRI->use_nodbg_end()) + // No other uses. + return false; + + // Ok, the source has other uses. See if we can replace the other uses + // with use of the result of the extension. + SmallPtrSet ReachedBBs; + UI = MRI->use_nodbg_begin(DstReg); + for (MachineRegisterInfo::use_nodbg_iterator UE = MRI->use_nodbg_end(); + UI != UE; ++UI) + ReachedBBs.insert(UI->getParent()); + + bool ExtendLife = true; + // Uses that are in the same BB of uses of the result of the instruction. + SmallVector Uses; + // Uses that the result of the instruction can reach. + SmallVector ExtendedUses; + + UI = MRI->use_nodbg_begin(SrcReg); + for (MachineRegisterInfo::use_nodbg_iterator UE = MRI->use_nodbg_end(); + UI != UE; ++UI) { + MachineOperand &UseMO = UI.getOperand(); + MachineInstr *UseMI = &*UI; + if (UseMI == MI) + continue; + if (UseMI->isPHI()) { + ExtendLife = false; + continue; + } - MachineBasicBlock *UseMBB = UseMI->getParent(); - if (UseMBB == MBB) { - // Local uses that come after the extension. - if (!LocalMIs.count(UseMI)) - Uses.push_back(&UseMO); - } else if (ReachedBBs.count(UseMBB)) - // Non-local uses where the result of extension is used. Always - // replace these unless it's a PHI. + // It's an error to translate this: + // + // %reg1025 = %reg1024 + // ... + // %reg1026 = SUBREG_TO_REG 0, %reg1024, 4 + // + // into this: + // + // %reg1025 = %reg1024 + // ... + // %reg1027 = COPY %reg1025:4 + // %reg1026 = SUBREG_TO_REG 0, %reg1027, 4 + // + // The problem here is that SUBREG_TO_REG is there to assert that an + // implicit zext occurs. It doesn't insert a zext instruction. If we allow + // the COPY here, it will give us the value after the , not the + // original value of %reg1024 before . + if (UseMI->getOpcode() == TargetOpcode::SUBREG_TO_REG) + continue; + + MachineBasicBlock *UseMBB = UseMI->getParent(); + if (UseMBB == MBB) { + // Local uses that come after the extension. + if (!LocalMIs.count(UseMI)) Uses.push_back(&UseMO); - else if (Aggressive && DT->dominates(MBB, UseMBB)) - // We may want to extend live range of the extension result in order - // to replace these uses. - ExtendedUses.push_back(&UseMO); - else { - // Both will be live out of the def MBB anyway. Don't extend live - // range of the extension result. - ExtendLife = false; - break; - } + } else if (ReachedBBs.count(UseMBB)) + // Non-local uses where the result of extension is used. Always replace + // these unless it's a PHI. + Uses.push_back(&UseMO); + else if (Aggressive && DT->dominates(MBB, UseMBB)) + // We may want to extend live range of the extension result in order to + // replace these uses. + ExtendedUses.push_back(&UseMO); + else { + // Both will be live out of the def MBB anyway. Don't extend live range of + // the extension result. + ExtendLife = false; + break; } + } + + if (ExtendLife && !ExtendedUses.empty()) + // Ok, we'll extend the liveness of the extension result. + std::copy(ExtendedUses.begin(), ExtendedUses.end(), + std::back_inserter(Uses)); + + // Now replace all uses. + bool Changed = false; + if (!Uses.empty()) { + SmallPtrSet PHIBBs; + // Look for PHI uses of the extended result, we don't want to extend the + // liveness of a PHI input. It breaks all kinds of assumptions down + // stream. A PHI use is expected to be the kill of its source values. + UI = MRI->use_nodbg_begin(DstReg); + for (MachineRegisterInfo::use_nodbg_iterator UE = MRI->use_nodbg_end(); + UI != UE; ++UI) + if (UI->isPHI()) + PHIBBs.insert(UI->getParent()); - if (ExtendLife && !ExtendedUses.empty()) - // Ok, we'll extend the liveness of the extension result. - std::copy(ExtendedUses.begin(), ExtendedUses.end(), - std::back_inserter(Uses)); - - // Now replace all uses. - if (!Uses.empty()) { - SmallPtrSet PHIBBs; - // Look for PHI uses of the extended result, we don't want to extend the - // liveness of a PHI input. It breaks all kinds of assumptions down - // stream. A PHI use is expected to be the kill of its source values. - UI = MRI->use_nodbg_begin(DstReg); - for (MachineRegisterInfo::use_nodbg_iterator UE = MRI->use_nodbg_end(); - UI != UE; ++UI) - if (UI->isPHI()) - PHIBBs.insert(UI->getParent()); - - const TargetRegisterClass *RC = MRI->getRegClass(SrcReg); - for (unsigned i = 0, e = Uses.size(); i != e; ++i) { - MachineOperand *UseMO = Uses[i]; - MachineInstr *UseMI = UseMO->getParent(); - MachineBasicBlock *UseMBB = UseMI->getParent(); - if (PHIBBs.count(UseMBB)) - continue; - unsigned NewVR = MRI->createVirtualRegister(RC); - BuildMI(*UseMBB, UseMI, UseMI->getDebugLoc(), - TII->get(TargetOpcode::COPY), NewVR) - .addReg(DstReg, 0, SubIdx); - UseMO->setReg(NewVR); - ++NumReuse; - Changed = true; - } + const TargetRegisterClass *RC = MRI->getRegClass(SrcReg); + for (unsigned i = 0, e = Uses.size(); i != e; ++i) { + MachineOperand *UseMO = Uses[i]; + MachineInstr *UseMI = UseMO->getParent(); + MachineBasicBlock *UseMBB = UseMI->getParent(); + if (PHIBBs.count(UseMBB)) + continue; + unsigned NewVR = MRI->createVirtualRegister(RC); + BuildMI(*UseMBB, UseMI, UseMI->getDebugLoc(), + TII->get(TargetOpcode::COPY), NewVR) + .addReg(DstReg, 0, SubIdx); + UseMO->setReg(NewVR); + ++NumReuse; + Changed = true; } } From stuart at apple.com Mon Aug 2 17:09:53 2010 From: stuart at apple.com (Stuart Hastings) Date: Mon, 02 Aug 2010 22:09:53 -0000 Subject: [llvm-commits] [llvm] r110070 - /llvm/trunk/test/FrontendObjC++/2010-08-02-NonPODObjectValue.mm Message-ID: <20100802220953.B62EF2A6C12C@llvm.org> Author: stuart Date: Mon Aug 2 17:09:53 2010 New Revision: 110070 URL: http://llvm.org/viewvc/llvm-project?rev=110070&view=rev Log: Testcase for r110043. Radar 8246180. Added: llvm/trunk/test/FrontendObjC++/2010-08-02-NonPODObjectValue.mm Added: llvm/trunk/test/FrontendObjC++/2010-08-02-NonPODObjectValue.mm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC%2B%2B/2010-08-02-NonPODObjectValue.mm?rev=110070&view=auto ============================================================================== --- llvm/trunk/test/FrontendObjC++/2010-08-02-NonPODObjectValue.mm (added) +++ llvm/trunk/test/FrontendObjC++/2010-08-02-NonPODObjectValue.mm Mon Aug 2 17:09:53 2010 @@ -0,0 +1,24 @@ +// RUN: not %llvmgcc %s -S -emit-llvm -o - |& FileCheck %s +// This tests for a specific diagnostic in LLVM-GCC. +// Clang compiles this correctly with no diagnostic, +// ergo this test will fail with a Clang-based front-end. +class TFENodeVector { +public: + TFENodeVector(const TFENodeVector& inNodeVector); + TFENodeVector(); +}; + + at interface TWindowHistoryEntry {} + at property (assign, nonatomic) TFENodeVector targetPath; + at end + + at implementation TWindowHistoryEntry + at synthesize targetPath; +- (void) initWithWindowController { + TWindowHistoryEntry* entry; + TFENodeVector newPath; + // CHECK: setting a C++ non-POD object value is not implemented + entry.targetPath = newPath; + [entry setTargetPath:newPath]; +} + at end From stuart at apple.com Mon Aug 2 17:12:31 2010 From: stuart at apple.com (Stuart Hastings) Date: Mon, 2 Aug 2010 15:12:31 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c In-Reply-To: <9340F438-AB28-4030-BF1F-035B2CF4662E@apple.com> References: <20100802171251.D446D2A6C12C@llvm.org> <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> <7CC17A93-795A-40D2-8E08-B4D1AFEF26A8@apple.com> <9340F438-AB28-4030-BF1F-035B2CF4662E@apple.com> Message-ID: On Aug 2, 2010, at 1:13 PM, Eric Christopher wrote: > > On Aug 2, 2010, at 12:28 PM, Stuart Hastings wrote: > >> >> On Aug 2, 2010, at 11:49 AM, Eric Christopher wrote: >> >>>> >>>> >>>> I have a test case for this, but I'm not sure how to mark it for the test suite. The correct behavior for llvm-gcc is to issue the diagnostic (above), but clang should compile it without error (it does). >>>> >>>> Is there a way for a test case to XFAIL itself only for a particular front-end (e.g. llvm-gcc versus clang) ? >>> >>> #if __clang__ ? >>> >>> -eric >> >> Hrm. Well, I guess I could make the test break itself when compiled with clang. You're suggesting >> >> #if __clang__ >> BOGUS XLERB HERE; >> #endif >> >> ? >> >> However, it wont' be the same diagnostic as llvm-gcc, so I can't have the test check for the (llvm-gcc only) diagnostic I want. >> >> (Perhaps I mis-insterpreted your suggestion?) > > > // dg-compile > > #if __clang__ > > test > > #else > > same test but checks for { dg-error ... } Ah, "dg-error" is a clue to what you're thinking... > #endif > > is what I was meaning. > > -eric Alas, this test is going into llvmCore/test/FrontendObjC++/..., so it will use FileCheck, and I don't think FileCheck respects #if directives. Thanks, stuart From echristo at apple.com Mon Aug 2 17:19:42 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 2 Aug 2010 15:19:42 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c In-Reply-To: References: <20100802171251.D446D2A6C12C@llvm.org> <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> <7CC17A93-795A-40D2-8E08-B4D1AFEF26A8@apple.com> <9340F438-AB28-4030-BF1F-035B2CF4662E@apple.com> Message-ID: <05FA7D86-C724-4CC0-90BC-D371858200E5@apple.com> >> >> >> // dg-compile >> >> #if __clang__ >> >> test >> >> #else >> >> same test but checks for { dg-error ... } > > Ah, "dg-error" is a clue to what you're thinking... > >> #endif >> >> is what I was meaning. >> >> -eric > > Alas, this test is going into llvmCore/test/FrontendObjC++/..., so it will use FileCheck, and I don't think FileCheck respects #if directives. Yeah, I'm not sure. It wouldn't work anyways since this will compile without error thus making the "not %llvmgcc" fail. Sounds like some FileCheck hacking is in the future. Might be a useful addition. -eric From dpatel at apple.com Mon Aug 2 17:27:37 2010 From: dpatel at apple.com (Devang Patel) Date: Mon, 2 Aug 2010 15:27:37 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c In-Reply-To: References: <20100802171251.D446D2A6C12C@llvm.org> <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> <7CC17A93-795A-40D2-8E08-B4D1AFEF26A8@apple.com> <9340F438-AB28-4030-BF1F-035B2CF4662E@apple.com> Message-ID: On Aug 2, 2010, at 3:12 PM, Stuart Hastings wrote: >> > > Ah, "dg-error" is a clue to what you're thinking... > >> #endif >> >> is what I was meaning. >> >> -eric > > Alas, this test is going into llvmCore/test/FrontendObjC++/..., so it will use FileCheck, and I don't think FileCheck respects #if directives. > You could put the test @ llvmgcc/gcc/testsuite/llvm.obj-c++ :) - Devang -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100802/5ae4f0b8/attachment.html From dalej at apple.com Mon Aug 2 17:44:15 2010 From: dalej at apple.com (Dale Johannesen) Date: Mon, 2 Aug 2010 15:44:15 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c In-Reply-To: References: <20100802171251.D446D2A6C12C@llvm.org> <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> <7CC17A93-795A-40D2-8E08-B4D1AFEF26A8@apple.com> <9340F438-AB28-4030-BF1F-035B2CF4662E@apple.com> Message-ID: <501E136D-7292-433C-9CE1-48F11A676461@apple.com> >>> >>> Hrm. Well, I guess I could make the test break itself when >>> compiled with clang. You're suggesting >>> >>> #if __clang__ >>> BOGUS XLERB HERE; >>> #endif >>> >>> ? >>> >>> However, it wont' be the same diagnostic as llvm-gcc, so I can't >>> have the test check for the (llvm-gcc only) diagnostic I want. #if __clang__ #error text close enough to gcc's error message to fool grep #endif It's a real hack, though. IMO improving the mechanism is a better way forward. Different compilers won't report the same error the same way, and the mechanism should understand that. From dpatel at apple.com Mon Aug 2 17:51:46 2010 From: dpatel at apple.com (Devang Patel) Date: Mon, 02 Aug 2010 22:51:46 -0000 Subject: [llvm-commits] [llvm] r110072 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h lib/Analysis/DebugInfo.cpp Message-ID: <20100802225146.6E3A52A6C12C@llvm.org> Author: dpatel Date: Mon Aug 2 17:51:46 2010 New Revision: 110072 URL: http://llvm.org/viewvc/llvm-project?rev=110072&view=rev Log: Add explicit constructors. Patch by Renato Golin. Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h llvm/trunk/lib/Analysis/DebugInfo.cpp Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=110072&r1=110071&r2=110072&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Mon Aug 2 17:51:46 2010 @@ -36,6 +36,12 @@ class LLVMContext; class raw_ostream; + class DIFile; + class DISubprogram; + class DILexicalBlock; + class DIVariable; + class DIType; + /// DIDescriptor - A thin wraper around MDNode to access encoded debug info. /// This should not be stored in a container, because underly MDNode may /// change in certain situations. @@ -61,6 +67,11 @@ public: explicit DIDescriptor() : DbgNode(0) {} explicit DIDescriptor(const MDNode *N) : DbgNode(N) {} + explicit DIDescriptor(const DIFile F); + explicit DIDescriptor(const DISubprogram F); + explicit DIDescriptor(const DILexicalBlock F); + explicit DIDescriptor(const DIVariable F); + explicit DIDescriptor(const DIType F); bool Verify() const { return DbgNode != 0; } Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=110072&r1=110071&r2=110072&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DebugInfo.cpp (original) +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Mon Aug 2 17:51:46 2010 @@ -32,6 +32,21 @@ // DIDescriptor //===----------------------------------------------------------------------===// +DIDescriptor::DIDescriptor(const DIFile F) : DbgNode(F.DbgNode) { +} + +DIDescriptor::DIDescriptor(const DISubprogram F) : DbgNode(F.DbgNode) { +} + +DIDescriptor::DIDescriptor(const DILexicalBlock F) : DbgNode(F.DbgNode) { +} + +DIDescriptor::DIDescriptor(const DIVariable F) : DbgNode(F.DbgNode) { +} + +DIDescriptor::DIDescriptor(const DIType F) : DbgNode(F.DbgNode) { +} + StringRef DIDescriptor::getStringField(unsigned Elt) const { if (DbgNode == 0) From stoklund at 2pi.dk Mon Aug 2 18:01:35 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 02 Aug 2010 23:01:35 -0000 Subject: [llvm-commits] [test-suite] r110073 - in /test-suite/trunk/SingleSource/Benchmarks/Misc-C++-EH: spirit.cpp spirit.reference_output.small Message-ID: <20100802230135.A6D5E2A6C12C@llvm.org> Author: stoklund Date: Mon Aug 2 18:01:35 2010 New Revision: 110073 URL: http://llvm.org/viewvc/llvm-project?rev=110073&view=rev Log: Reduce spirit workload for SMALL_PROBLEM_SIZE to avoid timeouts on ARM -O0. Added: test-suite/trunk/SingleSource/Benchmarks/Misc-C++-EH/spirit.reference_output.small Modified: test-suite/trunk/SingleSource/Benchmarks/Misc-C++-EH/spirit.cpp Modified: test-suite/trunk/SingleSource/Benchmarks/Misc-C++-EH/spirit.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Misc-C%2B%2B-EH/spirit.cpp?rev=110073&r1=110072&r2=110073&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Misc-C++-EH/spirit.cpp (original) +++ test-suite/trunk/SingleSource/Benchmarks/Misc-C++-EH/spirit.cpp Mon Aug 2 18:01:35 2010 @@ -14199,7 +14199,11 @@ main(int argc, char* argv[]) { c_grammar g; +#ifdef SMALL_PROBLEM_SIZE + unsigned long n = 4; +#else unsigned long n = 40; +#endif if (argc > 1) n = atol(argv[1]); for (unsigned long i=0;i Author: djg Date: Mon Aug 2 18:06:43 2010 New Revision: 110074 URL: http://llvm.org/viewvc/llvm-project?rev=110074&view=rev Log: Add a lint check for indirectbr with no successors. Modified: llvm/trunk/lib/Analysis/Lint.cpp llvm/trunk/test/Other/lint.ll Modified: llvm/trunk/lib/Analysis/Lint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=110074&r1=110073&r2=110074&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Lint.cpp (original) +++ llvm/trunk/lib/Analysis/Lint.cpp Mon Aug 2 18:06:43 2010 @@ -519,6 +519,9 @@ void Lint::visitIndirectBrInst(IndirectBrInst &I) { visitMemoryReference(I, I.getAddress(), ~0u, 0, 0, MemRef::Branchee); + + Assert1(I.getNumDestinations() != 0, + "Undefined behavior: indirectbr with no destinations", &I); } void Lint::visitExtractElementInst(ExtractElementInst &I) { Modified: llvm/trunk/test/Other/lint.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/lint.ll?rev=110074&r1=110073&r2=110074&view=diff ============================================================================== --- llvm/trunk/test/Other/lint.ll (original) +++ llvm/trunk/test/Other/lint.ll Mon Aug 2 18:06:43 2010 @@ -161,5 +161,7 @@ define void @struct_caller() nounwind { entry: call %struct bitcast (i32 ()* @foo to %struct ()*)() - ret void + + ; CHECK: Undefined behavior: indirectbr with no destinations + indirectbr i8* null, [] } From gohman at apple.com Mon Aug 2 18:08:33 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 02 Aug 2010 23:08:33 -0000 Subject: [llvm-commits] [llvm] r110075 - /llvm/trunk/lib/VMCore/Verifier.cpp Message-ID: <20100802230833.D47EA2A6C12C@llvm.org> Author: djg Date: Mon Aug 2 18:08:33 2010 New Revision: 110075 URL: http://llvm.org/viewvc/llvm-project?rev=110075&view=rev Log: Add Verifier logic for indirectbr. Modified: llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=110075&r1=110074&r2=110075&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Mon Aug 2 18:08:33 2010 @@ -331,6 +331,7 @@ void visitBranchInst(BranchInst &BI); void visitReturnInst(ReturnInst &RI); void visitSwitchInst(SwitchInst &SI); + void visitIndirectBrInst(IndirectBrInst &BI); void visitSelectInst(SelectInst &SI); void visitUserOp1(Instruction &I); void visitUserOp2(Instruction &I) { visitUserOp1(I); } @@ -864,6 +865,16 @@ visitTerminatorInst(SI); } +void Verifier::visitIndirectBrInst(IndirectBrInst &BI) { + Assert1(BI.getAddress()->getType()->isPointerTy(), + "Indirectbr operand must have pointer type!", &BI); + for (unsigned i = 0, e = BI.getNumDestinations(); i != e; ++i) + Assert1(BI.getDestination(i)->getType()->isLabelTy(), + "Indirectbr destinations must all have pointer type!", &BI); + + visitTerminatorInst(BI); +} + void Verifier::visitSelectInst(SelectInst &SI) { Assert1(!SelectInst::areInvalidOperands(SI.getOperand(0), SI.getOperand(1), SI.getOperand(2)), From gohman at apple.com Mon Aug 2 18:09:14 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 02 Aug 2010 23:09:14 -0000 Subject: [llvm-commits] [llvm] r110076 - /llvm/trunk/lib/VMCore/Verifier.cpp Message-ID: <20100802230915.0A7832A6C12C@llvm.org> Author: djg Date: Mon Aug 2 18:09:14 2010 New Revision: 110076 URL: http://llvm.org/viewvc/llvm-project?rev=110076&view=rev Log: Fix visitInvokeInst to call visitTerminatorInst, and remove a redundant check from checkInstruction. Modified: llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=110076&r1=110075&r2=110076&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Mon Aug 2 18:09:14 2010 @@ -1213,6 +1213,7 @@ void Verifier::visitInvokeInst(InvokeInst &II) { VerifyCallSite(&II); + visitTerminatorInst(II); } /// visitBinaryOperator - Check that both arguments to the binary operator are @@ -1419,10 +1420,6 @@ "Only PHI nodes may reference their own value!", &I); } - // Verify that if this is a terminator that it is at the end of the block. - if (isa(I)) - Assert1(BB->getTerminator() == &I, "Terminator not at end of block!", &I); - // Check that void typed values don't have names Assert1(!I.getType()->isVoidTy() || !I.hasName(), "Instruction has a name, but provides a void value!", &I); From gohman at apple.com Mon Aug 2 18:11:01 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 02 Aug 2010 23:11:01 -0000 Subject: [llvm-commits] [llvm] r110077 - in /llvm/trunk: include/llvm/Analysis/Passes.h include/llvm/LinkAllPasses.h lib/Analysis/TypeBasedAliasAnalysis.cpp Message-ID: <20100802231101.912AD2A6C12C@llvm.org> Author: djg Date: Mon Aug 2 18:11:01 2010 New Revision: 110077 URL: http://llvm.org/viewvc/llvm-project?rev=110077&view=rev Log: Sketch up a preliminary Type-Based Alias Analysis implementation. Added: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Modified: llvm/trunk/include/llvm/Analysis/Passes.h llvm/trunk/include/llvm/LinkAllPasses.h Modified: llvm/trunk/include/llvm/Analysis/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Passes.h?rev=110077&r1=110076&r2=110077&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/Passes.h (original) +++ llvm/trunk/include/llvm/Analysis/Passes.h Mon Aug 2 18:11:01 2010 @@ -81,6 +81,13 @@ //===--------------------------------------------------------------------===// // + // createTypeBasedAliasAnalysisPass - This pass implements metadata-based + // type-based alias analysis. + // + ImmutablePass *createTypeBasedAliasAnalysisPass(); + + //===--------------------------------------------------------------------===// + // // createProfileLoaderPass - This pass loads information from a profile dump // file. // Modified: llvm/trunk/include/llvm/LinkAllPasses.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LinkAllPasses.h?rev=110077&r1=110076&r2=110077&view=diff ============================================================================== --- llvm/trunk/include/llvm/LinkAllPasses.h (original) +++ llvm/trunk/include/llvm/LinkAllPasses.h Mon Aug 2 18:11:01 2010 @@ -53,6 +53,7 @@ (void) llvm::createBasicAliasAnalysisPass(); (void) llvm::createLibCallAliasAnalysisPass(0); (void) llvm::createScalarEvolutionAliasAnalysisPass(); + (void) llvm::createTypeBasedAliasAnalysisPass(); (void) llvm::createBlockPlacementPass(); (void) llvm::createBreakCriticalEdgesPass(); (void) llvm::createCFGSimplificationPass(); Added: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=110077&view=auto ============================================================================== --- llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp (added) +++ llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Mon Aug 2 18:11:01 2010 @@ -0,0 +1,191 @@ +//===- TypeBasedAliasAnalysis.cpp - Type-Based Alias Analysis -------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the TypeBasedAliasAnalysis pass, which implements +// metadata-based TBAA. +// +// In LLVM IR, memory does not have types, so LLVM's own type system is not +// suitable for doing TBAA. Instead, metadata is added to the IR to describe +// a type system of a higher level language. +// +// This pass is language-independent. The type system is encoded in +// metadata. This allows this pass to support typical C and C++ TBAA, but +// it can also support custom aliasing behavior for other languages. +// +// This is a work-in-progress. It doesn't work yet, and the metadata +// format isn't stable. +// +// TODO: getModRefBehavior. The AliasAnalysis infrastructure will need to +// be extended. +// TODO: AA chaining +// TODO: struct fields +// +//===----------------------------------------------------------------------===// + +#include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Analysis/Passes.h" +#include "llvm/Module.h" +#include "llvm/Metadata.h" +#include "llvm/Pass.h" +using namespace llvm; + +namespace { + /// TBAANode - This is a simple wrapper around an MDNode which provides a + /// higher-level interface by hiding the details of how alias analysis + /// information is encoded in its operands. + class TBAANode { + const MDNode *Node; + + public: + TBAANode() : Node(0) {} + explicit TBAANode(MDNode *N) : Node(N) {} + + /// getNode - Get the MDNode for this TBAANode. + const MDNode *getNode() const { return Node; } + + /// getParent - Get this TBAANode's Alias DAG parent. + TBAANode getParent() const { + if (Node->getNumOperands() < 2) + return TBAANode(); + MDNode *P = dyn_cast(Node->getOperand(1)); + if (!P) + return TBAANode(); + // Ok, this node has a valid parent. Return it. + return TBAANode(P); + } + + /// TypeIsImmutable - Test if this TBAANode represents a type for objects + /// which are not modified (by any means) in the context where this + /// AliasAnalysis is relevant. + bool TypeIsImmutable() const { + if (Node->getNumOperands() < 3) + return false; + ConstantInt *CI = dyn_cast(Node->getOperand(2)); + if (!CI) + return false; + // TODO: Think about the encoding. + return CI->isOne(); + } + }; +} + +namespace { + /// TypeBasedAliasAnalysis - This is a simple alias analysis + /// implementation that uses TypeBased to answer queries. + class TypeBasedAliasAnalysis : public ImmutablePass, + public AliasAnalysis { + public: + static char ID; // Class identification, replacement for typeinfo + TypeBasedAliasAnalysis() : ImmutablePass(&ID) {} + + /// getAdjustedAnalysisPointer - This method is used when a pass implements + /// an analysis interface through multiple inheritance. If needed, it + /// should override this to adjust the this pointer as needed for the + /// specified pass info. + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { + if (PI->isPassID(&AliasAnalysis::ID)) + return (AliasAnalysis*)this; + return this; + } + + private: + virtual void getAnalysisUsage(AnalysisUsage &AU) const; + virtual AliasResult alias(const Value *V1, unsigned V1Size, + const Value *V2, unsigned V2Size); + virtual bool pointsToConstantMemory(const Value *P); + }; +} // End of anonymous namespace + +// Register this pass... +char TypeBasedAliasAnalysis::ID = 0; +INITIALIZE_AG_PASS(TypeBasedAliasAnalysis, AliasAnalysis, "tbaa", + "Type-Based Alias Analysis", false, true, false); + +ImmutablePass *llvm::createTypeBasedAliasAnalysisPass() { + return new TypeBasedAliasAnalysis(); +} + +void +TypeBasedAliasAnalysis::getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesAll(); + AliasAnalysis::getAnalysisUsage(AU); +} + +AliasAnalysis::AliasResult +TypeBasedAliasAnalysis::alias(const Value *A, unsigned ASize, + const Value *B, unsigned BSize) { + // Currently, metadata can only be attached to Instructions. + const Instruction *AI = dyn_cast(A); + if (!AI) return MayAlias; + const Instruction *BI = dyn_cast(B); + if (!BI) return MayAlias; + + // Get the attached MDNodes. If either value lacks a tbaa MDNode, we must + // be conservative. + MDNode *AM = + AI->getMetadata(AI->getParent()->getParent()->getParent() + ->getMDKindID("tbaa")); + if (!AM) return MayAlias; + MDNode *BM = + AI->getMetadata(BI->getParent()->getParent()->getParent() + ->getMDKindID("tbaa")); + if (!BM) return MayAlias; + + // Keep track of the root node for A and B. + TBAANode RootA, RootB; + + // Climb the DAG from A to see if we reach B. + for (TBAANode T(AM); ; ) { + if (T.getNode() == BM) + // B is an ancestor of A. + return MayAlias; + + RootA = T; + T = T.getParent(); + if (!T.getNode()) + break; + } + + // Climb the DAG from B to see if we reach A. + for (TBAANode T(BM); ; ) { + if (T.getNode() == AM) + // A is an ancestor of B. + return MayAlias; + + RootB = T; + T = T.getParent(); + if (!T.getNode()) + break; + } + + // Neither node is an ancestor of the other. + + // If they have the same root, then we've proved there's no alias. + if (RootA.getNode() == RootB.getNode()) + return NoAlias; + + // If they have different roots, they're part of different potentially + // unrelated type systems, so we must be conservative. + return MayAlias; +} + +bool TypeBasedAliasAnalysis::pointsToConstantMemory(const Value *P) { + // Currently, metadata can only be attached to Instructions. + const Instruction *I = dyn_cast(P); + if (!I) return false; + + MDNode *M = + I->getMetadata(I->getParent()->getParent()->getParent() + ->getMDKindID("tbaa")); + if (!M) return false; + + // If this is an "immutable" type, we can assume the pointer is pointing + // to constant memory. + return TBAANode(M).TypeIsImmutable(); +} From stuart at apple.com Mon Aug 2 18:19:44 2010 From: stuart at apple.com (Stuart Hastings) Date: Mon, 2 Aug 2010 16:19:44 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c In-Reply-To: References: <20100802171251.D446D2A6C12C@llvm.org> <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> <7CC17A93-795A-40D2-8E08-B4D1AFEF26A8@apple.com> <9340F438-AB28-4030-BF1F-035B2CF4662E@apple.com> Message-ID: On Aug 2, 2010, at 3:27 PM, Devang Patel wrote: > > On Aug 2, 2010, at 3:12 PM, Stuart Hastings wrote: >>> >> >> Ah, "dg-error" is a clue to what you're thinking... >> >>> #endif >>> >>> is what I was meaning. >>> >>> -eric >> >> Alas, this test is going into llvmCore/test/FrontendObjC++/..., so it will use FileCheck, and I don't think FileCheck respects #if directives. >> > > You could put the test @ llvmgcc/gcc/testsuite/llvm.obj-c++ > > :) Yes, but some day I hope we'll try to run clang through the GCC DejaGNU test suite too, so I think this only defers the problem. stuart -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100802/3fe27e8b/attachment.html From echristo at apple.com Mon Aug 2 18:21:08 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 2 Aug 2010 16:21:08 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c In-Reply-To: References: <20100802171251.D446D2A6C12C@llvm.org> <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> <7CC17A93-795A-40D2-8E08-B4D1AFEF26A8@apple.com> <9340F438-AB28-4030-BF1F-035B2CF4662E@apple.com> Message-ID: On Aug 2, 2010, at 4:19 PM, Stuart Hastings wrote: > > On Aug 2, 2010, at 3:27 PM, Devang Patel wrote: > >> >> On Aug 2, 2010, at 3:12 PM, Stuart Hastings wrote: >>>> >>> >>> Ah, "dg-error" is a clue to what you're thinking... >>> >>>> #endif >>>> >>>> is what I was meaning. >>>> >>>> -eric >>> >>> Alas, this test is going into llvmCore/test/FrontendObjC++/..., so it will use FileCheck, and I don't think FileCheck respects #if directives. >>> >> >> You could put the test @ llvmgcc/gcc/testsuite/llvm.obj-c++ >> >> :) > > Yes, but some day I hope we'll try to run clang through the GCC DejaGNU test suite too, so I think this only defers the problem. Yes, but then my suggestion would work :) -eric From stuart at apple.com Mon Aug 2 18:24:17 2010 From: stuart at apple.com (Stuart Hastings) Date: Mon, 2 Aug 2010 16:24:17 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c In-Reply-To: <501E136D-7292-433C-9CE1-48F11A676461@apple.com> References: <20100802171251.D446D2A6C12C@llvm.org> <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> <7CC17A93-795A-40D2-8E08-B4D1AFEF26A8@apple.com> <9340F438-AB28-4030-BF1F-035B2CF4662E@apple.com> <501E136D-7292-433C-9CE1-48F11A676461@apple.com> Message-ID: On Aug 2, 2010, at 3:44 PM, Dale Johannesen wrote: >>>> >>>> Hrm. Well, I guess I could make the test break itself when compiled with clang. You're suggesting >>>> >>>> #if __clang__ >>>> BOGUS XLERB HERE; >>>> #endif >>>> >>>> ? >>>> >>>> However, it wont' be the same diagnostic as llvm-gcc, so I can't have the test check for the (llvm-gcc only) diagnostic I want. > > #if __clang__ > #error text close enough to gcc's error message to fool grep > #endif > > It's a real hack, though. IMO improving the mechanism is a better way forward. Different compilers won't report the same error the same way, and the mechanism should understand that. Wow. That's ... "ingenious." (Not the first word I thought of.) Regardless of my initial reaction, that's pretty diabolical, Dale. I'm impressed! :-) In fact, I'm going to do just that (thank you for the suggestion!). The diagnostic is already wired into the test, inside a "CHECK:" line, so I'm not making it any less portable. FWIW, Daniel says he regards all the LLVM Frontend* tests as LLVM-GCC-specific, and is quite unconcerned about making Clang pass them. stuart From dalej at apple.com Mon Aug 2 18:28:34 2010 From: dalej at apple.com (Dale Johannesen) Date: Mon, 2 Aug 2010 16:28:34 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c In-Reply-To: References: <20100802171251.D446D2A6C12C@llvm.org> <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> <7CC17A93-795A-40D2-8E08-B4D1AFEF26A8@apple.com> <9340F438-AB28-4030-BF1F-035B2CF4662E@apple.com> <501E136D-7292-433C-9CE1-48F11A676461@apple.com> Message-ID: On Aug 2, 2010, at 4:24 PMPDT, Stuart Hastings wrote: > > On Aug 2, 2010, at 3:44 PM, Dale Johannesen wrote: > > FWIW, Daniel says he regards all the LLVM Frontend* tests as LLVM- > GCC-specific, and is quite unconcerned about making Clang pass them. This is not the only one looking for a gcc-specific error message, fwiw. From stuart at apple.com Mon Aug 2 18:29:03 2010 From: stuart at apple.com (Stuart Hastings) Date: Mon, 02 Aug 2010 23:29:03 -0000 Subject: [llvm-commits] [llvm] r110081 - /llvm/trunk/test/FrontendObjC++/2010-08-02-NonPODObjectValue.mm Message-ID: <20100802232903.F2A182A6C12C@llvm.org> Author: stuart Date: Mon Aug 2 18:29:03 2010 New Revision: 110081 URL: http://llvm.org/viewvc/llvm-project?rev=110081&view=rev Log: Diabolical hack to make a test compatible with clang. (Thanks to Dale!) Radar 8246180. Modified: llvm/trunk/test/FrontendObjC++/2010-08-02-NonPODObjectValue.mm Modified: llvm/trunk/test/FrontendObjC++/2010-08-02-NonPODObjectValue.mm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC%2B%2B/2010-08-02-NonPODObjectValue.mm?rev=110081&r1=110080&r2=110081&view=diff ============================================================================== --- llvm/trunk/test/FrontendObjC++/2010-08-02-NonPODObjectValue.mm (original) +++ llvm/trunk/test/FrontendObjC++/2010-08-02-NonPODObjectValue.mm Mon Aug 2 18:29:03 2010 @@ -18,6 +18,9 @@ TWindowHistoryEntry* entry; TFENodeVector newPath; // CHECK: setting a C++ non-POD object value is not implemented +#ifdef __clang__ +#error setting a C++ non-POD object value is not implemented +#endif entry.targetPath = newPath; [entry setTargetPath:newPath]; } From stuart at apple.com Mon Aug 2 18:33:11 2010 From: stuart at apple.com (Stuart Hastings) Date: Mon, 2 Aug 2010 16:33:11 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110043 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c In-Reply-To: References: <20100802171251.D446D2A6C12C@llvm.org> <03B8EA13-DD33-48DC-A878-2F879B27AD45@apple.com> <7CC17A93-795A-40D2-8E08-B4D1AFEF26A8@apple.com> <9340F438-AB28-4030-BF1F-035B2CF4662E@apple.com> Message-ID: On Aug 2, 2010, at 4:21 PM, Eric Christopher wrote: > > On Aug 2, 2010, at 4:19 PM, Stuart Hastings wrote: > >> >> On Aug 2, 2010, at 3:27 PM, Devang Patel wrote: >> >>> >>> On Aug 2, 2010, at 3:12 PM, Stuart Hastings wrote: >>>>> >>>> >>>> Ah, "dg-error" is a clue to what you're thinking... >>>> >>>>> #endif >>>>> >>>>> is what I was meaning. >>>>> >>>>> -eric >>>> >>>> Alas, this test is going into llvmCore/test/FrontendObjC++/..., so it will use FileCheck, and I don't think FileCheck respects #if directives. >>>> >>> >>> You could put the test @ llvmgcc/gcc/testsuite/llvm.obj-c++ >>> >>> :) >> >> Yes, but some day I hope we'll try to run clang through the GCC DejaGNU test suite too, so I think this only defers the problem. > > Yes, but then my suggestion would work :) True, but I kinda assumed that I wanted to add tests inside the LLVM test suite instead of the GCC test suite... stuart From gohman at apple.com Mon Aug 2 18:49:30 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 02 Aug 2010 23:49:30 -0000 Subject: [llvm-commits] [llvm] r110086 - in /llvm/trunk: include/llvm/Analysis/ScalarEvolution.h include/llvm/Analysis/ScalarEvolutionExpressions.h lib/Analysis/ScalarEvolution.cpp unittests/Analysis/ unittests/Analysis/Makefile unittests/Analysis/ScalarEvolutionTest.cpp unittests/Makefile Message-ID: <20100802234930.9B1C62A6C12C@llvm.org> Author: djg Date: Mon Aug 2 18:49:30 2010 New Revision: 110086 URL: http://llvm.org/viewvc/llvm-project?rev=110086&view=rev Log: Make SCEVUnknown a CallbackVH, so that it can be notified directly of Value deletions and RAUWs, instead of relying on ScalarEvolution's Scalars map being notified, as that's complicated at best, and insufficient in general. This means SCEVUnknown needs a non-trivial destructor, so introduce a mechanism to allow ScalarEvolution to locate all the SCEVUnknowns. Added: llvm/trunk/unittests/Analysis/ (props changed) - copied from r109717, llvm/trunk/unittests/Analysis/ llvm/trunk/unittests/Analysis/Makefile - copied unchanged from r109717, llvm/trunk/unittests/Analysis/Makefile llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp - copied, changed from r109717, llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h llvm/trunk/lib/Analysis/ScalarEvolution.cpp llvm/trunk/unittests/Makefile Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=110086&r1=110085&r2=110086&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original) +++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Mon Aug 2 18:49:30 2010 @@ -661,6 +661,11 @@ private: FoldingSet UniqueSCEVs; BumpPtrAllocator SCEVAllocator; + + /// FirstUnknown - The head of a linked list of all SCEVUnknown + /// values that have been allocated. This is used by releaseMemory + /// to locate them all and call their destructors. + SCEVUnknown *FirstUnknown; }; } Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h?rev=110086&r1=110085&r2=110086&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h (original) +++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h Mon Aug 2 18:49:30 2010 @@ -520,18 +520,28 @@ /// value, and only represent it as its LLVM Value. This is the "bottom" /// value for the analysis. /// - class SCEVUnknown : public SCEV { + class SCEVUnknown : public SCEV, private CallbackVH { friend class ScalarEvolution; - friend class ScalarEvolution::SCEVCallbackVH; - // This should be an AssertingVH, however SCEVUnknowns are allocated in a - // BumpPtrAllocator so their destructors are never called. - Value *V; - SCEVUnknown(const FoldingSetNodeIDRef ID, Value *v) : - SCEV(ID, scUnknown), V(v) {} + // Implement CallbackVH. + virtual void deleted(); + virtual void allUsesReplacedWith(Value *New); + + /// SE - The parent ScalarEvolution value. This is used to update + /// the parent's maps when the value associated with a SCEVUnknown + /// is deleted or RAUW'd. + ScalarEvolution *SE; + + /// Next - The next pointer in the linked list of all + /// SCEVUnknown instances owned by a ScalarEvolution. + SCEVUnknown *Next; + + SCEVUnknown(const FoldingSetNodeIDRef ID, Value *V, + ScalarEvolution *se, SCEVUnknown *next) : + SCEV(ID, scUnknown), CallbackVH(V), SE(se), Next(next) {} public: - Value *getValue() const { return V; } + Value *getValue() const { return getValPtr(); } /// isSizeOf, isAlignOf, isOffsetOf - Test whether this is a special /// constant representing a type size, alignment, or field offset in Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=110086&r1=110085&r2=110086&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Aug 2 18:49:30 2010 @@ -337,12 +337,36 @@ OS << ">"; } +void SCEVUnknown::deleted() { + // Clear this SCEVUnknown from ValuesAtScopes. + SE->ValuesAtScopes.erase(this); + + // Remove this SCEVUnknown from the uniquing map. + SE->UniqueSCEVs.RemoveNode(this); + + // Release the value. + setValPtr(0); +} + +void SCEVUnknown::allUsesReplacedWith(Value *New) { + // Clear this SCEVUnknown from ValuesAtScopes. + SE->ValuesAtScopes.erase(this); + + // Remove this SCEVUnknown from the uniquing map. + SE->UniqueSCEVs.RemoveNode(this); + + // Update this SCEVUnknown to point to the new value. This is needed + // because there may still be outstanding SCEVs which still point to + // this SCEVUnknown. + setValPtr(New); +} + bool SCEVUnknown::isLoopInvariant(const Loop *L) const { // All non-instruction values are loop invariant. All instructions are loop // invariant if they are not contained in the specified loop. // Instructions are never considered invariant in the function body // (null loop) because they are defined within the "loop". - if (Instruction *I = dyn_cast(V)) + if (Instruction *I = dyn_cast(getValue())) return L && !L->contains(I); return true; } @@ -360,11 +384,11 @@ } const Type *SCEVUnknown::getType() const { - return V->getType(); + return getValue()->getType(); } bool SCEVUnknown::isSizeOf(const Type *&AllocTy) const { - if (ConstantExpr *VCE = dyn_cast(V)) + if (ConstantExpr *VCE = dyn_cast(getValue())) if (VCE->getOpcode() == Instruction::PtrToInt) if (ConstantExpr *CE = dyn_cast(VCE->getOperand(0))) if (CE->getOpcode() == Instruction::GetElementPtr && @@ -381,7 +405,7 @@ } bool SCEVUnknown::isAlignOf(const Type *&AllocTy) const { - if (ConstantExpr *VCE = dyn_cast(V)) + if (ConstantExpr *VCE = dyn_cast(getValue())) if (VCE->getOpcode() == Instruction::PtrToInt) if (ConstantExpr *CE = dyn_cast(VCE->getOperand(0))) if (CE->getOpcode() == Instruction::GetElementPtr && @@ -406,7 +430,7 @@ } bool SCEVUnknown::isOffsetOf(const Type *&CTy, Constant *&FieldNo) const { - if (ConstantExpr *VCE = dyn_cast(V)) + if (ConstantExpr *VCE = dyn_cast(getValue())) if (VCE->getOpcode() == Instruction::PtrToInt) if (ConstantExpr *CE = dyn_cast(VCE->getOperand(0))) if (CE->getOpcode() == Instruction::GetElementPtr && @@ -448,7 +472,7 @@ } // Otherwise just print it normally. - WriteAsOperand(OS, V, false); + WriteAsOperand(OS, getValue(), false); } //===----------------------------------------------------------------------===// @@ -2350,8 +2374,14 @@ ID.AddInteger(scUnknown); ID.AddPointer(V); void *IP = 0; - if (const SCEV *S = UniqueSCEVs.FindNodeOrInsertPos(ID, IP)) return S; - SCEV *S = new (SCEVAllocator) SCEVUnknown(ID.Intern(SCEVAllocator), V); + if (SCEV *S = UniqueSCEVs.FindNodeOrInsertPos(ID, IP)) { + assert(cast(S)->getValue() == V && + "Stale SCEVUnknown in uniquing map!"); + return S; + } + SCEV *S = new (SCEVAllocator) SCEVUnknown(ID.Intern(SCEVAllocator), V, this, + FirstUnknown); + FirstUnknown = cast(S); UniqueSCEVs.InsertNode(S, IP); return S; } @@ -3664,26 +3694,6 @@ /// changed a value in a way that may effect its value, or which may /// disconnect it from a def-use chain linking it to a loop. void ScalarEvolution::forgetValue(Value *V) { - // If there's a SCEVUnknown tying this value into the SCEV - // space, remove it from the folding set map. The SCEVUnknown - // object and any other SCEV objects which reference it - // (transitively) remain allocated, effectively leaked until - // the underlying BumpPtrAllocator is freed. - // - // This permits SCEV pointers to be used as keys in maps - // such as the ValuesAtScopes map. - FoldingSetNodeID ID; - ID.AddInteger(scUnknown); - ID.AddPointer(V); - void *IP; - if (SCEV *S = UniqueSCEVs.FindNodeOrInsertPos(ID, IP)) { - UniqueSCEVs.RemoveNode(S); - - // This isn't necessary, but we might as well remove the - // value from the ValuesAtScopes map too. - ValuesAtScopes.erase(S); - } - Instruction *I = dyn_cast(V); if (!I) return; @@ -5693,27 +5703,10 @@ void ScalarEvolution::SCEVCallbackVH::allUsesReplacedWith(Value *V) { assert(SE && "SCEVCallbackVH called with a null ScalarEvolution!"); - Value *Old = getValPtr(); - - // If there's a SCEVUnknown tying this value into the SCEV - // space, replace the SCEVUnknown's value with the new value - // for the benefit of any SCEVs still referencing it, and - // and remove it from the folding set map so that new scevs - // don't reference it. - FoldingSetNodeID ID; - ID.AddInteger(scUnknown); - ID.AddPointer(Old); - void *IP; - if (SCEVUnknown *S = cast_or_null( - SE->UniqueSCEVs.FindNodeOrInsertPos(ID, IP))) { - S->V = V; - SE->UniqueSCEVs.RemoveNode(S); - SE->ValuesAtScopes.erase(S); - } - // Forget all the expressions associated with users of the old value, // so that future queries will recompute the expressions using the new // value. + Value *Old = getValPtr(); SmallVector Worklist; SmallPtrSet Visited; for (Value::use_iterator UI = Old->use_begin(), UE = Old->use_end(); @@ -5749,7 +5742,7 @@ //===----------------------------------------------------------------------===// ScalarEvolution::ScalarEvolution() - : FunctionPass(&ID) { + : FunctionPass(&ID), FirstUnknown(0) { } bool ScalarEvolution::runOnFunction(Function &F) { @@ -5761,6 +5754,12 @@ } void ScalarEvolution::releaseMemory() { + // Iterate through all the SCEVUnknown instances and call their + // destructors, so that they release their references to their values. + for (SCEVUnknown *U = FirstUnknown; U; U = U->Next) + U->~SCEVUnknown(); + FirstUnknown = 0; + Scalars.clear(); BackedgeTakenCounts.clear(); ConstantEvolutionLoopExitValue.clear(); Propchange: llvm/trunk/unittests/Analysis/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Aug 2 18:49:30 2010 @@ -0,0 +1,9 @@ +Debug +Release +Release-Asserts +Debug+Coverage-Asserts +Debug+Coverage +Release+Coverage +Debug+Checks +Debug+Asserts +Release+Asserts Copied: llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp (from r109717, llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp?p2=llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp&p1=llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp&r1=109717&r2=110086&rev=110086&view=diff ============================================================================== --- llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp (original) +++ llvm/trunk/unittests/Analysis/ScalarEvolutionTest.cpp Mon Aug 2 18:49:30 2010 @@ -18,7 +18,7 @@ namespace llvm { namespace { -TEST(ScalarEvolutionsTest, ReturnInst) { +TEST(ScalarEvolutionsTest, SCEVUnknownRAUW) { LLVMContext Context; Module M("world", Context); @@ -72,6 +72,10 @@ EXPECT_EQ(cast(M0->getOperand(1))->getValue(), V0); EXPECT_EQ(cast(M1->getOperand(1))->getValue(), V0); EXPECT_EQ(cast(M2->getOperand(1))->getValue(), V0); + + // Manually clean up, since we allocated new SCEV objects after the + // pass was finished. + SE.releaseMemory(); } } // end anonymous namespace Modified: llvm/trunk/unittests/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Makefile?rev=110086&r1=110085&r2=110086&view=diff ============================================================================== --- llvm/trunk/unittests/Makefile (original) +++ llvm/trunk/unittests/Makefile Mon Aug 2 18:49:30 2010 @@ -9,7 +9,7 @@ LEVEL = .. -PARALLEL_DIRS = ADT ExecutionEngine Support Transforms VMCore +PARALLEL_DIRS = ADT ExecutionEngine Support Transforms VMCore Analysis include $(LEVEL)/Makefile.common From gohman at apple.com Mon Aug 2 19:56:30 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 03 Aug 2010 00:56:30 -0000 Subject: [llvm-commits] [llvm] r110090 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h lib/Analysis/Lint.cpp lib/Analysis/MemoryDependenceAnalysis.cpp Message-ID: <20100803005630.89DA52A6C12C@llvm.org> Author: djg Date: Mon Aug 2 19:56:30 2010 New Revision: 110090 URL: http://llvm.org/viewvc/llvm-project?rev=110090&view=rev Log: Add a convenient form of AliasAnalysis::alias for the case where the sizes are unknown. Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h llvm/trunk/lib/Analysis/Lint.cpp llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=110090&r1=110089&r2=110090&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Mon Aug 2 19:56:30 2010 @@ -94,6 +94,11 @@ virtual AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size); + /// alias - A convenience wrapper for the case where the sizes are unknown. + AliasResult alias(const Value *V1, const Value *V2) { + return alias(V1, ~0u, V2, ~0u); + } + /// isNoAlias - A trivial helper function to check to see if the specified /// pointers are no-alias. bool isNoAlias(const Value *V1, unsigned V1Size, Modified: llvm/trunk/lib/Analysis/Lint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=110090&r1=110089&r2=110090&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Lint.cpp (original) +++ llvm/trunk/lib/Analysis/Lint.cpp Mon Aug 2 19:56:30 2010 @@ -246,8 +246,7 @@ // where nothing is known. if (Formal->hasNoAliasAttr() && Actual->getType()->isPointerTy()) for (CallSite::arg_iterator BI = CS.arg_begin(); BI != AE; ++BI) { - Assert1(AI == BI || - AA->alias(*AI, ~0u, *BI, ~0u) != AliasAnalysis::MustAlias, + Assert1(AI == BI || AA->alias(*AI, *BI) != AliasAnalysis::MustAlias, "Unusual: noalias argument aliases another argument", &I); } Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=110090&r1=110089&r2=110090&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Mon Aug 2 19:56:30 2010 @@ -195,8 +195,7 @@ // FIXME: This only considers queries directly on the invariant-tagged // pointer, not on query pointers that are indexed off of them. It'd // be nice to handle that at some point. - AliasAnalysis::AliasResult R = - AA->alias(II->getArgOperand(2), ~0U, MemPtr, ~0U); + AliasAnalysis::AliasResult R = AA->alias(II->getArgOperand(2), MemPtr); if (R == AliasAnalysis::MustAlias) { InvariantTag = II->getArgOperand(0); continue; @@ -208,8 +207,7 @@ // FIXME: This only considers queries directly on the invariant-tagged // pointer, not on query pointers that are indexed off of them. It'd // be nice to handle that at some point. - AliasAnalysis::AliasResult R = - AA->alias(II->getArgOperand(1), ~0U, MemPtr, ~0U); + AliasAnalysis::AliasResult R = AA->alias(II->getArgOperand(1), MemPtr); if (R == AliasAnalysis::MustAlias) return MemDepResult::getDef(II); } From gohman at apple.com Mon Aug 2 20:03:12 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 03 Aug 2010 01:03:12 -0000 Subject: [llvm-commits] [llvm] r110091 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h lib/Analysis/BasicAliasAnalysis.cpp lib/Analysis/ScalarEvolutionAliasAnalysis.cpp Message-ID: <20100803010312.196002A6C12C@llvm.org> Author: djg Date: Mon Aug 2 20:03:11 2010 New Revision: 110091 URL: http://llvm.org/viewvc/llvm-project?rev=110091&view=rev Log: Introduce a symbolic constant for ~0u for use with AliasAnalysis. Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=110091&r1=110090&r2=110091&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Mon Aug 2 20:03:11 2010 @@ -64,6 +64,11 @@ AliasAnalysis() : TD(0), AA(0) {} virtual ~AliasAnalysis(); // We want to be subclassed + /// UnknownSize - This is a special value which can be used with the + /// size arguments in alias queries to indicate that the caller does not + /// know the sizes of the potential memory references. + static unsigned const UnknownSize = ~0u; + /// getTargetData - Return a pointer to the current TargetData object, or /// null if no TargetData object is available. /// @@ -96,7 +101,7 @@ /// alias - A convenience wrapper for the case where the sizes are unknown. AliasResult alias(const Value *V1, const Value *V2) { - return alias(V1, ~0u, V2, ~0u); + return alias(V1, UnknownSize, V2, UnknownSize); } /// isNoAlias - A trivial helper function to check to see if the specified Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110091&r1=110090&r2=110091&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Mon Aug 2 20:03:11 2010 @@ -334,7 +334,7 @@ // is impossible to alias the pointer we're checking. If not, we have to // assume that the call could touch the pointer, even though it doesn't // escape. - if (!isNoAlias(cast(CI), ~0U, P, ~0U)) { + if (!isNoAlias(cast(CI), UnknownSize, P, UnknownSize)) { PassedAsArg = true; break; } @@ -353,7 +353,7 @@ default: break; case Intrinsic::memcpy: case Intrinsic::memmove: { - unsigned Len = ~0U; + unsigned Len = UnknownSize; if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) Len = LenCI->getZExtValue(); Value *Dest = II->getArgOperand(0); @@ -490,7 +490,8 @@ // out if the indexes to the GEP tell us anything about the derived pointer. if (const GEPOperator *GEP2 = dyn_cast(V2)) { // Do the base pointers alias? - AliasResult BaseAlias = aliasCheck(UnderlyingV1, ~0U, UnderlyingV2, ~0U); + AliasResult BaseAlias = aliasCheck(UnderlyingV1, UnknownSize, + UnderlyingV2, UnknownSize); // If we get a No or May, then return it immediately, no amount of analysis // will improve this situation. @@ -527,10 +528,10 @@ // pointer, we know they cannot alias. // If both accesses are unknown size, we can't do anything useful here. - if (V1Size == ~0U && V2Size == ~0U) + if (V1Size == UnknownSize && V2Size == UnknownSize) return MayAlias; - AliasResult R = aliasCheck(UnderlyingV1, ~0U, V2, V2Size); + AliasResult R = aliasCheck(UnderlyingV1, UnknownSize, V2, V2Size); if (R != MustAlias) // If V2 may alias GEP base pointer, conservatively returns MayAlias. // If V2 is known not to alias GEP base pointer, then the two values @@ -778,8 +779,8 @@ // If the size of one access is larger than the entire object on the other // side, then we know such behavior is undefined and can assume no alias. if (TD) - if ((V1Size != ~0U && isObjectSmallerThan(O2, V1Size, *TD)) || - (V2Size != ~0U && isObjectSmallerThan(O1, V2Size, *TD))) + if ((V1Size != UnknownSize && isObjectSmallerThan(O2, V1Size, *TD)) || + (V2Size != UnknownSize && isObjectSmallerThan(O1, V2Size, *TD))) return NoAlias; // FIXME: This isn't aggressively handling alias(GEP, PHI) for example: if the Modified: llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp?rev=110091&r1=110090&r2=110091&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp Mon Aug 2 20:03:11 2010 @@ -155,8 +155,8 @@ Value *AO = GetBaseValue(AS); Value *BO = GetBaseValue(BS); if ((AO && AO != A) || (BO && BO != B)) - if (alias(AO ? AO : A, AO ? ~0u : ASize, - BO ? BO : B, BO ? ~0u : BSize) == NoAlias) + if (alias(AO ? AO : A, AO ? UnknownSize : ASize, + BO ? BO : B, BO ? UnknownSize : BSize) == NoAlias) return NoAlias; // Forward the query to the next analysis. From gohman at apple.com Mon Aug 2 20:07:32 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 03 Aug 2010 01:07:32 -0000 Subject: [llvm-commits] [llvm] r110092 - /llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Message-ID: <20100803010732.DF5AF2A6C12C@llvm.org> Author: djg Date: Mon Aug 2 20:07:32 2010 New Revision: 110092 URL: http://llvm.org/viewvc/llvm-project?rev=110092&view=rev Log: Update some comments. Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=110092&r1=110091&r2=110092&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Mon Aug 2 20:07:32 2010 @@ -18,12 +18,9 @@ // // This API represents memory as a (Pointer, Size) pair. The Pointer component // specifies the base memory address of the region, the Size specifies how large -// of an area is being queried. If Size is 0, two pointers only alias if they -// are exactly equal. If size is greater than zero, but small, the two pointers -// alias if the areas pointed to overlap. If the size is very large (ie, ~0U), -// then the two pointers alias if they may be pointing to components of the same -// memory object. Pointers that point to two completely different objects in -// memory never alias, regardless of the value of the Size component. +// of an area is being queried, or UnknownSize if the size is not known. +// Pointers that point to two completely different objects in memory never +// alias, regardless of the value of the Size component. // //===----------------------------------------------------------------------===// @@ -89,6 +86,9 @@ /// if (AA.alias(P1, P2)) { ... } /// to check to see if two pointers might alias. /// + /// See docs/AliasAnalysis.html for more information on the specific meanings + /// of these values. + /// enum AliasResult { NoAlias = 0, MayAlias = 1, MustAlias = 2 }; /// alias - The main low level interface to the alias analysis implementation. From bruno.cardoso at gmail.com Mon Aug 2 20:53:41 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 03 Aug 2010 01:53:41 -0000 Subject: [llvm-commits] [llvm] r110094 - /llvm/trunk/include/llvm/IntrinsicsX86.td Message-ID: <20100803015341.4D3902A6C12C@llvm.org> Author: bruno Date: Mon Aug 2 20:53:41 2010 New Revision: 110094 URL: http://llvm.org/viewvc/llvm-project?rev=110094&view=rev Log: Support x86 AVX 256-bit instruction intrinsics. Right now support all of them, but as soon as we properly codegen the simple vector operations in clang, remove the unnecessary builti-ins/intrinsics from clang and llvm. Modified: llvm/trunk/include/llvm/IntrinsicsX86.td Modified: llvm/trunk/include/llvm/IntrinsicsX86.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=110094&r1=110093&r2=110094&view=diff ============================================================================== --- llvm/trunk/include/llvm/IntrinsicsX86.td (original) +++ llvm/trunk/include/llvm/IntrinsicsX86.td Mon Aug 2 20:53:41 2010 @@ -978,6 +978,350 @@ } //===----------------------------------------------------------------------===// +// AVX + +// Arithmetic ops +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_add_pd_256 : GCCBuiltin<"__builtin_ia32_addpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_add_ps_256 : GCCBuiltin<"__builtin_ia32_addps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_sub_pd_256 : GCCBuiltin<"__builtin_ia32_subpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_sub_ps_256 : GCCBuiltin<"__builtin_ia32_subps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_addsub_pd_256 : GCCBuiltin<"__builtin_ia32_addsubpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_addsub_ps_256 : GCCBuiltin<"__builtin_ia32_addsubps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_div_pd_256 : GCCBuiltin<"__builtin_ia32_divpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_div_ps_256 : GCCBuiltin<"__builtin_ia32_divps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_max_pd_256 : GCCBuiltin<"__builtin_ia32_maxpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_max_ps_256 : GCCBuiltin<"__builtin_ia32_maxps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_min_pd_256 : GCCBuiltin<"__builtin_ia32_minpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_min_ps_256 : GCCBuiltin<"__builtin_ia32_minps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_mul_pd_256 : GCCBuiltin<"__builtin_ia32_mulpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_mul_ps_256 : GCCBuiltin<"__builtin_ia32_mulps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + + def int_x86_avx_sqrt_pd_256 : GCCBuiltin<"__builtin_ia32_sqrtpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_sqrt_ps_256 : GCCBuiltin<"__builtin_ia32_sqrtps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>; + + def int_x86_avx_sqrt_ps_nr_256 : GCCBuiltin<"__builtin_ia32_sqrtps_nr256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>; + + def int_x86_avx_rsqrt_ps_256 : GCCBuiltin<"__builtin_ia32_rsqrtps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_rsqrt_ps_nr_256 : GCCBuiltin<"__builtin_ia32_rsqrtps_nr256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>; + + def int_x86_avx_rcp_ps_256 : GCCBuiltin<"__builtin_ia32_rcpps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>; + + def int_x86_avx_round_pd_256 : GCCBuiltin<"__builtin_ia32_roundpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_i32_ty], [IntrNoMem]>; + def int_x86_avx_round_ps_256 : GCCBuiltin<"__builtin_ia32_roundps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_i32_ty], [IntrNoMem]>; +} + +// Logical ops +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_and_pd_256 : GCCBuiltin<"__builtin_ia32_andpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_and_ps_256 : GCCBuiltin<"__builtin_ia32_andps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_andn_pd_256 : GCCBuiltin<"__builtin_ia32_andnpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_andn_ps_256 : GCCBuiltin<"__builtin_ia32_andnps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_or_pd_256 : GCCBuiltin<"__builtin_ia32_orpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_or_ps_256 : GCCBuiltin<"__builtin_ia32_orps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_xor_pd_256 : GCCBuiltin<"__builtin_ia32_xorpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_xor_ps_256 : GCCBuiltin<"__builtin_ia32_xorps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; +} + +// Horizontal ops +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_hadd_pd_256 : GCCBuiltin<"__builtin_ia32_haddpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_hsub_ps_256 : GCCBuiltin<"__builtin_ia32_hsubps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_hsub_pd_256 : GCCBuiltin<"__builtin_ia32_hsubpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_hadd_ps_256 : GCCBuiltin<"__builtin_ia32_haddps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; +} + +// Vector permutation +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_vpermilvar_pd : GCCBuiltin<"__builtin_ia32_vpermilvarpd">, + Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, + llvm_v2i64_ty], [IntrNoMem]>; + def int_x86_avx_vpermilvar_ps : GCCBuiltin<"__builtin_ia32_vpermilvarps">, + Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, + llvm_v4i32_ty], [IntrNoMem]>; + + def int_x86_avx_vpermilvar_pd_256 : + GCCBuiltin<"__builtin_ia32_vpermilvarpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4i64_ty], [IntrNoMem]>; + def int_x86_avx_vpermilvar_ps_256 : + GCCBuiltin<"__builtin_ia32_vpermilvarps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8i32_ty], [IntrNoMem]>; + + def int_x86_avx_vperm2f128_pd_256 : + GCCBuiltin<"__builtin_ia32_vperm2f128_pd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx_vperm2f128_ps_256 : + GCCBuiltin<"__builtin_ia32_vperm2f128_ps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx_vperm2f128_si_256 : + GCCBuiltin<"__builtin_ia32_vperm2f128_si256">, + Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, + llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>; + + def int_x86_avx_vpermil_pd : GCCBuiltin<"__builtin_ia32_vpermilpd">, + Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, + llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx_vpermil_ps : GCCBuiltin<"__builtin_ia32_vpermilps">, + Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, + llvm_i8_ty], [IntrNoMem]>; + + def int_x86_avx_vpermil_pd_256 : GCCBuiltin<"__builtin_ia32_vpermilpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx_vpermil_ps_256 : GCCBuiltin<"__builtin_ia32_vpermilps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_i8_ty], [IntrNoMem]>; +} + +// Vector blend +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_blend_pd_256 : GCCBuiltin<"__builtin_ia32_blendpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx_blend_ps_256 : GCCBuiltin<"__builtin_ia32_blendps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx_blendv_pd_256 : GCCBuiltin<"__builtin_ia32_blendvpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty, llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_blendv_ps_256 : GCCBuiltin<"__builtin_ia32_blendvps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty, llvm_v8f32_ty], [IntrNoMem]>; +} + +// Vector dot product +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_dp_ps_256 : GCCBuiltin<"__builtin_ia32_dpps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>; +} + +// Vector shuffle +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_shuf_pd_256 : GCCBuiltin<"__builtin_ia32_shufpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx_shuf_ps_256 : GCCBuiltin<"__builtin_ia32_shufps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>; +} + +// Vector compare +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_cmp_pd_256 : GCCBuiltin<"__builtin_ia32_cmppd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx_cmp_ps_256 : GCCBuiltin<"__builtin_ia32_cmpps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>; +} + +// Vector extract and insert +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_vextractf128_pd_256 : + GCCBuiltin<"__builtin_ia32_vextractf128_pd256">, + Intrinsic<[llvm_v2f64_ty], [llvm_v4f64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx_vextractf128_ps_256 : + GCCBuiltin<"__builtin_ia32_vextractf128_ps256">, + Intrinsic<[llvm_v4f32_ty], [llvm_v8f32_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx_vextractf128_si_256 : + GCCBuiltin<"__builtin_ia32_vextractf128_si256">, + Intrinsic<[llvm_v4i32_ty], [llvm_v8i32_ty, llvm_i8_ty], [IntrNoMem]>; + + def int_x86_avx_vinsertf128_pd_256 : + GCCBuiltin<"__builtin_ia32_vinsertf128_pd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v2f64_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx_vinsertf128_ps_256 : + GCCBuiltin<"__builtin_ia32_vinsertf128_ps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v4f32_ty, llvm_i8_ty], [IntrNoMem]>; + def int_x86_avx_vinsertf128_si_256 : + GCCBuiltin<"__builtin_ia32_vinsertf128_si256">, + Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, + llvm_v4i32_ty, llvm_i8_ty], [IntrNoMem]>; +} + +// Vector convert +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_cvtdq2_pd_256 : GCCBuiltin<"__builtin_ia32_cvtdq2pd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4i32_ty], [IntrNoMem]>; + def int_x86_avx_cvtdq2_ps_256 : GCCBuiltin<"__builtin_ia32_cvtdq2ps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8i32_ty], [IntrNoMem]>; + def int_x86_avx_cvt_pd2_ps_256 : GCCBuiltin<"__builtin_ia32_cvtpd2ps256">, + Intrinsic<[llvm_v4f32_ty], [llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_cvt_ps2dq_256 : GCCBuiltin<"__builtin_ia32_cvtps2dq256">, + Intrinsic<[llvm_v8i32_ty], [llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_cvt_ps2_pd_256 : GCCBuiltin<"__builtin_ia32_cvtps2pd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f32_ty], [IntrNoMem]>; + def int_x86_avx_cvtt_pd2dq_256 : GCCBuiltin<"__builtin_ia32_cvttpd2dq256">, + Intrinsic<[llvm_v4i32_ty], [llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_cvt_pd2dq_256 : GCCBuiltin<"__builtin_ia32_cvtpd2dq256">, + Intrinsic<[llvm_v4i32_ty], [llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_cvtt_ps2dq_256 : GCCBuiltin<"__builtin_ia32_cvttps2dq256">, + Intrinsic<[llvm_v8i32_ty], [llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_si_256_si : GCCBuiltin<"__builtin_ia32_si256_si">, + Intrinsic<[llvm_v8i32_ty], [llvm_v4i32_ty], [IntrNoMem]>; + def int_x86_avx_ps_256_ps : GCCBuiltin<"__builtin_ia32_ps256_ps">, + Intrinsic<[llvm_v8f32_ty], [llvm_v4f32_ty], [IntrNoMem]>; + def int_x86_avx_pd_256_pd : GCCBuiltin<"__builtin_ia32_pd256_pd">, + Intrinsic<[llvm_v4f64_ty], [llvm_v2f64_ty], [IntrNoMem]>; + def int_x86_avx_si_si_256 : GCCBuiltin<"__builtin_ia32_si_si256">, + Intrinsic<[llvm_v4i32_ty], [llvm_v8i32_ty], [IntrNoMem]>; + def int_x86_avx_ps_ps_256 : GCCBuiltin<"__builtin_ia32_ps_ps256">, + Intrinsic<[llvm_v4f32_ty], [llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_pd_pd_256 : GCCBuiltin<"__builtin_ia32_pd_pd256">, + Intrinsic<[llvm_v2f64_ty], [llvm_v4f64_ty], [IntrNoMem]>; +} + +// Vector replicaete +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_movshdup_256 : GCCBuiltin<"__builtin_ia32_movshdup256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_movsldup_256 : GCCBuiltin<"__builtin_ia32_movsldup256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_movddup_256 : GCCBuiltin<"__builtin_ia32_movddup256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty], [IntrNoMem]>; +} + +// Vector unpack and interleave +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_unpckh_pd_256 : GCCBuiltin<"__builtin_ia32_unpckhpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_unpckl_pd_256 : GCCBuiltin<"__builtin_ia32_unpcklpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_unpckh_ps_256 : GCCBuiltin<"__builtin_ia32_unpckhps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_unpckl_ps_256 : GCCBuiltin<"__builtin_ia32_unpcklps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; +} + +// Vector bit test +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_vtestz_pd : GCCBuiltin<"__builtin_ia32_vtestzpd">, + Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty, + llvm_v2f64_ty], [IntrNoMem]>; + def int_x86_avx_vtestc_pd : GCCBuiltin<"__builtin_ia32_vtestcpd">, + Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty, + llvm_v2f64_ty], [IntrNoMem]>; + def int_x86_avx_vtestnzc_pd : GCCBuiltin<"__builtin_ia32_vtestnzcpd">, + Intrinsic<[llvm_i32_ty], [llvm_v2f64_ty, + llvm_v2f64_ty], [IntrNoMem]>; + def int_x86_avx_vtestz_ps : GCCBuiltin<"__builtin_ia32_vtestzps">, + Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, + llvm_v4f32_ty], [IntrNoMem]>; + def int_x86_avx_vtestc_ps : GCCBuiltin<"__builtin_ia32_vtestcps">, + Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, + llvm_v4f32_ty], [IntrNoMem]>; + def int_x86_avx_vtestnzc_ps : GCCBuiltin<"__builtin_ia32_vtestnzcps">, + Intrinsic<[llvm_i32_ty], [llvm_v4f32_ty, + llvm_v4f32_ty], [IntrNoMem]>; + def int_x86_avx_vtestz_pd_256 : GCCBuiltin<"__builtin_ia32_vtestzpd256">, + Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_vtestc_pd_256 : GCCBuiltin<"__builtin_ia32_vtestcpd256">, + Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_vtestnzc_pd_256 : GCCBuiltin<"__builtin_ia32_vtestnzcpd256">, + Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty, + llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_vtestz_ps_256 : GCCBuiltin<"__builtin_ia32_vtestzps256">, + Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_vtestc_ps_256 : GCCBuiltin<"__builtin_ia32_vtestcps256">, + Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_vtestnzc_ps_256 : GCCBuiltin<"__builtin_ia32_vtestnzcps256">, + Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty, + llvm_v8f32_ty], [IntrNoMem]>; + def int_x86_avx_ptestz_256 : GCCBuiltin<"__builtin_ia32_ptestz256">, + Intrinsic<[llvm_i32_ty], [llvm_v4i64_ty, + llvm_v4i64_ty], [IntrNoMem]>; + def int_x86_avx_ptestc_256 : GCCBuiltin<"__builtin_ia32_ptestc256">, + Intrinsic<[llvm_i32_ty], [llvm_v4i64_ty, + llvm_v4i64_ty], [IntrNoMem]>; + def int_x86_avx_ptestnzc_256 : GCCBuiltin<"__builtin_ia32_ptestnzc256">, + Intrinsic<[llvm_i32_ty], [llvm_v4i64_ty, + llvm_v4i64_ty], [IntrNoMem]>; +} + +// Vector extract sign mask +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_movmsk_pd_256 : GCCBuiltin<"__builtin_ia32_movmskpd256">, + Intrinsic<[llvm_i32_ty], [llvm_v4f64_ty], [IntrNoMem]>; + def int_x86_avx_movmsk_ps_256 : GCCBuiltin<"__builtin_ia32_movmskps256">, + Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty], [IntrNoMem]>; +} + +//===----------------------------------------------------------------------===// // MMX // Empty MMX state op. From bigcheesegs at gmail.com Mon Aug 2 21:38:21 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Tue, 03 Aug 2010 02:38:21 -0000 Subject: [llvm-commits] [llvm] r110097 - /llvm/trunk/lib/Analysis/CMakeLists.txt Message-ID: <20100803023821.17A132A6C12C@llvm.org> Author: mspencer Date: Mon Aug 2 21:38:20 2010 New Revision: 110097 URL: http://llvm.org/viewvc/llvm-project?rev=110097&view=rev Log: Fix CMake build Modified: llvm/trunk/lib/Analysis/CMakeLists.txt Modified: llvm/trunk/lib/Analysis/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CMakeLists.txt?rev=110097&r1=110096&r2=110097&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/CMakeLists.txt (original) +++ llvm/trunk/lib/Analysis/CMakeLists.txt Mon Aug 2 21:38:20 2010 @@ -46,6 +46,7 @@ ScalarEvolutionNormalization.cpp SparsePropagation.cpp Trace.cpp + TypeBasedAliasAnalysis.cpp ValueTracking.cpp ) From bigcheesegs at gmail.com Mon Aug 2 21:42:10 2010 From: bigcheesegs at gmail.com (Michael Spencer) Date: Mon, 2 Aug 2010 22:42:10 -0400 Subject: [llvm-commits] [llvm] r110077 - in /llvm/trunk: include/llvm/Analysis/Passes.h include/llvm/LinkAllPasses.h lib/Analysis/TypeBasedAliasAnalysis.cpp In-Reply-To: <20100802231101.912AD2A6C12C@llvm.org> References: <20100802231101.912AD2A6C12C@llvm.org> Message-ID: On Mon, Aug 2, 2010 at 7:11 PM, Dan Gohman wrote: > Author: djg > Date: Mon Aug ?2 18:11:01 2010 > New Revision: 110077 > > URL: http://llvm.org/viewvc/llvm-project?rev=110077&view=rev > Log: > Sketch up a preliminary Type-Based Alias Analysis implementation. > > Added: > ? ?llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp > Modified: > ? ?llvm/trunk/include/llvm/Analysis/Passes.h > ? ?llvm/trunk/include/llvm/LinkAllPasses.h > > Modified: llvm/trunk/include/llvm/Analysis/Passes.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Passes.h?rev=110077&r1=110076&r2=110077&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Analysis/Passes.h (original) > +++ llvm/trunk/include/llvm/Analysis/Passes.h Mon Aug ?2 18:11:01 2010 > @@ -81,6 +81,13 @@ > > ? //===--------------------------------------------------------------------===// > ? // > + ?// createTypeBasedAliasAnalysisPass - This pass implements metadata-based > + ?// type-based alias analysis. > + ?// > + ?ImmutablePass *createTypeBasedAliasAnalysisPass(); > + > + ?//===--------------------------------------------------------------------===// > + ?// > ? // createProfileLoaderPass - This pass loads information from a profile dump > ? // file. > ? // > > Modified: llvm/trunk/include/llvm/LinkAllPasses.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LinkAllPasses.h?rev=110077&r1=110076&r2=110077&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/LinkAllPasses.h (original) > +++ llvm/trunk/include/llvm/LinkAllPasses.h Mon Aug ?2 18:11:01 2010 > @@ -53,6 +53,7 @@ > ? ? ? (void) llvm::createBasicAliasAnalysisPass(); > ? ? ? (void) llvm::createLibCallAliasAnalysisPass(0); > ? ? ? (void) llvm::createScalarEvolutionAliasAnalysisPass(); > + ? ? ?(void) llvm::createTypeBasedAliasAnalysisPass(); > ? ? ? (void) llvm::createBlockPlacementPass(); > ? ? ? (void) llvm::createBreakCriticalEdgesPass(); > ? ? ? (void) llvm::createCFGSimplificationPass(); > > Added: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=110077&view=auto > ============================================================================== > --- llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp (added) > +++ llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Mon Aug ?2 18:11:01 2010 > @@ -0,0 +1,191 @@ > +//===- TypeBasedAliasAnalysis.cpp - Type-Based Alias Analysis -------------===// > +// > +// ? ? ? ? ? ? ? ? ? ? The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open Source > +// License. See LICENSE.TXT for details. > +// > +//===----------------------------------------------------------------------===// > +// > +// This file defines the TypeBasedAliasAnalysis pass, which implements > +// metadata-based TBAA. > +// > +// In LLVM IR, memory does not have types, so LLVM's own type system is not > +// suitable for doing TBAA. Instead, metadata is added to the IR to describe > +// a type system of a higher level language. > +// > +// This pass is language-independent. The type system is encoded in > +// metadata. This allows this pass to support typical C and C++ TBAA, but > +// it can also support custom aliasing behavior for other languages. > +// > +// This is a work-in-progress. It doesn't work yet, and the metadata > +// format isn't stable. > +// > +// TODO: getModRefBehavior. The AliasAnalysis infrastructure will need to > +// ? ? ? be extended. > +// TODO: AA chaining > +// TODO: struct fields > +// > +//===----------------------------------------------------------------------===// > + > +#include "llvm/Analysis/AliasAnalysis.h" > +#include "llvm/Analysis/Passes.h" > +#include "llvm/Module.h" > +#include "llvm/Metadata.h" > +#include "llvm/Pass.h" > +using namespace llvm; > + > +namespace { > + ?/// TBAANode - This is a simple wrapper around an MDNode which provides a > + ?/// higher-level interface by hiding the details of how alias analysis > + ?/// information is encoded in its operands. > + ?class TBAANode { > + ? ?const MDNode *Node; > + > + ?public: > + ? ?TBAANode() : Node(0) {} > + ? ?explicit TBAANode(MDNode *N) : Node(N) {} > + > + ? ?/// getNode - Get the MDNode for this TBAANode. > + ? ?const MDNode *getNode() const { return Node; } > + > + ? ?/// getParent - Get this TBAANode's Alias DAG parent. > + ? ?TBAANode getParent() const { > + ? ? ?if (Node->getNumOperands() < 2) > + ? ? ? ?return TBAANode(); > + ? ? ?MDNode *P = dyn_cast(Node->getOperand(1)); > + ? ? ?if (!P) > + ? ? ? ?return TBAANode(); > + ? ? ?// Ok, this node has a valid parent. Return it. > + ? ? ?return TBAANode(P); > + ? ?} > + > + ? ?/// TypeIsImmutable - Test if this TBAANode represents a type for objects > + ? ?/// which are not modified (by any means) in the context where this > + ? ?/// AliasAnalysis is relevant. > + ? ?bool TypeIsImmutable() const { > + ? ? ?if (Node->getNumOperands() < 3) > + ? ? ? ?return false; > + ? ? ?ConstantInt *CI = dyn_cast(Node->getOperand(2)); > + ? ? ?if (!CI) > + ? ? ? ?return false; > + ? ? ?// TODO: Think about the encoding. > + ? ? ?return CI->isOne(); > + ? ?} > + ?}; > +} > + > +namespace { > + ?/// TypeBasedAliasAnalysis - This is a simple alias analysis > + ?/// implementation that uses TypeBased to answer queries. > + ?class TypeBasedAliasAnalysis : public ImmutablePass, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? public AliasAnalysis { > + ?public: > + ? ?static char ID; // Class identification, replacement for typeinfo > + ? ?TypeBasedAliasAnalysis() : ImmutablePass(&ID) {} > + > + ? ?/// getAdjustedAnalysisPointer - This method is used when a pass implements > + ? ?/// an analysis interface through multiple inheritance. ?If needed, it > + ? ?/// should override this to adjust the this pointer as needed for the > + ? ?/// specified pass info. > + ? ?virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { > + ? ? ?if (PI->isPassID(&AliasAnalysis::ID)) > + ? ? ? ?return (AliasAnalysis*)this; > + ? ? ?return this; > + ? ?} > + > + ?private: > + ? ?virtual void getAnalysisUsage(AnalysisUsage &AU) const; > + ? ?virtual AliasResult alias(const Value *V1, unsigned V1Size, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?const Value *V2, unsigned V2Size); > + ? ?virtual bool pointsToConstantMemory(const Value *P); > + ?}; > +} ?// End of anonymous namespace > + > +// Register this pass... > +char TypeBasedAliasAnalysis::ID = 0; > +INITIALIZE_AG_PASS(TypeBasedAliasAnalysis, AliasAnalysis, "tbaa", > + ? ? ? ? ? ? ? ? ? "Type-Based Alias Analysis", false, true, false); > + > +ImmutablePass *llvm::createTypeBasedAliasAnalysisPass() { > + ?return new TypeBasedAliasAnalysis(); > +} > + > +void > +TypeBasedAliasAnalysis::getAnalysisUsage(AnalysisUsage &AU) const { > + ?AU.setPreservesAll(); > + ?AliasAnalysis::getAnalysisUsage(AU); > +} > + > +AliasAnalysis::AliasResult > +TypeBasedAliasAnalysis::alias(const Value *A, unsigned ASize, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?const Value *B, unsigned BSize) { > + ?// Currently, metadata can only be attached to Instructions. > + ?const Instruction *AI = dyn_cast(A); > + ?if (!AI) return MayAlias; > + ?const Instruction *BI = dyn_cast(B); > + ?if (!BI) return MayAlias; > + > + ?// Get the attached MDNodes. If either value lacks a tbaa MDNode, we must > + ?// be conservative. > + ?MDNode *AM = > + ? ?AI->getMetadata(AI->getParent()->getParent()->getParent() > + ? ? ? ? ? ? ? ? ? ? ?->getMDKindID("tbaa")); > + ?if (!AM) return MayAlias; > + ?MDNode *BM = > + ? ?AI->getMetadata(BI->getParent()->getParent()->getParent() > + ? ? ? ? ? ? ? ? ? ? ?->getMDKindID("tbaa")); > + ?if (!BM) return MayAlias; > + > + ?// Keep track of the root node for A and B. > + ?TBAANode RootA, RootB; > + > + ?// Climb the DAG from A to see if we reach B. > + ?for (TBAANode T(AM); ; ) { > + ? ?if (T.getNode() == BM) > + ? ? ?// B is an ancestor of A. > + ? ? ?return MayAlias; > + > + ? ?RootA = T; > + ? ?T = T.getParent(); > + ? ?if (!T.getNode()) > + ? ? ?break; > + ?} > + > + ?// Climb the DAG from B to see if we reach A. > + ?for (TBAANode T(BM); ; ) { > + ? ?if (T.getNode() == AM) > + ? ? ?// A is an ancestor of B. > + ? ? ?return MayAlias; > + > + ? ?RootB = T; > + ? ?T = T.getParent(); > + ? ?if (!T.getNode()) > + ? ? ?break; > + ?} > + > + ?// Neither node is an ancestor of the other. > + > + ?// If they have the same root, then we've proved there's no alias. > + ?if (RootA.getNode() == RootB.getNode()) > + ? ?return NoAlias; > + > + ?// If they have different roots, they're part of different potentially > + ?// unrelated type systems, so we must be conservative. > + ?return MayAlias; > +} > + > +bool TypeBasedAliasAnalysis::pointsToConstantMemory(const Value *P) { > + ?// Currently, metadata can only be attached to Instructions. > + ?const Instruction *I = dyn_cast(P); > + ?if (!I) return false; > + > + ?MDNode *M = > + ? ?I->getMetadata(I->getParent()->getParent()->getParent() > + ? ? ? ? ? ? ? ? ? ?->getMDKindID("tbaa")); > + ?if (!M) return false; > + > + ?// If this is an "immutable" type, we can assume the pointer is pointing > + ?// to constant memory. > + ?return TBAANode(M).TypeIsImmutable(); > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > You forgot to add TypeBasedAliasAnalysis.cpp to CMakeLists.txt. I did this in r110097. - Michael Spencer From tcare at apple.com Mon Aug 2 16:07:58 2010 From: tcare at apple.com (Tom Care) Date: Mon, 2 Aug 2010 14:07:58 -0700 Subject: [llvm-commits] [llvm] r110060 - /llvm/trunk/cmake/modules/LLVMConfig.cmake In-Reply-To: <20100802204801.CE6062A6C12C@llvm.org> References: <20100802204801.CE6062A6C12C@llvm.org> Message-ID: <93BA7591-BA11-418B-8966-059435143DD2@apple.com> Thanks Oscar :) On Aug 2, 2010, at 1:48 PM, Oscar Fuentes wrote: > Author: ofv > Date: Mon Aug 2 15:48:01 2010 > New Revision: 110060 > > URL: http://llvm.org/viewvc/llvm-project?rev=110060&view=rev > Log: > explicit_map_components_to_libraries now does not complain when there > is a dependence on an LLVM target that is not included on the build. > > When LLVM_TARGETS_TO_BUILD didn't include all the targets, the > function emitted an error like > > "Library LLVMArmParser not found in list of llvm libraries." > > Modified: > llvm/trunk/cmake/modules/LLVMConfig.cmake > > Modified: llvm/trunk/cmake/modules/LLVMConfig.cmake > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMConfig.cmake?rev=110060&r1=110059&r2=110060&view=diff > ============================================================================== > --- llvm/trunk/cmake/modules/LLVMConfig.cmake (original) > +++ llvm/trunk/cmake/modules/LLVMConfig.cmake Mon Aug 2 15:48:01 2010 > @@ -16,6 +16,24 @@ > endfunction(get_system_libs) > > > +function(is_llvm_target_library library return_var) > + # Sets variable `return_var' to ON if `library' corresponds to a > + # LLVM supported target. To OFF if it doesn't. > + set(${return_var} OFF PARENT_SCOPE) > + string(TOUPPER "${library}" capitalized_lib) > + string(TOUPPER "${LLVM_ALL_TARGETS}" targets) > + foreach(t ${targets}) > + if( capitalized_lib STREQUAL "LLVM${t}CODEGEN" OR > + capitalized_lib STREQUAL "LLVM${t}ASMPARSER" OR > + capitalized_lib STREQUAL "LLVM${t}DISASSEMBLER" OR > + capitalized_lib STREQUAL "LLVM${t}INFO" ) > + set(${return_var} ON PARENT_SCOPE) > + break() > + endif() > + endforeach() > +endfunction(is_llvm_target_library) > + > + > macro(llvm_config executable) > explicit_llvm_config(${executable} ${ARGN}) > endmacro(llvm_config) > @@ -87,7 +105,13 @@ > string(TOUPPER "${c}" capitalized) > list(FIND capitalized_libs ${capitalized} idx) > if( idx LESS 0 ) > - message(FATAL_ERROR "Library ${c} not found in list of llvm libraries.") > + # The library is unkown. Maybe is an ommitted target? > + is_llvm_target_library(${c} iltl_result) > + if( iltl_result ) > + break() > + else() > + message(FATAL_ERROR "Library ${c} not found in list of llvm libraries.") > + endif() > endif( idx LESS 0 ) > list(GET llvm_libs ${idx} canonical_lib) > list(REMOVE_ITEM result ${canonical_lib}) > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Mon Aug 2 22:21:42 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 03 Aug 2010 03:21:42 -0000 Subject: [llvm-commits] [www] r110098 - /www/trunk/Users.html Message-ID: <20100803032142.939D22A6C12C@llvm.org> Author: lattner Date: Mon Aug 2 22:21:42 2010 New Revision: 110098 URL: http://llvm.org/viewvc/llvm-project?rev=110098&view=rev Log: Labview 2010 Modified: www/trunk/Users.html Modified: www/trunk/Users.html URL: http://llvm.org/viewvc/llvm-project/www/trunk/Users.html?rev=110098&r1=110097&r2=110098&view=diff ============================================================================== --- www/trunk/Users.html (original) +++ www/trunk/Users.html Mon Aug 2 22:21:42 2010 @@ -160,6 +160,11 @@ Compiler for stack machine architecture + + National Instruments + Compiler for LabView 2010 + + NVIDIA From sabre at nondot.org Mon Aug 2 22:23:28 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 03 Aug 2010 03:23:28 -0000 Subject: [llvm-commits] [www] r110099 - /www/trunk/Users.html Message-ID: <20100803032328.DE5992A6C12C@llvm.org> Author: lattner Date: Mon Aug 2 22:23:28 2010 New Revision: 110099 URL: http://llvm.org/viewvc/llvm-project?rev=110099&view=rev Log: much meatier link. Modified: www/trunk/Users.html Modified: www/trunk/Users.html URL: http://llvm.org/viewvc/llvm-project/www/trunk/Users.html?rev=110099&r1=110098&r2=110099&view=diff ============================================================================== --- www/trunk/Users.html (original) +++ www/trunk/Users.html Mon Aug 2 22:23:28 2010 @@ -162,7 +162,7 @@ National Instruments - Compiler for LabView 2010 + Compiler for LabView 2010 From clattner at apple.com Mon Aug 2 22:43:45 2010 From: clattner at apple.com (Chris Lattner) Date: Mon, 2 Aug 2010 20:43:45 -0700 Subject: [llvm-commits] [llvm] r110091 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h lib/Analysis/BasicAliasAnalysis.cpp lib/Analysis/ScalarEvolutionAliasAnalysis.cpp In-Reply-To: <20100803010312.196002A6C12C@llvm.org> References: <20100803010312.196002A6C12C@llvm.org> Message-ID: <04BC9209-2E7E-493E-B08E-9F1ABA588E21@apple.com> On Aug 2, 2010, at 6:03 PM, Dan Gohman wrote: > Author: djg > Date: Mon Aug 2 20:03:11 2010 > New Revision: 110091 > > URL: http://llvm.org/viewvc/llvm-project?rev=110091&view=rev > Log: > Introduce a symbolic constant for ~0u for use with AliasAnalysis. Crazy. I thought everyone loved magic numbers? ;-) -Chris From bigcheesegs at gmail.com Mon Aug 2 23:43:24 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Tue, 03 Aug 2010 04:43:24 -0000 Subject: [llvm-commits] [llvm] r110100 - in /llvm/trunk: lib/MC/WinCOFFObjectWriter.cpp test/mc/ test/mc/COFF/ test/mc/COFF/symbol-fragment-offset.ll Message-ID: <20100803044324.8758C2A6C12C@llvm.org> Author: mspencer Date: Mon Aug 2 23:43:24 2010 New Revision: 110100 URL: http://llvm.org/viewvc/llvm-project?rev=110100&view=rev Log: MC: Fix symbol fragment offsets in COFF. Patch by Cameron Esfahani! Added: llvm/trunk/test/mc/ llvm/trunk/test/mc/COFF/ llvm/trunk/test/mc/COFF/symbol-fragment-offset.ll Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=110100&r1=110099&r2=110100&view=diff ============================================================================== --- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Mon Aug 2 23:43:24 2010 @@ -617,7 +617,8 @@ COFFSection *coff_section = SectionMap[SymbolData->Fragment->getParent()]; coff_symbol->Data.SectionNumber = coff_section->Number; - coff_symbol->Data.Value = Layout.getFragmentOffset(SymbolData->Fragment); + coff_symbol->Data.Value = Layout.getFragmentOffset(SymbolData->Fragment) + + SymbolData->Offset; } // Update auxiliary symbol info. Added: llvm/trunk/test/mc/COFF/symbol-fragment-offset.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/mc/COFF/symbol-fragment-offset.ll?rev=110100&view=auto ============================================================================== --- llvm/trunk/test/mc/COFF/symbol-fragment-offset.ll (added) +++ llvm/trunk/test/mc/COFF/symbol-fragment-offset.ll Mon Aug 2 23:43:24 2010 @@ -0,0 +1,182 @@ +; RUN: llc -filetype=obj %s -o %t +; RUN: coff-dump.py %abs_tmp | FileCheck %s + +; ModuleID = 'coff-fragment-test.c' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" +target triple = "i686-pc-win32" + + at .str = private constant [7 x i8] c"Hello \00" ; <[7 x i8]*> [#uses=1] + at str = internal constant [7 x i8] c"World!\00" ; <[7 x i8]*> [#uses=1] + +define i32 @main() nounwind { +entry: + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([7 x i8]* @.str, i32 0, i32 0)) nounwind ; [#uses=0] + %puts = tail call i32 @puts(i8* getelementptr inbounds ([7 x i8]* @str, i32 0, i32 0)) ; [#uses=0] + ret i32 0 +} + +declare i32 @printf(i8* nocapture, ...) nounwind + +declare i32 @puts(i8* nocapture) nounwind + +; CHECK: { +; CHECK: MachineType = IMAGE_FILE_MACHINE_I386 (0x14C) +; CHECK: NumberOfSections = 2 +; CHECK: TimeDateStamp = {{[0-9]+}} +; CHECK: PointerToSymbolTable = 0xBB +; CHECK: NumberOfSymbols = 9 +; CHECK: SizeOfOptionalHeader = 0 +; CHECK: Characteristics = 0x0 +; CHECK: Sections = [ +; CHECK: 0 = { +; CHECK: Name = .text +; CHECK: VirtualSize = 0 +; CHECK: VirtualAddress = 0 +; CHECK: SizeOfRawData = 33 +; CHECK: PointerToRawData = 0x64 +; CHECK: PointerToRelocations = 0x85 +; CHECK: PointerToLineNumbers = 0x0 +; CHECK: NumberOfRelocations = 4 +; CHECK: NumberOfLineNumbers = 0 +; CHECK: Charateristics = 0x60500020 +; CHECK: IMAGE_SCN_CNT_CODE +; CHECK: IMAGE_SCN_ALIGN_16BYTES +; CHECK: IMAGE_SCN_MEM_EXECUTE +; CHECK: IMAGE_SCN_MEM_READ +; CHECK: SectionData = +; CHECK: 83 EC 04 C7 04 24 00 00 - 00 00 E8 00 00 00 00 C7 |.....$..........| +; CHECK: 04 24 00 00 00 00 E8 00 - 00 00 00 31 C0 83 C4 04 |.$.........1....| +; CHECK: C3 |.| + +; CHECK: Relocations = [ +; CHECK: 0 = { +; CHECK: VirtualAddress = 0x6 +; CHECK: SymbolTableIndex = 5 +; CHECK: Type = IMAGE_REL_I386_DIR32 (6) +; CHECK: SymbolName = _main +; CHECK: } +; CHECK: 1 = { +; CHECK: VirtualAddress = 0xB +; CHECK: SymbolTableIndex = 6 +; CHECK: Type = IMAGE_REL_I386_REL32 (20) +; CHECK: SymbolName = L_.str +; CHECK: } +; CHECK: 2 = { +; CHECK: VirtualAddress = 0x12 +; CHECK: SymbolTableIndex = 7 +; CHECK: Type = IMAGE_REL_I386_DIR32 (6) +; CHECK: SymbolName = _printf +; CHECK: } +; CHECK: 3 = { +; CHECK: VirtualAddress = 0x17 +; CHECK: SymbolTableIndex = 8 +; CHECK: Type = IMAGE_REL_I386_REL32 (20) +; CHECK: SymbolName = _str +; CHECK: } +; CHECK: ] +; CHECK: } +; CHECK: 1 = { +; CHECK: Name = .data +; CHECK: VirtualSize = 0 +; CHECK: VirtualAddress = 0 +; CHECK: SizeOfRawData = 14 +; CHECK: PointerToRawData = 0xAD +; CHECK: PointerToRelocations = 0x0 +; CHECK: PointerToLineNumbers = 0x0 +; CHECK: NumberOfRelocations = 0 +; CHECK: NumberOfLineNumbers = 0 +; CHECK: Charateristics = 0xC0100040 +; CHECK: IMAGE_SCN_CNT_INITIALIZED_DATA +; CHECK: IMAGE_SCN_ALIGN_1BYTES +; CHECK: IMAGE_SCN_MEM_READ +; CHECK: IMAGE_SCN_MEM_WRITE +; CHECK: SectionData = +; CHECK: 48 65 6C 6C 6F 20 00 57 - 6F 72 6C 64 21 00 |Hello .World!.| + +; CHECK: Relocations = None +; CHECK: } +; CHECK: ] +; CHECK: Symbols = [ +; CHECK: 0 = { +; CHECK: Name = .text +; CHECK: Value = 0 +; CHECK: SectionNumber = 1 +; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3) +; CHECK: NumberOfAuxSymbols = 1 +; CHECK: AuxillaryData = +; CHECK: 21 00 00 00 04 00 00 00 - 00 00 00 00 01 00 00 00 |!...............| +; CHECK: 00 00 |..| + +; CHECK: } +; CHECK: 1 = { +; CHECK: Name = .data +; CHECK: Value = 0 +; CHECK: SectionNumber = 2 +; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3) +; CHECK: NumberOfAuxSymbols = 1 +; CHECK: AuxillaryData = +; CHECK: 0E 00 00 00 00 00 00 00 - 00 00 00 00 02 00 00 00 |................| +; CHECK: 00 00 |..| + +; CHECK: } +; CHECK: 2 = { +; CHECK: Name = _main +; CHECK: Value = 0 +; CHECK: SectionNumber = 1 +; CHECK: SimpleType = unknown (32) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2) +; CHECK: NumberOfAuxSymbols = 0 +; CHECK: AuxillaryData = + +; CHECK: } +; CHECK: 3 = { +; CHECK: Name = L_.str +; CHECK: Value = 0 +; CHECK: SectionNumber = 2 +; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3) +; CHECK: NumberOfAuxSymbols = 0 +; CHECK: AuxillaryData = + +; CHECK: } +; CHECK: 4 = { +; CHECK: Name = _printf +; CHECK: Value = 0 +; CHECK: SectionNumber = 0 +; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2) +; CHECK: NumberOfAuxSymbols = 0 +; CHECK: AuxillaryData = + +; CHECK: } +; CHECK: 5 = { +; CHECK: Name = _str +; CHECK: Value = 7 +; CHECK: SectionNumber = 2 +; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3) +; CHECK: NumberOfAuxSymbols = 0 +; CHECK: AuxillaryData = + +; CHECK: } +; CHECK: 6 = { +; CHECK: Name = _puts +; CHECK: Value = 0 +; CHECK: SectionNumber = 0 +; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2) +; CHECK: NumberOfAuxSymbols = 0 +; CHECK: AuxillaryData = + +; CHECK: } +; CHECK: ] +; CHECK: } From bigcheesegs at gmail.com Mon Aug 2 23:43:33 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Tue, 03 Aug 2010 04:43:33 -0000 Subject: [llvm-commits] [llvm] r110101 - /llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Message-ID: <20100803044333.3D94C2A6C12C@llvm.org> Author: mspencer Date: Mon Aug 2 23:43:33 2010 New Revision: 110101 URL: http://llvm.org/viewvc/llvm-project?rev=110101&view=rev Log: MC: Add time travel support to COFF. Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=110101&r1=110100&r2=110101&view=diff ============================================================================== --- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Mon Aug 2 23:43:33 2010 @@ -31,6 +31,8 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/System/TimeValue.h" + #include using namespace llvm; @@ -687,6 +689,8 @@ Header.PointerToSymbolTable = offset; + Header.TimeDateStamp = sys::TimeValue::now().toEpochTime(); + // Write it all to disk... WriteFileHeader(Header); From daniel at zuster.org Mon Aug 2 23:53:26 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 2 Aug 2010 21:53:26 -0700 Subject: [llvm-commits] [PATCH 2/5] Record a symbol's size which is needed for ELF symbol tables. In-Reply-To: References: <75e6e9d13ae15c9baf796f3d6fbbe504a2197172.1280173465.git.matt@console-pimps.org> Message-ID: On Mon, Jul 26, 2010 at 1:52 PM, Eli Friedman wrote: > On Mon, Jul 26, 2010 at 1:00 PM, Matt Fleming wrote: >> --- >> ?include/llvm/MC/MCAssembler.h | ? 22 ++++++++++++++++++++++ >> ?lib/MC/MCAssembler.cpp ? ? ? ?| ? ?3 ++- >> ?2 files changed, 24 insertions(+), 1 deletions(-) >> >> diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h >> index 51f265d..c189a1d 100644 >> --- a/include/llvm/MC/MCAssembler.h >> +++ b/include/llvm/MC/MCAssembler.h >> @@ -24,6 +24,7 @@ namespace llvm { >> ?class raw_ostream; >> ?class MCAsmLayout; >> ?class MCAssembler; >> +class MCBinaryExpr; >> ?class MCContext; >> ?class MCCodeEmitter; >> ?class MCExpr; >> @@ -460,6 +461,10 @@ public: >> ? // common symbol can never get a definition. >> ? uint64_t CommonSize; >> >> + ?uint64_t SymbolSize; >> + >> + ?const MCBinaryExpr *SizeSymbol; >> + >> ? /// CommonAlign - The alignment of the symbol, if it is 'common'. >> ? // >> ? // FIXME: Pack this in with other fields? >> @@ -517,6 +522,23 @@ public: >> ? ? return CommonSize; >> ? } >> >> + ?void setSize(uint64_t _SymbolSize) { >> + ? ?SymbolSize = _SymbolSize; >> + ?} >> + >> + ?uint64_t getSize() { >> + ? ?return SymbolSize; >> + ?} >> + >> + ?void setSizeSymbol(const MCBinaryExpr *SS) { >> + ? ?SizeSymbol = SS; >> + ?} >> + >> + ?const MCBinaryExpr *getSizeSymbol() { >> + ? ?return SizeSymbol; >> + ?} > > Why not just "const MCExpr *getSize()"? > > On a side note, I don't really follow the distinction between MCSymbol > and MCSymbolData... MCSymbol is shared with CodeGen, MCSymbolData is something private to the assembler backend and only used when writing .o files. That said, I would like to eliminate the split eventually... - Daniel > -Eli > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From bigcheesegs at gmail.com Mon Aug 2 23:53:28 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Tue, 03 Aug 2010 04:53:28 -0000 Subject: [llvm-commits] [llvm] r110103 - in /llvm/trunk: lib/MC/WinCOFFObjectWriter.cpp test/mc/COFF/symbol-fragment-offset.ll Message-ID: <20100803045328.E6F082A6C12C@llvm.org> Author: mspencer Date: Mon Aug 2 23:53:28 2010 New Revision: 110103 URL: http://llvm.org/viewvc/llvm-project?rev=110103&view=rev Log: Revert "MC: Fix symbol fragment offsets in COFF." This reverts commit r110100 Wrong path caps. Removed: llvm/trunk/test/mc/COFF/symbol-fragment-offset.ll Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=110103&r1=110102&r2=110103&view=diff ============================================================================== --- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Mon Aug 2 23:53:28 2010 @@ -619,8 +619,7 @@ COFFSection *coff_section = SectionMap[SymbolData->Fragment->getParent()]; coff_symbol->Data.SectionNumber = coff_section->Number; - coff_symbol->Data.Value = Layout.getFragmentOffset(SymbolData->Fragment) - + SymbolData->Offset; + coff_symbol->Data.Value = Layout.getFragmentOffset(SymbolData->Fragment); } // Update auxiliary symbol info. Removed: llvm/trunk/test/mc/COFF/symbol-fragment-offset.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/mc/COFF/symbol-fragment-offset.ll?rev=110102&view=auto ============================================================================== --- llvm/trunk/test/mc/COFF/symbol-fragment-offset.ll (original) +++ llvm/trunk/test/mc/COFF/symbol-fragment-offset.ll (removed) @@ -1,182 +0,0 @@ -; RUN: llc -filetype=obj %s -o %t -; RUN: coff-dump.py %abs_tmp | FileCheck %s - -; ModuleID = 'coff-fragment-test.c' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" -target triple = "i686-pc-win32" - - at .str = private constant [7 x i8] c"Hello \00" ; <[7 x i8]*> [#uses=1] - at str = internal constant [7 x i8] c"World!\00" ; <[7 x i8]*> [#uses=1] - -define i32 @main() nounwind { -entry: - %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([7 x i8]* @.str, i32 0, i32 0)) nounwind ; [#uses=0] - %puts = tail call i32 @puts(i8* getelementptr inbounds ([7 x i8]* @str, i32 0, i32 0)) ; [#uses=0] - ret i32 0 -} - -declare i32 @printf(i8* nocapture, ...) nounwind - -declare i32 @puts(i8* nocapture) nounwind - -; CHECK: { -; CHECK: MachineType = IMAGE_FILE_MACHINE_I386 (0x14C) -; CHECK: NumberOfSections = 2 -; CHECK: TimeDateStamp = {{[0-9]+}} -; CHECK: PointerToSymbolTable = 0xBB -; CHECK: NumberOfSymbols = 9 -; CHECK: SizeOfOptionalHeader = 0 -; CHECK: Characteristics = 0x0 -; CHECK: Sections = [ -; CHECK: 0 = { -; CHECK: Name = .text -; CHECK: VirtualSize = 0 -; CHECK: VirtualAddress = 0 -; CHECK: SizeOfRawData = 33 -; CHECK: PointerToRawData = 0x64 -; CHECK: PointerToRelocations = 0x85 -; CHECK: PointerToLineNumbers = 0x0 -; CHECK: NumberOfRelocations = 4 -; CHECK: NumberOfLineNumbers = 0 -; CHECK: Charateristics = 0x60500020 -; CHECK: IMAGE_SCN_CNT_CODE -; CHECK: IMAGE_SCN_ALIGN_16BYTES -; CHECK: IMAGE_SCN_MEM_EXECUTE -; CHECK: IMAGE_SCN_MEM_READ -; CHECK: SectionData = -; CHECK: 83 EC 04 C7 04 24 00 00 - 00 00 E8 00 00 00 00 C7 |.....$..........| -; CHECK: 04 24 00 00 00 00 E8 00 - 00 00 00 31 C0 83 C4 04 |.$.........1....| -; CHECK: C3 |.| - -; CHECK: Relocations = [ -; CHECK: 0 = { -; CHECK: VirtualAddress = 0x6 -; CHECK: SymbolTableIndex = 5 -; CHECK: Type = IMAGE_REL_I386_DIR32 (6) -; CHECK: SymbolName = _main -; CHECK: } -; CHECK: 1 = { -; CHECK: VirtualAddress = 0xB -; CHECK: SymbolTableIndex = 6 -; CHECK: Type = IMAGE_REL_I386_REL32 (20) -; CHECK: SymbolName = L_.str -; CHECK: } -; CHECK: 2 = { -; CHECK: VirtualAddress = 0x12 -; CHECK: SymbolTableIndex = 7 -; CHECK: Type = IMAGE_REL_I386_DIR32 (6) -; CHECK: SymbolName = _printf -; CHECK: } -; CHECK: 3 = { -; CHECK: VirtualAddress = 0x17 -; CHECK: SymbolTableIndex = 8 -; CHECK: Type = IMAGE_REL_I386_REL32 (20) -; CHECK: SymbolName = _str -; CHECK: } -; CHECK: ] -; CHECK: } -; CHECK: 1 = { -; CHECK: Name = .data -; CHECK: VirtualSize = 0 -; CHECK: VirtualAddress = 0 -; CHECK: SizeOfRawData = 14 -; CHECK: PointerToRawData = 0xAD -; CHECK: PointerToRelocations = 0x0 -; CHECK: PointerToLineNumbers = 0x0 -; CHECK: NumberOfRelocations = 0 -; CHECK: NumberOfLineNumbers = 0 -; CHECK: Charateristics = 0xC0100040 -; CHECK: IMAGE_SCN_CNT_INITIALIZED_DATA -; CHECK: IMAGE_SCN_ALIGN_1BYTES -; CHECK: IMAGE_SCN_MEM_READ -; CHECK: IMAGE_SCN_MEM_WRITE -; CHECK: SectionData = -; CHECK: 48 65 6C 6C 6F 20 00 57 - 6F 72 6C 64 21 00 |Hello .World!.| - -; CHECK: Relocations = None -; CHECK: } -; CHECK: ] -; CHECK: Symbols = [ -; CHECK: 0 = { -; CHECK: Name = .text -; CHECK: Value = 0 -; CHECK: SectionNumber = 1 -; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) -; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) -; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3) -; CHECK: NumberOfAuxSymbols = 1 -; CHECK: AuxillaryData = -; CHECK: 21 00 00 00 04 00 00 00 - 00 00 00 00 01 00 00 00 |!...............| -; CHECK: 00 00 |..| - -; CHECK: } -; CHECK: 1 = { -; CHECK: Name = .data -; CHECK: Value = 0 -; CHECK: SectionNumber = 2 -; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) -; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) -; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3) -; CHECK: NumberOfAuxSymbols = 1 -; CHECK: AuxillaryData = -; CHECK: 0E 00 00 00 00 00 00 00 - 00 00 00 00 02 00 00 00 |................| -; CHECK: 00 00 |..| - -; CHECK: } -; CHECK: 2 = { -; CHECK: Name = _main -; CHECK: Value = 0 -; CHECK: SectionNumber = 1 -; CHECK: SimpleType = unknown (32) -; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) -; CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2) -; CHECK: NumberOfAuxSymbols = 0 -; CHECK: AuxillaryData = - -; CHECK: } -; CHECK: 3 = { -; CHECK: Name = L_.str -; CHECK: Value = 0 -; CHECK: SectionNumber = 2 -; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) -; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) -; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3) -; CHECK: NumberOfAuxSymbols = 0 -; CHECK: AuxillaryData = - -; CHECK: } -; CHECK: 4 = { -; CHECK: Name = _printf -; CHECK: Value = 0 -; CHECK: SectionNumber = 0 -; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) -; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) -; CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2) -; CHECK: NumberOfAuxSymbols = 0 -; CHECK: AuxillaryData = - -; CHECK: } -; CHECK: 5 = { -; CHECK: Name = _str -; CHECK: Value = 7 -; CHECK: SectionNumber = 2 -; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) -; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) -; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3) -; CHECK: NumberOfAuxSymbols = 0 -; CHECK: AuxillaryData = - -; CHECK: } -; CHECK: 6 = { -; CHECK: Name = _puts -; CHECK: Value = 0 -; CHECK: SectionNumber = 0 -; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) -; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) -; CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2) -; CHECK: NumberOfAuxSymbols = 0 -; CHECK: AuxillaryData = - -; CHECK: } -; CHECK: ] -; CHECK: } From daniel at zuster.org Mon Aug 2 23:56:44 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 2 Aug 2010 21:56:44 -0700 Subject: [llvm-commits] [PATCH 3/5] Introduce a helper method to add a section to the end of a layout. This will be used by the ELF ObjectWriter code to add the metadata sections (symbol table, etc) to the end of an object file. In-Reply-To: References: Message-ID: Hi Matt, I'm not sure why this needs to exist in the assembler backend -- why can't the ELF streamer just create the appropriate sections at the end of assembly? - Daniel On Mon, Jul 26, 2010 at 1:00 PM, Matt Fleming wrote: > --- > ?include/llvm/MC/MCAssembler.h | ? ?2 ++ > ?lib/MC/MCAssembler.cpp ? ? ? ?| ? 34 ++++++++++++++++++++++++++++++++++ > ?2 files changed, 36 insertions(+), 0 deletions(-) > > diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h > index c189a1d..89d83ba 100644 > --- a/include/llvm/MC/MCAssembler.h > +++ b/include/llvm/MC/MCAssembler.h > @@ -679,6 +679,8 @@ public: > ? void WriteSectionData(const MCSectionData *Section, const MCAsmLayout &Layout, > ? ? ? ? ? ? ? ? ? ? ? ? MCObjectWriter *OW) const; > > + ?void AddSectionToTheEnd(MCSectionData &SD, MCAsmLayout &Layout); > + > ?public: > ? /// Construct a new assembler instance. > ? /// > diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp > index fe55e51..0444dc2 100644 > --- a/lib/MC/MCAssembler.cpp > +++ b/lib/MC/MCAssembler.cpp > @@ -649,6 +649,40 @@ void MCAssembler::WriteSectionData(const MCSectionData *SD, > ? assert(OW->getStream().tell() - Start == Layout.getSectionFileSize(SD)); > ?} > > +void MCAssembler::AddSectionToTheEnd(MCSectionData &SD, MCAsmLayout &Layout) { > + ?// Create dummy fragments and assign section ordinals. > + ?unsigned SectionIndex = 0; > + ?for (MCAssembler::iterator it = begin(), ie = end(); it != ie; ++it) > + ? ?SectionIndex++; > + > + ?SD.setOrdinal(SectionIndex); > + > + ?// Assign layout order indices to sections and fragments. > + ?unsigned FragmentIndex = 0; > + ?unsigned i = 0; > + ?for (unsigned e = Layout.getSectionOrder().size(); i != e; ++i) { > + ? ?MCSectionData *SD = Layout.getSectionOrder()[i]; > + > + ? ?for (MCSectionData::iterator it2 = SD->begin(), > + ? ? ? ? ? ie2 = SD->end(); it2 != ie2; ++it2) > + ? ? ?FragmentIndex++; > + ?} > + > + ?SD.setLayoutOrder(i); > + ?for (MCSectionData::iterator it2 = SD.begin(), > + ? ? ? ? ie2 = SD.end(); it2 != ie2; ++it2) { > + ? ?it2->setLayoutOrder(FragmentIndex++); > + ?} > + ?Layout.getSectionOrder().push_back(&SD); > + > + ?Layout.LayoutSection(&SD); > + > + ?// Layout until everything fits. > + ?while (LayoutOnce(Layout)) > + ? ?continue; > + > +} > + > ?void MCAssembler::Finish(MCObjectWriter *Writer) { > ? DEBUG_WITH_TYPE("mc-dump", { > ? ? ? llvm::errs() << "assembler backend - pre-layout\n--\n"; > -- > 1.6.4.rc0 > > From bigcheesegs at gmail.com Tue Aug 3 00:02:46 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Tue, 03 Aug 2010 05:02:46 -0000 Subject: [llvm-commits] [llvm] r110104 - in /llvm/trunk: lib/MC/WinCOFFObjectWriter.cpp test/MC/COFF/symbol-fragment-offset.ll Message-ID: <20100803050246.BDD052A6C12C@llvm.org> Author: mspencer Date: Tue Aug 3 00:02:46 2010 New Revision: 110104 URL: http://llvm.org/viewvc/llvm-project?rev=110104&view=rev Log: MC: Fix symbol fragment offsets in COFF. Patch by Cameron Esfahani! Added: llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=110104&r1=110103&r2=110104&view=diff ============================================================================== --- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Tue Aug 3 00:02:46 2010 @@ -619,7 +619,8 @@ COFFSection *coff_section = SectionMap[SymbolData->Fragment->getParent()]; coff_symbol->Data.SectionNumber = coff_section->Number; - coff_symbol->Data.Value = Layout.getFragmentOffset(SymbolData->Fragment); + coff_symbol->Data.Value = Layout.getFragmentOffset(SymbolData->Fragment) + + SymbolData->Offset; } // Update auxiliary symbol info. Added: llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll?rev=110104&view=auto ============================================================================== --- llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll (added) +++ llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll Tue Aug 3 00:02:46 2010 @@ -0,0 +1,182 @@ +; RUN: llc -filetype=obj %s -o %t +; RUN: coff-dump.py %abs_tmp | FileCheck %s + +; ModuleID = 'coff-fragment-test.c' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" +target triple = "i686-pc-win32" + + at .str = private constant [7 x i8] c"Hello \00" ; <[7 x i8]*> [#uses=1] + at str = internal constant [7 x i8] c"World!\00" ; <[7 x i8]*> [#uses=1] + +define i32 @main() nounwind { +entry: + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([7 x i8]* @.str, i32 0, i32 0)) nounwind ; [#uses=0] + %puts = tail call i32 @puts(i8* getelementptr inbounds ([7 x i8]* @str, i32 0, i32 0)) ; [#uses=0] + ret i32 0 +} + +declare i32 @printf(i8* nocapture, ...) nounwind + +declare i32 @puts(i8* nocapture) nounwind + +; CHECK: { +; CHECK: MachineType = IMAGE_FILE_MACHINE_I386 (0x14C) +; CHECK: NumberOfSections = 2 +; CHECK: TimeDateStamp = {{[0-9]+}} +; CHECK: PointerToSymbolTable = 0xBB +; CHECK: NumberOfSymbols = 9 +; CHECK: SizeOfOptionalHeader = 0 +; CHECK: Characteristics = 0x0 +; CHECK: Sections = [ +; CHECK: 0 = { +; CHECK: Name = .text +; CHECK: VirtualSize = 0 +; CHECK: VirtualAddress = 0 +; CHECK: SizeOfRawData = 33 +; CHECK: PointerToRawData = 0x64 +; CHECK: PointerToRelocations = 0x85 +; CHECK: PointerToLineNumbers = 0x0 +; CHECK: NumberOfRelocations = 4 +; CHECK: NumberOfLineNumbers = 0 +; CHECK: Charateristics = 0x60500020 +; CHECK: IMAGE_SCN_CNT_CODE +; CHECK: IMAGE_SCN_ALIGN_16BYTES +; CHECK: IMAGE_SCN_MEM_EXECUTE +; CHECK: IMAGE_SCN_MEM_READ +; CHECK: SectionData = +; CHECK: 83 EC 04 C7 04 24 00 00 - 00 00 E8 00 00 00 00 C7 |.....$..........| +; CHECK: 04 24 00 00 00 00 E8 00 - 00 00 00 31 C0 83 C4 04 |.$.........1....| +; CHECK: C3 |.| + +; CHECK: Relocations = [ +; CHECK: 0 = { +; CHECK: VirtualAddress = 0x6 +; CHECK: SymbolTableIndex = 5 +; CHECK: Type = IMAGE_REL_I386_DIR32 (6) +; CHECK: SymbolName = _main +; CHECK: } +; CHECK: 1 = { +; CHECK: VirtualAddress = 0xB +; CHECK: SymbolTableIndex = 6 +; CHECK: Type = IMAGE_REL_I386_REL32 (20) +; CHECK: SymbolName = L_.str +; CHECK: } +; CHECK: 2 = { +; CHECK: VirtualAddress = 0x12 +; CHECK: SymbolTableIndex = 7 +; CHECK: Type = IMAGE_REL_I386_DIR32 (6) +; CHECK: SymbolName = _printf +; CHECK: } +; CHECK: 3 = { +; CHECK: VirtualAddress = 0x17 +; CHECK: SymbolTableIndex = 8 +; CHECK: Type = IMAGE_REL_I386_REL32 (20) +; CHECK: SymbolName = _str +; CHECK: } +; CHECK: ] +; CHECK: } +; CHECK: 1 = { +; CHECK: Name = .data +; CHECK: VirtualSize = 0 +; CHECK: VirtualAddress = 0 +; CHECK: SizeOfRawData = 14 +; CHECK: PointerToRawData = 0xAD +; CHECK: PointerToRelocations = 0x0 +; CHECK: PointerToLineNumbers = 0x0 +; CHECK: NumberOfRelocations = 0 +; CHECK: NumberOfLineNumbers = 0 +; CHECK: Charateristics = 0xC0100040 +; CHECK: IMAGE_SCN_CNT_INITIALIZED_DATA +; CHECK: IMAGE_SCN_ALIGN_1BYTES +; CHECK: IMAGE_SCN_MEM_READ +; CHECK: IMAGE_SCN_MEM_WRITE +; CHECK: SectionData = +; CHECK: 48 65 6C 6C 6F 20 00 57 - 6F 72 6C 64 21 00 |Hello .World!.| + +; CHECK: Relocations = None +; CHECK: } +; CHECK: ] +; CHECK: Symbols = [ +; CHECK: 0 = { +; CHECK: Name = .text +; CHECK: Value = 0 +; CHECK: SectionNumber = 1 +; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3) +; CHECK: NumberOfAuxSymbols = 1 +; CHECK: AuxillaryData = +; CHECK: 21 00 00 00 04 00 00 00 - 00 00 00 00 01 00 00 00 |!...............| +; CHECK: 00 00 |..| + +; CHECK: } +; CHECK: 1 = { +; CHECK: Name = .data +; CHECK: Value = 0 +; CHECK: SectionNumber = 2 +; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3) +; CHECK: NumberOfAuxSymbols = 1 +; CHECK: AuxillaryData = +; CHECK: 0E 00 00 00 00 00 00 00 - 00 00 00 00 02 00 00 00 |................| +; CHECK: 00 00 |..| + +; CHECK: } +; CHECK: 2 = { +; CHECK: Name = _main +; CHECK: Value = 0 +; CHECK: SectionNumber = 1 +; CHECK: SimpleType = unknown (32) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2) +; CHECK: NumberOfAuxSymbols = 0 +; CHECK: AuxillaryData = + +; CHECK: } +; CHECK: 3 = { +; CHECK: Name = L_.str +; CHECK: Value = 0 +; CHECK: SectionNumber = 2 +; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3) +; CHECK: NumberOfAuxSymbols = 0 +; CHECK: AuxillaryData = + +; CHECK: } +; CHECK: 4 = { +; CHECK: Name = _printf +; CHECK: Value = 0 +; CHECK: SectionNumber = 0 +; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2) +; CHECK: NumberOfAuxSymbols = 0 +; CHECK: AuxillaryData = + +; CHECK: } +; CHECK: 5 = { +; CHECK: Name = _str +; CHECK: Value = 7 +; CHECK: SectionNumber = 2 +; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3) +; CHECK: NumberOfAuxSymbols = 0 +; CHECK: AuxillaryData = + +; CHECK: } +; CHECK: 6 = { +; CHECK: Name = _puts +; CHECK: Value = 0 +; CHECK: SectionNumber = 0 +; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0) +; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0) +; CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2) +; CHECK: NumberOfAuxSymbols = 0 +; CHECK: AuxillaryData = + +; CHECK: } +; CHECK: ] +; CHECK: } From bigcheesegs at gmail.com Tue Aug 3 00:11:37 2010 From: bigcheesegs at gmail.com (Michael Spencer) Date: Tue, 3 Aug 2010 01:11:37 -0400 Subject: [llvm-commits] COFF patch In-Reply-To: <251EC26C-1362-458A-93DC-7512D8AC5939@apple.com> References: <251EC26C-1362-458A-93DC-7512D8AC5939@apple.com> Message-ID: On Mon, Aug 2, 2010 at 5:18 PM, Cameron Esfahani wrote: > > On Jul 31, 2010, at 1:02 AM, Michael Spencer wrote: > >> On Thu, Jul 29, 2010 at 7:56 PM, Cameron Esfahani wrote: >>> My first patch, so please be gentle... >>> >>> This fixes a problem I was seeing with the COFF back end. ?All of the string data was getting put into one data fragment, and so none of the fixup references were correct. >> >> Can you post a test case so I can take a look? I'm not quite sure what >> the problem is. But I know this isn't the best way to fix the problem. >> > > Here's a reproducible case: http://pastebin.com/NCActA1d Reduces to: -------------------------------------------------------------- #include int main() { printf("Hello "); printf("World!\n"); } -------------------------------------------------------------- This will output: Hello Hello > > Build it with: clang -ccc-host-triple i686-pc-win32 -c -integrated-as -o HelloWorld.o HelloWorld.c. > > If you dump HelloWorld.o, you'll see that the symbol table entries for L_.str2, L_.str1 and L_.str have values of 0. > > Enclosed is, what I believe to be, a better fix for this problem. ?Instead of allocating a new data fragment for each new label, just make sure to account for the symbol's offset within the fragment when creating the symbol table value. Committed in r110104 > > This patch is based on revision 110062. > > I also noticed that the comment for Code in MCInstFragment was incorrect. ?I attempted to fix it, but it's probably horribly wrong... Daniel will have to take a look at that. > >>> I also made sure the TimeDateStamp in the COFF header had a correct value. Commited in r110101, but I forgot to add you as the author. I apologize about that. - Michael Spencer >> >> This is right. >> >>> I also fixed a spot in MCFragment where Offset wasn't being properly initialized. >>> >>> This patch was generated against revision 109821. >> >> Also, was this change required to get it to work? The SymbolTableIndex >> should be set down on line 674. >> >> @@ -578,12 +580,13 @@ void WinCOFFObjectWriter::RecordRelocation(const >> MCAssembler &Asm, >> ? FixedValue = Target.getConstant(); >> >> ? COFFRelocation Reloc; >> >> ? Reloc.Data.VirtualAddress = Layout.getFragmentOffset(Fragment); >> ? Reloc.Symb = coff_symbol; >> + ?Reloc.Data.SymbolTableIndex = 0; >> >> ? Reloc.Data.VirtualAddress += Fixup.getOffset(); >> >> ? switch (Fixup.getKind()) { >> ? case FirstTargetFixupKind: // reloc_pcrel_4byte >> ? ? Reloc.Data.Type = COFF::IMAGE_REL_I386_REL32; >> >> - Michael Spencer > > > The Reloc.Data.SymbolTableIndex = 0 line was required because of this warning: > > /usr/include/c++/4.2.1/ext/new_allocator.h: In member function ?virtual void::WinCOFFObjectWriter::RecordRelocation(const llvm::MCAssembler&, const llvm::MCAsmLayout&, const llvm::MCFragment*, const llvm::MCFixup&, llvm::MCValue, uint64_t&)?: > /usr/include/c++/4.2.1/ext/new_allocator.h:107: warning: ?Reloc.::COFFRelocation::Data.llvm::COFF::relocation::SymbolTableIndex? is used uninitialized in this function > WinCOFFObjectWriter.cpp:582: note: ?Reloc.::COFFRelocation::Data.llvm::COFF::relocation::SymbolTableIndex? was declared here > > > > Cameron Esfahani > dirty at apple.com > > "You only live once, and the way I live, once is enough" > > Frank Sinatra > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > From bigcheesegs at gmail.com Tue Aug 3 00:13:13 2010 From: bigcheesegs at gmail.com (Michael Spencer) Date: Tue, 3 Aug 2010 01:13:13 -0400 Subject: [llvm-commits] [llvm] r110101 - /llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp In-Reply-To: <20100803044333.3D94C2A6C12C@llvm.org> References: <20100803044333.3D94C2A6C12C@llvm.org> Message-ID: On Tue, Aug 3, 2010 at 12:43 AM, Michael J. Spencer wrote: > Author: mspencer > Date: Mon Aug ?2 23:43:33 2010 > New Revision: 110101 > > URL: http://llvm.org/viewvc/llvm-project?rev=110101&view=rev > Log: > MC: Add time travel support to COFF. I forgot to add: Patch by Cameron Esfahani! - Michael Spencer > > Modified: > ? ?llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp > > Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=110101&r1=110100&r2=110101&view=diff > ============================================================================== > --- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original) > +++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Mon Aug ?2 23:43:33 2010 > @@ -31,6 +31,8 @@ > ?#include "llvm/Support/Debug.h" > ?#include "llvm/Support/ErrorHandling.h" > > +#include "llvm/System/TimeValue.h" > + > ?#include > > ?using namespace llvm; > @@ -687,6 +689,8 @@ > > ? Header.PointerToSymbolTable = offset; > > + ?Header.TimeDateStamp = sys::TimeValue::now().toEpochTime(); > + > ? // Write it all to disk... > ? WriteFileHeader(Header); > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From bigcheesegs at gmail.com Tue Aug 3 00:30:49 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Tue, 03 Aug 2010 05:30:49 -0000 Subject: [llvm-commits] [llvm] r110105 - /llvm/trunk/test/mc/ Message-ID: <20100803053049.A763B2A6C12C@llvm.org> Author: mspencer Date: Tue Aug 3 00:30:49 2010 New Revision: 110105 URL: http://llvm.org/viewvc/llvm-project?rev=110105&view=rev Log: Remove the test/mc directory that I accidently added. This directory conflicts with test/MC on Windows machines. Removed: llvm/trunk/test/mc/ From rdivacky at freebsd.org Tue Aug 3 02:15:14 2010 From: rdivacky at freebsd.org (Roman Divacky) Date: Tue, 3 Aug 2010 09:15:14 +0200 Subject: [llvm-commits] [PATCH 3/5] Introduce a helper method to add a section to the end of a layout. This will be used by the ELF ObjectWriter code to add the metadata sections (symbol table, etc) to the end of an object file. In-Reply-To: References: Message-ID: <20100803071514.GA41763@freebsd.org> On Mon, Aug 02, 2010 at 09:56:44PM -0700, Daniel Dunbar wrote: > Hi Matt, > > I'm not sure why this needs to exist in the assembler backend -- why > can't the ELF streamer just create the appropriate sections at the end > of assembly? well, the sections needs to be laid out, right? how to do it without changing the Layout? From peter at pcc.me.uk Tue Aug 3 07:54:43 2010 From: peter at pcc.me.uk (Peter Collingbourne) Date: Tue, 3 Aug 2010 13:54:43 +0100 Subject: [llvm-commits] [PATCH] Fix CMake build In-Reply-To: <20100724203037.GA13960@pcc.me.uk> References: <20100724203037.GA13960@pcc.me.uk> Message-ID: <20100803125442.GA19274@pcc.me.uk> Hi, Ping... I also updated the patches (and the changes to LLVMLibDeps.cmake do not seem so significant now). The name changes to the PIC16 and XCore libraries do not seem to be needed now (I was unable to reproduce the error I got before) but it might still be worthwhile to make that change for the sake of consistency with the Makefile build and the other CodeGen libraries. On Sat, Jul 24, 2010 at 09:30:40PM +0100, Peter Collingbourne wrote: > Hi, > > These patches fix certain aspects of the CMake build for me, but I > wasn't 100% certain they are the right thing to do. In particular I > am not sure how the significant changes to LLVMLibDeps.cmake relate > to the changes I made. > > OK to commit? Thanks, -- Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Fix-CMake-shared-library-build.patch Type: text/x-diff Size: 11744 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100803/0262b88c/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Update-the-CMake-build.patch Type: text/x-diff Size: 6761 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100803/0262b88c/attachment-0001.bin From peter at pcc.me.uk Tue Aug 3 07:59:30 2010 From: peter at pcc.me.uk (Peter Collingbourne) Date: Tue, 3 Aug 2010 13:59:30 +0100 Subject: [llvm-commits] [PATCH] Prepare for arbitrary graph node pointer types In-Reply-To: <20100725022051.GA12403@pcc.me.uk> References: <20100725022051.GA12403@pcc.me.uk> Message-ID: <20100803125930.GB19274@pcc.me.uk> Hi, Ping... It would be nice to get some feedback on this patch series before I proceed to implement the whole-AST visualisation for Clang. On Sun, Jul 25, 2010 at 03:20:54AM +0100, Peter Collingbourne wrote: > Hi, > > This patch series extends LLVM's graph infrastructure to support > arbitrary node pointer types (NodePtrType) in GraphTraits > specialisations. This is part of planned work to implement a > whole-AST visualisation for Clang's AST, for which we will need a > polymorphic pointer type to represent the various Clang AST node types > (i.e. PointerUnion). > > I am developing this work in an incremental fashion. I introduced > a new class, GraphTraitsBase, to be used as a base class for > all GraphTraits specialisations, and updated all GraphTraits > specialisations in the LLVM code base. I also prepared df_iterator > for NodePtrType (I could not find any other class which needed > preparation). Once all GraphTraits specialisations are updated to use > GraphTraitsBase, we can modify the graph iterators to use NodePtrType. > > OK to commit? Thanks, -- Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Add-default-Pred-Succ-Iterator-ctor.patch Type: text/x-diff Size: 2346 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100803/d2f5949c/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Fix-default-value_use_iterator-ctor.patch Type: text/x-diff Size: 693 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100803/d2f5949c/attachment-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0003-Add-default-RegionIterator-ctor.patch Type: text/x-diff Size: 3747 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100803/d2f5949c/attachment-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0004-Have-DepthFirstIterator-use-default-ctor-for-iterato.patch Type: text/x-diff Size: 3276 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100803/d2f5949c/attachment-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0005-Provide-a-simpler-inverse-inverse-specialisation-of-.patch Type: text/x-diff Size: 1431 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100803/d2f5949c/attachment-0004.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0006-Introduce-GraphTraitsBase-class.patch Type: text/x-diff Size: 2779 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100803/d2f5949c/attachment-0005.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0007-Have-all-GraphTraits-specialisations-use-GraphTraits.patch Type: text/x-diff Size: 20321 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100803/d2f5949c/attachment-0006.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0008-Add-NodePtrType-to-GraphTraits.patch Type: text/x-diff Size: 1210 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100803/d2f5949c/attachment-0007.bin From peter at pcc.me.uk Tue Aug 3 08:01:07 2010 From: peter at pcc.me.uk (Peter Collingbourne) Date: Tue, 3 Aug 2010 14:01:07 +0100 Subject: [llvm-commits] [PATCH (try 4)] Add an atomic lowering pass In-Reply-To: <20100711155210.GA12279@pcc.me.uk> References: <20100622201233.GA2808@pcc.me.uk> <4C21B6F3.2080202@free.fr> <20100623233241.GA20055@pcc.me.uk> <20100630134211.GA14371@pcc.me.uk> <20100711155210.GA12279@pcc.me.uk> Message-ID: <20100803130107.GC19274@pcc.me.uk> Ping... On Sun, Jul 11, 2010 at 04:52:11PM +0100, Peter Collingbourne wrote: > Hi, > > Ping... > > I also updated the patch (attached) to add an entry in docs/Passes.html > for the pass. > > Thanks, > > On Wed, Jun 30, 2010 at 02:42:11PM +0100, Peter Collingbourne wrote: > > Hi, > > > > Here is the new version of the patch. I updated it to use > > getArgOperand and fixed a coding style issue (header ordering). > > > > Thanks, > > > > On Thu, Jun 24, 2010 at 12:32:42AM +0100, Peter Collingbourne wrote: > > > Hi Duncan, > > > > > > On Wed, Jun 23, 2010 at 09:25:39AM +0200, Duncan Sands wrote: > > > > Hi Peter, > > > > > > > > > My main motivation for the single-thread lowering is to be able to run > > > > > code that uses these intrinsics in the KLEE symbolic execution engine > > > > > but I imagine it could have other uses such as a whole-program LTO > > > > > that lowers atomic operations to more efficient non-atomic operations > > > > > when it is known to be safe to do so. > > > > > > > > instead, how about writing an LLVM IR pass that turns atomic intrinsics into > > > > non-atomic equivalent LLVM IR? > > > > > > Yes, that seems more sensible. I refactored the lowering into a pass > > > and added the remaining intrinsics (see attached patch). I'll commit > > > this if approved. > > > > > > I wonder if IntrinsicLowering should also be made into a pass, for > > > consistency with the other lowering passes. > > > > > > > Finally, I guess even "single threaded" code > > > > may have a use for some atomic operations if it makes use of signal handlers. > > > > > > Yes, good point. Perhaps "non-preemptible" is better terminology > > > which is what I used in the new patch. -- Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: lower-atomic3.patch Type: text/x-diff Size: 11084 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100803/f06e8e51/attachment.bin From daniel at zuster.org Tue Aug 3 09:26:18 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 03 Aug 2010 14:26:18 -0000 Subject: [llvm-commits] [llvm] r110109 - in /llvm/trunk: autoconf/configure.ac cmake/config-ix.cmake configure include/llvm/Config/config.h.cmake include/llvm/Config/config.h.in include/llvm/Target/TargetSelect.h Message-ID: <20100803142618.283912A6C12C@llvm.org> Author: ddunbar Date: Tue Aug 3 09:26:17 2010 New Revision: 110109 URL: http://llvm.org/viewvc/llvm-project?rev=110109&view=rev Log: build: Add LLVM_NATIVE_ARCHNAME, which has the sensible value, without "Target" appended. Modified: llvm/trunk/autoconf/configure.ac llvm/trunk/cmake/config-ix.cmake llvm/trunk/configure llvm/trunk/include/llvm/Config/config.h.cmake llvm/trunk/include/llvm/Config/config.h.in llvm/trunk/include/llvm/Target/TargetSelect.h Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=110109&r1=110108&r2=110109&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Tue Aug 3 09:26:17 2010 @@ -599,6 +599,8 @@ for a_target in $TARGETS_TO_BUILD; do if test "$a_target" = "$LLVM_NATIVE_ARCH"; then LLVM_NATIVE_ARCHTARGET="${LLVM_NATIVE_ARCH}Target" + AC_DEFINE_UNQUOTED(LLVM_NATIVE_ARCHNAME,$LLVM_NATIVE_ARCH, + [Short LLVM architecture name for the native architecture, if available]) AC_DEFINE_UNQUOTED(LLVM_NATIVE_ARCH,$LLVM_NATIVE_ARCHTARGET, [LLVM architecture name for the native architecture, if available]) fi Modified: llvm/trunk/cmake/config-ix.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=110109&r1=110108&r2=110109&view=diff ============================================================================== --- llvm/trunk/cmake/config-ix.cmake (original) +++ llvm/trunk/cmake/config-ix.cmake Tue Aug 3 09:26:17 2010 @@ -207,6 +207,7 @@ endif () if (LLVM_NATIVE_ARCH) + set(LLVM_NATIVE_ARCHNAME ${LLVM_NATIVE_ARCH}) list(FIND LLVM_TARGETS_TO_BUILD ${LLVM_NATIVE_ARCH} NATIVE_ARCH_IDX) if (NATIVE_ARCH_IDX EQUAL -1) message(STATUS Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=110109&r1=110108&r2=110109&view=diff ============================================================================== --- llvm/trunk/configure (original) +++ llvm/trunk/configure Tue Aug 3 09:26:17 2010 @@ -5018,6 +5018,11 @@ LLVM_NATIVE_ARCHTARGET="${LLVM_NATIVE_ARCH}Target" cat >>confdefs.h <<_ACEOF +#define LLVM_NATIVE_ARCHNAME $LLVM_NATIVE_ARCH +_ACEOF + + +cat >>confdefs.h <<_ACEOF #define LLVM_NATIVE_ARCH $LLVM_NATIVE_ARCHTARGET _ACEOF @@ -11391,7 +11396,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < Author: ofv Date: Tue Aug 3 10:07:17 2010 New Revision: 110110 URL: http://llvm.org/viewvc/llvm-project?rev=110110&view=rev Log: Bump cmake_minimum_required to version 2.8 Modified: llvm/trunk/CMakeLists.txt Modified: llvm/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=110110&r1=110109&r2=110110&view=diff ============================================================================== --- llvm/trunk/CMakeLists.txt (original) +++ llvm/trunk/CMakeLists.txt Tue Aug 3 10:07:17 2010 @@ -1,7 +1,7 @@ # See docs/CMake.html for instructions about how to build LLVM with CMake. project(LLVM) -cmake_minimum_required(VERSION 2.6.1) +cmake_minimum_required(VERSION 2.8) set(PACKAGE_NAME llvm) set(PACKAGE_VERSION 2.8svn) From daniel at zuster.org Tue Aug 3 10:44:16 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 3 Aug 2010 08:44:16 -0700 Subject: [llvm-commits] [PATCH (try 4)] Add an atomic lowering pass In-Reply-To: <20100803130107.GC19274@pcc.me.uk> References: <20100622201233.GA2808@pcc.me.uk> <4C21B6F3.2080202@free.fr> <20100623233241.GA20055@pcc.me.uk> <20100630134211.GA14371@pcc.me.uk> <20100711155210.GA12279@pcc.me.uk> <20100803130107.GC19274@pcc.me.uk> Message-ID: Hi Peter, Patch looks good to me, thanks! - Daniel On Tue, Aug 3, 2010 at 6:01 AM, Peter Collingbourne wrote: > Ping... > > On Sun, Jul 11, 2010 at 04:52:11PM +0100, Peter Collingbourne wrote: >> Hi, >> >> Ping... >> >> I also updated the patch (attached) to add an entry in docs/Passes.html >> for the pass. >> >> Thanks, >> >> On Wed, Jun 30, 2010 at 02:42:11PM +0100, Peter Collingbourne wrote: >> > Hi, >> > >> > Here is the new version of the patch. ?I updated it to use >> > getArgOperand and fixed a coding style issue (header ordering). >> > >> > Thanks, >> > >> > On Thu, Jun 24, 2010 at 12:32:42AM +0100, Peter Collingbourne wrote: >> > > Hi Duncan, >> > > >> > > On Wed, Jun 23, 2010 at 09:25:39AM +0200, Duncan Sands wrote: >> > > > Hi Peter, >> > > > >> > > > > My main motivation for the single-thread lowering is to be able to run >> > > > > code that uses these intrinsics in the KLEE symbolic execution engine >> > > > > but I imagine it could have other uses such as a whole-program LTO >> > > > > that lowers atomic operations to more efficient non-atomic operations >> > > > > when it is known to be safe to do so. >> > > > >> > > > instead, how about writing an LLVM IR pass that turns atomic intrinsics into >> > > > non-atomic equivalent LLVM IR? >> > > >> > > Yes, that seems more sensible. ?I refactored the lowering into a pass >> > > and added the remaining intrinsics (see attached patch). ?I'll commit >> > > this if approved. >> > > >> > > I wonder if IntrinsicLowering should also be made into a pass, for >> > > consistency with the other lowering passes. >> > > >> > > > Finally, I guess even "single threaded" code >> > > > may have a use for some atomic operations if it makes use of signal handlers. >> > > >> > > Yes, good point. ?Perhaps "non-preemptible" is better terminology >> > > which is what I used in the new patch. > -- > Peter > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > From gohman at apple.com Tue Aug 3 11:15:50 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 03 Aug 2010 16:15:50 -0000 Subject: [llvm-commits] [llvm] r110112 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp Message-ID: <20100803161551.029512A6C12C@llvm.org> Author: djg Date: Tue Aug 3 11:15:50 2010 New Revision: 110112 URL: http://llvm.org/viewvc/llvm-project?rev=110112&view=rev Log: Use unary + instead of a separate local variable for working around std::min vs static const friction. Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=110112&r1=110111&r2=110112&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp (original) +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp Tue Aug 3 11:15:50 2010 @@ -109,10 +109,9 @@ TrailZ = std::min(TrailZ, unsigned(sizeof(unsigned) * CHAR_BIT - 1)); unsigned Align = 1u << std::min(BitWidth - 1, TrailZ); - unsigned MaxAlign = Value::MaximumAlignment; // LLVM doesn't support alignments larger than this currently. - Align = std::min(Align, MaxAlign); + Align = std::min(Align, +Value::MaximumAlignment); if (PrefAlign > Align) Align = EnforceKnownAlignment(V, Align, PrefAlign); From peter at pcc.me.uk Tue Aug 3 11:19:16 2010 From: peter at pcc.me.uk (Peter Collingbourne) Date: Tue, 03 Aug 2010 16:19:16 -0000 Subject: [llvm-commits] [llvm] r110113 - in /llvm/trunk: docs/Passes.html include/llvm/LinkAllPasses.h include/llvm/Transforms/Scalar.h lib/Transforms/Scalar/CMakeLists.txt lib/Transforms/Scalar/LowerAtomic.cpp test/Transforms/LowerAtomic/ test/Transforms/LowerAtomic/atomic-load.ll test/Transforms/LowerAtomic/atomic-swap.ll test/Transforms/LowerAtomic/barrier.ll test/Transforms/LowerAtomic/dg.exp Message-ID: <20100803161916.756742A6C12D@llvm.org> Author: pcc Date: Tue Aug 3 11:19:16 2010 New Revision: 110113 URL: http://llvm.org/viewvc/llvm-project?rev=110113&view=rev Log: Add an atomic lowering pass Added: llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp llvm/trunk/test/Transforms/LowerAtomic/ llvm/trunk/test/Transforms/LowerAtomic/atomic-load.ll llvm/trunk/test/Transforms/LowerAtomic/atomic-swap.ll llvm/trunk/test/Transforms/LowerAtomic/barrier.ll llvm/trunk/test/Transforms/LowerAtomic/dg.exp Modified: llvm/trunk/docs/Passes.html llvm/trunk/include/llvm/LinkAllPasses.h llvm/trunk/include/llvm/Transforms/Scalar.h llvm/trunk/lib/Transforms/Scalar/CMakeLists.txt Modified: llvm/trunk/docs/Passes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Passes.html?rev=110113&r1=110112&r2=110113&view=diff ============================================================================== --- llvm/trunk/docs/Passes.html (original) +++ llvm/trunk/docs/Passes.html Tue Aug 3 11:19:16 2010 @@ -167,6 +167,7 @@ -loop-unrollUnroll loops -loop-unswitchUnswitch loops -loopsimplifyCanonicalize natural loops +-loweratomicLower atomic intrinsics -lowerinvokeLower invoke and unwind, for unwindless code generators -lowersetjmpLower Set Jump -lowerswitchLower SwitchInst's to branches @@ -1549,6 +1550,24 @@ +
+

+ This pass lowers atomic intrinsics to non-atomic form for use in a known + non-preemptible environment. +

+ +

+ The pass does not verify that the environment is non-preemptible (in + general this would require knowledge of the entire call graph of the + program including any libraries which may not be available in bitcode form); + it simply lowers every atomic intrinsic. +

+
+ + +
Modified: llvm/trunk/include/llvm/LinkAllPasses.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LinkAllPasses.h?rev=110113&r1=110112&r2=110113&view=diff ============================================================================== --- llvm/trunk/include/llvm/LinkAllPasses.h (original) +++ llvm/trunk/include/llvm/LinkAllPasses.h Tue Aug 3 11:19:16 2010 @@ -148,6 +148,7 @@ (void) llvm::createABCDPass(); (void) llvm::createLintPass(); (void) llvm::createSinkingPass(); + (void) llvm::createLowerAtomicPass(); (void)new llvm::IntervalPartition(); (void)new llvm::FindUsedTypes(); Modified: llvm/trunk/include/llvm/Transforms/Scalar.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar.h?rev=110113&r1=110112&r2=110113&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Scalar.h (original) +++ llvm/trunk/include/llvm/Transforms/Scalar.h Tue Aug 3 11:19:16 2010 @@ -338,6 +338,12 @@ // FunctionPass *createSinkingPass(); +//===----------------------------------------------------------------------===// +// +// LowerAtomic - Lower atomic intrinsics to non-atomic form +// +Pass *createLowerAtomicPass(); + } // End llvm namespace #endif Modified: llvm/trunk/lib/Transforms/Scalar/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CMakeLists.txt?rev=110113&r1=110112&r2=110113&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CMakeLists.txt (original) +++ llvm/trunk/lib/Transforms/Scalar/CMakeLists.txt Tue Aug 3 11:19:16 2010 @@ -17,6 +17,7 @@ LoopStrengthReduce.cpp LoopUnrollPass.cpp LoopUnswitch.cpp + LowerAtomic.cpp MemCpyOptimizer.cpp Reassociate.cpp Reg2Mem.cpp Added: llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp?rev=110113&view=auto ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp (added) +++ llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp Tue Aug 3 11:19:16 2010 @@ -0,0 +1,160 @@ +//===- LowerAtomic.cpp - Lower atomic intrinsics --------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This pass lowers atomic intrinsics to non-atomic form for use in a known +// non-preemptible environment. +// +//===----------------------------------------------------------------------===// + +#define DEBUG_TYPE "loweratomic" +#include "llvm/Transforms/Scalar.h" +#include "llvm/BasicBlock.h" +#include "llvm/Function.h" +#include "llvm/Instruction.h" +#include "llvm/Instructions.h" +#include "llvm/Intrinsics.h" +#include "llvm/Pass.h" +#include "llvm/Support/IRBuilder.h" + +using namespace llvm; + +namespace { + +bool LowerAtomicIntrinsic(CallInst *CI) { + IRBuilder<> Builder(CI->getParent(), CI); + + Function *Callee = CI->getCalledFunction(); + if (!Callee) + return false; + + unsigned IID = Callee->getIntrinsicID(); + switch (IID) { + case Intrinsic::memory_barrier: + break; + + case Intrinsic::atomic_load_add: + case Intrinsic::atomic_load_sub: + case Intrinsic::atomic_load_and: + case Intrinsic::atomic_load_nand: + case Intrinsic::atomic_load_or: + case Intrinsic::atomic_load_xor: + case Intrinsic::atomic_load_max: + case Intrinsic::atomic_load_min: + case Intrinsic::atomic_load_umax: + case Intrinsic::atomic_load_umin: { + Value *Ptr = CI->getArgOperand(0); + Value *Delta = CI->getArgOperand(1); + + LoadInst *Orig = Builder.CreateLoad(Ptr); + Value *Res; + switch (IID) { + case Intrinsic::atomic_load_add: + Res = Builder.CreateAdd(Orig, Delta); + break; + case Intrinsic::atomic_load_sub: + Res = Builder.CreateSub(Orig, Delta); + break; + case Intrinsic::atomic_load_and: + Res = Builder.CreateAnd(Orig, Delta); + break; + case Intrinsic::atomic_load_nand: + Res = Builder.CreateNot(Builder.CreateAnd(Orig, Delta)); + break; + case Intrinsic::atomic_load_or: + Res = Builder.CreateOr(Orig, Delta); + break; + case Intrinsic::atomic_load_xor: + Res = Builder.CreateXor(Orig, Delta); + break; + case Intrinsic::atomic_load_max: + Res = Builder.CreateSelect(Builder.CreateICmpSLT(Orig, Delta), + Delta, + Orig); + break; + case Intrinsic::atomic_load_min: + Res = Builder.CreateSelect(Builder.CreateICmpSLT(Orig, Delta), + Orig, + Delta); + break; + case Intrinsic::atomic_load_umax: + Res = Builder.CreateSelect(Builder.CreateICmpULT(Orig, Delta), + Delta, + Orig); + break; + case Intrinsic::atomic_load_umin: + Res = Builder.CreateSelect(Builder.CreateICmpULT(Orig, Delta), + Orig, + Delta); + break; + default: assert(0 && "Unrecognized atomic modify operation"); + } + Builder.CreateStore(Res, Ptr); + + CI->replaceAllUsesWith(Orig); + break; + } + + case Intrinsic::atomic_swap: { + Value *Ptr = CI->getArgOperand(0); + Value *Val = CI->getArgOperand(1); + + LoadInst *Orig = Builder.CreateLoad(Ptr); + Builder.CreateStore(Val, Ptr); + + CI->replaceAllUsesWith(Orig); + break; + } + + case Intrinsic::atomic_cmp_swap: { + Value *Ptr = CI->getArgOperand(0); + Value *Cmp = CI->getArgOperand(1); + Value *Val = CI->getArgOperand(2); + + LoadInst *Orig = Builder.CreateLoad(Ptr); + Value *Equal = Builder.CreateICmpEQ(Orig, Cmp); + Value *Res = Builder.CreateSelect(Equal, Val, Orig); + Builder.CreateStore(Res, Ptr); + + CI->replaceAllUsesWith(Orig); + break; + } + + default: + return false; + } + + assert(CI->use_empty() && + "Lowering should have eliminated any uses of the intrinsic call!"); + CI->eraseFromParent(); + + return true; +} + +struct LowerAtomic : public BasicBlockPass { + static char ID; + LowerAtomic() : BasicBlockPass(&ID) {} + bool runOnBasicBlock(BasicBlock &BB) { + bool Changed = false; + for (BasicBlock::iterator DI = BB.begin(), DE = BB.end(); DI != DE; ) { + Instruction *Inst = DI++; + if (CallInst *CI = dyn_cast(Inst)) + Changed |= LowerAtomicIntrinsic(CI); + } + return Changed; + } + +}; + +} + +char LowerAtomic::ID = 0; +static RegisterPass +X("loweratomic", "Lower atomic intrinsics to non-atomic form"); + +Pass *llvm::createLowerAtomicPass() { return new LowerAtomic(); } Added: llvm/trunk/test/Transforms/LowerAtomic/atomic-load.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LowerAtomic/atomic-load.ll?rev=110113&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LowerAtomic/atomic-load.ll (added) +++ llvm/trunk/test/Transforms/LowerAtomic/atomic-load.ll Tue Aug 3 11:19:16 2010 @@ -0,0 +1,40 @@ +; RUN: opt < %s -loweratomic -S | FileCheck %s + +declare i8 @llvm.atomic.load.add.i8.p0i8(i8* %ptr, i8 %delta) +declare i8 @llvm.atomic.load.nand.i8.p0i8(i8* %ptr, i8 %delta) +declare i8 @llvm.atomic.load.min.i8.p0i8(i8* %ptr, i8 %delta) + +define i8 @add() { +; CHECK: @add + %i = alloca i8 + %j = call i8 @llvm.atomic.load.add.i8.p0i8(i8* %i, i8 42) +; CHECK: [[INST:%[a-z0-9]+]] = load +; CHECK-NEXT: add +; CHECK-NEXT: store + ret i8 %j +; CHECK: ret i8 [[INST]] +} + +define i8 @nand() { +; CHECK: @nand + %i = alloca i8 + %j = call i8 @llvm.atomic.load.nand.i8.p0i8(i8* %i, i8 42) +; CHECK: [[INST:%[a-z0-9]+]] = load +; CHECK-NEXT: and +; CHECK-NEXT: xor +; CHECK-NEXT: store + ret i8 %j +; CHECK: ret i8 [[INST]] +} + +define i8 @min() { +; CHECK: @min + %i = alloca i8 + %j = call i8 @llvm.atomic.load.min.i8.p0i8(i8* %i, i8 42) +; CHECK: [[INST:%[a-z0-9]+]] = load +; CHECK-NEXT: icmp +; CHECK-NEXT: select +; CHECK-NEXT: store + ret i8 %j +; CHECK: ret i8 [[INST]] +} Added: llvm/trunk/test/Transforms/LowerAtomic/atomic-swap.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LowerAtomic/atomic-swap.ll?rev=110113&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LowerAtomic/atomic-swap.ll (added) +++ llvm/trunk/test/Transforms/LowerAtomic/atomic-swap.ll Tue Aug 3 11:19:16 2010 @@ -0,0 +1,26 @@ +; RUN: opt < %s -loweratomic -S | FileCheck %s + +declare i8 @llvm.atomic.cmp.swap.i8.p0i8(i8* %ptr, i8 %cmp, i8 %val) +declare i8 @llvm.atomic.swap.i8.p0i8(i8* %ptr, i8 %val) + +define i8 @cmpswap() { +; CHECK: @cmpswap + %i = alloca i8 + %j = call i8 @llvm.atomic.cmp.swap.i8.p0i8(i8* %i, i8 0, i8 42) +; CHECK: [[INST:%[a-z0-9]+]] = load +; CHECK-NEXT: icmp +; CHECK-NEXT: select +; CHECK-NEXT: store + ret i8 %j +; CHECK: ret i8 [[INST]] +} + +define i8 @swap() { +; CHECK: @swap + %i = alloca i8 + %j = call i8 @llvm.atomic.swap.i8.p0i8(i8* %i, i8 42) +; CHECK: [[INST:%[a-z0-9]+]] = load +; CHECK-NEXT: store + ret i8 %j +; CHECK: ret i8 [[INST]] +} Added: llvm/trunk/test/Transforms/LowerAtomic/barrier.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LowerAtomic/barrier.ll?rev=110113&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LowerAtomic/barrier.ll (added) +++ llvm/trunk/test/Transforms/LowerAtomic/barrier.ll Tue Aug 3 11:19:16 2010 @@ -0,0 +1,10 @@ +; RUN: opt < %s -loweratomic -S | FileCheck %s + +declare void @llvm.memory.barrier(i1 %ll, i1 %ls, i1 %sl, i1 %ss, i1 %device) + +define void @barrier() { +; CHECK: @barrier + call void @llvm.memory.barrier(i1 0, i1 0, i1 0, i1 0, i1 0) +; CHECK-NEXT: ret + ret void +} Added: llvm/trunk/test/Transforms/LowerAtomic/dg.exp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LowerAtomic/dg.exp?rev=110113&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LowerAtomic/dg.exp (added) +++ llvm/trunk/test/Transforms/LowerAtomic/dg.exp Tue Aug 3 11:19:16 2010 @@ -0,0 +1,3 @@ +load_lib llvm.exp + +RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] From peter at pcc.me.uk Tue Aug 3 11:22:34 2010 From: peter at pcc.me.uk (Peter Collingbourne) Date: Tue, 3 Aug 2010 17:22:34 +0100 Subject: [llvm-commits] [PATCH (try 4)] Add an atomic lowering pass In-Reply-To: References: <20100622201233.GA2808@pcc.me.uk> <4C21B6F3.2080202@free.fr> <20100623233241.GA20055@pcc.me.uk> <20100630134211.GA14371@pcc.me.uk> <20100711155210.GA12279@pcc.me.uk> <20100803130107.GC19274@pcc.me.uk> Message-ID: <20100803162234.GA19311@pcc.me.uk> On Tue, Aug 03, 2010 at 08:44:16AM -0700, Daniel Dunbar wrote: > Hi Peter, > > Patch looks good to me, thanks! Applied in r110113. Thanks, -- Peter From sabre at nondot.org Tue Aug 3 11:41:24 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 03 Aug 2010 16:41:24 -0000 Subject: [llvm-commits] [llvm] r110114 - /llvm/trunk/lib/Support/raw_ostream.cpp Message-ID: <20100803164124.A8CFA2A6C12C@llvm.org> Author: lattner Date: Tue Aug 3 11:41:24 2010 New Revision: 110114 URL: http://llvm.org/viewvc/llvm-project?rev=110114&view=rev Log: avoid undef behavior on minint, fixing PR7783. Modified: llvm/trunk/lib/Support/raw_ostream.cpp Modified: llvm/trunk/lib/Support/raw_ostream.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=110114&r1=110113&r2=110114&view=diff ============================================================================== --- llvm/trunk/lib/Support/raw_ostream.cpp (original) +++ llvm/trunk/lib/Support/raw_ostream.cpp Tue Aug 3 11:41:24 2010 @@ -143,9 +143,10 @@ } raw_ostream &raw_ostream::operator<<(long long N) { - if (N < 0) { + if (N < 0) { *this << '-'; - N = -N; + // Avoid undefined behavior on INT64_MIN with a cast. + N = -(unsigned long long)N; } return this->operator<<(static_cast(N)); From dpatel at apple.com Tue Aug 3 11:42:09 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 3 Aug 2010 09:42:09 -0700 Subject: [llvm-commits] [llvm] r110077 - in /llvm/trunk: include/llvm/Analysis/Passes.h include/llvm/LinkAllPasses.h lib/Analysis/TypeBasedAliasAnalysis.cpp In-Reply-To: <20100802231101.912AD2A6C12C@llvm.org> References: <20100802231101.912AD2A6C12C@llvm.org> Message-ID: <981CF100-CA47-43B3-A43C-FFD7188C72A5@apple.com> Dan, On Aug 2, 2010, at 4:11 PM, Dan Gohman wrote: > Author: djg > Date: Mon Aug 2 18:11:01 2010 > New Revision: 110077 > > URL: http://llvm.org/viewvc/llvm-project?rev=110077&view=rev > Log: > Sketch up a preliminary Type-Based Alias Analysis implementation. > > Added: > llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp > Modified: > llvm/trunk/include/llvm/Analysis/Passes.h > llvm/trunk/include/llvm/LinkAllPasses.h > > Modified: llvm/trunk/include/llvm/Analysis/Passes.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Passes.h?rev=110077&r1=110076&r2=110077&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Analysis/Passes.h (original) > +++ llvm/trunk/include/llvm/Analysis/Passes.h Mon Aug 2 18:11:01 2010 > @@ -81,6 +81,13 @@ > > //===--------------------------------------------------------------------===// > // > + // createTypeBasedAliasAnalysisPass - This pass implements metadata-based > + // type-based alias analysis. > + // > + ImmutablePass *createTypeBasedAliasAnalysisPass(); > + > + //===--------------------------------------------------------------------===// > + // > // createProfileLoaderPass - This pass loads information from a profile dump > // file. > // > > Modified: llvm/trunk/include/llvm/LinkAllPasses.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LinkAllPasses.h?rev=110077&r1=110076&r2=110077&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/LinkAllPasses.h (original) > +++ llvm/trunk/include/llvm/LinkAllPasses.h Mon Aug 2 18:11:01 2010 > @@ -53,6 +53,7 @@ > (void) llvm::createBasicAliasAnalysisPass(); > (void) llvm::createLibCallAliasAnalysisPass(0); > (void) llvm::createScalarEvolutionAliasAnalysisPass(); > + (void) llvm::createTypeBasedAliasAnalysisPass(); > (void) llvm::createBlockPlacementPass(); > (void) llvm::createBreakCriticalEdgesPass(); > (void) llvm::createCFGSimplificationPass(); > > Added: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=110077&view=auto > ============================================================================== > --- llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp (added) > +++ llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Mon Aug 2 18:11:01 2010 > @@ -0,0 +1,191 @@ > +//===- TypeBasedAliasAnalysis.cpp - Type-Based Alias Analysis -------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open Source > +// License. See LICENSE.TXT for details. > +// > +//===----------------------------------------------------------------------===// > +// > +// This file defines the TypeBasedAliasAnalysis pass, which implements > +// metadata-based TBAA. > +// > +// In LLVM IR, memory does not have types, so LLVM's own type system is not > +// suitable for doing TBAA. Instead, metadata is added to the IR to describe > +// a type system of a higher level language. > +// > +// This pass is language-independent. The type system is encoded in > +// metadata. This allows this pass to support typical C and C++ TBAA, but > +// it can also support custom aliasing behavior for other languages. > +// > +// This is a work-in-progress. It doesn't work yet, and the metadata > +// format isn't stable. > +// > +// TODO: getModRefBehavior. The AliasAnalysis infrastructure will need to > +// be extended. > +// TODO: AA chaining > +// TODO: struct fields > +// > +//===----------------------------------------------------------------------===// > + > +#include "llvm/Analysis/AliasAnalysis.h" > +#include "llvm/Analysis/Passes.h" > +#include "llvm/Module.h" > +#include "llvm/Metadata.h" > +#include "llvm/Pass.h" > +using namespace llvm; > + > +namespace { > + /// TBAANode - This is a simple wrapper around an MDNode which provides a > + /// higher-level interface by hiding the details of how alias analysis > + /// information is encoded in its operands. > + class TBAANode { > + const MDNode *Node; > + > + public: > + TBAANode() : Node(0) {} > + explicit TBAANode(MDNode *N) : Node(N) {} > + > + /// getNode - Get the MDNode for this TBAANode. > + const MDNode *getNode() const { return Node; } > + > + /// getParent - Get this TBAANode's Alias DAG parent. > + TBAANode getParent() const { > + if (Node->getNumOperands() < 2) > + return TBAANode(); > + MDNode *P = dyn_cast(Node->getOperand(1)); > + if (!P) > + return TBAANode(); > + // Ok, this node has a valid parent. Return it. > + return TBAANode(P); > + } > + > + /// TypeIsImmutable - Test if this TBAANode represents a type for objects > + /// which are not modified (by any means) in the context where this > + /// AliasAnalysis is relevant. > + bool TypeIsImmutable() const { > + if (Node->getNumOperands() < 3) > + return false; > + ConstantInt *CI = dyn_cast(Node->getOperand(2)); > + if (!CI) > + return false; > + // TODO: Think about the encoding. > + return CI->isOne(); > + } This method needs some description of how immutable types are encoded as a MDNode. > + }; > +} > + > +namespace { > + /// TypeBasedAliasAnalysis - This is a simple alias analysis > + /// implementation that uses TypeBased to answer queries. > + class TypeBasedAliasAnalysis : public ImmutablePass, > + public AliasAnalysis { > + public: > + static char ID; // Class identification, replacement for typeinfo > + TypeBasedAliasAnalysis() : ImmutablePass(&ID) {} > + > + /// getAdjustedAnalysisPointer - This method is used when a pass implements > + /// an analysis interface through multiple inheritance. If needed, it > + /// should override this to adjust the this pointer as needed for the > + /// specified pass info. > + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { > + if (PI->isPassID(&AliasAnalysis::ID)) > + return (AliasAnalysis*)this; > + return this; > + } > + > + private: > + virtual void getAnalysisUsage(AnalysisUsage &AU) const; > + virtual AliasResult alias(const Value *V1, unsigned V1Size, > + const Value *V2, unsigned V2Size); > + virtual bool pointsToConstantMemory(const Value *P); > + }; > +} // End of anonymous namespace > + > +// Register this pass... > +char TypeBasedAliasAnalysis::ID = 0; > +INITIALIZE_AG_PASS(TypeBasedAliasAnalysis, AliasAnalysis, "tbaa", > + "Type-Based Alias Analysis", false, true, false); > + > +ImmutablePass *llvm::createTypeBasedAliasAnalysisPass() { > + return new TypeBasedAliasAnalysis(); > +} > + > +void > +TypeBasedAliasAnalysis::getAnalysisUsage(AnalysisUsage &AU) const { > + AU.setPreservesAll(); > + AliasAnalysis::getAnalysisUsage(AU); > +} > + > +AliasAnalysis::AliasResult > +TypeBasedAliasAnalysis::alias(const Value *A, unsigned ASize, > + const Value *B, unsigned BSize) { > + // Currently, metadata can only be attached to Instructions. > + const Instruction *AI = dyn_cast(A); > + if (!AI) return MayAlias; > + const Instruction *BI = dyn_cast(B); > + if (!BI) return MayAlias; What if two instructions are not from same function ? > + // Get the attached MDNodes. If either value lacks a tbaa MDNode, we must > + // be conservative. > + MDNode *AM = > + AI->getMetadata(AI->getParent()->getParent()->getParent() > + ->getMDKindID("tbaa")); > + if (!AM) return MayAlias; > + MDNode *BM = > + AI->getMetadata(BI->getParent()->getParent()->getParent() > + ->getMDKindID("tbaa")); typo here. BI->getMetadata... - Devang From gohman at apple.com Tue Aug 3 11:48:31 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 03 Aug 2010 16:48:31 -0000 Subject: [llvm-commits] [llvm] r110115 - /llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Message-ID: <20100803164831.7B29A2A6C12C@llvm.org> Author: djg Date: Tue Aug 3 11:48:31 2010 New Revision: 110115 URL: http://llvm.org/viewvc/llvm-project?rev=110115&view=rev Log: Fix a typo Devang noticed. Modified: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=110115&r1=110114&r2=110115&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Tue Aug 3 11:48:31 2010 @@ -133,7 +133,7 @@ ->getMDKindID("tbaa")); if (!AM) return MayAlias; MDNode *BM = - AI->getMetadata(BI->getParent()->getParent()->getParent() + BI->getMetadata(BI->getParent()->getParent()->getParent() ->getMDKindID("tbaa")); if (!BM) return MayAlias; From gohman at apple.com Tue Aug 3 11:54:07 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 3 Aug 2010 09:54:07 -0700 Subject: [llvm-commits] [llvm] r110077 - in /llvm/trunk: include/llvm/Analysis/Passes.h include/llvm/LinkAllPasses.h lib/Analysis/TypeBasedAliasAnalysis.cpp In-Reply-To: <981CF100-CA47-43B3-A43C-FFD7188C72A5@apple.com> References: <20100802231101.912AD2A6C12C@llvm.org> <981CF100-CA47-43B3-A43C-FFD7188C72A5@apple.com> Message-ID: <5B8723F6-0AE7-440C-883A-99C29F8654B2@apple.com> On Aug 3, 2010, at 9:42 AM, Devang Patel wrote: >> >> +AliasAnalysis::AliasResult >> +TypeBasedAliasAnalysis::alias(const Value *A, unsigned ASize, >> + const Value *B, unsigned BSize) { >> + // Currently, metadata can only be attached to Instructions. >> + const Instruction *AI = dyn_cast(A); >> + if (!AI) return MayAlias; >> + const Instruction *BI = dyn_cast(B); >> + if (!BI) return MayAlias; > > What if two instructions are not from same function ? Such queries are not valid, as has recently been discussed on this list. I guess this code code be more aggressive about asserting for that though. >> + // Get the attached MDNodes. If either value lacks a tbaa MDNode, we must >> + // be conservative. >> + MDNode *AM = >> + AI->getMetadata(AI->getParent()->getParent()->getParent() >> + ->getMDKindID("tbaa")); >> + if (!AM) return MayAlias; >> + MDNode *BM = >> + AI->getMetadata(BI->getParent()->getParent()->getParent() >> + ->getMDKindID("tbaa")); > > typo here. BI->getMetadata... Fixed, thanks. Dan From clattner at apple.com Tue Aug 3 11:56:54 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 3 Aug 2010 09:56:54 -0700 Subject: [llvm-commits] [llvm] r110115 - /llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp In-Reply-To: <20100803164831.7B29A2A6C12C@llvm.org> References: <20100803164831.7B29A2A6C12C@llvm.org> Message-ID: On Aug 3, 2010, at 9:48 AM, Dan Gohman wrote: > Author: djg > Date: Tue Aug 3 11:48:31 2010 > New Revision: 110115 > > URL: http://llvm.org/viewvc/llvm-project?rev=110115&view=rev > Log: > Fix a typo Devang noticed. Random question: why recompute getMDKindID("tbaa") all over? -Chris > > Modified: > llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp > > Modified: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=110115&r1=110114&r2=110115&view=diff > ============================================================================== > --- llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp (original) > +++ llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Tue Aug 3 11:48:31 2010 > @@ -133,7 +133,7 @@ > ->getMDKindID("tbaa")); > if (!AM) return MayAlias; > MDNode *BM = > - AI->getMetadata(BI->getParent()->getParent()->getParent() > + BI->getMetadata(BI->getParent()->getParent()->getParent() > ->getMDKindID("tbaa")); > if (!BM) return MayAlias; > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Tue Aug 3 11:57:04 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 03 Aug 2010 16:57:04 -0000 Subject: [llvm-commits] [llvm] r110117 - /llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <20100803165704.0D6872A6C12C@llvm.org> Author: lattner Date: Tue Aug 3 11:57:03 2010 New Revision: 110117 URL: http://llvm.org/viewvc/llvm-project?rev=110117&view=rev Log: avoid undefined behavior negating minint. Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=110117&r1=110116&r2=110117&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Tue Aug 3 11:57:03 2010 @@ -735,8 +735,8 @@ Code = bitc::CST_CODE_UNDEF; } else if (const ConstantInt *IV = dyn_cast(C)) { if (IV->getBitWidth() <= 64) { - int64_t V = IV->getSExtValue(); - if (V >= 0) + uint64_t V = IV->getSExtValue(); + if ((int64_t)V >= 0) Record.push_back(V << 1); else Record.push_back((-V << 1) | 1); From stoklund at 2pi.dk Tue Aug 3 12:21:14 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 03 Aug 2010 17:21:14 -0000 Subject: [llvm-commits] [llvm] r110118 - /llvm/trunk/test/CodeGen/X86/stack-color-with-reg.ll Message-ID: <20100803172114.A49742A6C12C@llvm.org> Author: stoklund Date: Tue Aug 3 12:21:14 2010 New Revision: 110118 URL: http://llvm.org/viewvc/llvm-project?rev=110118&view=rev Log: OK, that's it. This test is going away now. But don't worry, I am taking it to a nice farm in the country where it can play with other tests. And bunnies. It is not clear what is being tested, and the revision history shows a bunch of random changes to the expected instruction count. Clearly, we are just fudging it to pass whenever it fails. Removed: llvm/trunk/test/CodeGen/X86/stack-color-with-reg.ll Removed: llvm/trunk/test/CodeGen/X86/stack-color-with-reg.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/stack-color-with-reg.ll?rev=110117&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/stack-color-with-reg.ll (original) +++ llvm/trunk/test/CodeGen/X86/stack-color-with-reg.ll (removed) @@ -1,361 +0,0 @@ -; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -relocation-model=pic -disable-fp-elim -color-ss-with-regs -stats -info-output-file - > %t -; RUN: grep asm-printer %t | grep 166 -; RUN: grep stackcoloring %t | grep "stack slot refs replaced with reg refs" | grep 5 - - type { [62 x %struct.Bitvec*] } ; type %0 - type { i8* } ; type %1 - type { double } ; type %2 - %struct..5sPragmaType = type { i8*, i32 } - %struct.AggInfo = type { i8, i8, i32, %struct.ExprList*, i32, %struct.AggInfo_col*, i32, i32, i32, %struct.AggInfo_func*, i32, i32 } - %struct.AggInfo_col = type { %struct.Table*, i32, i32, i32, i32, %struct.Expr* } - %struct.AggInfo_func = type { %struct.Expr*, %struct.FuncDef*, i32, i32 } - %struct.AuxData = type { i8*, void (i8*)* } - %struct.Bitvec = type { i32, i32, i32, %0 } - %struct.BtCursor = type { %struct.Btree*, %struct.BtShared*, %struct.BtCursor*, %struct.BtCursor*, i32 (i8*, i32, i8*, i32, i8*)*, i8*, i32, %struct.MemPage*, i32, %struct.CellInfo, i8, i8, i8*, i64, i32, i8, i32* } - %struct.BtLock = type { %struct.Btree*, i32, i8, %struct.BtLock* } - %struct.BtShared = type { %struct.Pager*, %struct.sqlite3*, %struct.BtCursor*, %struct.MemPage*, i8, i8, i8, i8, i8, i8, i8, i8, i32, i16, i16, i32, i32, i32, i32, i8, i32, i8*, void (i8*)*, %struct.sqlite3_mutex*, %struct.BusyHandler, i32, %struct.BtShared*, %struct.BtLock*, %struct.Btree* } - %struct.Btree = type { %struct.sqlite3*, %struct.BtShared*, i8, i8, i8, i32, %struct.Btree*, %struct.Btree* } - %struct.BtreeMutexArray = type { i32, [11 x %struct.Btree*] } - %struct.BusyHandler = type { i32 (i8*, i32)*, i8*, i32 } - %struct.CellInfo = type { i8*, i64, i32, i32, i16, i16, i16, i16 } - %struct.CollSeq = type { i8*, i8, i8, i8*, i32 (i8*, i32, i8*, i32, i8*)*, void (i8*)* } - %struct.Column = type { i8*, %struct.Expr*, i8*, i8*, i8, i8, i8, i8 } - %struct.Context = type { i64, i32, %struct.Fifo } - %struct.CountCtx = type { i64 } - %struct.Cursor = type { %struct.BtCursor*, i32, i64, i64, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i64, %struct.Btree*, i32, i8*, i64, i8*, %struct.KeyInfo*, i32, i64, %struct.sqlite3_vtab_cursor*, %struct.sqlite3_module*, i32, i32, i32*, i32*, i8* } - %struct.Db = type { i8*, %struct.Btree*, i8, i8, i8*, void (i8*)*, %struct.Schema* } - %struct.DbPage = type { %struct.Pager*, i32, %struct.DbPage*, %struct.DbPage*, %struct.PagerLruLink, %struct.DbPage*, i8, i8, i8, i8, i8, i16, %struct.DbPage*, %struct.DbPage*, i8* } - %struct.Expr = type { i8, i8, i16, %struct.CollSeq*, %struct.Expr*, %struct.Expr*, %struct.ExprList*, %struct..5sPragmaType, %struct..5sPragmaType, i32, i32, %struct.AggInfo*, i32, i32, %struct.Select*, %struct.Table*, i32 } - %struct.ExprList = type { i32, i32, i32, %struct.ExprList_item* } - %struct.ExprList_item = type { %struct.Expr*, i8*, i8, i8, i8 } - %struct.FKey = type { %struct.Table*, %struct.FKey*, i8*, %struct.FKey*, i32, %struct.sColMap*, i8, i8, i8, i8 } - %struct.Fifo = type { i32, %struct.FifoPage*, %struct.FifoPage* } - %struct.FifoPage = type { i32, i32, i32, %struct.FifoPage*, [1 x i64] } - %struct.FuncDef = type { i16, i8, i8, i8, i8*, %struct.FuncDef*, void (%struct.sqlite3_context*, i32, %struct.Mem**)*, void (%struct.sqlite3_context*, i32, %struct.Mem**)*, void (%struct.sqlite3_context*)*, [1 x i8] } - %struct.Hash = type { i8, i8, i32, i32, %struct.HashElem*, %struct._ht* } - %struct.HashElem = type { %struct.HashElem*, %struct.HashElem*, i8*, i8*, i32 } - %struct.IdList = type { %struct..5sPragmaType*, i32, i32 } - %struct.Index = type { i8*, i32, i32*, i32*, %struct.Table*, i32, i8, i8, i8*, %struct.Index*, %struct.Schema*, i8*, i8** } - %struct.KeyInfo = type { %struct.sqlite3*, i8, i8, i8, i32, i8*, [1 x %struct.CollSeq*] } - %struct.Mem = type { %struct.CountCtx, double, %struct.sqlite3*, i8*, i32, i16, i8, i8, void (i8*)* } - %struct.MemPage = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i16, i16, i16, i16, i16, [5 x %struct._OvflCell], %struct.BtShared*, i8*, %struct.DbPage*, i32, %struct.MemPage* } - %struct.Module = type { %struct.sqlite3_module*, i8*, i8*, void (i8*)* } - %struct.Op = type { i8, i8, i8, i8, i32, i32, i32, %1 } - %struct.Pager = type { %struct.sqlite3_vfs*, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.Bitvec*, %struct.Bitvec*, i8*, i8*, i8*, i8*, %struct.sqlite3_file*, %struct.sqlite3_file*, %struct.sqlite3_file*, %struct.BusyHandler*, %struct.PagerLruList, %struct.DbPage*, %struct.DbPage*, %struct.DbPage*, i64, i64, i64, i64, i64, i32, void (%struct.DbPage*, i32)*, void (%struct.DbPage*, i32)*, i32, %struct.DbPage**, i8*, [16 x i8] } - %struct.PagerLruLink = type { %struct.DbPage*, %struct.DbPage* } - %struct.PagerLruList = type { %struct.DbPage*, %struct.DbPage*, %struct.DbPage* } - %struct.Schema = type { i32, %struct.Hash, %struct.Hash, %struct.Hash, %struct.Hash, %struct.Table*, i8, i8, i16, i32, %struct.sqlite3* } - %struct.Select = type { %struct.ExprList*, i8, i8, i8, i8, i8, i8, i8, %struct.SrcList*, %struct.Expr*, %struct.ExprList*, %struct.Expr*, %struct.ExprList*, %struct.Select*, %struct.Select*, %struct.Select*, %struct.Expr*, %struct.Expr*, i32, i32, [3 x i32] } - %struct.SrcList = type { i16, i16, [1 x %struct.SrcList_item] } - %struct.SrcList_item = type { i8*, i8*, i8*, %struct.Table*, %struct.Select*, i8, i8, i32, %struct.Expr*, %struct.IdList*, i64 } - %struct.Table = type { i8*, i32, %struct.Column*, i32, %struct.Index*, i32, %struct.Select*, i32, %struct.Trigger*, %struct.FKey*, i8*, %struct.Expr*, i32, i8, i8, i8, i8, i8, i8, i8, %struct.Module*, %struct.sqlite3_vtab*, i32, i8**, %struct.Schema* } - %struct.Trigger = type { i8*, i8*, i8, i8, %struct.Expr*, %struct.IdList*, %struct..5sPragmaType, %struct.Schema*, %struct.Schema*, %struct.TriggerStep*, %struct.Trigger* } - %struct.TriggerStep = type { i32, i32, %struct.Trigger*, %struct.Select*, %struct..5sPragmaType, %struct.Expr*, %struct.ExprList*, %struct.IdList*, %struct.TriggerStep*, %struct.TriggerStep* } - %struct.Vdbe = type { %struct.sqlite3*, %struct.Vdbe*, %struct.Vdbe*, i32, i32, %struct.Op*, i32, i32, i32*, %struct.Mem**, %struct.Mem*, i32, %struct.Cursor**, i32, %struct.Mem*, i8**, i32, i32, i32, %struct.Mem*, i32, i32, %struct.Fifo, i32, i32, %struct.Context*, i32, i32, i32, i32, i32, [25 x i32], i32, i32, i8**, i8*, %struct.Mem*, i8, i8, i8, i8, i8, i8, i32, i64, i32, %struct.BtreeMutexArray, i32, i8*, i32 } - %struct.VdbeFunc = type { %struct.FuncDef*, i32, [1 x %struct.AuxData] } - %struct._OvflCell = type { i8*, i16 } - %struct._ht = type { i32, %struct.HashElem* } - %struct.sColMap = type { i32, i8* } - %struct.sqlite3 = type { %struct.sqlite3_vfs*, i32, %struct.Db*, i32, i32, i32, i32, i8, i8, i8, i8, i32, %struct.CollSeq*, i64, i64, i32, i32, i32, %struct.sqlite3_mutex*, %struct.sqlite3InitInfo, i32, i8**, %struct.Vdbe*, i32, void (i8*, i8*)*, i8*, void (i8*, i8*, i64)*, i8*, i8*, i32 (i8*)*, i8*, void (i8*)*, i8*, void (i8*, i32, i8*, i8*, i64)*, void (i8*, %struct.sqlite3*, i32, i8*)*, void (i8*, %struct.sqlite3*, i32, i8*)*, i8*, %struct.Mem*, i8*, i8*, %2, i32 (i8*, i32, i8*, i8*, i8*, i8*)*, i8*, i32 (i8*)*, i8*, i32, %struct.Hash, %struct.Table*, %struct.sqlite3_vtab**, i32, %struct.Hash, %struct.Hash, %struct.BusyHandler, i32, [2 x %struct.Db], i8 } - %struct.sqlite3InitInfo = type { i32, i32, i8 } - %struct.sqlite3_context = type { %struct.FuncDef*, %struct.VdbeFunc*, %struct.Mem, %struct.Mem*, i32, %struct.CollSeq* } - %struct.sqlite3_file = type { %struct.sqlite3_io_methods* } - %struct.sqlite3_index_constraint = type { i32, i8, i8, i32 } - %struct.sqlite3_index_constraint_usage = type { i32, i8 } - %struct.sqlite3_index_info = type { i32, %struct.sqlite3_index_constraint*, i32, %struct.sqlite3_index_constraint_usage*, %struct.sqlite3_index_constraint_usage*, i32, i8*, i32, i32, double } - %struct.sqlite3_io_methods = type { i32, i32 (%struct.sqlite3_file*)*, i32 (%struct.sqlite3_file*, i8*, i32, i64)*, i32 (%struct.sqlite3_file*, i8*, i32, i64)*, i32 (%struct.sqlite3_file*, i64)*, i32 (%struct.sqlite3_file*, i32)*, i32 (%struct.sqlite3_file*, i64*)*, i32 (%struct.sqlite3_file*, i32)*, i32 (%struct.sqlite3_file*, i32)*, i32 (%struct.sqlite3_file*)*, i32 (%struct.sqlite3_file*, i32, i8*)*, i32 (%struct.sqlite3_file*)*, i32 (%struct.sqlite3_file*)* } - %struct.sqlite3_module = type { i32, i32 (%struct.sqlite3*, i8*, i32, i8**, %struct.sqlite3_vtab**, i8**)*, i32 (%struct.sqlite3*, i8*, i32, i8**, %struct.sqlite3_vtab**, i8**)*, i32 (%struct.sqlite3_vtab*, %struct.sqlite3_index_info*)*, i32 (%struct.sqlite3_vtab*)*, i32 (%struct.sqlite3_vtab*)*, i32 (%struct.sqlite3_vtab*, %struct.sqlite3_vtab_cursor**)*, i32 (%struct.sqlite3_vtab_cursor*)*, i32 (%struct.sqlite3_vtab_cursor*, i32, i8*, i32, %struct.Mem**)*, i32 (%struct.sqlite3_vtab_cursor*)*, i32 (%struct.sqlite3_vtab_cursor*)*, i32 (%struct.sqlite3_vtab_cursor*, %struct.sqlite3_context*, i32)*, i32 (%struct.sqlite3_vtab_cursor*, i64*)*, i32 (%struct.sqlite3_vtab*, i32, %struct.Mem**, i64*)*, i32 (%struct.sqlite3_vtab*)*, i32 (%struct.sqlite3_vtab*)*, i32 (%struct.sqlite3_vtab*)*, i32 (%struct.sqlite3_vtab*)*, i32 (%struct.sqlite3_vtab*, i32, i8*, void (%struct.sqlite3_context*, i32, %struct.Mem**)**, i8**)*, i32 (%struct.sqlite3_vtab*, i8*)* } - %struct.sqlite3_mutex = type opaque - %struct.sqlite3_vfs = type { i32, i32, i32, %struct.sqlite3_vfs*, i8*, i8*, i32 (%struct.sqlite3_vfs*, i8*, %struct.sqlite3_file*, i32, i32*)*, i32 (%struct.sqlite3_vfs*, i8*, i32)*, i32 (%struct.sqlite3_vfs*, i8*, i32)*, i32 (%struct.sqlite3_vfs*, i32, i8*)*, i32 (%struct.sqlite3_vfs*, i8*, i32, i8*)*, i8* (%struct.sqlite3_vfs*, i8*)*, void (%struct.sqlite3_vfs*, i32, i8*)*, i8* (%struct.sqlite3_vfs*, i8*, i8*)*, void (%struct.sqlite3_vfs*, i8*)*, i32 (%struct.sqlite3_vfs*, i32, i8*)*, i32 (%struct.sqlite3_vfs*, i32)*, i32 (%struct.sqlite3_vfs*, double*)* } - %struct.sqlite3_vtab = type { %struct.sqlite3_module*, i32, i8* } - %struct.sqlite3_vtab_cursor = type { %struct.sqlite3_vtab* } - at llvm.used = appending global [1 x i8*] [i8* bitcast (void (%struct.MemPage*, i32, i32)* @dropCell to i8*)], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] - -define fastcc void @dropCell(%struct.MemPage* nocapture %pPage, i32 %idx, i32 %sz) nounwind ssp { -entry: - %0 = getelementptr %struct.MemPage* %pPage, i64 0, i32 18 ; [#uses=1] - %1 = load i8** %0, align 8 ; [#uses=34] - %2 = getelementptr %struct.MemPage* %pPage, i64 0, i32 12 ; [#uses=1] - %3 = load i16* %2, align 2 ; [#uses=1] - %4 = zext i16 %3 to i32 ; [#uses=2] - %5 = shl i32 %idx, 1 ; [#uses=2] - %6 = add i32 %4, %5 ; [#uses=1] - %7 = sext i32 %6 to i64 ; [#uses=2] - %8 = getelementptr i8* %1, i64 %7 ; [#uses=1] - %9 = load i8* %8, align 1 ; [#uses=2] - %10 = zext i8 %9 to i32 ; [#uses=1] - %11 = shl i32 %10, 8 ; [#uses=1] - %.sum3 = add i64 %7, 1 ; [#uses=1] - %12 = getelementptr i8* %1, i64 %.sum3 ; [#uses=1] - %13 = load i8* %12, align 1 ; [#uses=2] - %14 = zext i8 %13 to i32 ; [#uses=1] - %15 = or i32 %11, %14 ; [#uses=3] - %16 = icmp slt i32 %sz, 4 ; [#uses=1] - %size_addr.0.i = select i1 %16, i32 4, i32 %sz ; [#uses=3] - %17 = getelementptr %struct.MemPage* %pPage, i64 0, i32 8 ; [#uses=5] - %18 = load i8* %17, align 8 ; [#uses=1] - %19 = zext i8 %18 to i32 ; [#uses=4] - %20 = add i32 %19, 1 ; [#uses=2] - br label %bb3.i - -bb3.i: ; preds = %bb3.i, %entry - %addr.0.i = phi i32 [ %20, %entry ], [ %29, %bb3.i ] ; [#uses=1] - %21 = sext i32 %addr.0.i to i64 ; [#uses=2] - %22 = getelementptr i8* %1, i64 %21 ; [#uses=2] - %23 = load i8* %22, align 1 ; [#uses=2] - %24 = zext i8 %23 to i32 ; [#uses=1] - %25 = shl i32 %24, 8 ; [#uses=1] - %.sum34.i = add i64 %21, 1 ; [#uses=1] - %26 = getelementptr i8* %1, i64 %.sum34.i ; [#uses=2] - %27 = load i8* %26, align 1 ; [#uses=2] - %28 = zext i8 %27 to i32 ; [#uses=1] - %29 = or i32 %25, %28 ; [#uses=3] - %.not.i = icmp uge i32 %29, %15 ; [#uses=1] - %30 = icmp eq i32 %29, 0 ; [#uses=1] - %or.cond.i = or i1 %30, %.not.i ; [#uses=1] - br i1 %or.cond.i, label %bb5.i, label %bb3.i - -bb5.i: ; preds = %bb3.i - store i8 %9, i8* %22, align 1 - store i8 %13, i8* %26, align 1 - %31 = zext i32 %15 to i64 ; [#uses=2] - %32 = getelementptr i8* %1, i64 %31 ; [#uses=1] - store i8 %23, i8* %32, align 1 - %.sum32.i = add i64 %31, 1 ; [#uses=1] - %33 = getelementptr i8* %1, i64 %.sum32.i ; [#uses=1] - store i8 %27, i8* %33, align 1 - %34 = add i32 %15, 2 ; [#uses=1] - %35 = zext i32 %34 to i64 ; [#uses=2] - %36 = getelementptr i8* %1, i64 %35 ; [#uses=1] - %37 = lshr i32 %size_addr.0.i, 8 ; [#uses=1] - %38 = trunc i32 %37 to i8 ; [#uses=1] - store i8 %38, i8* %36, align 1 - %39 = trunc i32 %size_addr.0.i to i8 ; [#uses=1] - %.sum31.i = add i64 %35, 1 ; [#uses=1] - %40 = getelementptr i8* %1, i64 %.sum31.i ; [#uses=1] - store i8 %39, i8* %40, align 1 - %41 = getelementptr %struct.MemPage* %pPage, i64 0, i32 14 ; [#uses=4] - %42 = load i16* %41, align 2 ; [#uses=1] - %43 = trunc i32 %size_addr.0.i to i16 ; [#uses=1] - %44 = add i16 %42, %43 ; [#uses=1] - store i16 %44, i16* %41, align 2 - %45 = load i8* %17, align 8 ; [#uses=1] - %46 = zext i8 %45 to i32 ; [#uses=1] - %47 = add i32 %46, 1 ; [#uses=1] - br label %bb11.outer.i - -bb11.outer.i: ; preds = %bb6.i, %bb5.i - %addr.1.ph.i = phi i32 [ %47, %bb5.i ], [ %111, %bb6.i ] ; [#uses=1] - %48 = sext i32 %addr.1.ph.i to i64 ; [#uses=2] - %49 = getelementptr i8* %1, i64 %48 ; [#uses=1] - %.sum30.i = add i64 %48, 1 ; [#uses=1] - %50 = getelementptr i8* %1, i64 %.sum30.i ; [#uses=1] - br label %bb11.i - -bb6.i: ; preds = %bb11.i - %51 = zext i32 %111 to i64 ; [#uses=2] - %52 = getelementptr i8* %1, i64 %51 ; [#uses=2] - %53 = load i8* %52, align 1 ; [#uses=1] - %54 = zext i8 %53 to i32 ; [#uses=1] - %55 = shl i32 %54, 8 ; [#uses=1] - %.sum24.i = add i64 %51, 1 ; [#uses=1] - %56 = getelementptr i8* %1, i64 %.sum24.i ; [#uses=2] - %57 = load i8* %56, align 1 ; [#uses=3] - %58 = zext i8 %57 to i32 ; [#uses=1] - %59 = or i32 %55, %58 ; [#uses=5] - %60 = add i32 %111, 2 ; [#uses=1] - %61 = zext i32 %60 to i64 ; [#uses=2] - %62 = getelementptr i8* %1, i64 %61 ; [#uses=2] - %63 = load i8* %62, align 1 ; [#uses=1] - %64 = zext i8 %63 to i32 ; [#uses=1] - %65 = shl i32 %64, 8 ; [#uses=1] - %.sum23.i = add i64 %61, 1 ; [#uses=1] - %66 = getelementptr i8* %1, i64 %.sum23.i ; [#uses=2] - %67 = load i8* %66, align 1 ; [#uses=2] - %68 = zext i8 %67 to i32 ; [#uses=1] - %69 = or i32 %65, %68 ; [#uses=1] - %70 = add i32 %111, 3 ; [#uses=1] - %71 = add i32 %70, %69 ; [#uses=1] - %72 = icmp sge i32 %71, %59 ; [#uses=1] - %73 = icmp ne i32 %59, 0 ; [#uses=1] - %74 = and i1 %72, %73 ; [#uses=1] - br i1 %74, label %bb9.i, label %bb11.outer.i - -bb9.i: ; preds = %bb6.i - %75 = load i8* %17, align 8 ; [#uses=1] - %76 = zext i8 %75 to i32 ; [#uses=1] - %77 = add i32 %76, 7 ; [#uses=1] - %78 = zext i32 %77 to i64 ; [#uses=1] - %79 = getelementptr i8* %1, i64 %78 ; [#uses=2] - %80 = load i8* %79, align 1 ; [#uses=1] - %81 = sub i8 %109, %57 ; [#uses=1] - %82 = add i8 %81, %67 ; [#uses=1] - %83 = add i8 %82, %80 ; [#uses=1] - store i8 %83, i8* %79, align 1 - %84 = zext i32 %59 to i64 ; [#uses=2] - %85 = getelementptr i8* %1, i64 %84 ; [#uses=1] - %86 = load i8* %85, align 1 ; [#uses=1] - store i8 %86, i8* %52, align 1 - %.sum22.i = add i64 %84, 1 ; [#uses=1] - %87 = getelementptr i8* %1, i64 %.sum22.i ; [#uses=1] - %88 = load i8* %87, align 1 ; [#uses=1] - store i8 %88, i8* %56, align 1 - %89 = add i32 %59, 2 ; [#uses=1] - %90 = zext i32 %89 to i64 ; [#uses=2] - %91 = getelementptr i8* %1, i64 %90 ; [#uses=1] - %92 = load i8* %91, align 1 ; [#uses=1] - %93 = zext i8 %92 to i32 ; [#uses=1] - %94 = shl i32 %93, 8 ; [#uses=1] - %.sum20.i = add i64 %90, 1 ; [#uses=1] - %95 = getelementptr i8* %1, i64 %.sum20.i ; [#uses=2] - %96 = load i8* %95, align 1 ; [#uses=1] - %97 = zext i8 %96 to i32 ; [#uses=1] - %98 = or i32 %94, %97 ; [#uses=1] - %99 = sub i32 %59, %111 ; [#uses=1] - %100 = add i32 %99, %98 ; [#uses=1] - %101 = lshr i32 %100, 8 ; [#uses=1] - %102 = trunc i32 %101 to i8 ; [#uses=1] - store i8 %102, i8* %62, align 1 - %103 = load i8* %95, align 1 ; [#uses=1] - %104 = sub i8 %57, %109 ; [#uses=1] - %105 = add i8 %104, %103 ; [#uses=1] - store i8 %105, i8* %66, align 1 - br label %bb11.i - -bb11.i: ; preds = %bb9.i, %bb11.outer.i - %106 = load i8* %49, align 1 ; [#uses=1] - %107 = zext i8 %106 to i32 ; [#uses=1] - %108 = shl i32 %107, 8 ; [#uses=1] - %109 = load i8* %50, align 1 ; [#uses=3] - %110 = zext i8 %109 to i32 ; [#uses=1] - %111 = or i32 %108, %110 ; [#uses=6] - %112 = icmp eq i32 %111, 0 ; [#uses=1] - br i1 %112, label %bb12.i, label %bb6.i - -bb12.i: ; preds = %bb11.i - %113 = zext i32 %20 to i64 ; [#uses=2] - %114 = getelementptr i8* %1, i64 %113 ; [#uses=2] - %115 = load i8* %114, align 1 ; [#uses=2] - %116 = add i32 %19, 5 ; [#uses=1] - %117 = zext i32 %116 to i64 ; [#uses=2] - %118 = getelementptr i8* %1, i64 %117 ; [#uses=3] - %119 = load i8* %118, align 1 ; [#uses=1] - %120 = icmp eq i8 %115, %119 ; [#uses=1] - br i1 %120, label %bb13.i, label %bb1.preheader - -bb13.i: ; preds = %bb12.i - %121 = add i32 %19, 2 ; [#uses=1] - %122 = zext i32 %121 to i64 ; [#uses=1] - %123 = getelementptr i8* %1, i64 %122 ; [#uses=1] - %124 = load i8* %123, align 1 ; [#uses=1] - %125 = add i32 %19, 6 ; [#uses=1] - %126 = zext i32 %125 to i64 ; [#uses=1] - %127 = getelementptr i8* %1, i64 %126 ; [#uses=1] - %128 = load i8* %127, align 1 ; [#uses=1] - %129 = icmp eq i8 %124, %128 ; [#uses=1] - br i1 %129, label %bb14.i, label %bb1.preheader - -bb14.i: ; preds = %bb13.i - %130 = zext i8 %115 to i32 ; [#uses=1] - %131 = shl i32 %130, 8 ; [#uses=1] - %.sum29.i = add i64 %113, 1 ; [#uses=1] - %132 = getelementptr i8* %1, i64 %.sum29.i ; [#uses=1] - %133 = load i8* %132, align 1 ; [#uses=1] - %134 = zext i8 %133 to i32 ; [#uses=1] - %135 = or i32 %134, %131 ; [#uses=2] - %136 = zext i32 %135 to i64 ; [#uses=1] - %137 = getelementptr i8* %1, i64 %136 ; [#uses=1] - %138 = bitcast i8* %137 to i16* ; [#uses=1] - %139 = bitcast i8* %114 to i16* ; [#uses=1] - %tmp.i = load i16* %138, align 1 ; [#uses=1] - store i16 %tmp.i, i16* %139, align 1 - %140 = load i8* %118, align 1 ; [#uses=1] - %141 = zext i8 %140 to i32 ; [#uses=1] - %142 = shl i32 %141, 8 ; [#uses=1] - %.sum28.i = add i64 %117, 1 ; [#uses=1] - %143 = getelementptr i8* %1, i64 %.sum28.i ; [#uses=2] - %144 = load i8* %143, align 1 ; [#uses=2] - %145 = zext i8 %144 to i32 ; [#uses=1] - %146 = or i32 %142, %145 ; [#uses=1] - %147 = add i32 %135, 2 ; [#uses=1] - %148 = zext i32 %147 to i64 ; [#uses=2] - %149 = getelementptr i8* %1, i64 %148 ; [#uses=1] - %150 = load i8* %149, align 1 ; [#uses=1] - %151 = zext i8 %150 to i32 ; [#uses=1] - %152 = shl i32 %151, 8 ; [#uses=1] - %.sum27.i = add i64 %148, 1 ; [#uses=1] - %153 = getelementptr i8* %1, i64 %.sum27.i ; [#uses=2] - %154 = load i8* %153, align 1 ; [#uses=1] - %155 = zext i8 %154 to i32 ; [#uses=1] - %156 = or i32 %152, %155 ; [#uses=1] - %157 = add i32 %156, %146 ; [#uses=1] - %158 = lshr i32 %157, 8 ; [#uses=1] - %159 = trunc i32 %158 to i8 ; [#uses=1] - store i8 %159, i8* %118, align 1 - %160 = load i8* %153, align 1 ; [#uses=1] - %161 = add i8 %160, %144 ; [#uses=1] - store i8 %161, i8* %143, align 1 - br label %bb1.preheader - -bb1.preheader: ; preds = %bb14.i, %bb13.i, %bb12.i - %i.08 = add i32 %idx, 1 ; [#uses=2] - %162 = getelementptr %struct.MemPage* %pPage, i64 0, i32 15 ; [#uses=4] - %163 = load i16* %162, align 4 ; [#uses=2] - %164 = zext i16 %163 to i32 ; [#uses=1] - %165 = icmp sgt i32 %164, %i.08 ; [#uses=1] - br i1 %165, label %bb, label %bb2 - -bb: ; preds = %bb, %bb1.preheader - %indvar = phi i64 [ 0, %bb1.preheader ], [ %indvar.next, %bb ] ; [#uses=3] - %tmp16 = add i32 %5, %4 ; [#uses=1] - %tmp.17 = sext i32 %tmp16 to i64 ; [#uses=1] - %tmp19 = shl i64 %indvar, 1 ; [#uses=1] - %ctg2.sum = add i64 %tmp.17, %tmp19 ; [#uses=4] - %ctg229 = getelementptr i8* %1, i64 %ctg2.sum ; [#uses=1] - %ctg229.sum31 = add i64 %ctg2.sum, 2 ; [#uses=1] - %166 = getelementptr i8* %1, i64 %ctg229.sum31 ; [#uses=1] - %167 = load i8* %166, align 1 ; [#uses=1] - store i8 %167, i8* %ctg229 - %ctg229.sum30 = add i64 %ctg2.sum, 3 ; [#uses=1] - %168 = getelementptr i8* %1, i64 %ctg229.sum30 ; [#uses=1] - %169 = load i8* %168, align 1 ; [#uses=1] - %ctg229.sum = add i64 %ctg2.sum, 1 ; [#uses=1] - %170 = getelementptr i8* %1, i64 %ctg229.sum ; [#uses=1] - store i8 %169, i8* %170, align 1 - %indvar15 = trunc i64 %indvar to i32 ; [#uses=1] - %i.09 = add i32 %indvar15, %i.08 ; [#uses=1] - %i.0 = add i32 %i.09, 1 ; [#uses=1] - %171 = load i16* %162, align 4 ; [#uses=2] - %172 = zext i16 %171 to i32 ; [#uses=1] - %173 = icmp sgt i32 %172, %i.0 ; [#uses=1] - %indvar.next = add i64 %indvar, 1 ; [#uses=1] - br i1 %173, label %bb, label %bb2 - -bb2: ; preds = %bb, %bb1.preheader - %174 = phi i16 [ %163, %bb1.preheader ], [ %171, %bb ] ; [#uses=1] - %175 = add i16 %174, -1 ; [#uses=2] - store i16 %175, i16* %162, align 4 - %176 = load i8* %17, align 8 ; [#uses=1] - %177 = zext i8 %176 to i32 ; [#uses=1] - %178 = add i32 %177, 3 ; [#uses=1] - %179 = zext i32 %178 to i64 ; [#uses=1] - %180 = getelementptr i8* %1, i64 %179 ; [#uses=1] - %181 = lshr i16 %175, 8 ; [#uses=1] - %182 = trunc i16 %181 to i8 ; [#uses=1] - store i8 %182, i8* %180, align 1 - %183 = load i8* %17, align 8 ; [#uses=1] - %184 = zext i8 %183 to i32 ; [#uses=1] - %185 = add i32 %184, 3 ; [#uses=1] - %186 = zext i32 %185 to i64 ; [#uses=1] - %187 = load i16* %162, align 4 ; [#uses=1] - %188 = trunc i16 %187 to i8 ; [#uses=1] - %.sum = add i64 %186, 1 ; [#uses=1] - %189 = getelementptr i8* %1, i64 %.sum ; [#uses=1] - store i8 %188, i8* %189, align 1 - %190 = load i16* %41, align 2 ; [#uses=1] - %191 = add i16 %190, 2 ; [#uses=1] - store i16 %191, i16* %41, align 2 - %192 = getelementptr %struct.MemPage* %pPage, i64 0, i32 1 ; [#uses=1] - store i8 1, i8* %192, align 1 - ret void -} From stoklund at 2pi.dk Tue Aug 3 12:21:17 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 03 Aug 2010 17:21:17 -0000 Subject: [llvm-commits] [llvm] r110119 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <20100803172117.275052A6C12D@llvm.org> Author: stoklund Date: Tue Aug 3 12:21:16 2010 New Revision: 110119 URL: http://llvm.org/viewvc/llvm-project?rev=110119&view=rev Log: Oops. Don't normalize spill weights twice. When the normalizeSpillWeights function was introduced, I forgot to remove this normalization. This change could affect register allocation. Hopefully for the better. Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=110119&r1=110118&r2=110119&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Aug 3 12:21:16 2010 @@ -1855,7 +1855,6 @@ for (unsigned i = 0, e = NewLIs.size(); i != e; ++i) { LiveInterval *LI = NewLIs[i]; if (!LI->empty()) { - LI->weight /= SlotIndex::NUM * getApproximateInstructionCount(*LI); if (!AddedKill.count(LI)) { LiveRange *LR = &LI->ranges[LI->ranges.size()-1]; SlotIndex LastUseIdx = LR->end.getBaseIndex(); From gohman at apple.com Tue Aug 3 12:27:43 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 03 Aug 2010 17:27:43 -0000 Subject: [llvm-commits] [llvm] r110120 - /llvm/trunk/lib/Analysis/AliasAnalysis.cpp Message-ID: <20100803172743.DF0D42A6C12C@llvm.org> Author: djg Date: Tue Aug 3 12:27:43 2010 New Revision: 110120 URL: http://llvm.org/viewvc/llvm-project?rev=110120&view=rev Log: Make AliasAnalysis::getModRefInfo conservative in the face of volatility. Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=110120&r1=110119&r2=110120&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Tue Aug 3 12:27:43 2010 @@ -78,8 +78,17 @@ AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo(LoadInst *L, Value *P, unsigned Size) { - return alias(L->getOperand(0), getTypeStoreSize(L->getType()), - P, Size) ? Ref : NoModRef; + // If the load address doesn't alias the given address, it doesn't read + // or write the specified memory. + if (!alias(L->getOperand(0), getTypeStoreSize(L->getType()), P, Size)) + return NoModRef; + + // Be conservative in the face of volatile. + if (L->isVolatile()) + return ModRef; + + // Otherwise, a load just reads. + return Ref; } AliasAnalysis::ModRefResult @@ -90,9 +99,17 @@ getTypeStoreSize(S->getOperand(0)->getType()), P, Size)) return NoModRef; + // Be conservative in the face of volatile. + if (S->isVolatile()) + return ModRef; + // If the pointer is a pointer to constant memory, then it could not have been // modified by this store. - return pointsToConstantMemory(P) ? NoModRef : Mod; + if (pointsToConstantMemory(P)) + return NoModRef; + + // Otherwise, a store just writes. + return Mod; } AliasAnalysis::ModRefBehavior From ofv at wanadoo.es Tue Aug 3 12:28:09 2010 From: ofv at wanadoo.es (Oscar Fuentes) Date: Tue, 03 Aug 2010 17:28:09 -0000 Subject: [llvm-commits] [llvm] r110121 - in /llvm/trunk: CMakeLists.txt cmake/modules/VersionFromVCS.cmake Message-ID: <20100803172809.5435B2A6C12C@llvm.org> Author: ofv Date: Tue Aug 3 12:28:09 2010 New Revision: 110121 URL: http://llvm.org/viewvc/llvm-project?rev=110121&view=rev Log: CMake: add version control info to PACKAGE_VERSION, if available. Adds "svn" or "git", depending on the VCS used. If svn, adds the revision number as well. Added: llvm/trunk/cmake/modules/VersionFromVCS.cmake Modified: llvm/trunk/CMakeLists.txt Modified: llvm/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=110121&r1=110120&r2=110121&view=diff ============================================================================== --- llvm/trunk/CMakeLists.txt (original) +++ llvm/trunk/CMakeLists.txt Tue Aug 3 12:28:09 2010 @@ -3,8 +3,18 @@ project(LLVM) cmake_minimum_required(VERSION 2.8) +# Add path for custom modules +set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + "${CMAKE_CURRENT_SOURCE_DIR}/cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" + ) + +set(PACKAGE_VERSION "2.8") +include(VersionFromVCS) +add_version_info_from_vcs(PACKAGE_VERSION) + set(PACKAGE_NAME llvm) -set(PACKAGE_VERSION 2.8svn) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "llvmbugs at cs.uiuc.edu") @@ -124,13 +134,6 @@ set(llvm_builded_incs_dir ${LLVM_BINARY_DIR}/include/llvm) -# Add path for custom modules -set(CMAKE_MODULE_PATH - ${CMAKE_MODULE_PATH} - "${LLVM_MAIN_SRC_DIR}/cmake" - "${LLVM_MAIN_SRC_DIR}/cmake/modules" - ) - include(AddLLVMDefinitions) if(WIN32) Added: llvm/trunk/cmake/modules/VersionFromVCS.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/VersionFromVCS.cmake?rev=110121&view=auto ============================================================================== --- llvm/trunk/cmake/modules/VersionFromVCS.cmake (added) +++ llvm/trunk/cmake/modules/VersionFromVCS.cmake Tue Aug 3 12:28:09 2010 @@ -0,0 +1,20 @@ +# Adds version control information to the variable VERS. For +# determining the Version Control System used (if any) it inspects the +# existence of certain subdirectories under CMAKE_CURRENT_SOURCE_DIR. + +function(add_version_info_from_vcs VERS) + set(result ${${VERS}}) + if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.svn ) + set(result "${result}svn") + find_package(Subversion) + if( Subversion_FOUND ) + subversion_wc_info( ${CMAKE_CURRENT_SOURCE_DIR} Project ) + if( Project_WC_REVISION ) + set(result "${result}-r${Project_WC_REVISION}") + endif() + endif() + elseif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git ) + set(result "${result}git") + endif() + set(${VERS} ${result} PARENT_SCOPE) +endfunction(add_version_info_from_vcs) From ofv at wanadoo.es Tue Aug 3 12:40:32 2010 From: ofv at wanadoo.es (Oscar Fuentes) Date: Tue, 03 Aug 2010 17:40:32 -0000 Subject: [llvm-commits] [llvm] r110127 - in /llvm/trunk: cmake/modules/LLVMLibDeps.cmake lib/Target/PIC16/CMakeLists.txt lib/Target/XCore/CMakeLists.txt Message-ID: <20100803174032.220652A6C12C@llvm.org> Author: ofv Date: Tue Aug 3 12:40:31 2010 New Revision: 110127 URL: http://llvm.org/viewvc/llvm-project?rev=110127&view=rev Log: CMake: Change somme target library names: XCore->XCoreGen PIC16->PIC16CodeGen After updating your working copy, the first build will fail because it is using the old library dependencies. Start the build again and it will work fine. Modified: llvm/trunk/cmake/modules/LLVMLibDeps.cmake llvm/trunk/lib/Target/PIC16/CMakeLists.txt llvm/trunk/lib/Target/XCore/CMakeLists.txt Modified: llvm/trunk/cmake/modules/LLVMLibDeps.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMLibDeps.cmake?rev=110127&r1=110126&r2=110127&view=diff ============================================================================== --- llvm/trunk/cmake/modules/LLVMLibDeps.cmake (original) +++ llvm/trunk/cmake/modules/LLVMLibDeps.cmake Tue Aug 3 12:40:31 2010 @@ -33,7 +33,7 @@ set(MSVC_LIB_DEPS_LLVMMBlazeCodeGen LLVMCodeGen LLVMCore LLVMMBlazeInfo LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMMBlazeInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMMC LLVMSupport LLVMSystem) -set(MSVC_LIB_DEPS_LLVMMCDisassembler LLVMARMAsmParser LLVMARMCodeGen LLVMARMInfo LLVMAlphaAsmPrinter LLVMAlphaCodeGen LLVMAlphaInfo LLVMBlackfinAsmPrinter LLVMBlackfinCodeGen LLVMBlackfinInfo LLVMCBackend LLVMCBackendInfo LLVMCellSPUAsmPrinter LLVMCellSPUCodeGen LLVMCellSPUInfo LLVMCppBackend LLVMCppBackendInfo LLVMMBlazeAsmPrinter LLVMMBlazeCodeGen LLVMMBlazeInfo LLVMMC LLVMMCParser LLVMMSIL LLVMMSILInfo LLVMMSP430AsmPrinter LLVMMSP430CodeGen LLVMMSP430Info LLVMMipsAsmPrinter LLVMMipsCodeGen LLVMMipsInfo LLVMPIC16 LLVMPIC16AsmPrinter LLVMPIC16Info LLVMPowerPCAsmPrinter LLVMPowerPCCodeGen LLVMPowerPCInfo LLVMSparcAsmPrinter LLVMSparcCodeGen LLVMSparcInfo LLVMSupport LLVMSystem LLVMSystemZAsmPrinter LLVMSystemZCodeGen LLVMSystemZInfo LLVMX86AsmParser LLVMX86CodeGen LLVMX86Disassembler LLVMX86Info LLVMXCore LLVMXCoreAsmPrinter LLVMXCoreInfo) +set(MSVC_LIB_DEPS_LLVMMCDisassembler LLVMARMAsmParser LLVMARMCodeGen LLVMARMInfo LLVMAlphaAsmPrinter LLVMAlphaCodeGen LLVMAlphaInfo LLVMBlackfinAsmPrinter LLVMBlackfinCodeGen LLVMBlackfinInfo LLVMCBackend LLVMCBackendInfo LLVMCellSPUAsmPrinter LLVMCellSPUCodeGen LLVMCellSPUInfo LLVMCppBackend LLVMCppBackendInfo LLVMMBlazeAsmPrinter LLVMMBlazeCodeGen LLVMMBlazeInfo LLVMMC LLVMMCParser LLVMMSIL LLVMMSILInfo LLVMMSP430AsmPrinter LLVMMSP430CodeGen LLVMMSP430Info LLVMMipsAsmPrinter LLVMMipsCodeGen LLVMMipsInfo LLVMPIC16AsmPrinter LLVMPIC16CodeGen LLVMPIC16Info LLVMPowerPCAsmPrinter LLVMPowerPCCodeGen LLVMPowerPCInfo LLVMSparcAsmPrinter LLVMSparcCodeGen LLVMSparcInfo LLVMSupport LLVMSystem LLVMSystemZAsmPrinter LLVMSystemZCodeGen LLVMSystemZInfo LLVMX86AsmParser LLVMX86CodeGen LLVMX86Disassembler LLVMX86Info LLVMXCoreAsmPrinter LLVMXCoreCodeGen LLVMXCoreInfo) set(MSVC_LIB_DEPS_LLVMMCParser LLVMMC LLVMSupport) set(MSVC_LIB_DEPS_LLVMMSIL LLVMAnalysis LLVMCodeGen LLVMCore LLVMMSILInfo LLVMScalarOpts LLVMSupport LLVMTarget LLVMTransformUtils LLVMipa) set(MSVC_LIB_DEPS_LLVMMSILInfo LLVMSupport) @@ -43,8 +43,8 @@ set(MSVC_LIB_DEPS_LLVMMipsAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMipsCodeGen LLVMMipsInfo LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMMipsCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMMipsInfo LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) set(MSVC_LIB_DEPS_LLVMMipsInfo LLVMSupport) -set(MSVC_LIB_DEPS_LLVMPIC16 LLVMAnalysis LLVMCodeGen LLVMCore LLVMMC LLVMPIC16Info LLVMSelectionDAG LLVMSupport LLVMTarget) -set(MSVC_LIB_DEPS_LLVMPIC16AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPIC16 LLVMPIC16Info LLVMSupport LLVMTarget) +set(MSVC_LIB_DEPS_LLVMPIC16AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPIC16CodeGen LLVMPIC16Info LLVMSupport LLVMTarget) +set(MSVC_LIB_DEPS_LLVMPIC16CodeGen LLVMAnalysis LLVMCodeGen LLVMCore LLVMMC LLVMPIC16Info LLVMSelectionDAG LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMPIC16Info LLVMSupport) set(MSVC_LIB_DEPS_LLVMPowerPCAsmPrinter LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPowerPCCodeGen LLVMPowerPCInfo LLVMSupport LLVMTarget) set(MSVC_LIB_DEPS_LLVMPowerPCCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMPowerPCInfo LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget) @@ -66,8 +66,8 @@ set(MSVC_LIB_DEPS_LLVMX86CodeGen LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget LLVMX86AsmPrinter LLVMX86Info) set(MSVC_LIB_DEPS_LLVMX86Disassembler LLVMMC LLVMSupport LLVMX86Info) set(MSVC_LIB_DEPS_LLVMX86Info LLVMSupport) -set(MSVC_LIB_DEPS_LLVMXCore LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget LLVMXCoreInfo) -set(MSVC_LIB_DEPS_LLVMXCoreAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget LLVMXCore LLVMXCoreInfo) +set(MSVC_LIB_DEPS_LLVMXCoreAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMTarget LLVMXCoreCodeGen LLVMXCoreInfo) +set(MSVC_LIB_DEPS_LLVMXCoreCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget LLVMXCoreInfo) set(MSVC_LIB_DEPS_LLVMXCoreInfo LLVMSupport) set(MSVC_LIB_DEPS_LLVMipa LLVMAnalysis LLVMCore LLVMSupport LLVMSystem) set(MSVC_LIB_DEPS_LLVMipo LLVMAnalysis LLVMCore LLVMScalarOpts LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils LLVMipa) Modified: llvm/trunk/lib/Target/PIC16/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/CMakeLists.txt?rev=110127&r1=110126&r2=110127&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/CMakeLists.txt (original) +++ llvm/trunk/lib/Target/PIC16/CMakeLists.txt Tue Aug 3 12:40:31 2010 @@ -10,7 +10,7 @@ tablegen(PIC16GenCallingConv.inc -gen-callingconv) tablegen(PIC16GenSubtarget.inc -gen-subtarget) -add_llvm_target(PIC16 +add_llvm_target(PIC16CodeGen PIC16DebugInfo.cpp PIC16InstrInfo.cpp PIC16ISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/XCore/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/CMakeLists.txt?rev=110127&r1=110126&r2=110127&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/CMakeLists.txt (original) +++ llvm/trunk/lib/Target/XCore/CMakeLists.txt Tue Aug 3 12:40:31 2010 @@ -10,7 +10,7 @@ tablegen(XCoreGenCallingConv.inc -gen-callingconv) tablegen(XCoreGenSubtarget.inc -gen-subtarget) -add_llvm_target(XCore +add_llvm_target(XCoreCodeGen XCoreFrameInfo.cpp XCoreInstrInfo.cpp XCoreISelDAGToDAG.cpp From ofv at wanadoo.es Tue Aug 3 12:46:01 2010 From: ofv at wanadoo.es (=?utf-8?Q?=C3=93scar_Fuentes?=) Date: Tue, 03 Aug 2010 19:46:01 +0200 Subject: [llvm-commits] [PATCH] Fix CMake build References: <20100724203037.GA13960@pcc.me.uk> <20100803125442.GA19274@pcc.me.uk> Message-ID: <87wrs78u92.fsf@telefonica.net> Peter Collingbourne writes: >> These patches fix certain aspects of the CMake build for me, but I >> wasn't 100% certain they are the right thing to do. In particular I >> am not sure how the significant changes to LLVMLibDeps.cmake relate >> to the changes I made. >> >> OK to commit? > > I also updated the patches (and the changes to LLVMLibDeps.cmake do > not seem so significant now). The name changes to the PIC16 and XCore > libraries do not seem to be needed now (I was unable to reproduce the > error I got before) but it might still be worthwhile to make that > change for the sake of consistency with the Makefile build and the > other CodeGen libraries. I just updated the PIC16 and XCore library names and associated dependencies. For the other patch, I see nothing objectionable on the CMake changes. Others have to comment on the C++ part. From gohman at apple.com Tue Aug 3 13:20:32 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 03 Aug 2010 18:20:32 -0000 Subject: [llvm-commits] [llvm] r110128 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp test/Transforms/InstCombine/align-addr.ll test/Transforms/InstCombine/align-inc.ll Message-ID: <20100803182032.82D642A6C12C@llvm.org> Author: djg Date: Tue Aug 3 13:20:32 2010 New Revision: 110128 URL: http://llvm.org/viewvc/llvm-project?rev=110128&view=rev Log: Make instcombine set explicit alignments on load or store instructions with alignment 0, so that subsequent passes don't need to bother checking the TargetData ABI size manually. Removed: llvm/trunk/test/Transforms/InstCombine/align-inc.ll Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp llvm/trunk/test/Transforms/InstCombine/align-addr.ll Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=110128&r1=110127&r2=110128&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (original) +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Tue Aug 3 13:20:32 2010 @@ -146,10 +146,14 @@ if (TD) { unsigned KnownAlign = GetOrEnforceKnownAlignment(Op, TD->getPrefTypeAlignment(LI.getType())); - if (KnownAlign > - (LI.getAlignment() == 0 ? TD->getABITypeAlignment(LI.getType()) : - LI.getAlignment())) + unsigned LoadAlign = LI.getAlignment(); + unsigned EffectiveLoadAlign = LoadAlign != 0 ? LoadAlign : + TD->getABITypeAlignment(LI.getType()); + + if (KnownAlign > EffectiveLoadAlign) LI.setAlignment(KnownAlign); + else if (LoadAlign == 0) + LI.setAlignment(EffectiveLoadAlign); } // load (cast X) --> cast (load X) iff safe. @@ -411,10 +415,14 @@ if (TD) { unsigned KnownAlign = GetOrEnforceKnownAlignment(Ptr, TD->getPrefTypeAlignment(Val->getType())); - if (KnownAlign > - (SI.getAlignment() == 0 ? TD->getABITypeAlignment(Val->getType()) : - SI.getAlignment())) + unsigned StoreAlign = SI.getAlignment(); + unsigned EffectiveStoreAlign = StoreAlign != 0 ? StoreAlign : + TD->getABITypeAlignment(Val->getType()); + + if (KnownAlign > EffectiveStoreAlign) SI.setAlignment(KnownAlign); + else if (StoreAlign == 0) + SI.setAlignment(EffectiveStoreAlign); } // Do really simple DSE, to catch cases where there are several consecutive Modified: llvm/trunk/test/Transforms/InstCombine/align-addr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/align-addr.ll?rev=110128&r1=110127&r2=110128&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/align-addr.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/align-addr.ll Tue Aug 3 13:20:32 2010 @@ -1,10 +1,13 @@ -; RUN: opt < %s -instcombine -S | grep {align 16} | count 1 +; RUN: opt < %s -instcombine -S | FileCheck %s target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" ; Instcombine should be able to prove vector alignment in the ; presence of a few mild address computation tricks. -define void @foo(i8* %b, i64 %n, i64 %u, i64 %y) nounwind { +; CHECK: @test0( +; CHECK: align 16 + +define void @test0(i8* %b, i64 %n, i64 %u, i64 %y) nounwind { entry: %c = ptrtoint i8* %b to i64 %d = and i64 %c, -16 @@ -29,3 +32,29 @@ ret void } +; When we see a unaligned load from an insufficiently aligned global or +; alloca, increase the alignment of the load, turning it into an aligned load. + +; CHECK: @test1( +; CHECK: tmp = load +; CHECK: GLOBAL{{.*}}align 16 + + at GLOBAL = internal global [4 x i32] zeroinitializer + +define <16 x i8> @test1(<2 x i64> %x) { +entry: + %tmp = load <16 x i8>* bitcast ([4 x i32]* @GLOBAL to <16 x i8>*), align 1 + ret <16 x i8> %tmp +} + +; When a load or store lacks an explicit alignment, add one. + +; CHECK: @test2( +; CHECK: load double* %p, align 8 +; CHECK: store double %n, double* %p, align 8 + +define double @test2(double* %p, double %n) nounwind { + %t = load double* %p + store double %n, double* %p + ret double %t +} Removed: llvm/trunk/test/Transforms/InstCombine/align-inc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/align-inc.ll?rev=110127&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/align-inc.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/align-inc.ll (removed) @@ -1,12 +0,0 @@ -; RUN: opt < %s -instcombine -S | grep {GLOBAL.*align 16} -; RUN: opt < %s -instcombine -S | grep {tmp = load} -target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" - - at GLOBAL = internal global [4 x i32] zeroinitializer - -define <16 x i8> @foo(<2 x i64> %x) { -entry: - %tmp = load <16 x i8>* bitcast ([4 x i32]* @GLOBAL to <16 x i8>*), align 1 - ret <16 x i8> %tmp -} - From criswell at uiuc.edu Tue Aug 3 14:26:46 2010 From: criswell at uiuc.edu (John Criswell) Date: Tue, 03 Aug 2010 19:26:46 -0000 Subject: [llvm-commits] [poolalloc] r110132 - /poolalloc/trunk/lib/DSA/Local.cpp Message-ID: <20100803192646.BFB642A6C12C@llvm.org> Author: criswell Date: Tue Aug 3 14:26:46 2010 New Revision: 110132 URL: http://llvm.org/viewvc/llvm-project?rev=110132&view=rev Log: Improved formatting and added comments to the MergeConstantInitIntoNode() method. No functionality changes. Modified: poolalloc/trunk/lib/DSA/Local.cpp Modified: poolalloc/trunk/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=110132&r1=110131&r2=110132&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Local.cpp (original) +++ poolalloc/trunk/lib/DSA/Local.cpp Tue Aug 3 14:26:46 2010 @@ -948,42 +948,82 @@ // LocalDataStructures Implementation //===----------------------------------------------------------------------===// -// MergeConstantInitIntoNode - Merge the specified constant into the node -// pointed to by NH. -void GraphBuilder::MergeConstantInitIntoNode(DSNodeHandle &NH, const Type* Ty, Constant *C) { +// +// Function: MergeConstantInitIntoNode() +// +// Description: +// Merge the specified constant into the specified DSNode. +// +void +GraphBuilder::MergeConstantInitIntoNode(DSNodeHandle &NH, + const Type* Ty, + Constant *C) { + // // Ensure a type-record exists... + // DSNode *NHN = NH.getNode(); NHN->mergeTypeInfo(Ty, NH.getOffset()); + // + // If we've found something of pointer type, create or find its DSNode and + // make a link from the specified DSNode to the new DSNode describing the + // pointer we've just found. + // if (isa(Ty)) { - // Avoid adding edges from null, or processing non-"pointer" stores NH.addEdgeTo(getValueDest(C)); return; } + // + // If the type of the object (array element, structure field, etc.) is an + // integer or floating point type, then just ignore it. It has no DSNode. + // if (Ty->isIntOrIntVectorTy() || Ty->isFPOrFPVectorTy()) return; + // + // Handle aggregate constants. + // if (ConstantArray *CA = dyn_cast(C)) { - for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i) - // We don't currently do any indexing for arrays... - MergeConstantInitIntoNode(NH, cast(Ty)->getElementType(), cast(CA->getOperand(i))); + // + // For an array, we don't worry about different elements pointing to + // different objects; we essentially pretend that all array elements alias. + // + const Type * ElementType = cast(Ty)->getElementType(); + for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i) { + Constant * ConstElement = cast(CA->getOperand(i)); + MergeConstantInitIntoNode(NH, ElementType, ConstElement); + } } else if (ConstantStruct *CS = dyn_cast(C)) { + // + // For a structure, we need to merge each element of the constant structure + // into the specified DSNode. However, we must also handle structures that + // end with a zero-length array ([0 x sbyte]); this is a common C idiom + // that continues to plague the world. + // const StructLayout *SL = TD.getStructLayout(cast(Ty)); for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i) { DSNode *NHN = NH.getNode(); - //Some programmers think ending a structure with a [0 x sbyte] is cute if (SL->getElementOffset(i) < SL->getSizeInBytes()) { - DSNodeHandle NewNH(NHN, NH.getOffset()+(unsigned)SL->getElementOffset(i)); - MergeConstantInitIntoNode(NewNH, cast(Ty)->getElementType(i), cast(CS->getOperand(i))); + const Type * ElementType = cast(Ty)->getElementType(i); + Constant * ConstElement = cast(CS->getOperand(i)); + DSNodeHandle NewNH (NHN, + NH.getOffset()+(unsigned)SL->getElementOffset(i)); + MergeConstantInitIntoNode(NewNH, ElementType, ConstElement); } else if (SL->getElementOffset(i) == SL->getSizeInBytes()) { + // + // If this is one of those cute structures that ends with a zero-length + // array, just fold the DSNode now and get it over with. + // DEBUG(errs() << "Zero size element at end of struct\n" ); NHN->foldNodeCompletely(); } else { - assert(0 && "type was smaller than offsets of of struct layout indicate"); + assert(0 && "type was smaller than offsets of struct layout indicate"); } } } else if (isa(C) || isa(C)) { - // Noop + // + // Undefined values and NULL pointers have no DSNodes, so they do nothing. + // } else { assert(0 && "Unknown constant type!"); } From dpatel at apple.com Tue Aug 3 15:00:53 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 03 Aug 2010 20:00:53 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r110133 - in /llvm-gcc-4.2/trunk/gcc: llvm-debug.cpp llvm-debug.h Message-ID: <20100803200054.0378F2A6C12C@llvm.org> Author: dpatel Date: Tue Aug 3 15:00:53 2010 New Revision: 110133 URL: http://llvm.org/viewvc/llvm-project?rev=110133&view=rev Log: Revert 109536 and 109522. They causes gdb testsuite regressions (file-statics.exp). Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp llvm-gcc-4.2/trunk/gcc/llvm-debug.h Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=110133&r1=110132&r2=110133&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Tue Aug 3 15:00:53 2010 @@ -57,16 +57,28 @@ #endif -/// DirectoryAndFile - If Filename is absolute then directory name is empty. -/// Otherwise directory name is current working directory. +/// DirectoryAndFile - Extract the directory and file name from a path. If no +/// directory is specified, then use the source working directory. static void DirectoryAndFile(const std::string &FullPath, std::string &Directory, std::string &FileName) { - FileName = FullPath; - - if (FullPath[0] != '/') - Directory = std::string(get_src_pwd()); - else + // Look for the directory slash. + size_t Slash = FullPath.rfind('/'); + + // If no slash + if (Slash == std::string::npos) { + // The entire path is the file name. Directory = ""; + FileName = FullPath; + } else { + // Separate the directory from the file name. + Directory = FullPath.substr(0, Slash); + FileName = FullPath.substr(Slash + 1); + } + + // If no directory present then use source working directory. + if (Directory.empty() || Directory[0] != '/') { + Directory = std::string(get_src_pwd()) + "/" + Directory; + } } /// NodeSizeInBits - Returns the size in bits stored in a tree node regardless @@ -1381,6 +1393,11 @@ FullPath = main_input_filename; } + // Get source file information. + std::string Directory; + std::string FileName; + DirectoryAndFile(FullPath, Directory, FileName); + // Set up Language number. unsigned LangTag; const std::string LanguageName(lang_hooks.name); @@ -1415,8 +1432,8 @@ unsigned ObjcRunTimeVer = 0; if (flag_objc_abi != 0 && flag_objc_abi != -1) ObjcRunTimeVer = flag_objc_abi; - return DebugFactory.CreateCompileUnit(LangTag, FullPath, - get_src_pwd(), + return DebugFactory.CreateCompileUnit(LangTag, FileName.c_str(), + Directory.c_str(), version_string, isMain, optimize, Flags, ObjcRunTimeVer); @@ -1431,7 +1448,11 @@ FullPath = main_input_filename; } - return DebugFactory.CreateFile(FullPath, get_src_pwd(), TheCU); + // Get source file information. + std::string Directory; + std::string FileName; + DirectoryAndFile(FullPath, Directory, FileName); + return DebugFactory.CreateFile(FileName, Directory, TheCU); } /* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.h?rev=110133&r1=110132&r2=110133&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.h Tue Aug 3 15:00:53 2010 @@ -63,7 +63,6 @@ int PrevLineNo; // Previous location line# encountered. BasicBlock *PrevBB; // Last basic block encountered. DICompileUnit TheCU; // The compile unit. - std::string CWD; // Current working directory. // Current GCC lexical block (or enclosing FUNCTION_DECL). tree_node *CurrentGCCLexicalBlock; From gohman at apple.com Tue Aug 3 15:20:56 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 03 Aug 2010 20:20:56 -0000 Subject: [llvm-commits] [llvm] r110134 - /llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <20100803202056.94EF32A6C12C@llvm.org> Author: djg Date: Tue Aug 3 15:20:56 2010 New Revision: 110134 URL: http://llvm.org/viewvc/llvm-project?rev=110134&view=rev Log: Delete an unused function. Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110134&r1=110133&r2=110134&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Aug 3 15:20:56 2010 @@ -152,11 +152,6 @@ return MayAlias; } - virtual void getArgumentAccesses(Function *F, CallSite CS, - std::vector &Info) { - llvm_unreachable("This method may not be called on this function!"); - } - virtual bool pointsToConstantMemory(const Value *P) { return false; } virtual ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size) { return ModRef; From gohman at apple.com Tue Aug 3 15:23:52 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 03 Aug 2010 20:23:52 -0000 Subject: [llvm-commits] [llvm] r110135 - /llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <20100803202352.9D2B42A6C12C@llvm.org> Author: djg Date: Tue Aug 3 15:23:52 2010 New Revision: 110135 URL: http://llvm.org/viewvc/llvm-project?rev=110135&view=rev Log: The singular of "indices" is "index". Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110135&r1=110134&r2=110135&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Aug 3 15:23:52 2010 @@ -427,11 +427,11 @@ return NoAA::getModRefInfo(CS1, CS2); } -/// GetIndiceDifference - Dest and Src are the variable indices from two +/// GetIndexDifference - Dest and Src are the variable indices from two /// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base /// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic /// difference between the two pointers. -static void GetIndiceDifference( +static void GetIndexDifference( SmallVectorImpl > &Dest, const SmallVectorImpl > &Src) { if (Src.empty()) return; @@ -515,7 +515,7 @@ // Subtract the GEP2 pointer from the GEP1 pointer to find out their // symbolic difference. GEP1BaseOffset -= GEP2BaseOffset; - GetIndiceDifference(GEP1VariableIndices, GEP2VariableIndices); + GetIndexDifference(GEP1VariableIndices, GEP2VariableIndices); } else { // Check to see if these two pointers are related by the getelementptr From dirty at apple.com Tue Aug 3 15:31:34 2010 From: dirty at apple.com (Cameron Esfahani) Date: Tue, 3 Aug 2010 13:31:34 -0700 Subject: [llvm-commits] Patch to correctly emit 64-bit WINCALLs Message-ID: Here's a small patch to correctly emit a 64-bit WINCALL: Index: lib/Target/X86/X86Instr64bit.td =================================================================== --- lib/Target/X86/X86Instr64bit.td (revision 110105) +++ lib/Target/X86/X86Instr64bit.td (working copy) @@ -168,7 +168,7 @@ MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, EFLAGS], Uses = [RSP] in { - def WINCALL64pcrel32 : I<0xE8, RawFrm, + def WINCALL64pcrel32 : Ii32PCRel<0xE8, RawFrm, (outs), (ins i64i32imm_pcrel:$dst, variable_ops), "call\t$dst", []>, Requires<[IsWin64]>; Cameron Esfahani dirty at apple.com "It is the spirit and not the form of law that keeps justice alive." Earl Warren From anton at korobeynikov.info Tue Aug 3 15:35:29 2010 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Wed, 4 Aug 2010 00:35:29 +0400 Subject: [llvm-commits] Patch to correctly emit 64-bit WINCALLs In-Reply-To: References: Message-ID: Hello, Cameron > Here's a small patch to correctly emit a 64-bit WINCALL: Looks ok for me. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From natebegeman at mac.com Tue Aug 3 16:31:55 2010 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 03 Aug 2010 21:31:55 -0000 Subject: [llvm-commits] [llvm] r110152 - in /llvm/trunk: include/llvm/IntrinsicsARM.td lib/Target/ARM/ARMBaseRegisterInfo.cpp lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h lib/Target/ARM/ARMInstrVFP.td Message-ID: <20100803213155.78B2B2A6C12C@llvm.org> Author: sampo Date: Tue Aug 3 16:31:55 2010 New Revision: 110152 URL: http://llvm.org/viewvc/llvm-project?rev=110152&view=rev Log: Add support for getting & setting the FPSCR application register on ARM when VFP is enabled. Add support for using the FPSCR in conjunction with the vcvtr instruction, for controlling fp to int rounding. Add support for the FLT_ROUNDS_ node now that the FPSCR is exposed. Modified: llvm/trunk/include/llvm/IntrinsicsARM.td llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.h llvm/trunk/lib/Target/ARM/ARMInstrVFP.td Modified: llvm/trunk/include/llvm/IntrinsicsARM.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsARM.td?rev=110152&r1=110151&r2=110152&view=diff ============================================================================== --- llvm/trunk/include/llvm/IntrinsicsARM.td (original) +++ llvm/trunk/include/llvm/IntrinsicsARM.td Tue Aug 3 16:31:55 2010 @@ -36,6 +36,20 @@ } //===----------------------------------------------------------------------===// +// VFP + +let TargetPrefix = "arm" in { // All intrinsics start with "llvm.arm.". + def int_arm_get_fpscr : GCCBuiltin<"__builtin_arm_get_fpscr">, + Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>; + def int_arm_set_fpscr : GCCBuiltin<"__builtin_arm_set_fpscr">, + Intrinsic<[], [llvm_i32_ty], [IntrWriteMem]>; + def int_arm_vcvtr : Intrinsic<[llvm_float_ty], [llvm_anyfloat_ty], + [IntrNoMem]>; + def int_arm_vcvtru : Intrinsic<[llvm_float_ty], [llvm_anyfloat_ty], + [IntrNoMem]>; +} + +//===----------------------------------------------------------------------===// // Advanced SIMD (NEON) let TargetPrefix = "arm" in { // All intrinsics start with "llvm.arm.". Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=110152&r1=110151&r2=110152&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Tue Aug 3 16:31:55 2010 @@ -176,6 +176,7 @@ BitVector Reserved(getNumRegs()); Reserved.set(ARM::SP); Reserved.set(ARM::PC); + Reserved.set(ARM::FPSCR); if (STI.isTargetDarwin() || hasFP(MF)) Reserved.set(FramePtr); // Some targets reserve R9. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=110152&r1=110151&r2=110152&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Aug 3 16:31:55 2010 @@ -474,10 +474,12 @@ } setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand); - if (!UseSoftFloat && Subtarget->hasVFP2() && !Subtarget->isThumb1Only()) + if (!UseSoftFloat && Subtarget->hasVFP2() && !Subtarget->isThumb1Only()) { // Turn f64->i64 into VMOVRRD, i64 -> f64 to VMOVDRR // iff target supports vfp2. setOperationAction(ISD::BIT_CONVERT, MVT::i64, Custom); + setOperationAction(ISD::FLT_ROUNDS_, MVT::i32, Custom); + } // We want to custom lower some of our intrinsics. setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom); @@ -2764,6 +2766,24 @@ return DAG.getMergeValues(Ops, 2, dl); } +SDValue ARMTargetLowering::LowerFLT_ROUNDS_(SDValue Op, + SelectionDAG &DAG) const { + // The rounding mode is in bits 23:22 of the FPSCR. + // The ARM rounding mode value to FLT_ROUNDS mapping is 0->1, 1->2, 2->3, 3->0 + // The formula we use to implement this is (((FPSCR + 1 << 22) >> 22) & 3) + // so that the shift + and get folded into a bitfield extract. + DebugLoc dl = Op.getDebugLoc(); + SDValue FPSCR = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, MVT::i32, + DAG.getConstant(Intrinsic::arm_get_fpscr, + MVT::i32)); + SDValue FltRounds = DAG.getNode(ISD::ADD, dl, MVT::i32, FPSCR, + DAG.getConstant(1U << 22, MVT::i32)); + SDValue RMODE = DAG.getNode(ISD::SRL, dl, MVT::i32, FltRounds, + DAG.getConstant(22, MVT::i32)); + return DAG.getNode(ISD::AND, dl, MVT::i32, RMODE, + DAG.getConstant(3, MVT::i32)); +} + static SDValue LowerCTTZ(SDNode *N, SelectionDAG &DAG, const ARMSubtarget *ST) { EVT VT = N->getValueType(0); @@ -3705,6 +3725,7 @@ case ISD::VECTOR_SHUFFLE: return LowerVECTOR_SHUFFLE(Op, DAG); case ISD::EXTRACT_VECTOR_ELT: return LowerEXTRACT_VECTOR_ELT(Op, DAG); case ISD::CONCAT_VECTORS: return LowerCONCAT_VECTORS(Op, DAG); + case ISD::FLT_ROUNDS_: return LowerFLT_ROUNDS_(Op, DAG); } return SDValue(); } Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=110152&r1=110151&r2=110152&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Tue Aug 3 16:31:55 2010 @@ -82,7 +82,7 @@ MEMBARRIER, // Memory barrier SYNCBARRIER, // Memory sync barrier - + VCEQ, // Vector compare equal. VCGE, // Vector compare greater than or equal. VCGEU, // Vector compare unsigned greater than or equal. @@ -342,6 +342,7 @@ SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const; SDValue LowerShiftRightParts(SDValue Op, SelectionDAG &DAG) const; SDValue LowerShiftLeftParts(SDValue Op, SelectionDAG &DAG) const; + SDValue LowerFLT_ROUNDS_(SDValue Op, SelectionDAG &DAG) const; SDValue LowerCallResult(SDValue Chain, SDValue InFlag, CallingConv::ID CallConv, bool isVarArg, Modified: llvm/trunk/lib/Target/ARM/ARMInstrVFP.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrVFP.td?rev=110152&r1=110151&r2=110152&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrVFP.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrVFP.td Tue Aug 3 16:31:55 2010 @@ -420,34 +420,35 @@ // And the Z bit '0' variants, i.e. use the rounding mode specified by FPSCR. // For disassembly only. - +let Uses = [FPSCR] in { def VTOSIRD : AVConv1I<0b11101, 0b11, 0b1101, 0b1011, (outs SPR:$dst), (ins DPR:$a), IIC_fpCVTDI, "vcvtr", ".s32.f64\t$dst, $a", - [/* For disassembly only; pattern left blank */]> { + [(set SPR:$dst, (int_arm_vcvtr (f64 DPR:$a)))]> { let Inst{7} = 0; // Z bit } def VTOSIRS : AVConv1In<0b11101, 0b11, 0b1101, 0b1010, (outs SPR:$dst), (ins SPR:$a), IIC_fpCVTSI, "vcvtr", ".s32.f32\t$dst, $a", - [/* For disassembly only; pattern left blank */]> { + [(set SPR:$dst, (int_arm_vcvtr SPR:$a))]> { let Inst{7} = 0; // Z bit } def VTOUIRD : AVConv1I<0b11101, 0b11, 0b1100, 0b1011, (outs SPR:$dst), (ins DPR:$a), IIC_fpCVTDI, "vcvtr", ".u32.f64\t$dst, $a", - [/* For disassembly only; pattern left blank */]> { + [(set SPR:$dst, (int_arm_vcvtru (f64 DPR:$a)))]> { let Inst{7} = 0; // Z bit } def VTOUIRS : AVConv1In<0b11101, 0b11, 0b1100, 0b1010, (outs SPR:$dst), (ins SPR:$a), IIC_fpCVTSI, "vcvtr", ".u32.f32\t$dst, $a", - [/* For disassembly only; pattern left blank */]> { + [(set SPR:$dst, (int_arm_vcvtru SPR:$a))]> { let Inst{7} = 0; // Z bit } +} // Convert between floating-point and fixed-point // Data type for fixed-point naming convention: @@ -654,32 +655,27 @@ } // FPSCR <-> GPR (for disassembly only) - -let neverHasSideEffects = 1 in { -let Uses = [FPSCR] in { -def VMRS : VFPAI<(outs GPR:$dst), (ins), VFPMiscFrm, IIC_fpSTAT, "vmrs", - "\t$dst, fpscr", - [/* For disassembly only; pattern left blank */]> { +let hasSideEffects = 1, Uses = [FPSCR] in +def VMRS : VFPAI<(outs GPR:$dst), (ins), VFPMiscFrm, IIC_fpSTAT, + "vmrs", "\t$dst, fpscr", + [(set GPR:$dst, (int_arm_get_fpscr))]> { let Inst{27-20} = 0b11101111; let Inst{19-16} = 0b0001; let Inst{11-8} = 0b1010; let Inst{7} = 0; let Inst{4} = 1; } -} -let Defs = [FPSCR] in { -def VMSR : VFPAI<(outs), (ins GPR:$src), VFPMiscFrm, IIC_fpSTAT, "vmsr", - "\tfpscr, $src", - [/* For disassembly only; pattern left blank */]> { +let Defs = [FPSCR] in +def VMSR : VFPAI<(outs), (ins GPR:$src), VFPMiscFrm, IIC_fpSTAT, + "vmsr", "\tfpscr, $src", + [(int_arm_set_fpscr GPR:$src)]> { let Inst{27-20} = 0b11101110; let Inst{19-16} = 0b0001; let Inst{11-8} = 0b1010; let Inst{7} = 0; let Inst{4} = 1; } -} -} // neverHasSideEffects // Materialize FP immediates. VFP3 only. let isReMaterializable = 1 in { From gohman at apple.com Tue Aug 3 16:48:53 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 03 Aug 2010 21:48:53 -0000 Subject: [llvm-commits] [llvm] r110155 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h include/llvm/Analysis/LibCallAliasAnalysis.h include/llvm/Analysis/LibCallSemantics.h include/llvm/Support/CallSite.h lib/Analysis/AliasAnalysis.cpp lib/Analysis/AliasAnalysisCounter.cpp lib/Analysis/AliasDebugger.cpp lib/Analysis/AliasSetTracker.cpp lib/Analysis/BasicAliasAnalysis.cpp lib/Analysis/IPA/GlobalsModRef.cpp lib/Analysis/LibCallAliasAnalysis.cpp lib/Analysis/LibCallSemantics.cpp lib/Transforms/IPO/FunctionAttrs.cpp Message-ID: <20100803214854.0314D2A6C12D@llvm.org> Author: djg Date: Tue Aug 3 16:48:53 2010 New Revision: 110155 URL: http://llvm.org/viewvc/llvm-project?rev=110155&view=rev Log: Thread const correctness through a bunch of AliasAnalysis interfaces and eliminate several const_casts. Make CallSite implicitly convertible to ImmutableCallSite. Rename the getModRefBehavior for intrinsic IDs to getIntrinsicModRefBehavior to avoid overload ambiguity with CallSite, which happens to be implicitly convertible to bool. Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h llvm/trunk/include/llvm/Analysis/LibCallSemantics.h llvm/trunk/include/llvm/Support/CallSite.h llvm/trunk/lib/Analysis/AliasAnalysis.cpp llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp llvm/trunk/lib/Analysis/AliasDebugger.cpp llvm/trunk/lib/Analysis/AliasSetTracker.cpp llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp llvm/trunk/lib/Analysis/LibCallAliasAnalysis.cpp llvm/trunk/lib/Analysis/LibCallSemantics.cpp llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=110155&r1=110154&r2=110155&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Tue Aug 3 16:48:53 2010 @@ -178,17 +178,17 @@ }; /// getModRefBehavior - Return the behavior when calling the given call site. - virtual ModRefBehavior getModRefBehavior(CallSite CS, + virtual ModRefBehavior getModRefBehavior(ImmutableCallSite CS, std::vector *Info = 0); /// getModRefBehavior - Return the behavior when calling the given function. /// For use when the call site is not known. - virtual ModRefBehavior getModRefBehavior(Function *F, + virtual ModRefBehavior getModRefBehavior(const Function *F, std::vector *Info = 0); - /// getModRefBehavior - Return the modref behavior of the intrinsic with the - /// given id. - static ModRefBehavior getModRefBehavior(unsigned iid); + /// getIntrinsicModRefBehavior - Return the modref behavior of the intrinsic + /// with the given id. + static ModRefBehavior getIntrinsicModRefBehavior(unsigned iid); /// doesNotAccessMemory - If the specified call is known to never read or /// write memory, return true. If the call only reads from known-constant @@ -201,14 +201,14 @@ /// /// This property corresponds to the GCC 'const' attribute. /// - bool doesNotAccessMemory(CallSite CS) { + bool doesNotAccessMemory(ImmutableCallSite CS) { return getModRefBehavior(CS) == DoesNotAccessMemory; } /// doesNotAccessMemory - If the specified function is known to never read or /// write memory, return true. For use when the call site is not known. /// - bool doesNotAccessMemory(Function *F) { + bool doesNotAccessMemory(const Function *F) { return getModRefBehavior(F) == DoesNotAccessMemory; } @@ -221,7 +221,7 @@ /// /// This property corresponds to the GCC 'pure' attribute. /// - bool onlyReadsMemory(CallSite CS) { + bool onlyReadsMemory(ImmutableCallSite CS) { ModRefBehavior MRB = getModRefBehavior(CS); return MRB == DoesNotAccessMemory || MRB == OnlyReadsMemory; } @@ -230,7 +230,7 @@ /// non-volatile memory (or not access memory at all), return true. For use /// when the call site is not known. /// - bool onlyReadsMemory(Function *F) { + bool onlyReadsMemory(const Function *F) { ModRefBehavior MRB = getModRefBehavior(F); return MRB == DoesNotAccessMemory || MRB == OnlyReadsMemory; } @@ -244,7 +244,8 @@ /// a particular call site modifies or reads the memory specified by the /// pointer. /// - virtual ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size); + virtual ModRefResult getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size); /// getModRefInfo - Return information about whether two call sites may refer /// to the same set of memory locations. This function returns NoModRef if @@ -252,28 +253,32 @@ /// written by CS2, Mod if CS1 writes to memory read or written by CS2, or /// ModRef if CS1 might read or write memory accessed by CS2. /// - virtual ModRefResult getModRefInfo(CallSite CS1, CallSite CS2); + virtual ModRefResult getModRefInfo(ImmutableCallSite CS1, + ImmutableCallSite CS2); public: /// Convenience functions... - ModRefResult getModRefInfo(LoadInst *L, Value *P, unsigned Size); - ModRefResult getModRefInfo(StoreInst *S, Value *P, unsigned Size); - ModRefResult getModRefInfo(CallInst *C, Value *P, unsigned Size) { - return getModRefInfo(CallSite(C), P, Size); + ModRefResult getModRefInfo(const LoadInst *L, const Value *P, unsigned Size); + ModRefResult getModRefInfo(const StoreInst *S, const Value *P, unsigned Size); + ModRefResult getModRefInfo(const CallInst *C, const Value *P, unsigned Size) { + return getModRefInfo(ImmutableCallSite(C), P, Size); + } + ModRefResult getModRefInfo(const InvokeInst *I, + const Value *P, unsigned Size) { + return getModRefInfo(ImmutableCallSite(I), P, Size); } - ModRefResult getModRefInfo(InvokeInst *I, Value *P, unsigned Size) { - return getModRefInfo(CallSite(I), P, Size); - } - ModRefResult getModRefInfo(VAArgInst* I, Value* P, unsigned Size) { + ModRefResult getModRefInfo(const VAArgInst* I, + const Value* P, unsigned Size) { return AliasAnalysis::ModRef; } - ModRefResult getModRefInfo(Instruction *I, Value *P, unsigned Size) { + ModRefResult getModRefInfo(const Instruction *I, + const Value *P, unsigned Size) { switch (I->getOpcode()) { - case Instruction::VAArg: return getModRefInfo((VAArgInst*)I, P, Size); - case Instruction::Load: return getModRefInfo((LoadInst*)I, P, Size); - case Instruction::Store: return getModRefInfo((StoreInst*)I, P, Size); - case Instruction::Call: return getModRefInfo((CallInst*)I, P, Size); - case Instruction::Invoke: return getModRefInfo((InvokeInst*)I, P, Size); + case Instruction::VAArg: return getModRefInfo((const VAArgInst*)I, P,Size); + case Instruction::Load: return getModRefInfo((const LoadInst*)I, P, Size); + case Instruction::Store: return getModRefInfo((const StoreInst*)I, P,Size); + case Instruction::Call: return getModRefInfo((const CallInst*)I, P, Size); + case Instruction::Invoke: return getModRefInfo((const InvokeInst*)I,P,Size); default: return NoModRef; } } Modified: llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h?rev=110155&r1=110154&r2=110155&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h Tue Aug 3 16:48:53 2010 @@ -35,11 +35,13 @@ } ~LibCallAliasAnalysis(); - ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size); + ModRefResult getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size); - ModRefResult getModRefInfo(CallSite CS1, CallSite CS2) { + ModRefResult getModRefInfo(ImmutableCallSite CS1, + ImmutableCallSite CS2) { // TODO: Could compare two direct calls against each other if we cared to. - return AliasAnalysis::getModRefInfo(CS1,CS2); + return AliasAnalysis::getModRefInfo(CS1, CS2); } virtual void getAnalysisUsage(AnalysisUsage &AU) const; @@ -61,7 +63,8 @@ private: ModRefResult AnalyzeLibCallDetails(const LibCallFunctionInfo *FI, - CallSite CS, Value *P, unsigned Size); + ImmutableCallSite CS, + const Value *P, unsigned Size); }; } // End of llvm namespace Modified: llvm/trunk/include/llvm/Analysis/LibCallSemantics.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LibCallSemantics.h?rev=110155&r1=110154&r2=110155&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LibCallSemantics.h (original) +++ llvm/trunk/include/llvm/Analysis/LibCallSemantics.h Tue Aug 3 16:48:53 2010 @@ -47,7 +47,8 @@ enum LocResult { Yes, No, Unknown }; - LocResult (*isLocation)(CallSite CS, const Value *Ptr, unsigned Size); + LocResult (*isLocation)(ImmutableCallSite CS, + const Value *Ptr, unsigned Size); }; /// LibCallFunctionInfo - Each record in the array of FunctionInfo structs @@ -142,7 +143,7 @@ /// getFunctionInfo - Return the LibCallFunctionInfo object corresponding to /// the specified function if we have it. If not, return null. - const LibCallFunctionInfo *getFunctionInfo(Function *F) const; + const LibCallFunctionInfo *getFunctionInfo(const Function *F) const; //===------------------------------------------------------------------===// Modified: llvm/trunk/include/llvm/Support/CallSite.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CallSite.h?rev=110155&r1=110154&r2=110155&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/CallSite.h (original) +++ llvm/trunk/include/llvm/Support/CallSite.h Tue Aug 3 16:48:53 2010 @@ -271,16 +271,6 @@ } }; -/// ImmutableCallSite - establish a view to a call site for examination -class ImmutableCallSite : public CallSiteBase<> { - typedef CallSiteBase<> Base; -public: - ImmutableCallSite(const Value* V) : Base(V) {} - ImmutableCallSite(const CallInst *CI) : Base(CI) {} - ImmutableCallSite(const InvokeInst *II) : Base(II) {} - ImmutableCallSite(const Instruction *II) : Base(II) {} -}; - class CallSite : public CallSiteBase { typedef CallSiteBase { + typedef CallSiteBase<> Base; +public: + ImmutableCallSite(const Value* V) : Base(V) {} + ImmutableCallSite(const CallInst *CI) : Base(CI) {} + ImmutableCallSite(const InvokeInst *II) : Base(II) {} + ImmutableCallSite(const Instruction *II) : Base(II) {} + ImmutableCallSite(CallSite CS) : Base(CS.getInstruction()) {} +}; + } // End llvm namespace #endif Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=110155&r1=110154&r2=110155&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Tue Aug 3 16:48:53 2010 @@ -65,7 +65,7 @@ } AliasAnalysis::ModRefResult -AliasAnalysis::getModRefInfo(CallSite CS1, CallSite CS2) { +AliasAnalysis::getModRefInfo(ImmutableCallSite CS1, ImmutableCallSite CS2) { // FIXME: we can do better. assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!"); return AA->getModRefInfo(CS1, CS2); @@ -77,7 +77,7 @@ //===----------------------------------------------------------------------===// AliasAnalysis::ModRefResult -AliasAnalysis::getModRefInfo(LoadInst *L, Value *P, unsigned Size) { +AliasAnalysis::getModRefInfo(const LoadInst *L, const Value *P, unsigned Size) { // If the load address doesn't alias the given address, it doesn't read // or write the specified memory. if (!alias(L->getOperand(0), getTypeStoreSize(L->getType()), P, Size)) @@ -92,7 +92,7 @@ } AliasAnalysis::ModRefResult -AliasAnalysis::getModRefInfo(StoreInst *S, Value *P, unsigned Size) { +AliasAnalysis::getModRefInfo(const StoreInst *S, const Value *P, unsigned Size) { // If the stored address cannot alias the pointer in question, then the // pointer cannot be modified by the store. if (!alias(S->getOperand(1), @@ -113,7 +113,7 @@ } AliasAnalysis::ModRefBehavior -AliasAnalysis::getModRefBehavior(CallSite CS, +AliasAnalysis::getModRefBehavior(ImmutableCallSite CS, std::vector *Info) { if (CS.doesNotAccessMemory()) // Can't do better than this. @@ -125,7 +125,7 @@ } AliasAnalysis::ModRefBehavior -AliasAnalysis::getModRefBehavior(Function *F, +AliasAnalysis::getModRefBehavior(const Function *F, std::vector *Info) { if (F) { if (F->doesNotAccessMemory()) @@ -134,19 +134,21 @@ if (F->onlyReadsMemory()) return OnlyReadsMemory; if (unsigned id = F->getIntrinsicID()) - return getModRefBehavior(id); + return getIntrinsicModRefBehavior(id); } return UnknownModRefBehavior; } -AliasAnalysis::ModRefBehavior AliasAnalysis::getModRefBehavior(unsigned iid) { +AliasAnalysis::ModRefBehavior +AliasAnalysis::getIntrinsicModRefBehavior(unsigned iid) { #define GET_INTRINSIC_MODREF_BEHAVIOR #include "llvm/Intrinsics.gen" #undef GET_INTRINSIC_MODREF_BEHAVIOR } AliasAnalysis::ModRefResult -AliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) { +AliasAnalysis::getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size) { ModRefBehavior MRB = getModRefBehavior(CS); if (MRB == DoesNotAccessMemory) return NoModRef; @@ -156,7 +158,7 @@ Mask = Ref; else if (MRB == AliasAnalysis::AccessesArguments) { bool doesAlias = false; - for (CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end(); + for (ImmutableCallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end(); AI != AE; ++AI) if (!isNoAlias(*AI, ~0U, P, Size)) { doesAlias = true; @@ -223,12 +225,12 @@ const Value *Ptr, unsigned Size) { assert(I1.getParent() == I2.getParent() && "Instructions not in same basic block!"); - BasicBlock::iterator I = const_cast(&I1); - BasicBlock::iterator E = const_cast(&I2); + BasicBlock::const_iterator I = &I1; + BasicBlock::const_iterator E = &I2; ++E; // Convert from inclusive to exclusive range. for (; I != E; ++I) // Check every instruction in range - if (getModRefInfo(I, const_cast(Ptr), Size) & Mod) + if (getModRefInfo(I, Ptr, Size) & Mod) return true; return false; } @@ -237,7 +239,7 @@ /// function. bool llvm::isNoAliasCall(const Value *V) { if (isa(V) || isa(V)) - return CallSite(const_cast(cast(V))) + return ImmutableCallSite(cast(V)) .paramHasAttr(0, Attribute::NoAlias); return false; } Modified: llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp?rev=110155&r1=110154&r2=110155&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp Tue Aug 3 16:48:53 2010 @@ -103,8 +103,10 @@ AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size); - ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size); - ModRefResult getModRefInfo(CallSite CS1, CallSite CS2) { + ModRefResult getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size); + ModRefResult getModRefInfo(ImmutableCallSite CS1, + ImmutableCallSite CS2) { return AliasAnalysis::getModRefInfo(CS1,CS2); } }; @@ -145,7 +147,8 @@ } AliasAnalysis::ModRefResult -AliasAnalysisCounter::getModRefInfo(CallSite CS, Value *P, unsigned Size) { +AliasAnalysisCounter::getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size) { ModRefResult R = getAnalysis().getModRefInfo(CS, P, Size); const char *MRString; Modified: llvm/trunk/lib/Analysis/AliasDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasDebugger.cpp?rev=110155&r1=110154&r2=110155&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasDebugger.cpp (original) +++ llvm/trunk/lib/Analysis/AliasDebugger.cpp Tue Aug 3 16:48:53 2010 @@ -99,12 +99,14 @@ return AliasAnalysis::alias(V1, V1Size, V2, V2Size); } - ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size) { + ModRefResult getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size) { assert(Vals.find(P) != Vals.end() && "Never seen value in AA before"); return AliasAnalysis::getModRefInfo(CS, P, Size); } - ModRefResult getModRefInfo(CallSite CS1, CallSite CS2) { + ModRefResult getModRefInfo(ImmutableCallSite CS1, + ImmutableCallSite CS2) { return AliasAnalysis::getModRefInfo(CS1,CS2); } Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=110155&r1=110154&r2=110155&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original) +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Tue Aug 3 16:48:53 2010 @@ -155,7 +155,7 @@ // Check the call sites list and invoke list... if (!CallSites.empty()) { for (unsigned i = 0, e = CallSites.size(); i != e; ++i) - if (AA.getModRefInfo(CallSites[i], const_cast(Ptr), Size) + if (AA.getModRefInfo(CallSites[i], Ptr, Size) != AliasAnalysis::NoModRef) return true; } Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110155&r1=110154&r2=110155&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Aug 3 16:48:53 2010 @@ -153,10 +153,12 @@ } virtual bool pointsToConstantMemory(const Value *P) { return false; } - virtual ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size) { + virtual ModRefResult getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size) { return ModRef; } - virtual ModRefResult getModRefInfo(CallSite CS1, CallSite CS2) { + virtual ModRefResult getModRefInfo(ImmutableCallSite CS1, + ImmutableCallSite CS2) { return ModRef; } @@ -225,8 +227,10 @@ return Alias; } - ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size); - ModRefResult getModRefInfo(CallSite CS1, CallSite CS2); + ModRefResult getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size); + ModRefResult getModRefInfo(ImmutableCallSite CS1, + ImmutableCallSite CS2); /// pointsToConstantMemory - Chase pointers until we find a (constant /// global) or not. @@ -295,7 +299,8 @@ /// function, we really can't say much about this query. We do, however, use /// simple "address taken" analysis on local objects. AliasAnalysis::ModRefResult -BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) { +BasicAliasAnalysis::getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size) { assert(notDifferentParent(CS.getInstruction(), P) && "AliasAnalysis query involving multiple functions!"); @@ -307,7 +312,7 @@ // the current function not to the current function, and a tail callee // may reference them. if (isa(Object)) - if (CallInst *CI = dyn_cast(CS.getInstruction())) + if (const CallInst *CI = dyn_cast(CS.getInstruction())) if (CI->isTailCall()) return NoModRef; @@ -318,7 +323,7 @@ isNonEscapingLocalObject(Object)) { bool PassedAsArg = false; unsigned ArgNo = 0; - for (CallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end(); + for (ImmutableCallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end(); CI != CE; ++CI, ++ArgNo) { // Only look at the no-capture pointer arguments. if (!(*CI)->getType()->isPointerTy() || @@ -340,7 +345,7 @@ } // Finally, handle specific knowledge of intrinsics. - IntrinsicInst *II = dyn_cast(CS.getInstruction()); + const IntrinsicInst *II = dyn_cast(CS.getInstruction()); if (II == 0) return AliasAnalysis::getModRefInfo(CS, P, Size); @@ -411,7 +416,8 @@ AliasAnalysis::ModRefResult -BasicAliasAnalysis::getModRefInfo(CallSite CS1, CallSite CS2) { +BasicAliasAnalysis::getModRefInfo(ImmutableCallSite CS1, + ImmutableCallSite CS2) { // If CS1 or CS2 are readnone, they don't interact. ModRefBehavior CS1B = AliasAnalysis::getModRefBehavior(CS1); if (CS1B == DoesNotAccessMemory) return NoModRef; Modified: llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp?rev=110155&r1=110154&r2=110155&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp Tue Aug 3 16:48:53 2010 @@ -47,14 +47,15 @@ /// GlobalInfo - Maintain mod/ref info for all of the globals without /// addresses taken that are read or written (transitively) by this /// function. - std::map GlobalInfo; + std::map GlobalInfo; /// MayReadAnyGlobal - May read global variables, but it is not known which. bool MayReadAnyGlobal; - unsigned getInfoForGlobal(GlobalValue *GV) const { + unsigned getInfoForGlobal(const GlobalValue *GV) const { unsigned Effect = MayReadAnyGlobal ? AliasAnalysis::Ref : 0; - std::map::const_iterator I = GlobalInfo.find(GV); + std::map::const_iterator I = + GlobalInfo.find(GV); if (I != GlobalInfo.end()) Effect |= I->second; return Effect; @@ -71,19 +72,19 @@ class GlobalsModRef : public ModulePass, public AliasAnalysis { /// NonAddressTakenGlobals - The globals that do not have their addresses /// taken. - std::set NonAddressTakenGlobals; + std::set NonAddressTakenGlobals; /// IndirectGlobals - The memory pointed to by this global is known to be /// 'owned' by the global. - std::set IndirectGlobals; + std::set IndirectGlobals; /// AllocsForIndirectGlobals - If an instruction allocates memory for an /// indirect global, this map indicates which one. - std::map AllocsForIndirectGlobals; + std::map AllocsForIndirectGlobals; /// FunctionInfo - For each function, keep track of what globals are /// modified or read. - std::map FunctionInfo; + std::map FunctionInfo; public: static char ID; @@ -107,16 +108,18 @@ // AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size); - ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size); - ModRefResult getModRefInfo(CallSite CS1, CallSite CS2) { - return AliasAnalysis::getModRefInfo(CS1,CS2); + ModRefResult getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size); + ModRefResult getModRefInfo(ImmutableCallSite CS1, + ImmutableCallSite CS2) { + return AliasAnalysis::getModRefInfo(CS1, CS2); } /// getModRefBehavior - Return the behavior of the specified function if /// called from the specified call site. The call site may be null in which /// case the most generic behavior of this function should be returned. - ModRefBehavior getModRefBehavior(Function *F, - std::vector *Info) { + ModRefBehavior getModRefBehavior(const Function *F, + std::vector *Info) { if (FunctionRecord *FR = getFunctionInfo(F)) { if (FR->FunctionEffect == 0) return DoesNotAccessMemory; @@ -129,9 +132,9 @@ /// getModRefBehavior - Return the behavior of the specified function if /// called from the specified call site. The call site may be null in which /// case the most generic behavior of this function should be returned. - ModRefBehavior getModRefBehavior(CallSite CS, - std::vector *Info) { - Function* F = CS.getCalledFunction(); + ModRefBehavior getModRefBehavior(ImmutableCallSite CS, + std::vector *Info) { + const Function* F = CS.getCalledFunction(); if (!F) return AliasAnalysis::getModRefBehavior(CS, Info); if (FunctionRecord *FR = getFunctionInfo(F)) { if (FR->FunctionEffect == 0) @@ -158,8 +161,9 @@ private: /// getFunctionInfo - Return the function info for the function, or null if /// we don't have anything useful to say about it. - FunctionRecord *getFunctionInfo(Function *F) { - std::map::iterator I = FunctionInfo.find(F); + FunctionRecord *getFunctionInfo(const Function *F) { + std::map::iterator I = + FunctionInfo.find(F); if (I != FunctionInfo.end()) return &I->second; return 0; @@ -409,7 +413,7 @@ FunctionEffect |= CalleeFR->FunctionEffect; // Incorporate callee's effects on globals into our info. - for (std::map::iterator GI = + for (std::map::iterator GI = CalleeFR->GlobalInfo.begin(), E = CalleeFR->GlobalInfo.end(); GI != E; ++GI) FR.GlobalInfo[GI->first] |= GI->second; @@ -477,13 +481,13 @@ GlobalsModRef::alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size) { // Get the base object these pointers point to. - Value *UV1 = const_cast(V1->getUnderlyingObject()); - Value *UV2 = const_cast(V2->getUnderlyingObject()); + const Value *UV1 = V1->getUnderlyingObject(); + const Value *UV2 = V2->getUnderlyingObject(); // If either of the underlying values is a global, they may be non-addr-taken // globals, which we can answer queries about. - GlobalValue *GV1 = dyn_cast(UV1); - GlobalValue *GV2 = dyn_cast(UV2); + const GlobalValue *GV1 = dyn_cast(UV1); + const GlobalValue *GV2 = dyn_cast(UV2); if (GV1 || GV2) { // If the global's address is taken, pretend we don't know it's a pointer to // the global. @@ -503,12 +507,12 @@ // so, we may be able to handle this. First check to see if the base pointer // is a direct load from an indirect global. GV1 = GV2 = 0; - if (LoadInst *LI = dyn_cast(UV1)) + if (const LoadInst *LI = dyn_cast(UV1)) if (GlobalVariable *GV = dyn_cast(LI->getOperand(0))) if (IndirectGlobals.count(GV)) GV1 = GV; - if (LoadInst *LI = dyn_cast(UV2)) - if (GlobalVariable *GV = dyn_cast(LI->getOperand(0))) + if (const LoadInst *LI = dyn_cast(UV2)) + if (const GlobalVariable *GV = dyn_cast(LI->getOperand(0))) if (IndirectGlobals.count(GV)) GV2 = GV; @@ -530,16 +534,17 @@ } AliasAnalysis::ModRefResult -GlobalsModRef::getModRefInfo(CallSite CS, Value *P, unsigned Size) { +GlobalsModRef::getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size) { unsigned Known = ModRef; // If we are asking for mod/ref info of a direct call with a pointer to a // global we are tracking, return information if we have it. - if (GlobalValue *GV = dyn_cast(P->getUnderlyingObject())) + if (const GlobalValue *GV = dyn_cast(P->getUnderlyingObject())) if (GV->hasLocalLinkage()) - if (Function *F = CS.getCalledFunction()) + if (const Function *F = CS.getCalledFunction()) if (NonAddressTakenGlobals.count(GV)) - if (FunctionRecord *FR = getFunctionInfo(F)) + if (const FunctionRecord *FR = getFunctionInfo(F)) Known = FR->getInfoForGlobal(GV); if (Known == NoModRef) @@ -558,7 +563,7 @@ // any AllocRelatedValues for it. if (IndirectGlobals.erase(GV)) { // Remove any entries in AllocsForIndirectGlobals for this global. - for (std::map::iterator + for (std::map::iterator I = AllocsForIndirectGlobals.begin(), E = AllocsForIndirectGlobals.end(); I != E; ) { if (I->second == GV) { Modified: llvm/trunk/lib/Analysis/LibCallAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LibCallAliasAnalysis.cpp?rev=110155&r1=110154&r2=110155&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LibCallAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/LibCallAliasAnalysis.cpp Tue Aug 3 16:48:53 2010 @@ -43,7 +43,7 @@ /// vs the specified pointer/size. AliasAnalysis::ModRefResult LibCallAliasAnalysis::AnalyzeLibCallDetails(const LibCallFunctionInfo *FI, - CallSite CS, Value *P, + ImmutableCallSite CS, const Value *P, unsigned Size) { // If we have a function, check to see what kind of mod/ref effects it // has. Start by including any info globally known about the function. @@ -117,13 +117,14 @@ // specified memory object. // AliasAnalysis::ModRefResult -LibCallAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) { +LibCallAliasAnalysis::getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size) { ModRefResult MRInfo = ModRef; // If this is a direct call to a function that LCI knows about, get the // information about the runtime function. if (LCI) { - if (Function *F = CS.getCalledFunction()) { + if (const Function *F = CS.getCalledFunction()) { if (const LibCallFunctionInfo *FI = LCI->getFunctionInfo(F)) { MRInfo = ModRefResult(MRInfo & AnalyzeLibCallDetails(FI, CS, P, Size)); if (MRInfo == NoModRef) return NoModRef; Modified: llvm/trunk/lib/Analysis/LibCallSemantics.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LibCallSemantics.cpp?rev=110155&r1=110154&r2=110155&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LibCallSemantics.cpp (original) +++ llvm/trunk/lib/Analysis/LibCallSemantics.cpp Tue Aug 3 16:48:53 2010 @@ -40,7 +40,8 @@ /// getFunctionInfo - Return the LibCallFunctionInfo object corresponding to /// the specified function if we have it. If not, return null. -const LibCallFunctionInfo *LibCallInfo::getFunctionInfo(Function *F) const { +const LibCallFunctionInfo * +LibCallInfo::getFunctionInfo(const Function *F) const { StringMap *Map = getMap(Impl); /// If this is the first time we are querying for this info, lazily construct Modified: llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp?rev=110155&r1=110154&r2=110155&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp Tue Aug 3 16:48:53 2010 @@ -169,7 +169,7 @@ continue; // Ignore intrinsics that only access local memory. if (unsigned id = CS.getCalledFunction()->getIntrinsicID()) - if (AliasAnalysis::getModRefBehavior(id) == + if (AliasAnalysis::getIntrinsicModRefBehavior(id) == AliasAnalysis::AccessesArguments) { // Check that all pointer arguments point to local memory. for (CallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end(); From criswell at uiuc.edu Tue Aug 3 16:49:13 2010 From: criswell at uiuc.edu (John Criswell) Date: Tue, 03 Aug 2010 21:49:13 -0000 Subject: [llvm-commits] [poolalloc] r110156 - /poolalloc/trunk/lib/DSA/Local.cpp Message-ID: <20100803214913.EF4992A6C12C@llvm.org> Author: criswell Date: Tue Aug 3 16:49:13 2010 New Revision: 110156 URL: http://llvm.org/viewvc/llvm-project?rev=110156&view=rev Log: Added comments to visitGetElementPtrInst(). No functionality changes. Modified: poolalloc/trunk/lib/DSA/Local.cpp Modified: poolalloc/trunk/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=110156&r1=110155&r2=110156&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Local.cpp (original) +++ poolalloc/trunk/lib/DSA/Local.cpp Tue Aug 3 16:49:13 2010 @@ -470,12 +470,19 @@ } void GraphBuilder::visitGetElementPtrInst(User &GEP) { + // + // Ensure that the indexed pointer has a DSNode. + // DSNodeHandle Value = getValueDest(GEP.getOperand(0)); if (Value.isNull()) Value = createNode(); - // As a special case, if all of the index operands of GEP are constant zeros, - // handle this just like we handle casts (ie, don't do much). + // + // There are a few quick and easy cases to handle. If the index operands of + // the GEP are all zero, or if the DSNode of the indexed pointer is already + // folded, then we know that the result of the GEP will have the same offset + // into the same DSNode as the indexed pointer. + // bool AllZeros = true; for (unsigned i = 1, e = GEP.getNumOperands(); i != e; ++i) { if (ConstantInt * CI = dyn_cast(GEP.getOperand(i))) @@ -486,15 +493,25 @@ break; } - // If all of the indices are zero, the result points to the operand without - // applying the type. if (AllZeros || (!Value.isNull() && Value.getNode()->isNodeCompletelyFolded())) { setDestTo(GEP, Value); return; } - //Make sure the uncollapsed node has a large enough size for the struct type + // + // Okay, no easy way out. Calculate the offset into the object being + // indexed. + // + + // + // Ensure the uncollapsed node has a large enough size for the struct type + // + // FIXME: I am not sure if the code below is completely correct (especially + // if we start doing fancy analysis on non-constant array indices). + // What if the array is indexed using a larger index than its declared + // size? Does the LLVM verifier catch such issues? + // const PointerType *PTy = cast (GEP.getOperand(0)->getType()); const Type *CurTy = PTy->getElementType(); if (TD.getTypeAllocSize(CurTy) + Value.getOffset() > Value.getNode()->getSize()) @@ -528,7 +545,18 @@ } #endif - // All of these subscripts are indexing INTO the elements we have... + // + // Determine the offset (in bytes) between the result of the GEP and the + // GEP's pointer operand. + // + // Note: All of these subscripts are indexing INTO the elements we have... + // + // FIXME: We can do better for array indexing. First, if the array index is + // constant, we can determine how much farther we're moving the + // pointer. Second, we can try to use the results of other analysis + // passes (e.g., ScalarEvolution) to find min/max values to do less + // conservative type-folding. + // unsigned Offset = 0; for (gep_type_iterator I = gep_type_begin(GEP), E = gep_type_end(GEP); I != E; ++I) @@ -537,6 +565,14 @@ int FieldNo = CUI->getSExtValue(); Offset += (unsigned)TD.getStructLayout(STy)->getElementOffset(FieldNo); } else if (isa(*I)) { + // + // Unless we're advancing the pointer by zero bytes via array indexing, + // fold the node (i.e., mark it type-unknown) and indicate that we're + // indexing zero bytes into the object. + // + // Note that we break out of the loop if we fold the node. Once + // something is folded, all values within it are considered to alias. + // if (!isa(I.getOperand()) || !cast(I.getOperand())->isNullValue()) { Value.getNode()->setArrayMarker(); From geek4civic at gmail.com Tue Aug 3 17:39:34 2010 From: geek4civic at gmail.com (NAKAMURA Takumi) Date: Wed, 4 Aug 2010 07:39:34 +0900 Subject: [llvm-commits] [Patch Proposal] Reduction of build time to get rid of invoking shells Message-ID: This patch brings extreme reduction of build time on certain hosts. (eg. NTOS!!!) We can use $realpath function with GNU Make >= 3.81. The macro realpath in this patch should be activated with prior versions. The expression $(call realpath, path/to) is evaluated as built-in when realpath is built-in function. Otherwise the macro realpath should be expanded. The case on "up-to-date" tree. 6m42.119s->1m32.030s cygwin Atom 2.0GHz 10.781s->3.719s msys Core i7 2.66GHz 38.253s->25.518s Fedora 12 Cell BE -------------- next part -------------- diff --git a/Makefile.config.in b/Makefile.config.in index 1d54b31..5ebd803 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -39,14 +39,18 @@ ifndef PROJECT_NAME PROJECT_NAME := $(LLVMPackageName) endif -PROJ_OBJ_DIR := $(shell $(PWD)) -PROJ_OBJ_ROOT := $(shell cd $(PROJ_OBJ_DIR)/$(LEVEL); $(PWD)) +# The macro below is expanded when 'realpath' is not built-in. +# Built-in 'realpath' is available on GNU Make 3.81. +realpath = $(shell cd $(1); $(PWD)) + +PROJ_OBJ_DIR := $(call realpath, .) +PROJ_OBJ_ROOT := $(call realpath, $(PROJ_OBJ_DIR)/$(LEVEL)) ifeq ($(PROJECT_NAME),llvm) -LLVM_SRC_ROOT := $(shell cd @abs_top_srcdir@; $(PWD)) -LLVM_OBJ_ROOT := $(shell cd @abs_top_builddir@; $(PWD)) -PROJ_SRC_ROOT := $(shell cd $(LLVM_SRC_ROOT); $(PWD)) -PROJ_SRC_DIR := $(shell cd $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD)) +LLVM_SRC_ROOT := $(call realpath, @abs_top_srcdir@) +LLVM_OBJ_ROOT := $(call realpath, @abs_top_builddir@) +PROJ_SRC_ROOT := $(LLVM_SRC_ROOT) +PROJ_SRC_DIR := $(call realpath, $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))) prefix := @prefix@ PROJ_prefix := $(prefix) PROJ_VERSION := $(LLVMVersion) @@ -66,7 +70,7 @@ endif ifndef LLVM_OBJ_ROOT $(error Projects must define LLVM_OBJ_ROOT) endif -PROJ_SRC_DIR := $(shell cd $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD)) +PROJ_SRC_DIR := $(call realpath, $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))) prefix := $(PROJ_INSTALL_ROOT) PROJ_prefix := $(prefix) ifndef PROJ_VERSION From sabre at nondot.org Tue Aug 3 17:49:22 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 03 Aug 2010 22:49:22 -0000 Subject: [llvm-commits] [llvm] r110164 - /llvm/trunk/lib/Target/X86/X86Instr64bit.td Message-ID: <20100803224922.A99322A6C12C@llvm.org> Author: lattner Date: Tue Aug 3 17:49:22 2010 New Revision: 110164 URL: http://llvm.org/viewvc/llvm-project?rev=110164&view=rev Log: fix a win64 encoding problem, patch by Cameron Esfahani! Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=110164&r1=110163&r2=110164&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Tue Aug 3 17:49:22 2010 @@ -168,7 +168,7 @@ MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, EFLAGS], Uses = [RSP] in { - def WINCALL64pcrel32 : I<0xE8, RawFrm, + def WINCALL64pcrel32 : Ii32PCRel<0xE8, RawFrm, (outs), (ins i64i32imm_pcrel:$dst, variable_ops), "call\t$dst", []>, Requires<[IsWin64]>; From clattner at apple.com Tue Aug 3 17:49:48 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 3 Aug 2010 15:49:48 -0700 Subject: [llvm-commits] Patch to correctly emit 64-bit WINCALLs In-Reply-To: References: Message-ID: <388B1EBF-C509-45F2-B100-E5C51B0B6249@apple.com> Thanks! Applied in r110164 -Chris On Aug 3, 2010, at 1:31 PM, Cameron Esfahani wrote: > Here's a small patch to correctly emit a 64-bit WINCALL: > > Index: lib/Target/X86/X86Instr64bit.td > =================================================================== > --- lib/Target/X86/X86Instr64bit.td (revision 110105) > +++ lib/Target/X86/X86Instr64bit.td (working copy) > @@ -168,7 +168,7 @@ > MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, > XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, EFLAGS], > Uses = [RSP] in { > - def WINCALL64pcrel32 : I<0xE8, RawFrm, > + def WINCALL64pcrel32 : Ii32PCRel<0xE8, RawFrm, > (outs), (ins i64i32imm_pcrel:$dst, variable_ops), > "call\t$dst", []>, > Requires<[IsWin64]>; > > Cameron Esfahani > dirty at apple.com > > "It is the spirit and not the form of law that keeps justice alive." > > Earl Warren > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Tue Aug 3 17:53:22 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 03 Aug 2010 22:53:22 -0000 Subject: [llvm-commits] [llvm] r110166 - /llvm/trunk/Makefile.config.in Message-ID: <20100803225322.AFFFC2A6C12C@llvm.org> Author: lattner Date: Tue Aug 3 17:53:22 2010 New Revision: 110166 URL: http://llvm.org/viewvc/llvm-project?rev=110166&view=rev Log: Make the makefiles go much faster by using the realpath builtin instead of shell. On my 8 core mac pro, this speeds up a 'make -j8' null build of the lib directory from 1.11s to 0.77s wall time. Patch by NAKAMURA Takumi! Modified: llvm/trunk/Makefile.config.in Modified: llvm/trunk/Makefile.config.in URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.config.in?rev=110166&r1=110165&r2=110166&view=diff ============================================================================== --- llvm/trunk/Makefile.config.in (original) +++ llvm/trunk/Makefile.config.in Tue Aug 3 17:53:22 2010 @@ -39,14 +39,18 @@ PROJECT_NAME := $(LLVMPackageName) endif -PROJ_OBJ_DIR := $(shell $(PWD)) -PROJ_OBJ_ROOT := $(shell cd $(PROJ_OBJ_DIR)/$(LEVEL); $(PWD)) +# The macro below is expanded when 'realpath' is not built-in. +# Built-in 'realpath' is available on GNU Make 3.81. +realpath = $(shell cd $(1); $(PWD)) + +PROJ_OBJ_DIR := $(call realpath, .) +PROJ_OBJ_ROOT := $(call realpath, $(PROJ_OBJ_DIR)/$(LEVEL)) ifeq ($(PROJECT_NAME),llvm) -LLVM_SRC_ROOT := $(shell cd @abs_top_srcdir@; $(PWD)) -LLVM_OBJ_ROOT := $(shell cd @abs_top_builddir@; $(PWD)) -PROJ_SRC_ROOT := $(shell cd $(LLVM_SRC_ROOT); $(PWD)) -PROJ_SRC_DIR := $(shell cd $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD)) +LLVM_SRC_ROOT := $(call realpath, @abs_top_srcdir@) +LLVM_OBJ_ROOT := $(call realpath, @abs_top_builddir@) +PROJ_SRC_ROOT := $(LLVM_SRC_ROOT) +PROJ_SRC_DIR := $(call realpath, $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))) prefix := @prefix@ PROJ_prefix := $(prefix) PROJ_VERSION := $(LLVMVersion) @@ -66,7 +70,7 @@ ifndef LLVM_OBJ_ROOT $(error Projects must define LLVM_OBJ_ROOT) endif -PROJ_SRC_DIR := $(shell cd $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD)) +PROJ_SRC_DIR := $(call realpath, $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))) prefix := $(PROJ_INSTALL_ROOT) PROJ_prefix := $(prefix) ifndef PROJ_VERSION From clattner at apple.com Tue Aug 3 17:53:52 2010 From: clattner at apple.com (Chris Lattner) Date: Tue, 3 Aug 2010 15:53:52 -0700 Subject: [llvm-commits] [Patch Proposal] Reduction of build time to get rid of invoking shells In-Reply-To: References: Message-ID: <4C077D84-0B98-4431-8409-5AB9540D6CEC@apple.com> Wow, nice speedup! Committed in r110166, thanks! -Chris On Aug 3, 2010, at 3:39 PM, NAKAMURA Takumi wrote: > This patch brings extreme reduction of build time on certain hosts. > (eg. NTOS!!!) > > We can use $realpath function with GNU Make >= 3.81. > The macro realpath in this patch should be activated with prior versions. > > The expression $(call realpath, path/to) is evaluated as built-in > when realpath is built-in function. > Otherwise the macro realpath should be expanded. > > > The case on "up-to-date" tree. > 6m42.119s->1m32.030s cygwin Atom 2.0GHz > 10.781s->3.719s msys Core i7 2.66GHz > 38.253s->25.518s Fedora 12 Cell BE > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Tue Aug 3 18:08:10 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 03 Aug 2010 23:08:10 -0000 Subject: [llvm-commits] [llvm] r110167 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h lib/Analysis/AliasAnalysis.cpp lib/Analysis/IPA/GlobalsModRef.cpp Message-ID: <20100803230810.BF9942A6C12C@llvm.org> Author: djg Date: Tue Aug 3 18:08:10 2010 New Revision: 110167 URL: http://llvm.org/viewvc/llvm-project?rev=110167&view=rev Log: Remove PointerAccessInfo, which nothing was using. Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h llvm/trunk/lib/Analysis/AliasAnalysis.cpp llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=110167&r1=110166&r2=110167&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Tue Aug 3 18:08:10 2010 @@ -164,27 +164,12 @@ UnknownModRefBehavior }; - /// PointerAccessInfo - This struct is used to return results for pointers, - /// globals, and the return value of a function. - struct PointerAccessInfo { - /// V - The value this record corresponds to. This may be an Argument for - /// the function, a GlobalVariable, or null, corresponding to the return - /// value for the function. - Value *V; - - /// ModRefInfo - Whether the pointer is loaded or stored to/from. - /// - ModRefResult ModRefInfo; - }; - /// getModRefBehavior - Return the behavior when calling the given call site. - virtual ModRefBehavior getModRefBehavior(ImmutableCallSite CS, - std::vector *Info = 0); + virtual ModRefBehavior getModRefBehavior(ImmutableCallSite CS); /// getModRefBehavior - Return the behavior when calling the given function. /// For use when the call site is not known. - virtual ModRefBehavior getModRefBehavior(const Function *F, - std::vector *Info = 0); + virtual ModRefBehavior getModRefBehavior(const Function *F); /// getIntrinsicModRefBehavior - Return the modref behavior of the intrinsic /// with the given id. Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=110167&r1=110166&r2=110167&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Tue Aug 3 18:08:10 2010 @@ -113,20 +113,18 @@ } AliasAnalysis::ModRefBehavior -AliasAnalysis::getModRefBehavior(ImmutableCallSite CS, - std::vector *Info) { +AliasAnalysis::getModRefBehavior(ImmutableCallSite CS) { if (CS.doesNotAccessMemory()) // Can't do better than this. return DoesNotAccessMemory; - ModRefBehavior MRB = getModRefBehavior(CS.getCalledFunction(), Info); + ModRefBehavior MRB = getModRefBehavior(CS.getCalledFunction()); if (MRB != DoesNotAccessMemory && CS.onlyReadsMemory()) return OnlyReadsMemory; return MRB; } AliasAnalysis::ModRefBehavior -AliasAnalysis::getModRefBehavior(const Function *F, - std::vector *Info) { +AliasAnalysis::getModRefBehavior(const Function *F) { if (F) { if (F->doesNotAccessMemory()) // Can't do better than this. Modified: llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp?rev=110167&r1=110166&r2=110167&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp Tue Aug 3 18:08:10 2010 @@ -118,31 +118,29 @@ /// getModRefBehavior - Return the behavior of the specified function if /// called from the specified call site. The call site may be null in which /// case the most generic behavior of this function should be returned. - ModRefBehavior getModRefBehavior(const Function *F, - std::vector *Info) { + ModRefBehavior getModRefBehavior(const Function *F) { if (FunctionRecord *FR = getFunctionInfo(F)) { if (FR->FunctionEffect == 0) return DoesNotAccessMemory; else if ((FR->FunctionEffect & Mod) == 0) return OnlyReadsMemory; } - return AliasAnalysis::getModRefBehavior(F, Info); + return AliasAnalysis::getModRefBehavior(F); } /// getModRefBehavior - Return the behavior of the specified function if /// called from the specified call site. The call site may be null in which /// case the most generic behavior of this function should be returned. - ModRefBehavior getModRefBehavior(ImmutableCallSite CS, - std::vector *Info) { + ModRefBehavior getModRefBehavior(ImmutableCallSite CS) { const Function* F = CS.getCalledFunction(); - if (!F) return AliasAnalysis::getModRefBehavior(CS, Info); + if (!F) return AliasAnalysis::getModRefBehavior(CS); if (FunctionRecord *FR = getFunctionInfo(F)) { if (FR->FunctionEffect == 0) return DoesNotAccessMemory; else if ((FR->FunctionEffect & Mod) == 0) return OnlyReadsMemory; } - return AliasAnalysis::getModRefBehavior(CS, Info); + return AliasAnalysis::getModRefBehavior(CS); } virtual void deleteValue(Value *V); From gohman at apple.com Tue Aug 3 19:00:13 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 00:00:13 -0000 Subject: [llvm-commits] [llvm] r110168 - /llvm/trunk/utils/lit/lit/TestRunner.py Message-ID: <20100804000013.960842A6C12C@llvm.org> Author: djg Date: Tue Aug 3 19:00:13 2010 New Revision: 110168 URL: http://llvm.org/viewvc/llvm-project?rev=110168&view=rev Log: Use the regular conditional operator syntax instead of a clever hack. Modified: llvm/trunk/utils/lit/lit/TestRunner.py Modified: llvm/trunk/utils/lit/lit/TestRunner.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=110168&r1=110167&r2=110168&view=diff ============================================================================== --- llvm/trunk/utils/lit/lit/TestRunner.py (original) +++ llvm/trunk/utils/lit/lit/TestRunner.py Tue Aug 3 19:00:13 2010 @@ -522,10 +522,10 @@ out,err,exitCode = res if isXFail: ok = exitCode != 0 - status = (Test.XPASS, Test.XFAIL)[ok] + status = Test.XFAIL if ok else Test.XPASS else: ok = exitCode == 0 - status = (Test.FAIL, Test.PASS)[ok] + status = Test.PASS if ok else Test.FAIL if ok: return (status,'') @@ -558,10 +558,10 @@ out,err,exitCode = res if isXFail: ok = exitCode != 0 - status = (Test.XPASS, Test.XFAIL)[ok] + status = Test.XFAIL if ok else Test.XPASS else: ok = exitCode == 0 - status = (Test.FAIL, Test.PASS)[ok] + status = Test.PASS if ok else Test.FAIL if ok: return (status,'') From gohman at apple.com Tue Aug 3 19:05:16 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 00:05:16 -0000 Subject: [llvm-commits] [llvm] r110169 - /llvm/trunk/utils/lit/lit/TestRunner.py Message-ID: <20100804000516.C70F52A6C12C@llvm.org> Author: djg Date: Tue Aug 3 19:05:16 2010 New Revision: 110169 URL: http://llvm.org/viewvc/llvm-project?rev=110169&view=rev Log: Don't print "Command output (stdout):" when the command has no output, and same for stderr, to avoid clutter in the output. Modified: llvm/trunk/utils/lit/lit/TestRunner.py Modified: llvm/trunk/utils/lit/lit/TestRunner.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=110169&r1=110168&r2=110169&view=diff ============================================================================== --- llvm/trunk/utils/lit/lit/TestRunner.py (original) +++ llvm/trunk/utils/lit/lit/TestRunner.py Tue Aug 3 19:05:16 2010 @@ -487,14 +487,16 @@ print >>output, '\n'.join(script) print >>output, "--" print >>output, "Exit Code: %r" % exitCode - print >>output, "Command Output (stdout):" - print >>output, "--" - output.write(out) - print >>output, "--" - print >>output, "Command Output (stderr):" - print >>output, "--" - output.write(err) - print >>output, "--" + if out: + print >>output, "Command Output (stdout):" + print >>output, "--" + output.write(out) + print >>output, "--" + if err: + print >>output, "Command Output (stderr):" + print >>output, "--" + output.write(err) + print >>output, "--" return (status, output.getvalue()) def executeTclTest(test, litConfig): From bob.wilson at apple.com Tue Aug 3 19:12:08 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Wed, 04 Aug 2010 00:12:08 -0000 Subject: [llvm-commits] [llvm] r110170 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/vaba.ll Message-ID: <20100804001208.AC3442A6C12C@llvm.org> Author: bwilson Date: Tue Aug 3 19:12:08 2010 New Revision: 110170 URL: http://llvm.org/viewvc/llvm-project?rev=110170&view=rev Log: Combine NEON VABD (absolute difference) intrinsics with ADDs to make VABA (absolute difference with accumulate) intrinsics. Radar 8228576. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/test/CodeGen/ARM/vaba.ll Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=110170&r1=110169&r2=110170&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Aug 3 19:12:08 2010 @@ -4248,12 +4248,28 @@ /// operands. static SDValue PerformADDCombineWithOperands(SDNode *N, SDValue N0, SDValue N1, TargetLowering::DAGCombinerInfo &DCI) { + SelectionDAG &DAG = DCI.DAG; + // fold (add (select cc, 0, c), x) -> (select cc, x, (add, x, c)) if (N0.getOpcode() == ISD::SELECT && N0.getNode()->hasOneUse()) { SDValue Result = combineSelectAndUse(N, N0, N1, DCI); if (Result.getNode()) return Result; } + // fold (add (arm_neon_vabd a, b) c) -> (arm_neon_vaba c, a, b) + EVT VT = N->getValueType(0); + if (N0.getOpcode() == ISD::INTRINSIC_WO_CHAIN && VT.isInteger()) { + unsigned IntNo = cast(N0.getOperand(0))->getZExtValue(); + if (IntNo == Intrinsic::arm_neon_vabds) + return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, N->getDebugLoc(), VT, + DAG.getConstant(Intrinsic::arm_neon_vabas, MVT::i32), + N1, N0.getOperand(1), N0.getOperand(2)); + if (IntNo == Intrinsic::arm_neon_vabdu) + return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, N->getDebugLoc(), VT, + DAG.getConstant(Intrinsic::arm_neon_vabau, MVT::i32), + N1, N0.getOperand(1), N0.getOperand(2)); + } + return SDValue(); } Modified: llvm/trunk/test/CodeGen/ARM/vaba.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vaba.ll?rev=110170&r1=110169&r2=110170&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vaba.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vaba.ll Tue Aug 3 19:12:08 2010 @@ -203,3 +203,27 @@ declare <8 x i16> @llvm.arm.neon.vabalu.v8i16(<8 x i16>, <8 x i8>, <8 x i8>) nounwind readnone declare <4 x i32> @llvm.arm.neon.vabalu.v4i32(<4 x i32>, <4 x i16>, <4 x i16>) nounwind readnone declare <2 x i64> @llvm.arm.neon.vabalu.v2i64(<2 x i64>, <2 x i32>, <2 x i32>) nounwind readnone + +define <8 x i8> @vabd_combine_s8(<8 x i8>* %A, <8 x i8>* %B) nounwind { +;CHECK: vabd_combine_s8: +;CHECK: vaba.s8 + %tmp1 = load <8 x i8>* %A + %tmp2 = load <8 x i8>* %B + %tmp3 = call <8 x i8> @llvm.arm.neon.vabds.v8i8(<8 x i8> %tmp1, <8 x i8> %tmp2) + %tmp4 = add <8 x i8> %tmp2, %tmp3 + ret <8 x i8> %tmp4 +} + +define <4 x i16> @vabd_combine_u16(<4 x i16>* %A, <4 x i16>* %B) nounwind { +;CHECK: vabd_combine_u16: +;CHECK: vaba.u16 + %tmp1 = load <4 x i16>* %A + %tmp2 = load <4 x i16>* %B + %tmp3 = call <4 x i16> @llvm.arm.neon.vabdu.v4i16(<4 x i16> %tmp1, <4 x i16> %tmp2) + %tmp4 = add <4 x i16> %tmp3, %tmp1 + ret <4 x i16> %tmp4 +} + +declare <8 x i8> @llvm.arm.neon.vabds.v8i8(<8 x i8>, <8 x i8>) nounwind readnone +declare <4 x i16> @llvm.arm.neon.vabdu.v4i16(<4 x i16>, <4 x i16>) nounwind readnone + From gohman at apple.com Tue Aug 3 19:12:32 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 00:12:32 -0000 Subject: [llvm-commits] [llvm] r110171 - /llvm/trunk/utils/lit/lit/TestRunner.py Message-ID: <20100804001232.0E1692A6C12C@llvm.org> Author: djg Date: Tue Aug 3 19:12:31 2010 New Revision: 110171 URL: http://llvm.org/viewvc/llvm-project?rev=110171&view=rev Log: Change the logic which interprets output on stderr as an error so that it doesn't modify the exit code or the stdout contents, and so that it doesn't clutter the output with "Command has output on stderr!". Modified: llvm/trunk/utils/lit/lit/TestRunner.py Modified: llvm/trunk/utils/lit/lit/TestRunner.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=110171&r1=110170&r2=110171&view=diff ============================================================================== --- llvm/trunk/utils/lit/lit/TestRunner.py (original) +++ llvm/trunk/utils/lit/lit/TestRunner.py Tue Aug 3 19:12:31 2010 @@ -312,11 +312,6 @@ out,err,exitCode = executeCommand(command, cwd=cwd, env=test.config.environment) - # Tcl commands fail on standard error output. - if err: - exitCode = 1 - out = 'Command has output on stderr!\n\n' + out - return out,err,exitCode else: results = [] @@ -328,11 +323,6 @@ out = err = '' - # Tcl commands fail on standard error output. - if [True for _,_,err,res in results if err]: - exitCode = 1 - out += 'Command has output on stderr!\n\n' - for i,(cmd, cmd_out, cmd_err, res) in enumerate(results): out += 'Command %d: %s\n' % (i, ' '.join('"%s"' % s for s in cmd.args)) out += 'Command %d Result: %r\n' % (i, res) @@ -521,12 +511,14 @@ if len(res) == 2: return res + # Test for failure. In addition to the exit code, Tcl commands fail + # if there is any standard error output. out,err,exitCode = res if isXFail: - ok = exitCode != 0 + ok = exitCode != 0 or err status = Test.XFAIL if ok else Test.XPASS else: - ok = exitCode == 0 + ok = exitCode == 0 and not err status = Test.PASS if ok else Test.FAIL if ok: From bruno.cardoso at gmail.com Tue Aug 3 20:09:41 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 04 Aug 2010 01:09:41 -0000 Subject: [llvm-commits] [llvm] r110177 - /llvm/trunk/include/llvm/IntrinsicsX86.td Message-ID: <20100804010941.203162A6C12C@llvm.org> Author: bruno Date: Tue Aug 3 20:09:40 2010 New Revision: 110177 URL: http://llvm.org/viewvc/llvm-project?rev=110177&view=rev Log: Fix a comment typo and add more 256-bit intrinsics Modified: llvm/trunk/include/llvm/IntrinsicsX86.td Modified: llvm/trunk/include/llvm/IntrinsicsX86.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=110177&r1=110176&r2=110177&view=diff ============================================================================== --- llvm/trunk/include/llvm/IntrinsicsX86.td (original) +++ llvm/trunk/include/llvm/IntrinsicsX86.td Tue Aug 3 20:09:40 2010 @@ -1238,7 +1238,7 @@ Intrinsic<[llvm_v2f64_ty], [llvm_v4f64_ty], [IntrNoMem]>; } -// Vector replicaete +// Vector replicate let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_avx_movshdup_256 : GCCBuiltin<"__builtin_ia32_movshdup256">, Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty], [IntrNoMem]>; @@ -1321,6 +1321,95 @@ Intrinsic<[llvm_i32_ty], [llvm_v8f32_ty], [IntrNoMem]>; } +// Vector zero +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_vzeroall : GCCBuiltin<"__builtin_ia32_vzeroall">, + Intrinsic<[], [], [IntrNoMem]>; + def int_x86_avx_vzeroupper : GCCBuiltin<"__builtin_ia32_vzeroupper">, + Intrinsic<[], [], [IntrNoMem]>; +} + +// Vector load with broadcast +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_vbroadcastss : + GCCBuiltin<"__builtin_ia32_vbroadcastss">, + Intrinsic<[llvm_v4f32_ty], [llvm_ptr_ty], [IntrReadMem]>; + def int_x86_avx_vbroadcast_sd_256 : + GCCBuiltin<"__builtin_ia32_vbroadcastsd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_ptr_ty], [IntrReadMem]>; + def int_x86_avx_vbroadcastss_256 : + GCCBuiltin<"__builtin_ia32_vbroadcastss256">, + Intrinsic<[llvm_v8f32_ty], [llvm_ptr_ty], [IntrReadMem]>; + def int_x86_avx_vbroadcastf128_pd_256 : + GCCBuiltin<"__builtin_ia32_vbroadcastf128_pd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_ptr_ty], [IntrReadMem]>; + def int_x86_avx_vbroadcastf128_ps_256 : + GCCBuiltin<"__builtin_ia32_vbroadcastf128_ps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_ptr_ty], [IntrReadMem]>; +} + +// SIMD load ops +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_loadu_pd_256 : GCCBuiltin<"__builtin_ia32_loadupd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_ptr_ty], [IntrReadMem]>; + def int_x86_avx_loadu_ps_256 : GCCBuiltin<"__builtin_ia32_loadups256">, + Intrinsic<[llvm_v8f32_ty], [llvm_ptr_ty], [IntrReadMem]>; + def int_x86_avx_loadu_dq_256 : GCCBuiltin<"__builtin_ia32_loaddqu256">, + Intrinsic<[llvm_v32i8_ty], [llvm_ptr_ty], [IntrReadMem]>; + def int_x86_avx_ldu_dq_256 : GCCBuiltin<"__builtin_ia32_lddqu256">, + Intrinsic<[llvm_v32i8_ty], [llvm_ptr_ty], [IntrReadMem]>; +} + +// SIMD store ops +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_storeu_pd_256 : GCCBuiltin<"__builtin_ia32_storeupd256">, + Intrinsic<[], [llvm_ptr_ty, llvm_v4f64_ty], [IntrWriteMem]>; + def int_x86_avx_storeu_ps_256 : GCCBuiltin<"__builtin_ia32_storeups256">, + Intrinsic<[], [llvm_ptr_ty, llvm_v8f32_ty], [IntrWriteMem]>; + def int_x86_avx_storeu_dq_256 : GCCBuiltin<"__builtin_ia32_storedqu256">, + Intrinsic<[], [llvm_ptr_ty, llvm_v32i8_ty], [IntrWriteMem]>; +} + +// Cacheability support ops +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_movnt_dq_256 : GCCBuiltin<"__builtin_ia32_movntdq256">, + Intrinsic<[], [llvm_ptr_ty, llvm_v4i64_ty], [IntrWriteMem]>; + def int_x86_avx_movnt_pd_256 : GCCBuiltin<"__builtin_ia32_movntpd256">, + Intrinsic<[], [llvm_ptr_ty, llvm_v4f64_ty], [IntrWriteMem]>; + def int_x86_avx_movnt_ps_256 : GCCBuiltin<"__builtin_ia32_movntps256">, + Intrinsic<[], [llvm_ptr_ty, llvm_v8f32_ty], [IntrWriteMem]>; +} + +// Conditional load ops +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_maskload_pd : GCCBuiltin<"__builtin_ia32_maskloadpd">, + Intrinsic<[llvm_v2f64_ty], [llvm_ptr_ty, llvm_v2f64_ty], [IntrReadMem]>; + def int_x86_avx_maskload_ps : GCCBuiltin<"__builtin_ia32_maskloadps">, + Intrinsic<[llvm_v4f32_ty], [llvm_ptr_ty, llvm_v4f32_ty], [IntrReadMem]>; + def int_x86_avx_maskload_pd_256 : GCCBuiltin<"__builtin_ia32_maskloadpd256">, + Intrinsic<[llvm_v4f64_ty], [llvm_ptr_ty, llvm_v4f64_ty], [IntrReadMem]>; + def int_x86_avx_maskload_ps_256 : GCCBuiltin<"__builtin_ia32_maskloadps256">, + Intrinsic<[llvm_v8f32_ty], [llvm_ptr_ty, llvm_v8f32_ty], [IntrReadMem]>; +} + +// Conditional store ops +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_avx_maskstore_pd : GCCBuiltin<"__builtin_ia32_maskstorepd">, + Intrinsic<[], [llvm_ptr_ty, + llvm_v2f64_ty, llvm_v2f64_ty], [IntrWriteMem]>; + def int_x86_avx_maskstore_ps : GCCBuiltin<"__builtin_ia32_maskstoreps">, + Intrinsic<[], [llvm_ptr_ty, + llvm_v4f32_ty, llvm_v4f32_ty], [IntrWriteMem]>; + def int_x86_avx_maskstore_pd_256 : + GCCBuiltin<"__builtin_ia32_maskstorepd256">, + Intrinsic<[], [llvm_ptr_ty, + llvm_v4f64_ty, llvm_v4f64_ty], [IntrWriteMem]>; + def int_x86_avx_maskstore_ps_256 : + GCCBuiltin<"__builtin_ia32_maskstoreps256">, + Intrinsic<[], [llvm_ptr_ty, + llvm_v8f32_ty, llvm_v8f32_ty], [IntrWriteMem]>; +} + //===----------------------------------------------------------------------===// // MMX From gohman at apple.com Tue Aug 3 20:13:49 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 01:13:49 -0000 Subject: [llvm-commits] [llvm] r110179 - in /llvm/trunk: include/llvm/Support/IRReader.h lib/AsmParser/Parser.cpp Message-ID: <20100804011349.237072A6C12C@llvm.org> Author: djg Date: Tue Aug 3 20:13:48 2010 New Revision: 110179 URL: http://llvm.org/viewvc/llvm-project?rev=110179&view=rev Log: Don't print the filename twice in file-not-found errors. Modified: llvm/trunk/include/llvm/Support/IRReader.h llvm/trunk/lib/AsmParser/Parser.cpp Modified: llvm/trunk/include/llvm/Support/IRReader.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRReader.h?rev=110179&r1=110178&r2=110179&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/IRReader.h (original) +++ llvm/trunk/include/llvm/Support/IRReader.h Tue Aug 3 20:13:48 2010 @@ -60,8 +60,7 @@ MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrMsg); if (F == 0) { Err = SMDiagnostic(Filename, - "Could not open input file " - "'" + Filename + "': " + ErrMsg); + "Could not open input file: " + ErrMsg); return 0; } @@ -99,8 +98,7 @@ MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrMsg); if (F == 0) { Err = SMDiagnostic(Filename, - "Could not open input file " - "'" + Filename + "': " + ErrMsg); + "Could not open input file: " + ErrMsg); return 0; } Modified: llvm/trunk/lib/AsmParser/Parser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/Parser.cpp?rev=110179&r1=110178&r2=110179&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/Parser.cpp (original) +++ llvm/trunk/lib/AsmParser/Parser.cpp Tue Aug 3 20:13:48 2010 @@ -45,8 +45,7 @@ MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrorStr); if (F == 0) { Err = SMDiagnostic(Filename, - "Could not open input file '" + Filename + "': " + - ErrorStr); + "Could not open input file: " + ErrorStr); return 0; } From gohman at apple.com Tue Aug 3 20:14:33 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 01:14:33 -0000 Subject: [llvm-commits] [llvm] r110180 - /llvm/trunk/include/llvm/Support/SourceMgr.h Message-ID: <20100804011433.DC0D12A6C12C@llvm.org> Author: djg Date: Tue Aug 3 20:14:33 2010 New Revision: 110180 URL: http://llvm.org/viewvc/llvm-project?rev=110180&view=rev Log: Don't construct a std::string with a literal "". Modified: llvm/trunk/include/llvm/Support/SourceMgr.h Modified: llvm/trunk/include/llvm/Support/SourceMgr.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/SourceMgr.h?rev=110180&r1=110179&r2=110180&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/SourceMgr.h (original) +++ llvm/trunk/include/llvm/Support/SourceMgr.h Tue Aug 3 20:14:33 2010 @@ -161,8 +161,8 @@ // Diagnostic with no location (e.g. file not found, command line arg error). SMDiagnostic(const std::string &filename, const std::string &Msg, bool showline = true) - : SM(0), Loc(), Filename(filename), LineNo(-1), ColumnNo(-1), - Message(Msg), LineContents(""), ShowLine(showline) {} + : SM(0), Filename(filename), LineNo(-1), ColumnNo(-1), + Message(Msg), ShowLine(showline) {} // Diagnostic with a location. SMDiagnostic(const SourceMgr &sm, SMLoc L, const std::string &FN, From gohman at apple.com Tue Aug 3 20:16:35 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 01:16:35 -0000 Subject: [llvm-commits] [llvm] r110181 - /llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Message-ID: <20100804011635.9EA892A6C12C@llvm.org> Author: djg Date: Tue Aug 3 20:16:35 2010 New Revision: 110181 URL: http://llvm.org/viewvc/llvm-project?rev=110181&view=rev Log: Fix a comment. Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp?rev=110181&r1=110180&r2=110181&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Tue Aug 3 20:16:35 2010 @@ -2156,7 +2156,7 @@ // * pow(pow(x,y),z)-> pow(x,y*z) // // puts: -// * puts("") -> putchar("\n") +// * puts("") -> putchar('\n') // // round, roundf, roundl: // * round(cnst) -> cnst' From bob.wilson at apple.com Tue Aug 3 20:24:08 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Wed, 04 Aug 2010 01:24:08 -0000 Subject: [llvm-commits] [test-suite] r110182 - /test-suite/trunk/MultiSource/Applications/Makefile Message-ID: <20100804012408.61C5A2A6C12C@llvm.org> Author: bwilson Date: Tue Aug 3 20:24:08 2010 New Revision: 110182 URL: http://llvm.org/viewvc/llvm-project?rev=110182&view=rev Log: Temporarily remove OpenSSL since it is breaking buildbots. Modified: test-suite/trunk/MultiSource/Applications/Makefile Modified: test-suite/trunk/MultiSource/Applications/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/Makefile?rev=110182&r1=110181&r2=110182&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Applications/Makefile (original) +++ test-suite/trunk/MultiSource/Applications/Makefile Tue Aug 3 20:24:08 2010 @@ -5,7 +5,7 @@ include $(LEVEL)/Makefile.config PARALLEL_DIRS = Burg aha sgefa siod d spiff treecc SPASS \ - oggenc JM viterbi SIBsim4 ClamAV sqlite3 lemon OpenSSL + oggenc JM viterbi SIBsim4 ClamAV sqlite3 lemon ifndef DISABLE_CXX PARALLEL_DIRS += lambda-0.1.3 hbd hexxagon minisat endif From gohman at apple.com Tue Aug 3 20:39:08 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 01:39:08 -0000 Subject: [llvm-commits] [llvm] r110183 - in /llvm/trunk/lib: CodeGen/SelectionDAG/SelectionDAGPrinter.cpp System/Unix/Path.inc VMCore/Module.cpp Message-ID: <20100804013908.5FD652A6C12C@llvm.org> Author: djg Date: Tue Aug 3 20:39:08 2010 New Revision: 110183 URL: http://llvm.org/viewvc/llvm-project?rev=110183&view=rev Log: Eliminate unnecessary empty string literals. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp llvm/trunk/lib/System/Unix/Path.inc llvm/trunk/lib/VMCore/Module.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=110183&r1=110182&r2=110183&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Tue Aug 3 20:39:08 2010 @@ -199,7 +199,7 @@ #else errs() << "SelectionDAG::getGraphAttrs is only available in debug builds" << " on systems with Graphviz or gv!\n"; - return std::string(""); + return std::string(); #endif } Modified: llvm/trunk/lib/System/Unix/Path.inc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Path.inc?rev=110183&r1=110182&r2=110183&view=diff ============================================================================== --- llvm/trunk/lib/System/Unix/Path.inc (original) +++ llvm/trunk/lib/System/Unix/Path.inc Tue Aug 3 20:39:08 2010 @@ -276,7 +276,7 @@ char pathname[MAXPATHLEN]; if (!getcwd(pathname,MAXPATHLEN)) { assert (false && "Could not query current working directory."); - return Path(""); + return Path(); } return Path(pathname); @@ -408,7 +408,7 @@ std::string::size_type dot = path.rfind('.'); if (dot == std::string::npos || dot < slash) - return StringRef(""); + return StringRef(); else return StringRef(path).substr(dot + 1); } Modified: llvm/trunk/lib/VMCore/Module.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Module.cpp?rev=110183&r1=110182&r2=110183&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Module.cpp (original) +++ llvm/trunk/lib/VMCore/Module.cpp Tue Aug 3 20:39:08 2010 @@ -58,7 +58,7 @@ // Module::Module(StringRef MID, LLVMContext& C) - : Context(C), Materializer(NULL), ModuleID(MID), DataLayout("") { + : Context(C), Materializer(NULL), ModuleID(MID) { ValSymTab = new ValueSymbolTable(); TypeSymTab = new TypeSymbolTable(); NamedMDSymTab = new StringMap(); From daniel at zuster.org Wed Aug 4 02:36:56 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 4 Aug 2010 00:36:56 -0700 Subject: [llvm-commits] [llvm] r110171 - /llvm/trunk/utils/lit/lit/TestRunner.py In-Reply-To: <20100804001232.0E1692A6C12C@llvm.org> References: <20100804001232.0E1692A6C12C@llvm.org> Message-ID: Hi Dan, The problem with this change is that it becomes very non-obvious from reading a test report why it is failing. Clang's tests don't have the error-on-stderr property, so I always appreciate the reminder when looking at a test report. I think it would make sense to make sure a note about this ends up somewhere in the output. - Daniel On Tue, Aug 3, 2010 at 5:12 PM, Dan Gohman wrote: > Author: djg > Date: Tue Aug ?3 19:12:31 2010 > New Revision: 110171 > > URL: http://llvm.org/viewvc/llvm-project?rev=110171&view=rev > Log: > Change the logic which interprets output on stderr as an error so that > it doesn't modify the exit code or the stdout contents, and so that it > doesn't clutter the output with "Command has output on stderr!". > > Modified: > ? ?llvm/trunk/utils/lit/lit/TestRunner.py > > Modified: llvm/trunk/utils/lit/lit/TestRunner.py > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=110171&r1=110170&r2=110171&view=diff > ============================================================================== > --- llvm/trunk/utils/lit/lit/TestRunner.py (original) > +++ llvm/trunk/utils/lit/lit/TestRunner.py Tue Aug ?3 19:12:31 2010 > @@ -312,11 +312,6 @@ > ? ? ? ? out,err,exitCode = executeCommand(command, cwd=cwd, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? env=test.config.environment) > > - ? ? ? ?# Tcl commands fail on standard error output. > - ? ? ? ?if err: > - ? ? ? ? ? ?exitCode = 1 > - ? ? ? ? ? ?out = 'Command has output on stderr!\n\n' + out > - > ? ? ? ? return out,err,exitCode > ? ? else: > ? ? ? ? results = [] > @@ -328,11 +323,6 @@ > > ? ? out = err = '' > > - ? ?# Tcl commands fail on standard error output. > - ? ?if [True for _,_,err,res in results if err]: > - ? ? ? ?exitCode = 1 > - ? ? ? ?out += 'Command has output on stderr!\n\n' > - > ? ? for i,(cmd, cmd_out, cmd_err, res) in enumerate(results): > ? ? ? ? out += 'Command %d: %s\n' % (i, ' '.join('"%s"' % s for s in cmd.args)) > ? ? ? ? out += 'Command %d Result: %r\n' % (i, res) > @@ -521,12 +511,14 @@ > ? ? if len(res) == 2: > ? ? ? ? return res > > + ? ?# Test for failure. In addition to the exit code, Tcl commands fail > + ? ?# if there is any standard error output. > ? ? out,err,exitCode = res > ? ? if isXFail: > - ? ? ? ?ok = exitCode != 0 > + ? ? ? ?ok = exitCode != 0 or err > ? ? ? ? status = Test.XFAIL if ok else Test.XPASS > ? ? else: > - ? ? ? ?ok = exitCode == 0 > + ? ? ? ?ok = exitCode == 0 and not err > ? ? ? ? status = Test.PASS if ok else Test.FAIL > > ? ? if ok: > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From edwintorok at gmail.com Wed Aug 4 04:30:20 2010 From: edwintorok at gmail.com (Torok Edwin) Date: Wed, 04 Aug 2010 09:30:20 -0000 Subject: [llvm-commits] [llvm] r110193 - /llvm/trunk/include/llvm/Support/DataFlow.h Message-ID: <20100804093020.66C932A6C12C@llvm.org> Author: edwin Date: Wed Aug 4 04:30:20 2010 New Revision: 110193 URL: http://llvm.org/viewvc/llvm-project?rev=110193&view=rev Log: Fix build of DataFlow.h Modified: llvm/trunk/include/llvm/Support/DataFlow.h Modified: llvm/trunk/include/llvm/Support/DataFlow.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/DataFlow.h?rev=110193&r1=110192&r2=110193&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/DataFlow.h (original) +++ llvm/trunk/include/llvm/Support/DataFlow.h Wed Aug 4 04:30:20 2010 @@ -25,7 +25,7 @@ template <> struct GraphTraits { typedef const Value NodeType; - typedef Value::use_const_iterator ChildIteratorType; + typedef Value::const_use_iterator ChildIteratorType; static NodeType *getEntryNode(const Value *G) { return G; From ggreif at gmail.com Wed Aug 4 05:00:52 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 04 Aug 2010 10:00:52 -0000 Subject: [llvm-commits] [llvm] r110194 - /llvm/trunk/lib/Target/CBackend/CBackend.cpp Message-ID: <20100804100052.AED782A6C12C@llvm.org> Author: ggreif Date: Wed Aug 4 05:00:52 2010 New Revision: 110194 URL: http://llvm.org/viewvc/llvm-project?rev=110194&view=rev Log: by Alexander Herz: "The CWriter::GetValueName() method does not check if a value as an alias and emits the alias name which will never be defined in the output .c file (so the output file fails to compile). This can happen if you have multiple inheritance with several destructors defined by clang (...D0Ev, ...D1Ev, ...D2Ev)." -- applied with minor tweaks. Thanks! Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=110194&r1=110193&r2=110194&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Wed Aug 4 05:00:52 2010 @@ -1300,6 +1300,13 @@ } std::string CWriter::GetValueName(const Value *Operand) { + + // Resolve potential alias. + if (const GlobalAlias *GA = dyn_cast(Operand)) { + if (const Value *V = GA->resolveAliasedGlobal(false)) + Operand = V; + } + // Mangle globals with the standard mangler interface for LLC compatibility. if (const GlobalValue *GV = dyn_cast(Operand)) { SmallString<128> Str; From edwintorok at gmail.com Wed Aug 4 06:42:45 2010 From: edwintorok at gmail.com (Torok Edwin) Date: Wed, 04 Aug 2010 11:42:45 -0000 Subject: [llvm-commits] [llvm] r110195 - in /llvm/trunk: include/llvm/Analysis/PointerTracking.h lib/Analysis/PointerTracking.cpp Message-ID: <20100804114245.D0AE12A6C12C@llvm.org> Author: edwin Date: Wed Aug 4 06:42:45 2010 New Revision: 110195 URL: http://llvm.org/viewvc/llvm-project?rev=110195&view=rev Log: Add a missing function. Modified: llvm/trunk/include/llvm/Analysis/PointerTracking.h llvm/trunk/lib/Analysis/PointerTracking.cpp Modified: llvm/trunk/include/llvm/Analysis/PointerTracking.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/PointerTracking.h?rev=110195&r1=110194&r2=110195&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/PointerTracking.h (original) +++ llvm/trunk/include/llvm/Analysis/PointerTracking.h Wed Aug 4 06:42:45 2010 @@ -98,6 +98,7 @@ virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const; void print(raw_ostream &OS, const Module* = 0) const; + Value *computeAllocationCountValue(Value *P, const Type *&Ty) const; private: Function *FF; TargetData *TD; Modified: llvm/trunk/lib/Analysis/PointerTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/PointerTracking.cpp?rev=110195&r1=110194&r2=110195&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/PointerTracking.cpp (original) +++ llvm/trunk/lib/Analysis/PointerTracking.cpp Wed Aug 4 06:42:45 2010 @@ -144,6 +144,55 @@ return SE->getCouldNotCompute(); } +Value *PointerTracking::computeAllocationCountValue(Value *P, const Type *&Ty) const +{ + Value *V = P->stripPointerCasts(); + if (AllocaInst *AI = dyn_cast(V)) { + Ty = AI->getAllocatedType(); + // arraySize elements of type Ty. + return AI->getArraySize(); + } + + if (CallInst *CI = extractMallocCall(V)) { + Ty = getMallocAllocatedType(CI); + if (!Ty) + return 0; + Value *arraySize = getMallocArraySize(CI, TD); + if (!arraySize) { + Ty = Type::getInt8Ty(P->getContext()); + return CI->getArgOperand(0); + } + // arraySize elements of type Ty. + return arraySize; + } + + if (GlobalVariable *GV = dyn_cast(V)) { + if (GV->hasDefinitiveInitializer()) { + Constant *C = GV->getInitializer(); + if (const ArrayType *ATy = dyn_cast(C->getType())) { + Ty = ATy->getElementType(); + return ConstantInt::get(Type::getInt32Ty(P->getContext()), + ATy->getNumElements()); + } + } + Ty = cast(GV->getType())->getElementType(); + return ConstantInt::get(Type::getInt32Ty(P->getContext()), 1); + //TODO: implement more tracking for globals + } + + if (CallInst *CI = dyn_cast(V)) { + CallSite CS(CI); + Function *F = dyn_cast(CS.getCalledValue()->stripPointerCasts()); + if (F == reallocFunc) { + Ty = Type::getInt8Ty(P->getContext()); + // realloc allocates arg1 bytes. + return CS.getArgument(1); + } + } + + return 0; +} + // Calculates the number of elements of type Ty allocated for P. const SCEV *PointerTracking::computeAllocationCountForType(Value *P, const Type *Ty) From edwintorok at gmail.com Wed Aug 4 07:43:22 2010 From: edwintorok at gmail.com (Torok Edwin) Date: Wed, 04 Aug 2010 12:43:22 -0000 Subject: [llvm-commits] [llvm] r110196 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <20100804124322.768AB2A6C12C@llvm.org> Author: edwin Date: Wed Aug 4 07:43:22 2010 New Revision: 110196 URL: http://llvm.org/viewvc/llvm-project?rev=110196&view=rev Log: Note some LLVM 2.7 -> 2.8 APIs that changed / got renamed. I encountered these while upgrading libclamav. Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=110196&r1=110195&r2=110196&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Wed Aug 4 07:43:22 2010 @@ -323,7 +323,34 @@ these routines tend to perform costly dereference operations more than once. You have to dereference the iterators yourself and pass them in. - +
  • + llvm.memcpy.*, llvm.memset.*, llvm.memmove.* (and possibly other?) intrinsics + take an extra parameter now (i1 isVolatile), totaling 5 parameters. + If you were creating these intrinsic calls and prototypes yourself (as opposed + to using Intrinsic::getDeclaration), you can use UpgradeIntrinsicFunction/UpgradeIntrinsicCall + to be portable accross releases. + Note that you cannot use Intrinsic::getDeclaration() in a backwards compatible + way (needs 2/3 types now, in 2.7 it needed just 1). +
  • +
  • + SetCurrentDebugLocation takes a DebugLoc now instead of a MDNode. + Change your code to use + SetCurrentDebugLocation(DebugLoc::getFromDILocation(...)). +
  • +
  • + VISIBILITY_HIDDEN is gone. +
  • +
  • + SMDiagnostic takes different parameters now. //FIXME: how to upgrade? +
  • +
  • + Some APIs got renamed: +
      +
    • llvm_report_error -> report_fatal_error
    • +
    • llvm_install_error_handler -> install_fatal_error_handler
    • +
    • llvm::DwarfExceptionHandling -> llvm::JITExceptionHandling
    • +
    +
  • From benny.kra at googlemail.com Wed Aug 4 08:16:30 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Wed, 04 Aug 2010 13:16:30 -0000 Subject: [llvm-commits] [llvm] r110197 - /llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Message-ID: <20100804131630.2B66A2A6C12C@llvm.org> Author: d0k Date: Wed Aug 4 08:16:30 2010 New Revision: 110197 URL: http://llvm.org/viewvc/llvm-project?rev=110197&view=rev Log: Print an error message when someone tries -integrated-as on an unsupported target. - The COFF backend doesn't support MingW/Cygwin at the moment, it'll report an error, but it's still much better than random assertions from the MachO backend. - We want to make ELF the default eventually, it's what the majority of targets use. Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=110197&r1=110196&r2=110197&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Wed Aug 4 08:16:30 2010 @@ -46,10 +46,16 @@ bool RelaxAll) { Triple TheTriple(TT); switch (TheTriple.getOS()) { + case Triple::Darwin: + return createMachOStreamer(Ctx, TAB, _OS, _Emitter, RelaxAll); + case Triple::MinGW32: + case Triple::MinGW64: + case Triple::Cygwin: case Triple::Win32: return createWinCOFFStreamer(Ctx, TAB, *_Emitter, _OS, RelaxAll); default: - return createMachOStreamer(Ctx, TAB, _OS, _Emitter, RelaxAll); + // FIXME: default to ELF. + report_fatal_error("object emission not implemented for this target."); } } From kalle.raiskila at nokia.com Wed Aug 4 08:59:49 2010 From: kalle.raiskila at nokia.com (Kalle Raiskila) Date: Wed, 04 Aug 2010 13:59:49 -0000 Subject: [llvm-commits] [llvm] r110198 - in /llvm/trunk: lib/Target/CellSPU/SPUISelDAGToDAG.cpp lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUInstrInfo.td test/CodeGen/CellSPU/v2f32.ll test/CodeGen/CellSPU/v2i32.ll Message-ID: <20100804135949.30C7C2A6C12C@llvm.org> Author: kraiskil Date: Wed Aug 4 08:59:48 2010 New Revision: 110198 URL: http://llvm.org/viewvc/llvm-project?rev=110198&view=rev Log: Make SPU backend handle insertelement and store for "half vectors" Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td llvm/trunk/test/CodeGen/CellSPU/v2f32.ll llvm/trunk/test/CodeGen/CellSPU/v2i32.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=110198&r1=110197&r2=110198&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Wed Aug 4 08:59:48 2010 @@ -607,7 +607,8 @@ return true; } else if (Opc == ISD::Register ||Opc == ISD::CopyFromReg - ||Opc == ISD::UNDEF) { + ||Opc == ISD::UNDEF + ||Opc == ISD::Constant) { unsigned OpOpc = Op->getOpcode(); if (OpOpc == ISD::STORE || OpOpc == ISD::LOAD) { Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=110198&r1=110197&r2=110198&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Wed Aug 4 08:59:48 2010 @@ -2102,7 +2102,10 @@ SDValue Pointer = DAG.getNode(SPUISD::IndirectAddr, dl, PtrVT, DAG.getRegister(SPU::R1, PtrVT), DAG.getConstant(Idx, PtrVT)); - SDValue ShufMask = DAG.getNode(SPUISD::SHUFFLE_MASK, dl, VT, Pointer); + // widen the mask when dealing with half vectors + EVT maskVT = EVT::getVectorVT(*(DAG.getContext()), VT.getVectorElementType(), + 128/ VT.getVectorElementType().getSizeInBits()); + SDValue ShufMask = DAG.getNode(SPUISD::SHUFFLE_MASK, dl, maskVT, Pointer); SDValue result = DAG.getNode(SPUISD::SHUFB, dl, VT, Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td?rev=110198&r1=110197&r2=110198&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td Wed Aug 4 08:59:48 2010 @@ -63,6 +63,7 @@ def v2f64: LoadDFormVec; def v2i32: LoadDFormVec; + def v2f32: LoadDFormVec; def r128: LoadDForm; def r64: LoadDForm; @@ -97,6 +98,7 @@ def v2f64: LoadAFormVec; def v2i32: LoadAFormVec; + def v2f32: LoadAFormVec; def r128: LoadAForm; def r64: LoadAForm; @@ -131,6 +133,7 @@ def v2f64: LoadXFormVec; def v2i32: LoadXFormVec; + def v2f32: LoadXFormVec; def r128: LoadXForm; def r64: LoadXForm; @@ -181,6 +184,7 @@ def v2f64: StoreDFormVec; def v2i32: StoreDFormVec; + def v2f32: StoreDFormVec; def r128: StoreDForm; def r64: StoreDForm; @@ -213,6 +217,7 @@ def v2f64: StoreAFormVec; def v2i32: StoreAFormVec; + def v2f32: StoreAFormVec; def r128: StoreAForm; def r64: StoreAForm; @@ -247,6 +252,7 @@ def v2f64: StoreXFormVec; def v2i32: StoreXFormVec; + def v2f32: StoreXFormVec; def r128: StoreXForm; def r64: StoreXForm; Modified: llvm/trunk/test/CodeGen/CellSPU/v2f32.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/v2f32.ll?rev=110198&r1=110197&r2=110198&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/v2f32.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/v2f32.ll Wed Aug 4 08:59:48 2010 @@ -42,4 +42,22 @@ ret %vec %rv } +define void @test_store(%vec %val, %vec* %ptr){ + +;CHECK: stqd + store %vec undef, %vec* null + +;CHECK: stqd $3, 0($4) +;CHECK: bi $lr + store %vec %val, %vec* %ptr + ret void +} + +define %vec @test_insert(){ +;CHECK: cwd +;CHECK: shufb $3 + %rv = insertelement %vec undef, float 0.0e+00, i32 undef +;CHECK: bi $lr + ret %vec %rv +} Modified: llvm/trunk/test/CodeGen/CellSPU/v2i32.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/v2i32.ll?rev=110198&r1=110197&r2=110198&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/v2i32.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/v2i32.ll Wed Aug 4 08:59:48 2010 @@ -55,3 +55,10 @@ ret i32 %rv } +define void @test_store( %vec %val, %vec* %ptr) +{ +;CHECK: stqd $3, 0($4) +;CHECK: bi $lr + store %vec %val, %vec* %ptr + ret void +} From dimitry at andric.com Wed Aug 4 09:17:17 2010 From: dimitry at andric.com (Dimitry Andric) Date: Wed, 04 Aug 2010 16:17:17 +0200 Subject: [llvm-commits] [PATCH] Fix backslash escape for call-imm.ll test Message-ID: <4C59766D.6030802@andric.com> One of the tests in test/CodeGen/X86/call-imm.ll has: ; RUN: llc < %s -march=x86-64 | grep {call.*\*%rax} It looks like this eventually runs grep with this command line: grep call.**%rax so it drops the backslash, probably due to "sh -c" invocation. For some reason, GNU grep accepts this regex, and even produces the expected result, but at least one other grep complains "Invalid preceding regular expression". It looks like most other tests use \\ to pass a single backslash to grep (or other test programs), so the attached patch does the same here. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: llvm-fix-call-imm-test-quoting.diff Url: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100804/62da8205/attachment.pl From stuart at apple.com Wed Aug 4 10:31:35 2010 From: stuart at apple.com (Stuart Hastings) Date: Wed, 04 Aug 2010 15:31:35 -0000 Subject: [llvm-commits] [llvm] r110199 - /llvm/trunk/test/CodeGen/X86/call-imm.ll Message-ID: <20100804153135.6A7032A6C12C@llvm.org> Author: stuart Date: Wed Aug 4 10:31:35 2010 New Revision: 110199 URL: http://llvm.org/viewvc/llvm-project?rev=110199&view=rev Log: call-imm.ll test case regex fix. Patch by Dimitry Andric! Modified: llvm/trunk/test/CodeGen/X86/call-imm.ll Modified: llvm/trunk/test/CodeGen/X86/call-imm.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/call-imm.ll?rev=110199&r1=110198&r2=110199&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/call-imm.ll (original) +++ llvm/trunk/test/CodeGen/X86/call-imm.ll Wed Aug 4 10:31:35 2010 @@ -5,7 +5,7 @@ ; Call to immediate is not safe on x86-64 unless we *know* that the ; call will be within 32-bits pcrel from the dest immediate. -; RUN: llc < %s -march=x86-64 | grep {call.*\*%rax} +; RUN: llc < %s -march=x86-64 | grep {call.*\\*%rax} ; PR3666 ; PR3773 From benny.kra at googlemail.com Wed Aug 4 10:32:40 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Wed, 04 Aug 2010 15:32:40 -0000 Subject: [llvm-commits] [llvm] r110200 - /llvm/trunk/lib/Target/X86/X86AsmBackend.cpp Message-ID: <20100804153240.55AA92A6C12C@llvm.org> Author: d0k Date: Wed Aug 4 10:32:40 2010 New Revision: 110200 URL: http://llvm.org/viewvc/llvm-project?rev=110200&view=rev Log: Enable COFF writer on mingw32 and cygwin. Modified: llvm/trunk/lib/Target/X86/X86AsmBackend.cpp Modified: llvm/trunk/lib/Target/X86/X86AsmBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmBackend.cpp?rev=110200&r1=110199&r2=110200&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86AsmBackend.cpp (original) +++ llvm/trunk/lib/Target/X86/X86AsmBackend.cpp Wed Aug 4 10:32:40 2010 @@ -308,6 +308,8 @@ switch (Triple(TT).getOS()) { case Triple::Darwin: return new DarwinX86_32AsmBackend(T); + case Triple::MinGW32: + case Triple::Cygwin: case Triple::Win32: return new WindowsX86AsmBackend(T); default: From stuart at apple.com Wed Aug 4 10:34:08 2010 From: stuart at apple.com (Stuart Hastings) Date: Wed, 4 Aug 2010 08:34:08 -0700 Subject: [llvm-commits] [PATCH] Fix backslash escape for call-imm.ll test In-Reply-To: <4C59766D.6030802@andric.com> References: <4C59766D.6030802@andric.com> Message-ID: <3FC6409B-9B2F-4258-A94C-7072C2749934@apple.com> On Aug 4, 2010, at 7:17 AM, Dimitry Andric wrote: > One of the tests in test/CodeGen/X86/call-imm.ll has: > > ; RUN: llc < %s -march=x86-64 | grep {call.*\*%rax} > > It looks like this eventually runs grep with this command line: > > grep call.**%rax > > so it drops the backslash, probably due to "sh -c" invocation. For some > reason, GNU grep accepts this regex, and even produces the expected > result, but at least one other grep complains "Invalid preceding regular > expression". > > It looks like most other tests use \\ to pass a single backslash to grep > (or other test programs), so the attached patch does the same here. Patch applied. Thank you! stuart From gohman at apple.com Wed Aug 4 10:58:01 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 15:58:01 -0000 Subject: [llvm-commits] [llvm] r110201 - /llvm/trunk/test/Archive/README.txt Message-ID: <20100804155801.2D0EF2A6C12C@llvm.org> Author: djg Date: Wed Aug 4 10:58:01 2010 New Revision: 110201 URL: http://llvm.org/viewvc/llvm-project?rev=110201&view=rev Log: These tests are no longer stored in *CVS*. Modified: llvm/trunk/test/Archive/README.txt Modified: llvm/trunk/test/Archive/README.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Archive/README.txt?rev=110201&r1=110200&r2=110201&view=diff ============================================================================== --- llvm/trunk/test/Archive/README.txt (original) +++ llvm/trunk/test/Archive/README.txt Wed Aug 4 10:58:01 2010 @@ -5,7 +5,7 @@ compatibility reading other ar(1) formats. It also provides a basic functionality test for these tools. -There are four archives stored in CVS with these tests: +There are four archives accompanying these tests: GNU.a - constructed on Linux with GNU ar MacOSX.a - constructed on Mac OS X with its native BSD4.4 ar From gohman at apple.com Wed Aug 4 10:59:17 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 15:59:17 -0000 Subject: [llvm-commits] [llvm] r110202 - /llvm/trunk/docs/ProgrammersManual.html Message-ID: <20100804155917.43E132A6C12C@llvm.org> Author: djg Date: Wed Aug 4 10:59:16 2010 New Revision: 110202 URL: http://llvm.org/viewvc/llvm-project?rev=110202&view=rev Log: Remove a link which is no longer relevant. Modified: llvm/trunk/docs/ProgrammersManual.html Modified: llvm/trunk/docs/ProgrammersManual.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.html?rev=110202&r1=110201&r2=110202&view=diff ============================================================================== --- llvm/trunk/docs/ProgrammersManual.html (original) +++ llvm/trunk/docs/ProgrammersManual.html Wed Aug 4 10:59:16 2010 @@ -309,8 +309,6 @@
      -
    1. CVS -Branch and Tag Primer
    2. Using static and shared libraries across platforms
    From gohman at apple.com Wed Aug 4 11:07:22 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 16:07:22 -0000 Subject: [llvm-commits] [llvm] r110203 - in /llvm/trunk: docs/DeveloperPolicy.html utils/mkpatch Message-ID: <20100804160722.C201A2A6C12C@llvm.org> Author: djg Date: Wed Aug 4 11:07:22 2010 New Revision: 110203 URL: http://llvm.org/viewvc/llvm-project?rev=110203&view=rev Log: Delete mkpatch. Everything it does is already done by svn diff by default. Removed: llvm/trunk/utils/mkpatch Modified: llvm/trunk/docs/DeveloperPolicy.html Modified: llvm/trunk/docs/DeveloperPolicy.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/DeveloperPolicy.html?rev=110203&r1=110202&r2=110203&view=diff ============================================================================== --- llvm/trunk/docs/DeveloperPolicy.html (original) +++ llvm/trunk/docs/DeveloperPolicy.html Wed Aug 4 11:07:22 2010 @@ -107,18 +107,13 @@ patches may not apply correctly if the underlying code changes between the time the patch was created and the time it is applied. -
  • Patches should be made with this command: -
    -
    -svn diff
    -
    -
    - or with the utility utils/mkpatch, which makes it easy to read - the diff.
  • - -
  • Patches should not include differences in generated code such as the code - generated by autoconf or tblgen. The - utils/mkpatch utility takes care of this for you.
  • +
  • Patches should be made with svn diff, or similar. If you use + a different tool, make sure it uses the diff -u format and + that it doesn't contain clutter which makes it hard to read.
  • + +
  • If you are modifying generated files, such as the top-level + configure script, please separate out those changes into + a separate patch from the rest of your changes.
  • When sending a patch to a mailing list, it is a good idea to send it as an Removed: llvm/trunk/utils/mkpatch URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/mkpatch?rev=110202&view=auto ============================================================================== --- llvm/trunk/utils/mkpatch (original) +++ llvm/trunk/utils/mkpatch (removed) @@ -1,37 +0,0 @@ -#!/bin/bash -# -# This script makes a patch for LLVM ensuring the correct diff options and -# putting the files in a standard review order. - - -function error { - retcode="$?" - echo "mkpatch: error: $1 ($retcode)" - exit 1 -} - -if [ ! -e llvm.spec.in ] ; then - error "Please change directory to the LLVM top source directory" -fi -if [ "$#" -ne 1 ] ; then - error "usage: utils/mkpatch [PATCH_NAME]" -fi -NAME="$1" -echo "mkpatch: Generating differences on top level files" -svn diff -N -x -u > "$NAME".patch.raw 2>&1 -echo "mkpatch: Generating differences on all directories" -svn diff -x -u >> "$NAME".patch.raw 2>&1 \ - autoconf docs utils include lib/System lib/Support lib/VMCore lib/AsmParser \ - lib/Bitcode lib/Analysis lib/Transforms lib/CodeGen lib/Target \ - lib/ExecutionEngine lib/Linker lib/MC \ - tools test unittests runtime projects examples Xcode - -echo "mkpatch: Removing cruft from the patch file" -sed -e '/^[?] .*/d' -e '/^cvs diff: Diffing/d' "$NAME".patch.raw | awk '\ -BEGIN { deleting = 0; } \ -/^Index: .*[.]cvs$/ { deleting = 1; fname=substr($0,7); \ - print "Skipping: ", fname > "/dev/stderr"; } \ -/^Index:.*/ && !/^Index: .*[.]cvs$/ { deleting = 0; } \ -{ if (! deleting) { print; } } ' > "$NAME".patch || \ - error "sed/awk cleanup failed" - From gohman at apple.com Wed Aug 4 11:09:01 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 16:09:01 -0000 Subject: [llvm-commits] [llvm] r110204 - in /llvm/trunk/utils: Makefile llvmdo Message-ID: <20100804160901.81E032A6C12C@llvm.org> Author: djg Date: Wed Aug 4 11:09:01 2010 New Revision: 110204 URL: http://llvm.org/viewvc/llvm-project?rev=110204&view=rev Log: cvsupdate is gone. Modified: llvm/trunk/utils/Makefile llvm/trunk/utils/llvmdo Modified: llvm/trunk/utils/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/Makefile?rev=110204&r1=110203&r2=110204&view=diff ============================================================================== --- llvm/trunk/utils/Makefile (original) +++ llvm/trunk/utils/Makefile Wed Aug 4 11:09:01 2010 @@ -11,7 +11,7 @@ PARALLEL_DIRS := FileCheck FileUpdate TableGen PerfectShuffle \ count fpcmp llvm-lit not unittest -EXTRA_DIST := cgiplotNLT.pl check-each-file codegen-diff countloc.sh cvsupdate \ +EXTRA_DIST := cgiplotNLT.pl check-each-file codegen-diff countloc.sh \ DSAclean.py DSAextract.py emacs findsym.pl GenLibDeps.pl \ getsrcs.sh importNLT.pl llvmdo llvmgrep llvm-native-gcc \ llvm-native-gxx makellvm NightlyTest.gnuplot NightlyTest.pl \ Modified: llvm/trunk/utils/llvmdo URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvmdo?rev=110204&r1=110203&r2=110204&view=diff ============================================================================== --- llvm/trunk/utils/llvmdo (original) +++ llvm/trunk/utils/llvmdo Wed Aug 4 11:09:01 2010 @@ -130,7 +130,6 @@ -o -name llvmgrep \ -o -name check-each-file \ -o -name codgen-diff \ - -o -name cvsupdate \ -o -name llvm-native-gcc \ -o -name llvm-native-gxx \ -o -name makellvm \ From gohman at apple.com Wed Aug 4 11:10:42 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 16:10:42 -0000 Subject: [llvm-commits] [llvm] r110205 - in /llvm/trunk/utils: Makefile RegressionFinder.pl userloc.pl Message-ID: <20100804161042.9891A2A6C12C@llvm.org> Author: djg Date: Wed Aug 4 11:10:42 2010 New Revision: 110205 URL: http://llvm.org/viewvc/llvm-project?rev=110205&view=rev Log: Delete scripts which haven't noticed that CVS has gone away. Removed: llvm/trunk/utils/RegressionFinder.pl llvm/trunk/utils/userloc.pl Modified: llvm/trunk/utils/Makefile Modified: llvm/trunk/utils/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/Makefile?rev=110205&r1=110204&r2=110205&view=diff ============================================================================== --- llvm/trunk/utils/Makefile (original) +++ llvm/trunk/utils/Makefile Wed Aug 4 11:10:42 2010 @@ -16,7 +16,7 @@ getsrcs.sh importNLT.pl llvmdo llvmgrep llvm-native-gcc \ llvm-native-gxx makellvm NightlyTest.gnuplot NightlyTest.pl \ NightlyTestTemplate.html NLT.schema OldenDataRecover.pl \ - parseNLT.pl plotNLT.pl profile.pl RegressionFinder.pl userloc.pl \ + parseNLT.pl plotNLT.pl profile.pl \ webNLT.pl vim include $(LEVEL)/Makefile.common Removed: llvm/trunk/utils/RegressionFinder.pl URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/RegressionFinder.pl?rev=110204&view=auto ============================================================================== --- llvm/trunk/utils/RegressionFinder.pl (original) +++ llvm/trunk/utils/RegressionFinder.pl (removed) @@ -1,186 +0,0 @@ -#! /usr/bin/perl -# Script to find regressions by binary-searching a time interval in the -# CVS tree. Written by Brian Gaeke on 2-Mar-2004. -# - -require 5.6.0; # NOTE: This script not tested with earlier versions. -use Getopt::Std; -use POSIX; -use Time::Local; -use IO::Handle; - -sub usage { - print STDERR <) { - if (/$regex/) { - close FILE; - return 1; - } - } - close FILE; - return 0; -} - -sub updateSources { - my ($time) = @_; - my $inst = "include/llvm/Instruction.h"; - unlink($inst); - run( "cvs update -D'" . timeAsString($time) . "'" ); - if ( !contains( $inst, 'class Instruction.*Annotable' ) ) { - run("patch -F100 -p0 < makeInstructionAnnotable.patch"); - } -} - -sub regressionPresentAt { - my ($time) = @_; - - updateSources($time); - buildLibrariesAndTools(); - my $rc = run($SCRIPT); - if ($rc) { - print LOG "** Found that regression was PRESENT at " - . timeAsString($time) . "\n"; - return 1; - } - else { - print LOG "** Found that regression was ABSENT at " - . timeAsString($time) . "\n"; - return 0; - } -} - -sub regressionAbsentAt { - my ($time) = @_; - return !regressionPresentAt($time); -} - -sub closeTo { - my ( $time1, $time2 ) = @_; - return abs( $time1 - $time2 ) < 600; # 10 minutes seems reasonable. -} - -sub halfWayPoint { - my ( $time1, $time2 ) = @_; - my $halfSpan = int( abs( $time1 - $time2 ) / 2 ); - if ( $time1 < $time2 ) { - return $time1 + $halfSpan; - } - else { - return $time2 + $halfSpan; - } -} - -sub checkBoundaryConditions { - print LOG "** Checking for presence of regression at ", timeAsString($DTIME), - "\n"; - if ( !regressionPresentAt($DTIME) ) { - die ( "** Can't help you; $SCRIPT says regression absent at dtime: " - . timeAsString($DTIME) - . "\n" ); - } - print LOG "** Checking for absence of regression at ", timeAsString($WTIME), - "\n"; - if ( !regressionAbsentAt($WTIME) ) { - die ( "** Can't help you; $SCRIPT says regression present at wtime: " - . timeAsString($WTIME) - . "\n" ); - } -} - -############################################################################## - -# Set up log files -open (STDERR, ">&STDOUT") || die "** Can't redirect std.err: $!\n"; -autoflush STDOUT 1; -autoflush STDERR 1; -open (LOG, ">RegFinder.log") || die "** can't write RegFinder.log: $!\n"; -autoflush LOG 1; -# Check command line arguments and environment variables -getopts('Iw:d:t:c:'); -if ( !( $opt_w && $opt_d && $opt_t && $opt_c ) ) { - usage; -} -$MAKE = $ENV{'MAKE'}; -$MAKE = 'gmake' unless $MAKE; -$WTIME = timeAsSeconds($opt_w); -print LOG "** Assuming worked at ", timeAsString($WTIME), "\n"; -$DTIME = timeAsSeconds($opt_d); -print LOG "** Assuming didn't work at ", timeAsString($DTIME), "\n"; -$opt_t =~ s/\s*//g; -$SCRIPT = $opt_c; -die "** $SCRIPT is not executable or not found\n" unless -x $SCRIPT; -print LOG "** Checking for the regression using $SCRIPT\n"; - at TOOLS = split ( /,/, $opt_t ); -print LOG ( - "** Going to rebuild: ", - ( join ", ", @TOOLS ), - " before each $SCRIPT run\n" -); -if ($opt_I) { checkBoundaryConditions(); } -# do the dirty work: -while ( !closeTo( $DTIME, $WTIME ) ) { - my $halfPt = halfWayPoint( $DTIME, $WTIME ); - print LOG "** Checking whether regression is present at ", - timeAsString($halfPt), "\n"; - if ( regressionPresentAt($halfPt) ) { - $DTIME = $halfPt; - } - else { - $WTIME = $halfPt; - } -} -# Tell them what we found -print LOG "** Narrowed it down to:\n"; -print LOG "** Worked at: ", timeAsString($WTIME), "\n"; -print LOG "** Did not work at: ", timeAsString($DTIME), "\n"; -close LOG; -exit 0; Removed: llvm/trunk/utils/userloc.pl URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/userloc.pl?rev=110204&view=auto ============================================================================== --- llvm/trunk/utils/userloc.pl (original) +++ llvm/trunk/utils/userloc.pl (removed) @@ -1,216 +0,0 @@ -#!/usr/bin/perl -w -# -# Program: userloc.pl -# -# Synopsis: This program uses "cvs annotate" to get a summary of how many lines -# of code the various developres are responsible for. It takes one -# argument, the directory to process. If the argument is not specified -# then the cwd is used. The directory must be an LLVM tree checked out -# from cvs. -# -# Syntax: userloc.pl [-tag=tag|-html... ... -# -# Options: -# -tag=tag -# Use "tag" to select the revision (as per cvs -r option) -# -filedetails -# Report details about lines of code in each file for each user -# -html -# Generate HTML output instead of text output -# -topdir -# Specify where the top llvm source directory is. Otherwise the -# llvm-config tool is used to find it. -# Directories: -# The directories passed after the options should be relative paths to -# directories of interest from the top of the llvm source tree, e.g. "lib" -# or "include", etc. - -die "Usage userloc.pl [-tag=tag|-html] ..." - if ($#ARGV < 0); - -my $tag = ""; -my $html = 0; -my $debug = 0; -my $filedetails = ""; -my $srcroot = ""; -while ( defined($ARGV[0]) && substr($ARGV[0],0,1) eq '-' ) -{ - if ($ARGV[0] =~ /-tag=.*/) { - $tag = $ARGV[0]; - $tag =~ s#-tag=(.*)#$1#; - } elsif ($ARGV[0] =~ /-filedetails/) { - $filedetails = 1; - } elsif ($ARGV[0] eq "-html") { - $html = 1; - } elsif ($ARGV[0] eq "-debug") { - $debug = 1; - } elsif ($ARGV[0] eq "-topdir") { - shift; $srcroot = $ARGV[0]; shift; - } else { - die "Invalid option: $ARGV[0]"; - } - shift; -} - -if (length($srcroot) == 0) { - chomp($srcroot = `llvm-config --src-root`); -} -if (! -d "$srcroot") { - die "Invalid source root: $srcroot\n"; -} -chdir($srcroot); -my $llvmdo = "$srcroot/utils/llvmdo -topdir '$srcroot'"; -my %Stats; -my %FileStats; - -my $annotate = "cvs -z6 annotate -lf "; -if (length($tag) > 0) -{ - $annotate = $annotate . " -r" . $tag; -} - -sub GetCVSFiles -{ - my $d = $_[0]; - my $files =""; - open FILELIST, - "$llvmdo -dirs \"$d\" -code-only echo |" || die "Can't get list of files with llvmdo"; - while ( defined($line = ) ) { - chomp($file = $line); - print "File: $file\n" if ($debug); - $files = "$files $file"; - } - return $files; -} - -sub ScanDir -{ - my $Dir = $_[0]; - my $files = GetCVSFiles($Dir); - - open (DATA,"$annotate $files 2>&1 |") - || die "Can't read cvs annotation data"; - - my $curfile = ""; - while ( defined($line = ) ) - { - chomp($line); - if ($line =~ '^Annotations for.*') { - $curfile = $line; - $curfile =~ s#^Annotations for ([[:print:]]*)#$1#; - print "Scanning: $curfile\n" if ($debug); - } elsif ($line =~ /^[0-9.]*[ \t]*\([^)]*\):/) { - $uname = $line; - $uname =~ s#^[0-9.]*[ \t]*\(([a-zA-Z0-9_.-]*) [^)]*\):.*#$1#; - $Stats{$uname}++; - if ($filedetails) { - $FileStats{$uname} = {} unless exists $FileStats{$uname}; - ${$FileStats{$uname}}{$curfile}++; - } - } - } - close DATA; -} - -sub printStats -{ - my $dir = $_[0]; - my $hash = $_[1]; - my $user; - my $total = 0; - - foreach $user (keys %Stats) { $total += $Stats{$user}; } - - if ($html) { - print "

    Total Source Lines: $total

    \n"; - print ""; - print " \n"; - print " \n"; - print " \n"; - print "\n"; - } - - foreach $user ( sort keys %Stats ) - { - my $v = $Stats{$user}; - if (defined($v)) - { - if ($html) { - printf ""; - } else { - print $user,""; - } - } else { - printf "%8d (%4.1f%%) %s\n", $v, (100.0/$total)*$v, $user; - } - } - } - print "
    LOC\%LOCUser
    %d(%4.1f%%)", $v, (100.0/$total)*$v; - if ($filedetails) { - print "$user
    \n" if ($html); - - if ($filedetails) { - foreach $user (sort keys %FileStats) { - my $total = 0; - foreach $file (sort keys %{$FileStats{$user}}) { - $total += ${$FileStats{$user}}{$file} - } - if ($html) { - print "\n"; - } else { - print $user,":\n"; - } - foreach $file (sort keys %{$FileStats{$user}}) { - my $v = ${$FileStats{$user}}{$file}; - if ($html) { - printf "",$v, (100.0/$total)*$v,$file; - } else { - printf "%8d (%4.1f%%) %s\n", $v, (100.0/$total)*$v, $file; - } - } - if ($html) { print "
    $user
      %d %4.1f%%%s
    \n"; } - } - } -} - - -if ($html) -{ -print "\n"; -print "\n\n"; -print " LLVM LOC Based On CVS Annotation\n"; -print " \n"; -print "\n"; -print "
    LLVM LOC Based On CVS Annotation
    \n"; -print "

    This document shows the total lines of code per user in each\n"; -print "LLVM directory. Lines of code are attributed by the user that last\n"; -print "committed the line. This does not necessarily reflect authorship.

    \n"; -} - -my @DIRS; -if ($#ARGV > 0) { - @DIRS = @ARGV; -} else { - push @DIRS, 'include'; - push @DIRS, 'lib'; - push @DIRS, 'tools'; - push @DIRS, 'runtime'; - push @DIRS, 'docs'; - push @DIRS, 'test'; - push @DIRS, 'utils'; - push @DIRS, 'examples'; - push @DIRS, 'projects/Stacker'; - push @DIRS, 'projects/sample'; - push @DIRS, 'autoconf'; -} - -for $Index ( 0 .. $#DIRS) { - print "Scanning Dir: $DIRS[$Index]\n" if ($debug); - ScanDir($DIRS[$Index]); -} - -printStats; - -print "\n" if ($html) ; From gohman at apple.com Wed Aug 4 11:11:24 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 16:11:24 -0000 Subject: [llvm-commits] [llvm] r110206 - /llvm/trunk/utils/llvmdo Message-ID: <20100804161124.903DC2A6C12C@llvm.org> Author: djg Date: Wed Aug 4 11:11:24 2010 New Revision: 110206 URL: http://llvm.org/viewvc/llvm-project?rev=110206&view=rev Log: Remove CVS artifacts. Modified: llvm/trunk/utils/llvmdo Modified: llvm/trunk/utils/llvmdo URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvmdo?rev=110206&r1=110205&r2=110206&view=diff ============================================================================== --- llvm/trunk/utils/llvmdo (original) +++ llvm/trunk/utils/llvmdo Wed Aug 4 11:11:24 2010 @@ -76,8 +76,6 @@ shift; paths_to_ignore="\ - -path */CVS -o \ - -path */CVS/* -o \ -path */.svn/ -o \ -path */.svn/* -o \ -path docs/doxygen/* -o \ @@ -152,7 +150,6 @@ -name \.* \ -o -name *~ \ -o -name #* \ - -o -name *.cvs \ -o -name configure \ -o -name slow.ll \ -o -name *libtool* \ From gohman at apple.com Wed Aug 4 11:25:01 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 16:25:01 -0000 Subject: [llvm-commits] [llvm] r110207 - in /llvm/trunk: autoconf/configure.ac configure Message-ID: <20100804162501.391E42A6C12C@llvm.org> Author: djg Date: Wed Aug 4 11:25:01 2010 New Revision: 110207 URL: http://llvm.org/viewvc/llvm-project?rev=110207&view=rev Log: Remove CVS artifacts. Modified: llvm/trunk/autoconf/configure.ac llvm/trunk/configure Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=110207&r1=110206&r2=110207&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Wed Aug 4 11:25:01 2010 @@ -101,7 +101,6 @@ do if test -d ${srcdir}/projects/${i} ; then case ${i} in - CVS) ;; sample) AC_CONFIG_SUBDIRS([projects/sample]) ;; privbracket) AC_CONFIG_SUBDIRS([projects/privbracket]) ;; llvm-stacker) AC_CONFIG_SUBDIRS([projects/llvm-stacker]) ;; @@ -369,13 +368,13 @@ AC_SUBST(LLVM_CROSS_COMPILING, [0]) fi -dnl Check to see if there's a "CVS" (or .svn or .git) directory indicating -dnl that this build is being done from a checkout. This sets up several -dnl defaults for the command line switches. When we build with a CVS directory, +dnl Check to see if there's a .svn or .git directory indicating that this +dnl build is being done from a checkout. This sets up several defaults for +dnl the command line switches. When we build with a checkout directory, dnl we get a debug with assertions turned on. Without, we assume a source dnl release and we get an optimized build without assertions. dnl See --enable-optimized and --enable-assertions below -if test -d "CVS" -o -d "${srcdir}/CVS" -o -d ".svn" -o -d "${srcdir}/.svn" -o -d ".git" -o -d "${srcdir}/.git"; then +if test -d ".svn" -o -d "${srcdir}/.svn" -o -d ".git" -o -d "${srcdir}/.git"; then cvsbuild="yes" optimize="no" AC_SUBST(CVSBUILD,[[CVSBUILD=1]]) Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=110207&r1=110206&r2=110207&view=diff ============================================================================== --- llvm/trunk/configure (original) +++ llvm/trunk/configure Wed Aug 4 11:25:01 2010 @@ -1988,7 +1988,6 @@ do if test -d ${srcdir}/projects/${i} ; then case ${i} in - CVS) ;; sample) subdirs="$subdirs projects/sample" ;; privbracket) subdirs="$subdirs projects/privbracket" @@ -4691,7 +4690,7 @@ fi -if test -d "CVS" -o -d "${srcdir}/CVS" -o -d ".svn" -o -d "${srcdir}/.svn" -o -d ".git" -o -d "${srcdir}/.git"; then +if test -d ".svn" -o -d "${srcdir}/.svn" -o -d ".git" -o -d "${srcdir}/.git"; then cvsbuild="yes" optimize="no" CVSBUILD=CVSBUILD=1 @@ -11396,7 +11395,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < Author: djg Date: Wed Aug 4 11:42:38 2010 New Revision: 110208 URL: http://llvm.org/viewvc/llvm-project?rev=110208&view=rev Log: Print a message when a test failure is due to stderr output alone, rather than just an exit code. Modified: llvm/trunk/utils/lit/lit/TestRunner.py Modified: llvm/trunk/utils/lit/lit/TestRunner.py URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=110208&r1=110207&r2=110208&view=diff ============================================================================== --- llvm/trunk/utils/lit/lit/TestRunner.py (original) +++ llvm/trunk/utils/lit/lit/TestRunner.py Wed Aug 4 11:42:38 2010 @@ -470,13 +470,17 @@ isXFail = isExpectedFail(xfails, xtargets, test.suite.config.target_triple) return script,isXFail,tmpBase,execdir -def formatTestOutput(status, out, err, exitCode, script): +def formatTestOutput(status, out, err, exitCode, failDueToStderr, script): output = StringIO.StringIO() print >>output, "Script:" print >>output, "--" print >>output, '\n'.join(script) print >>output, "--" - print >>output, "Exit Code: %r" % exitCode + print >>output, "Exit Code: %r" % exitCode, + if failDueToStderr: + print >>output, "(but there was output on stderr)" + else: + print >>output if out: print >>output, "Command Output (stdout):" print >>output, "--" @@ -511,8 +515,8 @@ if len(res) == 2: return res - # Test for failure. In addition to the exit code, Tcl commands fail - # if there is any standard error output. + # Test for failure. In addition to the exit code, Tcl commands are + # considered to fail if there is any standard error output. out,err,exitCode = res if isXFail: ok = exitCode != 0 or err @@ -524,7 +528,11 @@ if ok: return (status,'') - return formatTestOutput(status, out, err, exitCode, script) + # Set a flag for formatTestOutput so it can explain why the test was + # considered to have failed, despite having an exit code of 0. + failDueToStderr = exitCode == 0 and err + + return formatTestOutput(status, out, err, exitCode, failDueToStderr, script) def executeShTest(test, litConfig, useExternalSh): if test.config.unsupported: @@ -560,4 +568,7 @@ if ok: return (status,'') - return formatTestOutput(status, out, err, exitCode, script) + # Sh tests are not considered to fail just from stderr output. + failDueToStderr = False + + return formatTestOutput(status, out, err, exitCode, failDueToStderr, script) From gohman at apple.com Wed Aug 4 11:44:17 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 4 Aug 2010 09:44:17 -0700 Subject: [llvm-commits] [llvm] r110171 - /llvm/trunk/utils/lit/lit/TestRunner.py In-Reply-To: References: <20100804001232.0E1692A6C12C@llvm.org> Message-ID: <765F6D5E-333D-477F-8E62-D38C286E8FA3@apple.com> On Aug 4, 2010, at 12:36 AM, Daniel Dunbar wrote: > Hi Dan, > > The problem with this change is that it becomes very non-obvious from > reading a test report why it is failing. Clang's tests don't have the > error-on-stderr property, so I always appreciate the reminder when > looking at a test report. I think it would make sense to make sure a > note about this ends up somewhere in the output. Ok, I added a note in 110208. Dan From gohman at apple.com Wed Aug 4 11:48:36 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 16:48:36 -0000 Subject: [llvm-commits] [llvm] r110211 - /llvm/trunk/autoconf/configure.ac Message-ID: <20100804164836.D35082A6C12C@llvm.org> Author: djg Date: Wed Aug 4 11:48:36 2010 New Revision: 110211 URL: http://llvm.org/viewvc/llvm-project?rev=110211&view=rev Log: Fix a typo in a comment. Modified: llvm/trunk/autoconf/configure.ac Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=110211&r1=110210&r2=110211&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Wed Aug 4 11:48:36 2010 @@ -298,7 +298,7 @@ AC_SUBST(LINKALL,$llvm_cv_link_all_option) AC_SUBST(NOLINKALL,$llvm_cv_no_link_all_option) -dnl Set the "LLVM_ON_*" variables based on llvm_cvs_platform_type +dnl Set the "LLVM_ON_*" variables based on llvm_cv_platform_type dnl This is used by lib/System to determine the basic kind of implementation dnl to use. case $llvm_cv_platform_type in From criswell at uiuc.edu Wed Aug 4 11:53:57 2010 From: criswell at uiuc.edu (John Criswell) Date: Wed, 04 Aug 2010 16:53:57 -0000 Subject: [llvm-commits] [poolalloc] r110212 - /poolalloc/trunk/lib/DSA/CallTargets.cpp Message-ID: <20100804165357.9149A2A6C12C@llvm.org> Author: criswell Date: Wed Aug 4 11:53:57 2010 New Revision: 110212 URL: http://llvm.org/viewvc/llvm-project?rev=110212&view=rev Log: Fixed indentation. No functionality changes. Modified: poolalloc/trunk/lib/DSA/CallTargets.cpp Modified: poolalloc/trunk/lib/DSA/CallTargets.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/CallTargets.cpp?rev=110212&r1=110211&r2=110212&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/CallTargets.cpp (original) +++ poolalloc/trunk/lib/DSA/CallTargets.cpp Wed Aug 4 11:53:57 2010 @@ -75,10 +75,10 @@ if (N->isCompleteNode() && !IndMap[cs].size()) { ++CompleteEmpty; DEBUG(errs() << "Call site empty: '" - << cs.getInstruction()->getName() - << "' In '" - << cs.getInstruction()->getParent()->getParent()->getName() - << "'\n"); + << cs.getInstruction()->getName() + << "' In '" + << cs.getInstruction()->getParent()->getParent()->getName() + << "'\n"); } } } else { From clattner at apple.com Wed Aug 4 11:57:41 2010 From: clattner at apple.com (Chris Lattner) Date: Wed, 4 Aug 2010 09:57:41 -0700 Subject: [llvm-commits] [llvm] r110198 - in /llvm/trunk: lib/Target/CellSPU/SPUISelDAGToDAG.cpp lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUInstrInfo.td test/CodeGen/CellSPU/v2f32.ll test/CodeGen/CellSPU/v2i32.ll In-Reply-To: <20100804135949.30C7C2A6C12C@llvm.org> References: <20100804135949.30C7C2A6C12C@llvm.org> Message-ID: <9C3E9AC6-B017-4B34-8D37-AC03172030A5@apple.com> On Aug 4, 2010, at 6:59 AM, Kalle Raiskila wrote: > Author: kraiskil > Date: Wed Aug 4 08:59:48 2010 > New Revision: 110198 > > URL: http://llvm.org/viewvc/llvm-project?rev=110198&view=rev > Log: > Make SPU backend handle insertelement and > store for "half vectors" Kalle, Again, why doesn't vector widening in legalize already handle this? You shouldn't have to duplicate all the operations to support half wide operations in vectors. -Chris From gohman at apple.com Wed Aug 4 12:01:59 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 17:01:59 -0000 Subject: [llvm-commits] [llvm] r110215 - /llvm/trunk/utils/llvm.grm Message-ID: <20100804170159.EDEA82A6C12C@llvm.org> Author: djg Date: Wed Aug 4 12:01:59 2010 New Revision: 110215 URL: http://llvm.org/viewvc/llvm-project?rev=110215&view=rev Log: Update the polygen grammar for linker_private and linker_private_weak, and add comments about major implemented features. Modified: llvm/trunk/utils/llvm.grm Modified: llvm/trunk/utils/llvm.grm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm.grm?rev=110215&r1=110214&r2=110215&view=diff ============================================================================== --- llvm/trunk/utils/llvm.grm (original) +++ llvm/trunk/utils/llvm.grm Wed Aug 4 12:01:59 2010 @@ -8,6 +8,9 @@ IR that is semantically valid. Most of the IR produced doesn't pass the Verifier. +TODO: Metadata, in all its forms +TODO: Union types + *) I ::= "title: LLVM assembly language\n" @@ -90,6 +93,8 @@ | dllexport | common | private + | "linker_private" + | "linker_private_weak" ; GVExternalLinkage From anton at korobeynikov.info Wed Aug 4 12:05:00 2010 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Wed, 4 Aug 2010 21:05:00 +0400 Subject: [llvm-commits] [llvm] r110215 - /llvm/trunk/utils/llvm.grm In-Reply-To: <20100804170159.EDEA82A6C12C@llvm.org> References: <20100804170159.EDEA82A6C12C@llvm.org> Message-ID: > Update the polygen grammar for linker_private and linker_private_weak, > and add comments about major implemented features. You mean "unimplemented" ? -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From criswell at uiuc.edu Wed Aug 4 12:32:35 2010 From: criswell at uiuc.edu (John Criswell) Date: Wed, 04 Aug 2010 17:32:35 -0000 Subject: [llvm-commits] [poolalloc] r110220 - in /poolalloc/trunk: include/dsa/DSNode.h lib/DSA/DataStructure.cpp Message-ID: <20100804173235.5BEDF2A6C12C@llvm.org> Author: criswell Date: Wed Aug 4 12:32:35 2010 New Revision: 110220 URL: http://llvm.org/viewvc/llvm-project?rev=110220&view=rev Log: Added the dumpFuncs() method to help debug callgraph problems from gdb. Added an assertion to mergeTypeInfo(). Modified: poolalloc/trunk/include/dsa/DSNode.h poolalloc/trunk/lib/DSA/DataStructure.cpp Modified: poolalloc/trunk/include/dsa/DSNode.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DSNode.h?rev=110220&r1=110219&r2=110220&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DSNode.h (original) +++ poolalloc/trunk/include/dsa/DSNode.h Wed Aug 4 12:32:35 2010 @@ -390,6 +390,7 @@ void print(llvm::raw_ostream &O, const DSGraph *G) const; void dump() const; + void dumpFuncs(); void assertOK() const; Modified: poolalloc/trunk/lib/DSA/DataStructure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructure.cpp?rev=110220&r1=110219&r2=110220&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DataStructure.cpp (original) +++ poolalloc/trunk/lib/DSA/DataStructure.cpp Wed Aug 4 12:32:35 2010 @@ -308,6 +308,15 @@ } } +void DSNode::dumpFuncs() { + std::vector List; + addFullFunctionList (List); + for (unsigned index = 0; index < List.size(); ++index) { + std::cerr << List[index]->getNameStr() << std::endl; + } + return; +} + /// mergeTypeInfo - This method merges the specified type into the current node /// at the specified offset. This may update the current node's type record if /// this gives more information to the node, it may do nothing to the node if @@ -1177,6 +1186,7 @@ assert(F && "No function"); DSGraph *&G = DSInfo[F]; if (!G) { + assert (F->isDeclaration() || GraphSource->hasDSGraph(*F)); //Clone or Steal the Source Graph DSGraph* BaseGraph = GraphSource->getDSGraph(*F); if (Clone) { From gohman at apple.com Wed Aug 4 12:43:57 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 17:43:57 -0000 Subject: [llvm-commits] [llvm] r110223 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <20100804174357.667A52A6C12C@llvm.org> Author: djg Date: Wed Aug 4 12:43:57 2010 New Revision: 110223 URL: http://llvm.org/viewvc/llvm-project?rev=110223&view=rev Log: Fix whitespace. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=110223&r1=110222&r2=110223&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Wed Aug 4 12:43:57 2010 @@ -2298,7 +2298,7 @@ // Collect all operands except *J. SmallVector InnerAddOps - ( ((const SmallVector &)AddOps).begin(), J); + (((const SmallVector &)AddOps).begin(), J); InnerAddOps.append (llvm::next(J), ((const SmallVector &)AddOps).end()); From dpatel at apple.com Wed Aug 4 13:06:05 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 04 Aug 2010 18:06:05 -0000 Subject: [llvm-commits] [llvm] r110224 - /llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp Message-ID: <20100804180605.2F9682A6C12C@llvm.org> Author: dpatel Date: Wed Aug 4 13:06:05 2010 New Revision: 110224 URL: http://llvm.org/viewvc/llvm-project?rev=110224&view=rev Log: Add DEBUG message. Modified: llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp Modified: llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp?rev=110224&r1=110223&r2=110224&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp Wed Aug 4 13:06:05 2010 @@ -36,6 +36,7 @@ #include "llvm/CodeGen/MachineModuleInfoImpls.h" #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" #include "llvm/Support/COFF.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Target/Mangler.h" #include "llvm/Target/TargetOptions.h" @@ -668,6 +669,9 @@ if (MI->getOperand(0).isReg() && MI->getOperand(3).isImm()) Location.set(MI->getOperand(0).getReg(), MI->getOperand(3).getImm()); + else { + DEBUG(dbgs() << "DBG_VALUE instruction ignored! " << *MI << "\n"); + } return Location; } From criswell at uiuc.edu Wed Aug 4 13:06:56 2010 From: criswell at uiuc.edu (John Criswell) Date: Wed, 04 Aug 2010 18:06:56 -0000 Subject: [llvm-commits] [poolalloc] r110225 - in /poolalloc/trunk: include/dsa/DataStructure.h lib/DSA/CompleteBottomUp.cpp lib/DSA/DSCallGraph.cpp lib/DSA/EquivClassGraphs.cpp Message-ID: <20100804180656.B776F2A6C12C@llvm.org> Author: criswell Date: Wed Aug 4 13:06:56 2010 New Revision: 110225 URL: http://llvm.org/viewvc/llvm-project?rev=110225&view=rev Log: Fixes for PR#7630 with additional repairs to ensure the fix doesn't break anything. Modified DSCallGraph::insert() to convert functions into function leaders and to add new functions as separate SCCs in the call graph. This should trivially fix PR#7630 but doesn't, in and of itself, fix 254.gap. Modified the Complete Bottom Up and EQ Bottom Up passes to clone local information back into the globals graph. This fixes some other problems with 254.gap. Finally, modified the CBU pass so that it converts a function to use its global leader when doing sanity checks on the call graph. This fixes a new assertion that gets triggered when PR#7799 is fixed. Modified: poolalloc/trunk/include/dsa/DataStructure.h poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp poolalloc/trunk/lib/DSA/DSCallGraph.cpp poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp Modified: poolalloc/trunk/include/dsa/DataStructure.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DataStructure.h?rev=110225&r1=110224&r2=110225&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DataStructure.h (original) +++ poolalloc/trunk/include/dsa/DataStructure.h Wed Aug 4 13:06:56 2010 @@ -211,6 +211,7 @@ EntryPointAnalysis* EP; + void cloneIntoGlobals(DSGraph* G); public: static char ID; //Child constructor (CBU) @@ -235,7 +236,6 @@ private: void mergeSCCs(); - DSGraph* postOrder(const Function*, svset& marked); @@ -243,7 +243,6 @@ void CloneAuxIntoGlobal(DSGraph* G); void cloneGlobalsInto(DSGraph* G); - void cloneIntoGlobals(DSGraph* G); void finalizeGlobals(void); }; Modified: poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp?rev=110225&r1=110224&r2=110225&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp (original) +++ poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp Wed Aug 4 13:06:56 2010 @@ -37,7 +37,22 @@ buildIndirectFunctionSets(M); formGlobalECs(); - return runOnModuleInternal(M); + // + // Propagate information from the local graphs to the globals graphs. + // + for (Module::iterator F = M.begin(); F != M.end(); ++F) { + if (!(F->isDeclaration())) { + if (DSGraph * Graph = getOrCreateGraph(F)) { + cloneIntoGlobals (Graph); + } + } + } + + // + // Do bottom-up propagation. + // + bool modified = runOnModuleInternal(M); + return modified; } void CompleteBUDataStructures::buildIndirectFunctionSets(Module &M) { @@ -48,7 +63,7 @@ DSGraph* G = getGlobalsGraph(); DSGraph::ScalarMapTy& SM = G->getScalarMap(); - //mege nodes in the global graph for these functions + // Merge nodes in the global graph for these functions for (DSCallGraph::callee_key_iterator ii = callgraph.key_begin(), ee = callgraph.key_end(); ii != ee; ++ii) { @@ -62,9 +77,15 @@ csee = callgraph.callee_end(*ii); for (; csii != csee; ++csii) { - // Declarations don't have to have entries - if(!(*csii)->isDeclaration()) - assert(SM.count(*csii) && "Indirect function callee not in globals?"); + // + // Declarations don't have to have entries. Functions may be + // equivalence classed already, so we have to check their equivalence + // class leader instead of the global itself. + // + const Function * F = *csii; + if (!(F->isDeclaration())) + assert (SM.count (SM.getLeaderForGlobal(F)) && + "Indirect function callee not in globals?"); } } @@ -91,8 +112,9 @@ // Merge the rest of the callees (that we have entries for) together // with the first one. for (; csi != cse; ++csi) { - if (SM.count(*csi)) + if (SM.count(*csi)) { SrcNH.mergeWith(SM.find(*csi)->second); + } } } } Modified: poolalloc/trunk/lib/DSA/DSCallGraph.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSCallGraph.cpp?rev=110225&r1=110224&r2=110225&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSCallGraph.cpp (original) +++ poolalloc/trunk/lib/DSA/DSCallGraph.cpp Wed Aug 4 13:06:56 2010 @@ -207,12 +207,28 @@ //Filter all call edges. We only want pointer edges. void DSCallGraph::insert(llvm::CallSite CS, const llvm::Function* F) { - //Create an empty set for the callee, hence all called functions get to be - // in the call graph also. This simplifies SCC formation - SimpleCallees[CS.getInstruction()->getParent()->getParent()]; + // + // Find the function to which the call site belongs. + // + const llvm::Function * Parent = CS.getInstruction()->getParent()->getParent(); + + // + // Determine the SCC leaders for both the calling function and the called + // function. If they don't belong to an SCC, add them as leaders. + // + SCCs.insert (Parent); + SCCs.insert (F); + const llvm::Function * ParentLeader = SCCs.getLeaderValue (Parent); + const llvm::Function * FLeader = SCCs.getLeaderValue (F); + + // + // Create an empty set for the callee; hence, all called functions get to be + // in the call graph also. This simplifies SCC formation. + // + SimpleCallees[ParentLeader]; if (F) { - ActualCallees[CS].insert(F); - SimpleCallees[CS.getInstruction()->getParent()->getParent()].insert(F); + ActualCallees[CS].insert(FLeader); + SimpleCallees[ParentLeader].insert(FLeader); } } Modified: poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp?rev=110225&r1=110224&r2=110225&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp (original) +++ poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp Wed Aug 4 13:06:56 2010 @@ -50,10 +50,17 @@ } -// Merge all graphs that are in the same equivalence class -// the ensures things like poolalloc only deal with one graph for a -// call site -void EquivBUDataStructures::mergeGraphsByGlobalECs() { +// +// Method: mergeGraphsByGlobalECs() +// +// Description: +// Merge all graphs that are in the same equivalence class. This ensures +// that transforms like Automatic Pool Allocation only see one graph for a +// call site. +// +void +EquivBUDataStructures::mergeGraphsByGlobalECs() { + // // Merge the graphs for each equivalence class. // for (EquivalenceClasses::iterator EQSI = GlobalECs.begin(), @@ -86,6 +93,13 @@ } } } + + // + // Update the globals graph with any information that has changed due to + // graph merging. + // + if (BaseGraph) + cloneIntoGlobals(BaseGraph); } } From dalej at apple.com Wed Aug 4 13:07:17 2010 From: dalej at apple.com (Dale Johannesen) Date: Wed, 04 Aug 2010 18:07:17 -0000 Subject: [llvm-commits] [llvm] r110226 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <20100804180717.871752A6C12C@llvm.org> Author: johannes Date: Wed Aug 4 13:07:17 2010 New Revision: 110226 URL: http://llvm.org/viewvc/llvm-project?rev=110226&view=rev Log: Remove switch for disabling ARM tail calls. They seem to be working correctly. No functional change. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=110226&r1=110225&r2=110226&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Aug 4 13:07:17 2010 @@ -51,12 +51,6 @@ STATISTIC(NumTailCalls, "Number of tail calls"); -// This option should go away when tail calls fully work. -static cl::opt -EnableARMTailCalls("arm-tail-calls", cl::Hidden, - cl::desc("Generate tail calls (TEMPORARY OPTION)."), - cl::init(true)); - // This option should go away when Machine LICM is smart enough to hoist a // reg-to-reg VDUP. static cl::opt @@ -1123,9 +1117,6 @@ MachineFunction &MF = DAG.getMachineFunction(); bool IsStructRet = (Outs.empty()) ? false : Outs[0].Flags.isSRet(); bool IsSibCall = false; - // Temporarily disable tail calls so things don't break. - if (!EnableARMTailCalls) - isTailCall = false; if (isTailCall) { // Check if it's really possible to do a tail call. isTailCall = IsEligibleForTailCallOptimization(Callee, CallConv, From criswell at uiuc.edu Wed Aug 4 13:14:41 2010 From: criswell at uiuc.edu (John Criswell) Date: Wed, 04 Aug 2010 18:14:41 -0000 Subject: [llvm-commits] [poolalloc] r110227 - /poolalloc/trunk/lib/DSA/DSGraph.cpp Message-ID: <20100804181441.C838B2A6C12C@llvm.org> Author: criswell Date: Wed Aug 4 13:14:41 2010 New Revision: 110227 URL: http://llvm.org/viewvc/llvm-project?rev=110227&view=rev Log: Made code easier to read and to study using a debugger. Added comments. No functionality changes. Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=110227&r1=110226&r2=110227&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSGraph.cpp (original) +++ poolalloc/trunk/lib/DSA/DSGraph.cpp Wed Aug 4 13:14:41 2010 @@ -1219,24 +1219,49 @@ return; } + // + // Modify the entry in the node map so that the DSNode from the first + // DSNodeHandle is mapped to the second DSNodeHandle. + // Entry.setTo(N2, NH2.getOffset()-NH1.getOffset()); - // Loop over all of the fields that N1 and N2 have in common, recursively - // mapping the edges together now. - int N2Idx = NH2.getOffset()-NH1.getOffset(); + // + // The two DSNodes that we have could be strucures with outgoing links to + // other DSNodes. Recursively map such outgoing edges together, too. + // + + // + // If the second DSNode has no outgoing edges, then stop processing. There + // is nothing more to do. + // unsigned N2Size = N2->getSize(); if (N2Size == 0) return; // No edges to map to. + // + // Recursively link outgoing edges together. + // + int N2Idx = NH2.getOffset()-NH1.getOffset(); for (unsigned i = 0, e = N1->getSize(); i < e; ++i) { const DSNodeHandle &N1NH = N1->getLink(i); + // // Don't call N2->getLink if not needed (avoiding crash if N2Idx is not - // aligned right). + // aligned correctly). + // if (!N1NH.isNull()) { + // + // Compute the offset into the second DSNode. + // + unsigned offset = 0; if (unsigned(N2Idx)+i < N2Size) - computeNodeMapping(N1NH, N2->getLink(N2Idx+i), NodeMap, StrictChecking); + offset = N2Idx+i; else - computeNodeMapping(N1NH, - N2->getLink(unsigned(N2Idx+i) % N2Size), NodeMap, StrictChecking); + offset = (unsigned(N2Idx+i) % N2Size); + + // + // Compute the node mapping for the link. + // + //if (N2->hasLink (offset)) + computeNodeMapping (N1NH, N2->getLink(offset), NodeMap, StrictChecking); } } } @@ -1248,9 +1273,33 @@ DSGraph &GG = *getGlobalsGraph(); DSScalarMap &SM = getScalarMap(); + + // + // Iterate through all values used by this function (i.e., those values in + // the local graph in the function's DSGraph). For each one, compute the + // mapping between its DSNode in the local graph and its DSNode in the + // globals graph. + // + // Note that we use variables to hold intermediate values. This allows us + // to query these values more easily in the debugger. + // for (DSScalarMap::global_iterator I = SM.global_begin(), - E = SM.global_end(); I != E; ++I) - DSGraph::computeNodeMapping(SM[*I], GG.getNodeForValue(*I), NodeMap); + E = SM.global_end(); I != E; ++I) { + // Local value in the scalar map + const Value * LocalValue = *I; + + // DSNode Handle for the value in the local graph + DSNodeHandle LocalNodeHandle = SM[LocalValue]; + + // DSNode Handle for the value in the globals graph + DSNodeHandle GlobalNodeHandle = GG.getNodeForValue(LocalValue); + + // + // Add to the node mapping the mapping between the DSNode in the local + // graph and the DSNode in the globals graph. + // + DSGraph::computeNodeMapping(LocalNodeHandle, GlobalNodeHandle, NodeMap); + } } /// computeGGToGMapping - Compute the mapping of nodes in the global graph to From criswell at uiuc.edu Wed Aug 4 13:15:46 2010 From: criswell at uiuc.edu (John Criswell) Date: Wed, 04 Aug 2010 18:15:46 -0000 Subject: [llvm-commits] [poolalloc] r110228 - /poolalloc/trunk/lib/DSA/DSGraph.cpp Message-ID: <20100804181546.508A82A6C12C@llvm.org> Author: criswell Date: Wed Aug 4 13:15:46 2010 New Revision: 110228 URL: http://llvm.org/viewvc/llvm-project?rev=110228&view=rev Log: Removed commented-out code. No functionality changes. Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=110228&r1=110227&r2=110228&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSGraph.cpp (original) +++ poolalloc/trunk/lib/DSA/DSGraph.cpp Wed Aug 4 13:15:46 2010 @@ -1260,8 +1260,7 @@ // // Compute the node mapping for the link. // - //if (N2->hasLink (offset)) - computeNodeMapping (N1NH, N2->getLink(offset), NodeMap, StrictChecking); + computeNodeMapping (N1NH, N2->getLink(offset), NodeMap, StrictChecking); } } } From resistor at mac.com Wed Aug 4 13:27:08 2010 From: resistor at mac.com (Owen Anderson) Date: Wed, 04 Aug 2010 18:27:08 -0000 Subject: [llvm-commits] [llvm] r110231 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <20100804182709.0870E2A6C12C@llvm.org> Author: resistor Date: Wed Aug 4 13:27:08 2010 New Revision: 110231 URL: http://llvm.org/viewvc/llvm-project?rev=110231&view=rev Log: Add a note about the changing pass registration interface. Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=110231&r1=110230&r2=110231&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Wed Aug 4 13:27:08 2010 @@ -341,6 +341,11 @@ VISIBILITY_HIDDEN is gone.
  • + The RegisterPass and RegisterAnalysisGroup templates are + considered deprecated, but continue to function in LLVM 2.8. Clients are + strongly advised to use the upcoming INITIALIZE_PASS() and + INITIALIZE_AG_PASS() macros instead. +
  • SMDiagnostic takes different parameters now. //FIXME: how to upgrade?
  • From resistor at mac.com Wed Aug 4 13:32:47 2010 From: resistor at mac.com (Owen Anderson) Date: Wed, 04 Aug 2010 18:32:47 -0000 Subject: [llvm-commits] [llvm] r110233 - /llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp Message-ID: <20100804183247.1FAD82A6C12C@llvm.org> Author: resistor Date: Wed Aug 4 13:32:46 2010 New Revision: 110233 URL: http://llvm.org/viewvc/llvm-project?rev=110233&view=rev Log: Experiments show that we can safely increase our unrolling threshold without unduly impacting code size, particularly since unrolling is not enabled at -Os. Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp?rev=110233&r1=110232&r2=110233&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp Wed Aug 4 13:32:46 2010 @@ -27,7 +27,7 @@ using namespace llvm; static cl::opt -UnrollThreshold("unroll-threshold", cl::init(100), cl::Hidden, +UnrollThreshold("unroll-threshold", cl::init(200), cl::Hidden, cl::desc("The cut-off point for automatic loop unrolling")); static cl::opt From dpatel at apple.com Wed Aug 4 13:40:52 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 04 Aug 2010 18:40:52 -0000 Subject: [llvm-commits] [llvm] r110234 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Message-ID: <20100804184052.7B97A2A6C12C@llvm.org> Author: dpatel Date: Wed Aug 4 13:40:52 2010 New Revision: 110234 URL: http://llvm.org/viewvc/llvm-project?rev=110234&view=rev Log: If a variable is spilled by code generator then use DW_OP_fbreg to describe its location on stack. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=110234&r1=110233&r2=110234&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Aug 4 13:40:52 2010 @@ -2307,7 +2307,12 @@ } End = *MVI; MachineLocation MLoc; - MLoc.set(Begin->getOperand(0).getReg(), 0); + if (Begin->getNumOperands() == 3) { + if (Begin->getOperand(0).isReg() && Begin->getOperand(1).isImm()) + MLoc.set(Begin->getOperand(0).getReg(), Begin->getOperand(1).getImm()); + } else + MLoc = Asm->getDebugValueLocation(Begin); + const MCSymbol *FLabel = getLabelBeforeInsn(Begin); const MCSymbol *SLabel = getLabelBeforeInsn(End); DotDebugLocEntries.push_back(DotDebugLocEntry(FLabel, SLabel, MLoc)); @@ -2315,9 +2320,14 @@ if (MVI + 1 == MVE) { // If End is the last instruction then its value is valid // until the end of the funtion. - MLoc.set(End->getOperand(0).getReg(), 0); + MachineLocation EMLoc; + if (End->getNumOperands() == 3) { + if (End->getOperand(0).isReg() && Begin->getOperand(1).isImm()) + EMLoc.set(Begin->getOperand(0).getReg(), Begin->getOperand(1).getImm()); + } else + EMLoc = Asm->getDebugValueLocation(End); DotDebugLocEntries. - push_back(DotDebugLocEntry(SLabel, FunctionEndSym, MLoc)); + push_back(DotDebugLocEntry(SLabel, FunctionEndSym, EMLoc)); } } DotDebugLocEntries.push_back(DotDebugLocEntry()); @@ -3637,15 +3647,30 @@ Asm->OutStreamer.EmitSymbolValue(Entry.End, Size, 0); const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo(); unsigned Reg = RI->getDwarfRegNum(Entry.Loc.getReg(), false); - if (Reg < 32) { + if (int Offset = Entry.Loc.getOffset()) { + // If the value is at a certain offset from frame register then + // use DW_OP_fbreg. + unsigned OffsetSize = Offset ? MCAsmInfo::getSLEB128Size(Offset) : 1; Asm->OutStreamer.AddComment("Loc expr size"); - Asm->EmitInt16(1); - Asm->EmitInt8(dwarf::DW_OP_reg0 + Reg); + Asm->EmitInt16(1 + OffsetSize); + Asm->OutStreamer.AddComment( + dwarf::OperationEncodingString(dwarf::DW_OP_fbreg)); + Asm->EmitInt8(dwarf::DW_OP_fbreg); + Asm->OutStreamer.AddComment("Offset"); + Asm->EmitSLEB128(Offset); } else { - Asm->OutStreamer.AddComment("Loc expr size"); - Asm->EmitInt16(1+MCAsmInfo::getULEB128Size(Reg)); - Asm->EmitInt8(dwarf::DW_OP_regx); - Asm->EmitULEB128(Reg); + if (Reg < 32) { + Asm->OutStreamer.AddComment("Loc expr size"); + Asm->EmitInt16(1); + Asm->OutStreamer.AddComment( + dwarf::OperationEncodingString(dwarf::DW_OP_breg0 + Reg)); + Asm->EmitInt8(dwarf::DW_OP_reg0 + Reg); + } else { + Asm->OutStreamer.AddComment("Loc expr size"); + Asm->EmitInt16(1 + MCAsmInfo::getULEB128Size(Reg)); + Asm->EmitInt8(dwarf::DW_OP_regx); + Asm->EmitULEB128(Reg); + } } } } From dpatel at apple.com Wed Aug 4 13:42:02 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 04 Aug 2010 18:42:02 -0000 Subject: [llvm-commits] [llvm] r110235 - /llvm/trunk/lib/CodeGen/RegAllocFast.cpp Message-ID: <20100804184202.4FD862A6C12C@llvm.org> Author: dpatel Date: Wed Aug 4 13:42:02 2010 New Revision: 110235 URL: http://llvm.org/viewvc/llvm-project?rev=110235&view=rev Log: While spilling live registers at the end of block check whether they are used by DBG_VALUE machine instructions or not. If a spilled register is used by DBG_VALUE machine instruction then insert a new DBG_VALUE machine instruction to encode variable's new location on stack. Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=110235&r1=110234&r2=110235&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Wed Aug 4 13:42:02 2010 @@ -16,6 +16,7 @@ #include "llvm/BasicBlock.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstr.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/Passes.h" @@ -80,6 +81,8 @@ // that is currently available in a physical register. LiveRegMap LiveVirtRegs; + DenseMap LiveDbgValueMap; + // RegState - Track the state of a physical register. enum RegState { // A disabled register is not available for allocation, but an alias may @@ -265,6 +268,24 @@ TII->storeRegToStackSlot(*MBB, MI, LR.PhysReg, SpillKill, FI, RC, TRI); ++NumStores; // Update statistics + // If this register is used by DBG_VALUE then insert new DBG_VALUE to + // identify spilled location as the place to find corresponding variable's + // value. + if (MachineInstr *DBG = LiveDbgValueMap.lookup(LRI->first)) { + const MDNode *MDPtr = + DBG->getOperand(DBG->getNumOperands()-1).getMetadata(); + int64_t Offset = 0; + if (DBG->getOperand(1).isImm()) + Offset = DBG->getOperand(1).getImm(); + DebugLoc DL = MI->getDebugLoc(); + if (MachineInstr *NewDV = + TII->emitFrameIndexDebugValue(*MF, FI, Offset, MDPtr, DL)) { + MachineBasicBlock *MBB = DBG->getParent(); + MBB->insert(MI, NewDV); + DEBUG(dbgs() << "Inserting debug info due to spill:" << "\n" << *NewDV); + LiveDbgValueMap[LRI->first] = NewDV; + } + } if (SpillKill) LR.LastUse = 0; // Don't kill register again } @@ -761,6 +782,7 @@ if (!MO.isReg()) continue; unsigned Reg = MO.getReg(); if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg)) continue; + LiveDbgValueMap[Reg] = MI; LiveRegMap::iterator LRI = LiveVirtRegs.find(Reg); if (LRI != LiveVirtRegs.end()) setPhysReg(MI, i, LRI->second.PhysReg); @@ -770,7 +792,7 @@ MO.setReg(0); // We can't allocate a physreg for a DebugValue, sorry! else { // Modify DBG_VALUE now that the value is in a spill slot. - uint64_t Offset = MI->getOperand(1).getImm(); + int64_t Offset = MI->getOperand(1).getImm(); const MDNode *MDPtr = MI->getOperand(MI->getNumOperands()-1).getMetadata(); DebugLoc DL = MI->getDebugLoc(); @@ -1004,6 +1026,7 @@ SkippedInstrs.clear(); StackSlotForVirtReg.clear(); + LiveDbgValueMap.clear(); return true; } From criswell at uiuc.edu Wed Aug 4 13:42:36 2010 From: criswell at uiuc.edu (John Criswell) Date: Wed, 04 Aug 2010 18:42:36 -0000 Subject: [llvm-commits] [poolalloc] r110237 - /poolalloc/trunk/lib/DSA/Local.cpp Message-ID: <20100804184236.9B7022A6C12D@llvm.org> Author: criswell Date: Wed Aug 4 13:42:36 2010 New Revision: 110237 URL: http://llvm.org/viewvc/llvm-project?rev=110237&view=rev Log: Fixed PR#7799. When merging a global initializer into a DSNode (done by the GraphBuilder::mergeExternalGlobal() method), make sure that the DSNode is large enough to hold the global initializer. This may require resizing the DSNode. Modified: poolalloc/trunk/lib/DSA/Local.cpp Modified: poolalloc/trunk/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=110237&r1=110236&r2=110237&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Local.cpp (original) +++ poolalloc/trunk/lib/DSA/Local.cpp Wed Aug 4 13:42:36 2010 @@ -1040,10 +1040,30 @@ for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i) { DSNode *NHN = NH.getNode(); if (SL->getElementOffset(i) < SL->getSizeInBytes()) { + // + // Get the type and constant value of this particular element of the + // constant structure. + // const Type * ElementType = cast(Ty)->getElementType(i); Constant * ConstElement = cast(CS->getOperand(i)); - DSNodeHandle NewNH (NHN, - NH.getOffset()+(unsigned)SL->getElementOffset(i)); + + // + // Get the offset (in bytes) into the memory object that we're + // analyzing. + // + unsigned offset = NH.getOffset()+(unsigned)SL->getElementOffset(i); + + // + // Create a new DSNodeHandle. This DSNodeHandle will point to the same + // DSNode as the one we're constructing for our caller; however, it + // will point into a different offset into that DSNode. + // + DSNodeHandle NewNH (NHN, offset); + + // + // Recursively merge in this element of the constant struture into the + // DSNode. + // MergeConstantInitIntoNode(NewNH, ElementType, ConstElement); } else if (SL->getElementOffset(i) == SL->getSizeInBytes()) { // @@ -1066,10 +1086,27 @@ } void GraphBuilder::mergeInGlobalInitializer(GlobalVariable *GV) { + // Ensure that the global variable is not external assert(!GV->isDeclaration() && "Cannot merge in external global!"); + + // // Get a node handle to the global node and merge the initializer into it. + // DSNodeHandle NH = getValueDest(GV); - MergeConstantInitIntoNode(NH, GV->getType()->getElementType(), GV->getInitializer()); + + // + // Ensure that the DSNode is large enough to hold the new constant that we'll + // be adding to it. + // + const Type * ElementType = GV->getType()->getElementType(); + unsigned requiredSize = TD.getTypeAllocSize(ElementType) + NH.getOffset(); + if (NH.getNode()->getSize() < requiredSize) + NH.getNode()->growSize (requiredSize); + + // + // Do the actual merging in of the constant initializer. + // + MergeConstantInitIntoNode(NH, ElementType, GV->getInitializer()); } void GraphBuilder::mergeExternalGlobal(GlobalVariable *GV) { From dpatel at apple.com Wed Aug 4 13:42:46 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 04 Aug 2010 18:42:46 -0000 Subject: [llvm-commits] [llvm] r110238 - /llvm/trunk/test/DebugInfo/2010-08-04-StackVariable.ll Message-ID: <20100804184246.783702A6C12C@llvm.org> Author: dpatel Date: Wed Aug 4 13:42:46 2010 New Revision: 110238 URL: http://llvm.org/viewvc/llvm-project?rev=110238&view=rev Log: Test case for combination of r110234 & r110235. Added: llvm/trunk/test/DebugInfo/2010-08-04-StackVariable.ll Added: llvm/trunk/test/DebugInfo/2010-08-04-StackVariable.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2010-08-04-StackVariable.ll?rev=110238&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2010-08-04-StackVariable.ll (added) +++ llvm/trunk/test/DebugInfo/2010-08-04-StackVariable.ll Wed Aug 4 13:42:46 2010 @@ -0,0 +1,124 @@ +; RUN: llc -O0 < %s | grep DW_OP_fbreg +; Use DW_OP_fbreg in variable's location expression if the variable is in a stack slot. + +%struct.SVal = type { i8*, i32 } + +define i32 @_Z3fooi4SVal(i32 %i, %struct.SVal* noalias %location) nounwind ssp { +entry: + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + call void @llvm.dbg.value(metadata !{i32 %i}, i64 0, metadata !23), !dbg !24 + call void @llvm.dbg.value(metadata !{%struct.SVal* %location}, i64 0, metadata !25), !dbg !24 + %0 = icmp ne i32 %i, 0, !dbg !27 ; [#uses=1] + br i1 %0, label %bb, label %bb1, !dbg !27 + +bb: ; preds = %entry + %1 = getelementptr inbounds %struct.SVal* %location, i32 0, i32 1, !dbg !29 ; [#uses=1] + %2 = load i32* %1, align 8, !dbg !29 ; [#uses=1] + %3 = add i32 %2, %i, !dbg !29 ; [#uses=1] + br label %bb2, !dbg !29 + +bb1: ; preds = %entry + %4 = getelementptr inbounds %struct.SVal* %location, i32 0, i32 1, !dbg !30 ; [#uses=1] + %5 = load i32* %4, align 8, !dbg !30 ; [#uses=1] + %6 = sub i32 %5, 1, !dbg !30 ; [#uses=1] + br label %bb2, !dbg !30 + +bb2: ; preds = %bb1, %bb + %.0 = phi i32 [ %3, %bb ], [ %6, %bb1 ] ; [#uses=1] + br label %return, !dbg !29 + +return: ; preds = %bb2 + ret i32 %.0, !dbg !29 +} + +define linkonce_odr void @_ZN4SValC1Ev(%struct.SVal* %this) nounwind ssp align 2 { +entry: + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + call void @llvm.dbg.value(metadata !{%struct.SVal* %this}, i64 0, metadata !31), !dbg !34 + %0 = getelementptr inbounds %struct.SVal* %this, i32 0, i32 0, !dbg !34 ; [#uses=1] + store i8* null, i8** %0, align 8, !dbg !34 + %1 = getelementptr inbounds %struct.SVal* %this, i32 0, i32 1, !dbg !34 ; [#uses=1] + store i32 0, i32* %1, align 8, !dbg !34 + br label %return, !dbg !34 + +return: ; preds = %entry + ret void, !dbg !35 +} + +declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone + +define i32 @main() nounwind ssp { +entry: + %0 = alloca %struct.SVal ; <%struct.SVal*> [#uses=3] + %v = alloca %struct.SVal ; <%struct.SVal*> [#uses=4] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + call void @llvm.dbg.declare(metadata !{%struct.SVal* %v}, metadata !38), !dbg !41 + call void @_ZN4SValC1Ev(%struct.SVal* %v) nounwind, !dbg !41 + %1 = getelementptr inbounds %struct.SVal* %v, i32 0, i32 1, !dbg !42 ; [#uses=1] + store i32 1, i32* %1, align 8, !dbg !42 + %2 = getelementptr inbounds %struct.SVal* %0, i32 0, i32 0, !dbg !43 ; [#uses=1] + %3 = getelementptr inbounds %struct.SVal* %v, i32 0, i32 0, !dbg !43 ; [#uses=1] + %4 = load i8** %3, align 8, !dbg !43 ; [#uses=1] + store i8* %4, i8** %2, align 8, !dbg !43 + %5 = getelementptr inbounds %struct.SVal* %0, i32 0, i32 1, !dbg !43 ; [#uses=1] + %6 = getelementptr inbounds %struct.SVal* %v, i32 0, i32 1, !dbg !43 ; [#uses=1] + %7 = load i32* %6, align 8, !dbg !43 ; [#uses=1] + store i32 %7, i32* %5, align 8, !dbg !43 + %8 = call i32 @_Z3fooi4SVal(i32 2, %struct.SVal* noalias %0) nounwind, !dbg !43 ; [#uses=0] + call void @llvm.dbg.value(metadata !{i32 %8}, i64 0, metadata !44), !dbg !43 + br label %return, !dbg !45 + +return: ; preds = %entry + ret i32 0, !dbg !45 +} + +declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone + +!llvm.dbg.sp = !{!0, !9, !16, !17, !20} + +!0 = metadata !{i32 524334, i32 0, metadata !1, metadata !"SVal", metadata !"SVal", metadata !"", metadata !2, i32 11, metadata !14, i1 false, i1 false, i32 0, i32 0, null, i1 false, i1 false, null} ; [ DW_TAG_subprogram ] +!1 = metadata !{i32 524307, metadata !2, metadata !"SVal", metadata !2, i32 1, i64 128, i64 64, i64 0, i32 0, null, metadata !4, i32 0, null} ; [ DW_TAG_structure_type ] +!2 = metadata !{i32 524329, metadata !"small.cc", metadata !"/Users/manav/R8248330", metadata !3} ; [ DW_TAG_file_type ] +!3 = metadata !{i32 524305, i32 0, i32 4, metadata !"small.cc", metadata !"/Users/manav/R8248330", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ] +!4 = metadata !{metadata !5, metadata !7, metadata !0, metadata !9} +!5 = metadata !{i32 524301, metadata !1, metadata !"Data", metadata !2, i32 7, i64 64, i64 64, i64 0, i32 0, metadata !6} ; [ DW_TAG_member ] +!6 = metadata !{i32 524303, metadata !2, metadata !"", metadata !2, i32 0, i64 64, i64 64, i64 0, i32 0, null} ; [ DW_TAG_pointer_type ] +!7 = metadata !{i32 524301, metadata !1, metadata !"Kind", metadata !2, i32 8, i64 32, i64 32, i64 64, i32 0, metadata !8} ; [ DW_TAG_member ] +!8 = metadata !{i32 524324, metadata !2, metadata !"unsigned int", metadata !2, i32 0, i64 32, i64 32, i64 0, i32 0, i32 7} ; [ DW_TAG_base_type ] +!9 = metadata !{i32 524334, i32 0, metadata !1, metadata !"~SVal", metadata !"~SVal", metadata !"", metadata !2, i32 12, metadata !10, i1 false, i1 false, i32 0, i32 0, null, i1 false, i1 false, null} ; [ DW_TAG_subprogram ] +!10 = metadata !{i32 524309, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !11, i32 0, null} ; [ DW_TAG_subroutine_type ] +!11 = metadata !{null, metadata !12, metadata !13} +!12 = metadata !{i32 524303, metadata !2, metadata !"", metadata !2, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !1} ; [ DW_TAG_pointer_type ] +!13 = metadata !{i32 524324, metadata !2, metadata !"int", metadata !2, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] +!14 = metadata !{i32 524309, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !15, i32 0, null} ; [ DW_TAG_subroutine_type ] +!15 = metadata !{null, metadata !12} +!16 = metadata !{i32 524334, i32 0, metadata !1, metadata !"SVal", metadata !"SVal", metadata !"_ZN4SValC1Ev", metadata !2, i32 11, metadata !14, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false, void (%struct.SVal*)* @_ZN4SValC1Ev} ; [ DW_TAG_subprogram ] +!17 = metadata !{i32 524334, i32 0, metadata !2, metadata !"foo", metadata !"foo", metadata !"_Z3fooi4SVal", metadata !2, i32 16, metadata !18, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false, i32 (i32, %struct.SVal*)* @_Z3fooi4SVal} ; [ DW_TAG_subprogram ] +!18 = metadata !{i32 524309, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !19, i32 0, null} ; [ DW_TAG_subroutine_type ] +!19 = metadata !{metadata !13, metadata !13, metadata !1} +!20 = metadata !{i32 524334, i32 0, metadata !2, metadata !"main", metadata !"main", metadata !"main", metadata !2, i32 23, metadata !21, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false, i32 ()* @main} ; [ DW_TAG_subprogram ] +!21 = metadata !{i32 524309, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !22, i32 0, null} ; [ DW_TAG_subroutine_type ] +!22 = metadata !{metadata !13} +!23 = metadata !{i32 524545, metadata !17, metadata !"i", metadata !2, i32 16, metadata !13} ; [ DW_TAG_arg_variable ] +!24 = metadata !{i32 16, i32 0, metadata !17, null} +!25 = metadata !{i32 524545, metadata !17, metadata !"location", metadata !2, i32 16, metadata !26} ; [ DW_TAG_arg_variable ] +!26 = metadata !{i32 524304, metadata !2, metadata !"SVal", metadata !2, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !1} ; [ DW_TAG_reference_type ] +!27 = metadata !{i32 17, i32 0, metadata !28, null} +!28 = metadata !{i32 524299, metadata !17, i32 16, i32 0, metadata !2, i32 2} ; [ DW_TAG_lexical_block ] +!29 = metadata !{i32 18, i32 0, metadata !28, null} +!30 = metadata !{i32 20, i32 0, metadata !28, null} +!31 = metadata !{i32 524545, metadata !16, metadata !"this", metadata !2, i32 11, metadata !32} ; [ DW_TAG_arg_variable ] +!32 = metadata !{i32 524326, metadata !2, metadata !"", metadata !2, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !33} ; [ DW_TAG_const_type ] +!33 = metadata !{i32 524303, metadata !2, metadata !"", metadata !2, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !1} ; [ DW_TAG_pointer_type ] +!34 = metadata !{i32 11, i32 0, metadata !16, null} +!35 = metadata !{i32 11, i32 0, metadata !36, null} +!36 = metadata !{i32 524299, metadata !37, i32 11, i32 0, metadata !2, i32 1} ; [ DW_TAG_lexical_block ] +!37 = metadata !{i32 524299, metadata !16, i32 11, i32 0, metadata !2, i32 0} ; [ DW_TAG_lexical_block ] +!38 = metadata !{i32 524544, metadata !39, metadata !"v", metadata !2, i32 24, metadata !1} ; [ DW_TAG_auto_variable ] +!39 = metadata !{i32 524299, metadata !40, i32 23, i32 0, metadata !2, i32 4} ; [ DW_TAG_lexical_block ] +!40 = metadata !{i32 524299, metadata !20, i32 23, i32 0, metadata !2, i32 3} ; [ DW_TAG_lexical_block ] +!41 = metadata !{i32 24, i32 0, metadata !39, null} +!42 = metadata !{i32 25, i32 0, metadata !39, null} +!43 = metadata !{i32 26, i32 0, metadata !39, null} +!44 = metadata !{i32 524544, metadata !39, metadata !"k", metadata !2, i32 26, metadata !13} ; [ DW_TAG_auto_variable ] +!45 = metadata !{i32 27, i32 0, metadata !39, null} From gohman at apple.com Wed Aug 4 13:51:09 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 18:51:09 -0000 Subject: [llvm-commits] [llvm] r110240 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Message-ID: <20100804185109.3A42C2A6C12C@llvm.org> Author: djg Date: Wed Aug 4 13:51:09 2010 New Revision: 110240 URL: http://llvm.org/viewvc/llvm-project?rev=110240&view=rev Log: Change this llvm_unreachable to report_fatal_error, since it can be triggered by valid, if dubious, IR. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=110240&r1=110239&r2=110240&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Wed Aug 4 13:51:09 2010 @@ -1268,10 +1268,17 @@ ConstantFoldConstantExpression(CE, AP.TM.getTargetData())) if (C != CE) return LowerConstant(C, AP); -#ifndef NDEBUG - CE->dump(); -#endif - llvm_unreachable("FIXME: Don't support this constant expr"); + + // Otherwise report the problem to the user. + { + std::string S; + raw_string_ostream OS(S); + OS << "Unsupported expression in static initializer: "; + WriteAsOperand(OS, CE, /*PrintType=*/false, + !AP.MF ? 0 : AP.MF->getFunction()->getParent()); + report_fatal_error(OS.str()); + } + return MCConstantExpr::Create(0, Ctx); case Instruction::GetElementPtr: { const TargetData &TD = *AP.TM.getTargetData(); // Generate a symbolic expression for the byte address From gohman at apple.com Wed Aug 4 14:52:51 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 19:52:51 -0000 Subject: [llvm-commits] [llvm] r110241 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <20100804195251.2A8F22A6C12C@llvm.org> Author: djg Date: Wed Aug 4 14:52:50 2010 New Revision: 110241 URL: http://llvm.org/viewvc/llvm-project?rev=110241&view=rev Log: Fix a minor bug which resulted in intermediate calculations using wider types than are necessary. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=110241&r1=110240&r2=110241&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed Aug 4 14:52:50 2010 @@ -1896,7 +1896,7 @@ // TODO: Generalize this to non-constants by using known-bits information. const Type *Ty = LHS->getType(); unsigned LZ = RHSC->getValue()->getValue().countLeadingZeros(); - unsigned MaxShiftAmt = getTypeSizeInBits(Ty) - LZ; + unsigned MaxShiftAmt = getTypeSizeInBits(Ty) - LZ - 1; // For non-power-of-two values, effectively round the value up to the // nearest power of two. if (!RHSC->getValue()->getValue().isPowerOf2()) From dpatel at apple.com Wed Aug 4 15:32:36 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 04 Aug 2010 20:32:36 -0000 Subject: [llvm-commits] [llvm] r110244 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Message-ID: <20100804203236.B4CFC2A6C12C@llvm.org> Author: dpatel Date: Wed Aug 4 15:32:36 2010 New Revision: 110244 URL: http://llvm.org/viewvc/llvm-project?rev=110244&view=rev Log: Fix typo in comment. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=110244&r1=110243&r2=110244&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Aug 4 15:32:36 2010 @@ -3663,7 +3663,7 @@ Asm->OutStreamer.AddComment("Loc expr size"); Asm->EmitInt16(1); Asm->OutStreamer.AddComment( - dwarf::OperationEncodingString(dwarf::DW_OP_breg0 + Reg)); + dwarf::OperationEncodingString(dwarf::DW_OP_reg0 + Reg)); Asm->EmitInt8(dwarf::DW_OP_reg0 + Reg); } else { Asm->OutStreamer.AddComment("Loc expr size"); From edwintorok at gmail.com Wed Aug 4 15:47:44 2010 From: edwintorok at gmail.com (Torok Edwin) Date: Wed, 04 Aug 2010 20:47:44 -0000 Subject: [llvm-commits] [llvm] r110246 - in /llvm/trunk/lib/Target/PowerPC: PPCISelLowering.cpp PPCSubtarget.cpp PPCSubtarget.h Message-ID: <20100804204744.7570A2A6C12C@llvm.org> Author: edwin Date: Wed Aug 4 15:47:44 2010 New Revision: 110246 URL: http://llvm.org/viewvc/llvm-project?rev=110246&view=rev Log: Use indirect calls in PowerPC JIT. See PR5201. There is no way to know if direct calls will be within the allowed range for BL. Hence emit all calls as indirect when in JIT mode. Without this long-running applications will fail to JIT on PowerPC with a relocation failure. Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCSubtarget.cpp llvm/trunk/lib/Target/PowerPC/PPCSubtarget.h Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=110246&r1=110245&r2=110246&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Wed Aug 4 15:47:44 2010 @@ -2467,18 +2467,31 @@ unsigned CallOpc = isSVR4ABI ? PPCISD::CALL_SVR4 : PPCISD::CALL_Darwin; - // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every - // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol - // node so that legalize doesn't hack it. - if (GlobalAddressSDNode *G = dyn_cast(Callee)) - Callee = DAG.getTargetGlobalAddress(G->getGlobal(), dl, - Callee.getValueType()); - else if (ExternalSymbolSDNode *S = dyn_cast(Callee)) - Callee = DAG.getTargetExternalSymbol(S->getSymbol(), Callee.getValueType()); - else if (SDNode *Dest = isBLACompatibleAddress(Callee, DAG)) + bool needIndirectCall = true; + if (SDNode *Dest = isBLACompatibleAddress(Callee, DAG)) { // If this is an absolute destination address, use the munged value. Callee = SDValue(Dest, 0); - else { + needIndirectCall = false; + } + // XXX Work around for http://llvm.org/bugs/show_bug.cgi?id=5201 + // Use indirect calls for ALL functions calls in JIT mode, since the + // far-call stubs may be outside relocation limits for a BL instruction. + if (!DAG.getTarget().getSubtarget().isJITCodeModel()) { + // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every + // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol + // node so that legalize doesn't hack it. + if (GlobalAddressSDNode *G = dyn_cast(Callee)) { + Callee = DAG.getTargetGlobalAddress(G->getGlobal(), dl, + Callee.getValueType()); + needIndirectCall = false; + } + } + if (ExternalSymbolSDNode *S = dyn_cast(Callee)) { + Callee = DAG.getTargetExternalSymbol(S->getSymbol(), + Callee.getValueType()); + needIndirectCall = false; + } + if (needIndirectCall) { // Otherwise, this is an indirect call. We have to use a MTCTR/BCTRL pair // to do the call, we can't use PPCISD::CALL. SDValue MTCTROps[] = {Chain, Callee, InFlag}; Modified: llvm/trunk/lib/Target/PowerPC/PPCSubtarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCSubtarget.cpp?rev=110246&r1=110245&r2=110246&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCSubtarget.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCSubtarget.cpp Wed Aug 4 15:47:44 2010 @@ -69,6 +69,7 @@ , HasFSQRT(false) , HasSTFIWX(false) , HasLazyResolverStubs(false) + , IsJITCodeModel(false) , DarwinVers(0) { // Determine default and user specified characteristics @@ -117,6 +118,9 @@ // everything is. This matters for PPC64, which codegens in PIC mode without // stubs. HasLazyResolverStubs = false; + + // Calls to external functions need to use indirect calls + IsJITCodeModel = true; } Modified: llvm/trunk/lib/Target/PowerPC/PPCSubtarget.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCSubtarget.h?rev=110246&r1=110245&r2=110246&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCSubtarget.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCSubtarget.h Wed Aug 4 15:47:44 2010 @@ -63,6 +63,7 @@ bool HasFSQRT; bool HasSTFIWX; bool HasLazyResolverStubs; + bool IsJITCodeModel; /// DarwinVers - Nonzero if this is a darwin platform. Otherwise, the numeric /// version of the platform, e.g. 8 = 10.4 (Tiger), 9 = 10.5 (Leopard), etc. @@ -124,6 +125,9 @@ bool hasLazyResolverStub(const GlobalValue *GV, const TargetMachine &TM) const; + // isJITCodeModel - True if we're generating code for the JIT + bool isJITCodeModel() const { return IsJITCodeModel; } + // Specific obvious features. bool hasFSQRT() const { return HasFSQRT; } bool hasSTFIWX() const { return HasSTFIWX; } From isanbard at gmail.com Wed Aug 4 16:44:13 2010 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 04 Aug 2010 21:44:13 -0000 Subject: [llvm-commits] [llvm] r110248 - /llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Message-ID: <20100804214413.420492A6C12C@llvm.org> Author: void Date: Wed Aug 4 16:44:13 2010 New Revision: 110248 URL: http://llvm.org/viewvc/llvm-project?rev=110248&view=rev Log: The EH prepare passes really want to be the last passes run before code-gen. Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=110248&r1=110247&r2=110248&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Wed Aug 4 16:44:13 2010 @@ -272,6 +272,11 @@ PM.add(createPrintFunctionPass("\n\n*** Code after LSR ***\n", &dbgs())); } + PM.add(createGCLoweringPass()); + + // Make sure that no unreachable blocks are instruction selected. + PM.add(createUnreachableBlockEliminationPass()); + // Turn exception handling constructs into something the code generators can // handle. switch (getMCAsmInfo()->getExceptionHandlingType()) { @@ -293,11 +298,6 @@ break; } - PM.add(createGCLoweringPass()); - - // Make sure that no unreachable blocks are instruction selected. - PM.add(createUnreachableBlockEliminationPass()); - if (OptLevel != CodeGenOpt::None && !DisableCGP) PM.add(createCodeGenPreparePass(getTargetLowering())); From isanbard at gmail.com Wed Aug 4 16:56:30 2010 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 04 Aug 2010 21:56:30 -0000 Subject: [llvm-commits] [llvm] r110249 - /llvm/trunk/test/CodeGen/ARM/2010-08-04-EHCrash.ll Message-ID: <20100804215630.DE2B52A6C12C@llvm.org> Author: void Date: Wed Aug 4 16:56:30 2010 New Revision: 110249 URL: http://llvm.org/viewvc/llvm-project?rev=110249&view=rev Log: Testcase for r110248. Added: llvm/trunk/test/CodeGen/ARM/2010-08-04-EHCrash.ll Added: llvm/trunk/test/CodeGen/ARM/2010-08-04-EHCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2010-08-04-EHCrash.ll?rev=110249&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2010-08-04-EHCrash.ll (added) +++ llvm/trunk/test/CodeGen/ARM/2010-08-04-EHCrash.ll Wed Aug 4 16:56:30 2010 @@ -0,0 +1,65 @@ +; RUN: llc < %s -mtriple=thumbv7-apple-darwin10 +; + +define linkonce_odr arm_apcscc void @func1() { +entry: + %save_filt.936 = alloca i32 ; [#uses=2] + %save_eptr.935 = alloca i8* ; [#uses=2] + %eh_exception = alloca i8* ; [#uses=5] + %eh_selector = alloca i32 ; [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + call arm_apcscc void @func2() + br label %return + +bb: ; No predecessors! + %eh_select = load i32* %eh_selector ; [#uses=1] + store i32 %eh_select, i32* %save_filt.936, align 4 + %eh_value = load i8** %eh_exception ; [#uses=1] + store i8* %eh_value, i8** %save_eptr.935, align 4 + invoke arm_apcscc void @func3() + to label %invcont unwind label %lpad + +invcont: ; preds = %bb + %tmp6 = load i8** %save_eptr.935, align 4 ; [#uses=1] + store i8* %tmp6, i8** %eh_exception, align 4 + %tmp7 = load i32* %save_filt.936, align 4 ; [#uses=1] + store i32 %tmp7, i32* %eh_selector, align 4 + br label %Unwind + +bb12: ; preds = %ppad + call arm_apcscc void @_ZSt9terminatev() noreturn nounwind + unreachable + +return: ; preds = %entry + ret void + +lpad: ; preds = %bb + %eh_ptr = call i8* @llvm.eh.exception() ; [#uses=1] + store i8* %eh_ptr, i8** %eh_exception + %eh_ptr13 = load i8** %eh_exception ; [#uses=1] + %eh_select14 = call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %eh_ptr13, i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*), i32 1) + store i32 %eh_select14, i32* %eh_selector + br label %ppad + +ppad: + br label %bb12 + +Unwind: + %eh_ptr15 = load i8** %eh_exception + call arm_apcscc void @_Unwind_SjLj_Resume(i8* %eh_ptr15) + unreachable +} + +declare arm_apcscc void @func2() + +declare arm_apcscc void @_ZSt9terminatev() noreturn nounwind + +declare i8* @llvm.eh.exception() nounwind readonly + +declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind + +declare arm_apcscc void @_Unwind_SjLj_Resume(i8*) + +declare arm_apcscc void @func3() + +declare arm_apcscc i32 @__gxx_personality_sj0(...) From stuart at apple.com Wed Aug 4 16:58:00 2010 From: stuart at apple.com (Stuart Hastings) Date: Wed, 04 Aug 2010 21:58:00 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r110250 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Message-ID: <20100804215801.02A822A6C12C@llvm.org> Author: stuart Date: Wed Aug 4 16:58:00 2010 New Revision: 110250 URL: http://llvm.org/viewvc/llvm-project?rev=110250&view=rev Log: Avoid ICE on ObjC++ template expansion. Radar 8264670. Patch by Fariborz Jahanian! Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=110250&r1=110249&r2=110250&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Wed Aug 4 16:58:00 2010 @@ -19636,7 +19636,8 @@ return other; /* APPLE LOCAL end radar 5796058 - blocks */ - if (!strcmp (IDENTIFIER_POINTER (id), "super")) + if (id && TREE_CODE (id) == IDENTIFIER_NODE + && !strcmp (IDENTIFIER_POINTER (id), "super")) /* We have a message to super. */ return get_super_receiver (); From stuart at apple.com Wed Aug 4 17:05:38 2010 From: stuart at apple.com (Stuart Hastings) Date: Wed, 04 Aug 2010 22:05:38 -0000 Subject: [llvm-commits] [llvm] r110254 - /llvm/trunk/test/FrontendObjC++/2010-08-04-Template.mm Message-ID: <20100804220538.F2B1B2A6C12C@llvm.org> Author: stuart Date: Wed Aug 4 17:05:38 2010 New Revision: 110254 URL: http://llvm.org/viewvc/llvm-project?rev=110254&view=rev Log: Test case for r110250. Radar 8264670. Test case by Fariborz Jahanian! Added: llvm/trunk/test/FrontendObjC++/2010-08-04-Template.mm Added: llvm/trunk/test/FrontendObjC++/2010-08-04-Template.mm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC%2B%2B/2010-08-04-Template.mm?rev=110254&view=auto ============================================================================== --- llvm/trunk/test/FrontendObjC++/2010-08-04-Template.mm (added) +++ llvm/trunk/test/FrontendObjC++/2010-08-04-Template.mm Wed Aug 4 17:05:38 2010 @@ -0,0 +1,10 @@ +// RUN: %llvmgcc %s -S -emit-llvm +struct TRunSoon { + template static void Post() {} +}; + + at implementation TPrivsTableViewMainController +- (void) applyToEnclosed { + TRunSoon::Post(); +} + at end From dpatel at apple.com Wed Aug 4 17:07:27 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 04 Aug 2010 22:07:27 -0000 Subject: [llvm-commits] [llvm] r110255 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Message-ID: <20100804220727.ED1022A6C12C@llvm.org> Author: dpatel Date: Wed Aug 4 17:07:27 2010 New Revision: 110255 URL: http://llvm.org/viewvc/llvm-project?rev=110255&view=rev Log: Use location entry only of the location described by DBG_VALUE is valid. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=110255&r1=110254&r2=110255&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Aug 4 17:07:27 2010 @@ -2315,7 +2315,9 @@ const MCSymbol *FLabel = getLabelBeforeInsn(Begin); const MCSymbol *SLabel = getLabelBeforeInsn(End); - DotDebugLocEntries.push_back(DotDebugLocEntry(FLabel, SLabel, MLoc)); + if (MLoc.getReg()) + DotDebugLocEntries.push_back(DotDebugLocEntry(FLabel, SLabel, MLoc)); + Begin = End; if (MVI + 1 == MVE) { // If End is the last instruction then its value is valid @@ -2326,8 +2328,9 @@ EMLoc.set(Begin->getOperand(0).getReg(), Begin->getOperand(1).getImm()); } else EMLoc = Asm->getDebugValueLocation(End); - DotDebugLocEntries. - push_back(DotDebugLocEntry(SLabel, FunctionEndSym, EMLoc)); + if (EMLoc.getReg()) + DotDebugLocEntries. + push_back(DotDebugLocEntry(SLabel, FunctionEndSym, EMLoc)); } } DotDebugLocEntries.push_back(DotDebugLocEntry()); From dpatel at apple.com Wed Aug 4 17:07:50 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 04 Aug 2010 22:07:50 -0000 Subject: [llvm-commits] [llvm] r110256 - /llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Message-ID: <20100804220750.36DA32A6C12C@llvm.org> Author: dpatel Date: Wed Aug 4 17:07:50 2010 New Revision: 110256 URL: http://llvm.org/viewvc/llvm-project?rev=110256&view=rev Log: Implement target specific getDebugValueLocation(). Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=110256&r1=110255&r2=110256&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Wed Aug 4 17:07:50 2010 @@ -43,6 +43,7 @@ #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetRegistry.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" @@ -327,6 +328,19 @@ void printPredicateOperand(const MachineInstr *MI, unsigned OpNo, raw_ostream &O, const char *Modifier); + + MachineLocation getDebugValueLocation(const MachineInstr *MI) const { + + MachineLocation Location; + assert (MI->getNumOperands() == 4 && "Invalid no. of machine operands!"); + // Frame address. Currently handles register +- offset only. + if (MI->getOperand(0).isReg() && MI->getOperand(2).isImm()) + Location.set(MI->getOperand(0).getReg(), MI->getOperand(2).getImm()); + else { + DEBUG(dbgs() << "DBG_VALUE instruction ignored! " << *MI << "\n"); + } + return Location; + } }; /// PPCLinuxAsmPrinter - PowerPC assembly printer, customized for Linux From stoklund at 2pi.dk Wed Aug 4 17:08:39 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 04 Aug 2010 22:08:39 -0000 Subject: [llvm-commits] [llvm] r110257 - in /llvm/trunk/lib/CodeGen: InlineSpiller.cpp SplitKit.cpp SplitKit.h Message-ID: <20100804220839.ED58B2A6C12C@llvm.org> Author: stoklund Date: Wed Aug 4 17:08:39 2010 New Revision: 110257 URL: http://llvm.org/viewvc/llvm-project?rev=110257&view=rev Log: Checkpoint SplitKit progress. We are now at a point where we can split around simple single-entry, single-exit loops, although still with some bugs. Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp llvm/trunk/lib/CodeGen/SplitKit.cpp llvm/trunk/lib/CodeGen/SplitKit.h Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/InlineSpiller.cpp?rev=110257&r1=110256&r2=110257&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/InlineSpiller.cpp (original) +++ llvm/trunk/lib/CodeGen/InlineSpiller.cpp Wed Aug 4 17:08:39 2010 @@ -110,7 +110,8 @@ splitAnalysis_.analyze(li_); if (const MachineLoop *loop = splitAnalysis_.getBestSplitLoop()) { - SplitEditor(splitAnalysis_, lis_, vrm_).splitAroundLoop(loop); + SplitEditor(splitAnalysis_, lis_, vrm_, *newIntervals_) + .splitAroundLoop(loop); return true; } return false; @@ -372,7 +373,9 @@ if (li_->empty()) return; - stackSlot_ = vrm_.assignVirt2StackSlot(li->reg); + stackSlot_ = vrm_.getStackSlot(li->reg); + if (stackSlot_ == VirtRegMap::NO_STACK_SLOT) + stackSlot_ = vrm_.assignVirt2StackSlot(li->reg); // Iterate over instructions using register. for (MachineRegisterInfo::reg_iterator RI = mri_.reg_begin(li->reg); Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=110257&r1=110256&r2=110257&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SplitKit.cpp (original) +++ llvm/trunk/lib/CodeGen/SplitKit.cpp Wed Aug 4 17:08:39 2010 @@ -222,6 +222,13 @@ for (LoopPtrSet::const_iterator I = usingLoops_.begin(), E = usingLoops_.end(); I != E; ++I) { getLoopBlocks(*I, Blocks); + + // FIXME: We need an SSA updater to properly handle multiple exit blocks. + if (Blocks.Exits.size() > 1) { + DEBUG(dbgs() << "MultipleExits: " << **I); + continue; + } + LoopPtrSet *LPS = 0; switch(analyzeLoopPeripheralUse(Blocks)) { case OutsideLoop: @@ -277,11 +284,14 @@ //===----------------------------------------------------------------------===// /// Create a new SplitEditor for editing the LiveInterval analyzed by SA. -SplitEditor::SplitEditor(SplitAnalysis &sa, LiveIntervals &lis, VirtRegMap &vrm) +SplitEditor::SplitEditor(SplitAnalysis &sa, LiveIntervals &lis, VirtRegMap &vrm, + std::vector &intervals) : sa_(sa), lis_(lis), vrm_(vrm), mri_(vrm.getMachineFunction().getRegInfo()), tii_(*vrm.getMachineFunction().getTarget().getInstrInfo()), - dupli_(0), openli_(0) + dupli_(0), openli_(0), + intervals_(intervals), + firstInterval(intervals_.size()) { const LiveInterval *curli = sa_.getCurLI(); assert(curli && "SplitEditor created from empty SplitAnalysis"); @@ -313,44 +323,56 @@ return VNI; } -/// Create a new virtual register and live interval to be used by following -/// use* and copy* calls. -void SplitEditor::openLI() { - assert(!openli_ && "Previous LI not closed before openLI"); +/// Insert a COPY instruction curli -> li. Allocate a new value from li +/// defined by the COPY. Note that rewrite() will deal with the curli +/// register, so this function can be used to copy from any interval - openli, +/// curli, or dupli. +VNInfo *SplitEditor::insertCopy(LiveInterval &LI, + MachineBasicBlock &MBB, + MachineBasicBlock::iterator I) { + unsigned curli = sa_.getCurLI()->reg; + MachineInstr *MI = BuildMI(MBB, I, DebugLoc(), tii_.get(TargetOpcode::COPY), + LI.reg).addReg(curli); + SlotIndex DefIdx = lis_.InsertMachineInstrInMaps(MI).getDefIndex(); + return LI.getNextValue(DefIdx, MI, true, lis_.getVNInfoAllocator()); +} + +/// Create a new virtual register and live interval. +void SplitEditor::openIntv() { + assert(!openli_ && "Previous LI not closed before openIntv"); openli_ = createInterval(); + intervals_.push_back(openli_); + liveThrough_ = false; } -/// copyToPHI - Insert a copy to openli at the end of A, and catch it with a -/// PHI def at the beginning of the successor B. This call is ignored if dupli -/// is not live out of A. -void SplitEditor::copyToPHI(MachineBasicBlock &A, MachineBasicBlock &B) { - assert(openli_ && "openLI not called before copyToPHI"); +/// enterIntvAtEnd - Enter openli at the end of MBB. +/// PhiMBB is a successor inside openli where a PHI value is created. +/// Currently, all entries must share the same PhiMBB. +void SplitEditor::enterIntvAtEnd(MachineBasicBlock &A, MachineBasicBlock &B) { + assert(openli_ && "openIntv not called before enterIntvAtEnd"); SlotIndex EndA = lis_.getMBBEndIdx(&A); VNInfo *DupVNIA = dupli_->getVNInfoAt(EndA.getPrevIndex()); if (!DupVNIA) { - DEBUG(dbgs() << " ignoring copyToPHI, dupli not live out of BB#" + DEBUG(dbgs() << " ignoring enterIntvAtEnd, dupli not live out of BB#" << A.getNumber() << ".\n"); return; } - // Insert the COPY instruction at the end of A. - MachineInstr *MI = BuildMI(A, A.getFirstTerminator(), DebugLoc(), - tii_.get(TargetOpcode::COPY), dupli_->reg) - .addReg(openli_->reg); - SlotIndex DefIdx = lis_.InsertMachineInstrInMaps(MI).getDefIndex(); - // Add a phi kill value and live range out of A. - VNInfo *VNIA = openli_->getNextValue(DefIdx, MI, true, - lis_.getVNInfoAllocator()); - openli_->addRange(LiveRange(DefIdx, EndA, VNIA)); + VNInfo *VNIA = insertCopy(*openli_, A, A.getFirstTerminator()); + openli_->addRange(LiveRange(VNIA->def, EndA, VNIA)); + + // FIXME: If this is the only entry edge, we don't need the extra PHI value. + // FIXME: If there are multiple entry blocks (so not a loop), we need proper + // SSA update. // Now look at the start of B. SlotIndex StartB = lis_.getMBBStartIdx(&B); SlotIndex EndB = lis_.getMBBEndIdx(&B); LiveRange *DupB = dupli_->getLiveRangeContaining(StartB); if (!DupB) { - DEBUG(dbgs() << " copyToPHI:, dupli not live in to BB#" + DEBUG(dbgs() << " enterIntvAtEnd: dupli not live in to BB#" << B.getNumber() << ".\n"); return; } @@ -375,16 +397,16 @@ } - DEBUG(dbgs() << " copyToPHI at " << DefIdx << ": " << *openli_ << '\n'); + DEBUG(dbgs() << " enterIntvAtEnd: " << *openli_ << '\n'); } -/// useLI - indicate that all instructions in MBB should use openli. -void SplitEditor::useLI(const MachineBasicBlock &MBB) { - useLI(lis_.getMBBStartIdx(&MBB), lis_.getMBBEndIdx(&MBB)); +/// useIntv - indicate that all instructions in MBB should use openli. +void SplitEditor::useIntv(const MachineBasicBlock &MBB) { + useIntv(lis_.getMBBStartIdx(&MBB), lis_.getMBBEndIdx(&MBB)); } -void SplitEditor::useLI(SlotIndex Start, SlotIndex End) { - assert(openli_ && "openLI not called before useLI"); +void SplitEditor::useIntv(SlotIndex Start, SlotIndex End) { + assert(openli_ && "openIntv not called before useIntv"); // Map the dupli values from the interval into openli_ LiveInterval::const_iterator B = dupli_->begin(), E = dupli_->end(); @@ -392,8 +414,7 @@ if (I != B) { --I; - // I begins before Start, but overlaps. openli may already have a value from - // copyToLI. + // I begins before Start, but overlaps. openli may already have a value. if (I->end > Start && !openli_->liveAt(Start)) openli_->addRange(LiveRange(Start, std::min(End, I->end), mapValue(I->valno))); @@ -408,24 +429,95 @@ << '\n'); } -/// copyFromLI - Insert a copy back to dupli from openli at position I. -SlotIndex SplitEditor::copyFromLI(MachineBasicBlock &MBB, MachineBasicBlock::iterator I) { - assert(openli_ && "openLI not called before copyFromLI"); +/// leaveIntvAtTop - Leave the interval at the top of MBB. +/// Currently, only one value can leave the interval. +void SplitEditor::leaveIntvAtTop(MachineBasicBlock &MBB) { + assert(openli_ && "openIntv not called before leaveIntvAtTop"); + + SlotIndex Start = lis_.getMBBStartIdx(&MBB); + LiveRange *DupLR = dupli_->getLiveRangeContaining(Start); + + // Is dupli even live-in to MBB? + if (!DupLR) { + DEBUG(dbgs() << " leaveIntvAtTop at " << Start << ": not live\n"); + return; + } + + // Is dupli defined by PHI at the beginning of MBB? + bool isPHIDef = DupLR->valno->isPHIDef() && + DupLR->valno->def.getBaseIndex() == Start; + + // If MBB is using a value of dupli that was defined outside the openli range, + // we don't want to copy it back here. + if (!isPHIDef && !openli_->liveAt(DupLR->valno->def)) { + DEBUG(dbgs() << " leaveIntvAtTop at " << Start + << ": using external value\n"); + liveThrough_ = true; + return; + } // Insert the COPY instruction. - MachineInstr *MI = - BuildMI(MBB, I, DebugLoc(), tii_.get(TargetOpcode::COPY), openli_->reg) - .addReg(dupli_->reg); - SlotIndex Idx = lis_.InsertMachineInstrInMaps(MI); + MachineInstr *MI = BuildMI(MBB, MBB.begin(), DebugLoc(), + tii_.get(TargetOpcode::COPY), openli_->reg) + .addReg(dupli_->reg); + SlotIndex Idx = lis_.InsertMachineInstrInMaps(MI).getDefIndex(); + + // Adjust dupli and openli values. + if (isPHIDef) { + // dupli was already a PHI on entry to MBB. Simply insert an openli PHI, + // and shift the dupli def down to the COPY. + VNInfo *VNI = openli_->getNextValue(SlotIndex(Start, true), 0, false, + lis_.getVNInfoAllocator()); + VNI->setIsPHIDef(true); + openli_->addRange(LiveRange(VNI->def, Idx, VNI)); + + dupli_->removeRange(Start, Idx); + DupLR->valno->def = Idx; + DupLR->valno->setIsPHIDef(false); + } else { + // The dupli value was defined somewhere inside the openli range. + DEBUG(dbgs() << " leaveIntvAtTop source value defined at " + << DupLR->valno->def << "\n"); + // FIXME: We may not need a PHI here if all predecessors have the same + // value. + VNInfo *VNI = openli_->getNextValue(SlotIndex(Start, true), 0, false, + lis_.getVNInfoAllocator()); + VNI->setIsPHIDef(true); + openli_->addRange(LiveRange(VNI->def, Idx, VNI)); + + // FIXME: What if DupLR->valno is used by multiple exits? SSA Update. + + // closeIntv is going to remove the superfluous live ranges. + DupLR->valno->def = Idx; + DupLR->valno->setIsPHIDef(false); + } - DEBUG(dbgs() << " copyFromLI at " << Idx << ": " << *openli_ << '\n'); - return Idx; + DEBUG(dbgs() << " leaveIntvAtTop at " << Idx << ": " << *openli_ << '\n'); } -/// closeLI - Indicate that we are done editing the currently open +/// closeIntv - Indicate that we are done editing the currently open /// LiveInterval, and ranges can be trimmed. -void SplitEditor::closeLI() { - assert(openli_ && "openLI not called before closeLI"); +void SplitEditor::closeIntv() { + assert(openli_ && "openIntv not called before closeIntv"); + + DEBUG(dbgs() << " closeIntv cleaning up\n"); + + DEBUG(dbgs() << " dup " << *dupli_ << '\n'); + DEBUG(dbgs() << " open " << *openli_ << '\n'); + + if (liveThrough_) { + DEBUG(dbgs() << " value live through region, leaving dupli as is.\n"); + } else { + // live out with copies inserted, or killed by region. Either way we need to + // remove the overlapping region from dupli. + for (LiveInterval::iterator I = openli_->begin(), E = openli_->end(); + I != E; ++I) { + dupli_->removeRange(I->start, I->end); + } + // FIXME: A block branching to the entry block may also branch elsewhere + // curli is live. We need both openli and curli to be live in that case. + DEBUG(dbgs() << " dup2 " << *dupli_ << '\n'); + } openli_ = 0; } @@ -433,6 +525,39 @@ /// instructions using curli to use the new intervals. void SplitEditor::rewrite() { assert(!openli_ && "Previous LI not closed before rewrite"); + const LiveInterval *curli = sa_.getCurLI(); + for (MachineRegisterInfo::reg_iterator RI = mri_.reg_begin(curli->reg), + RE = mri_.reg_end(); RI != RE;) { + MachineOperand &MO = RI.getOperand(); + MachineInstr *MI = MO.getParent(); + ++RI; + if (MI->isDebugValue()) { + DEBUG(dbgs() << "Zapping " << *MI); + // FIXME: We can do much better with debug values. + MO.setReg(0); + continue; + } + SlotIndex Idx = lis_.getInstructionIndex(MI); + Idx = MO.isUse() ? Idx.getUseIndex() : Idx.getDefIndex(); + LiveInterval *LI = dupli_; + for (unsigned i = firstInterval, e = intervals_.size(); i != e; ++i) { + LiveInterval *testli = intervals_[i]; + if (testli->liveAt(Idx)) { + LI = testli; + break; + } + } + if (LI) + MO.setReg(LI->reg); + DEBUG(dbgs() << "rewrite " << Idx << '\t' << *MI); + } + + // dupli_ goes in last, after rewriting. + if (dupli_) + intervals_.push_back(dupli_); + + // FIXME: *Calculate spill weights, allocation hints, and register classes for + // firstInterval.. } @@ -450,37 +575,29 @@ assert(CriticalExits.empty() && "Cannot break critical exits yet"); // Create new live interval for the loop. - openLI(); + openIntv(); // Insert copies in the predecessors. for (SplitAnalysis::BlockPtrSet::iterator I = Blocks.Preds.begin(), E = Blocks.Preds.end(); I != E; ++I) { MachineBasicBlock &MBB = const_cast(**I); - copyToPHI(MBB, *Loop->getHeader()); + enterIntvAtEnd(MBB, *Loop->getHeader()); } // Switch all loop blocks. for (SplitAnalysis::BlockPtrSet::iterator I = Blocks.Loop.begin(), E = Blocks.Loop.end(); I != E; ++I) - useLI(**I); + useIntv(**I); // Insert back copies in the exit blocks. for (SplitAnalysis::BlockPtrSet::iterator I = Blocks.Exits.begin(), E = Blocks.Exits.end(); I != E; ++I) { MachineBasicBlock &MBB = const_cast(**I); - SlotIndex Start = lis_.getMBBStartIdx(&MBB); - VNInfo *VNI = sa_.getCurLI()->getVNInfoAt(Start); - // Only insert a back copy if curli is live and is either a phi or a value - // defined inside the loop. - if (!VNI) continue; - if (openli_->liveAt(VNI->def) || - (VNI->isPHIDef() && VNI->def.getBaseIndex() == Start)) - copyFromLI(MBB, MBB.begin()); + leaveIntvAtTop(MBB); } // Done. - closeLI(); + closeIntv(); rewrite(); - abort(); } Modified: llvm/trunk/lib/CodeGen/SplitKit.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.h?rev=110257&r1=110256&r2=110257&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SplitKit.h (original) +++ llvm/trunk/lib/CodeGen/SplitKit.h Wed Aug 4 17:08:39 2010 @@ -121,14 +121,14 @@ /// SplitEditor - Edit machine code and LiveIntervals for live range /// splitting. /// -/// 1. Create a SplitEditor from a SplitAnalysis. This will create a new -/// LiveInterval, dupli, that is identical to SA.curli. -/// 2. Start a new live interval with openLI. -/// 3. Insert copies to the new interval with copyTo* and mark the ranges where -/// it should be used with use*. -/// 4. Insert back-copies with copyFromLI. -/// 5. Finish the current LI with closeLI and repeat from 2. -/// 6. Rewrite instructions with rewrite(). +/// - Create a SplitEditor from a SplitAnalysis. This will create a new +/// LiveInterval, dupli, that is identical to SA.curli. +/// - Start a new live interval with openIntv. +/// - Mark the places where the new interval is entered using enterIntv* +/// - Mark the ranges where the new interval is used with useIntv* +/// - Mark the places where the interval is exited with exitIntv*. +/// - Finish the current interval with closeIntv and repeat from 2. +/// - Rewrite instructions with rewrite(). /// class SplitEditor { SplitAnalysis &sa_; @@ -138,7 +138,7 @@ const TargetInstrInfo &tii_; /// dupli_ - Created as a copy of sa_.curli_, ranges are carved out as new - /// intervals get added through openLI / closeLI. + /// intervals get added through openIntv / closeIntv. LiveInterval *dupli_; /// Currently open LiveInterval. @@ -148,43 +148,60 @@ /// register class and spill slot as curli. LiveInterval *createInterval(); - /// valueMap_ - Map values in dupli to values in openli. These are direct 1-1 + /// valueMap_ - Map values in dupli to values in openIntv. These are direct 1-1 /// mappings, and do not include values created by inserted copies. DenseMap valueMap_; - /// mapValue - Return the openli value that corresponds to the given dupli + /// mapValue - Return the openIntv value that corresponds to the given dupli /// value. - VNInfo *mapValue(VNInfo *dupliVNI); + VNInfo *mapValue(VNInfo *dupliVNI); + + /// A dupli value is live through openIntv. + bool liveThrough_; + + /// All the new intervals created for this split are added to intervals_. + std::vector &intervals_; + + /// The index into intervals_ of the first interval we added. There may be + /// others from before we got it. + unsigned firstInterval; + + /// Insert a COPY instruction curli -> li. Allocate a new value from li + /// defined by the COPY + VNInfo *insertCopy(LiveInterval &LI, + MachineBasicBlock &MBB, + MachineBasicBlock::iterator I); public: /// Create a new SplitEditor for editing the LiveInterval analyzed by SA. - SplitEditor(SplitAnalysis&, LiveIntervals&, VirtRegMap&); + /// Newly created intervals will be appended to newIntervals. + SplitEditor(SplitAnalysis &SA, LiveIntervals&, VirtRegMap&, + std::vector &newIntervals); /// getAnalysis - Get the corresponding analysis. SplitAnalysis &getAnalysis() { return sa_; } - /// Create a new virtual register and live interval to be used by following - /// use* and copy* calls. - void openLI(); - - /// copyToPHI - Insert a copy to openli at the end of A, and catch it with a - /// PHI def at the beginning of the successor B. This call is ignored if dupli - /// is not live out of A. - void copyToPHI(MachineBasicBlock &A, MachineBasicBlock &B); - - /// useLI - indicate that all instructions in MBB should use openli. - void useLI(const MachineBasicBlock &MBB); - - /// useLI - indicate that all instructions in range should use openli. - void useLI(SlotIndex Start, SlotIndex End); - - /// copyFromLI - Insert a copy back to dupli from openli at position I. - /// This also marks the remainder of MBB as not used by openli. - SlotIndex copyFromLI(MachineBasicBlock &MBB, MachineBasicBlock::iterator I); + /// Create a new virtual register and live interval. + void openIntv(); + + /// enterIntvAtEnd - Enter openli at the end of MBB. + /// PhiMBB is a successor inside openli where a PHI value is created. + /// Currently, all entries must share the same PhiMBB. + void enterIntvAtEnd(MachineBasicBlock &MBB, MachineBasicBlock &PhiMBB); + + /// useIntv - indicate that all instructions in MBB should use openli. + void useIntv(const MachineBasicBlock &MBB); + + /// useIntv - indicate that all instructions in range should use openli. + void useIntv(SlotIndex Start, SlotIndex End); + + /// leaveIntvAtTop - Leave the interval at the top of MBB. + /// Currently, only one value can leave the interval. + void leaveIntvAtTop(MachineBasicBlock &MBB); - /// closeLI - Indicate that we are done editing the currently open + /// closeIntv - Indicate that we are done editing the currently open /// LiveInterval, and ranges can be trimmed. - void closeLI(); + void closeIntv(); /// rewrite - after all the new live ranges have been created, rewrite /// instructions using curli to use the new intervals. From grosbach at apple.com Wed Aug 4 17:10:15 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 04 Aug 2010 22:10:15 -0000 Subject: [llvm-commits] [llvm] r110258 - /llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Message-ID: <20100804221015.2A1D62A6C12C@llvm.org> Author: grosbach Date: Wed Aug 4 17:10:15 2010 New Revision: 110258 URL: http://llvm.org/viewvc/llvm-project?rev=110258&view=rev Log: Reserve a stack slot if the function adjusts the stack but doesn't simplify the call frame pseudo instructions. In that situation, the calculations for estimating the stack size will be way off, leading to not having an emergency spill slot when we need one. It should be possible to be more precise about tracking the adjustment values, but not really necessary for correctness. Upcoming cleanups for PEI in general will render that moot. Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=110258&r1=110257&r2=110258&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Wed Aug 4 17:10:15 2010 @@ -851,13 +851,18 @@ // slot of the previous FP. Also, if we have variable sized objects in the // function, stack slot references will often be negative, and some of // our instructions are positive-offset only, so conservatively consider - // that case to want a spill slot (or register) as well. + // that case to want a spill slot (or register) as well. Similarly, if + // the function adjusts the stack pointer during execution and the + // adjustments aren't already part of our stack size estimate, our offset + // calculations may be off, so be conservative. // FIXME: We could add logic to be more precise about negative offsets // and which instructions will need a scratch register for them. Is it // worth the effort and added fragility? bool BigStack = (RS && (estimateStackSize(MF) + (hasFP(MF) ? 4:0) >= - estimateRSStackSizeLimit(MF))) || MFI->hasVarSizedObjects(); + estimateRSStackSizeLimit(MF)) + || MFI->hasVarSizedObjects() + || (MFI->adjustsStack() && !canSimplifyCallFramePseudos(MF))); bool ExtraCSSpill = false; if (BigStack || !CanEliminateFrame || cannotEliminateFrame(MF)) { From grosbach at apple.com Wed Aug 4 17:12:43 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 04 Aug 2010 22:12:43 -0000 Subject: [llvm-commits] [llvm] r110259 - /llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Message-ID: <20100804221243.DA42A2A6C12C@llvm.org> Author: grosbach Date: Wed Aug 4 17:12:43 2010 New Revision: 110259 URL: http://llvm.org/viewvc/llvm-project?rev=110259&view=rev Log: oops. revert for a moment to clean up tests first. Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=110259&r1=110258&r2=110259&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Wed Aug 4 17:12:43 2010 @@ -851,18 +851,13 @@ // slot of the previous FP. Also, if we have variable sized objects in the // function, stack slot references will often be negative, and some of // our instructions are positive-offset only, so conservatively consider - // that case to want a spill slot (or register) as well. Similarly, if - // the function adjusts the stack pointer during execution and the - // adjustments aren't already part of our stack size estimate, our offset - // calculations may be off, so be conservative. + // that case to want a spill slot (or register) as well. // FIXME: We could add logic to be more precise about negative offsets // and which instructions will need a scratch register for them. Is it // worth the effort and added fragility? bool BigStack = (RS && (estimateStackSize(MF) + (hasFP(MF) ? 4:0) >= - estimateRSStackSizeLimit(MF)) - || MFI->hasVarSizedObjects() - || (MFI->adjustsStack() && !canSimplifyCallFramePseudos(MF))); + estimateRSStackSizeLimit(MF))) || MFI->hasVarSizedObjects(); bool ExtraCSSpill = false; if (BigStack || !CanEliminateFrame || cannotEliminateFrame(MF)) { From stoklund at 2pi.dk Wed Aug 4 17:35:11 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 04 Aug 2010 22:35:11 -0000 Subject: [llvm-commits] [llvm] r110266 - /llvm/trunk/lib/CodeGen/InlineSpiller.cpp Message-ID: <20100804223511.959952A6C12C@llvm.org> Author: stoklund Date: Wed Aug 4 17:35:11 2010 New Revision: 110266 URL: http://llvm.org/viewvc/llvm-project?rev=110266&view=rev Log: Coalesce stack slot accesses that arise when spilling both sides of a COPY. This helps avoid silly code: %R0 STORE , %R0 Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/InlineSpiller.cpp?rev=110266&r1=110265&r2=110266&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/InlineSpiller.cpp (original) +++ llvm/trunk/lib/CodeGen/InlineSpiller.cpp Wed Aug 4 17:35:11 2010 @@ -85,6 +85,7 @@ bool reMaterializeFor(MachineBasicBlock::iterator MI); void reMaterializeAll(); + bool coalesceStackAccess(MachineInstr *MI); bool foldMemoryOperand(MachineBasicBlock::iterator MI, const SmallVectorImpl &Ops); void insertReload(LiveInterval &NewLI, MachineBasicBlock::iterator MI); @@ -291,6 +292,24 @@ } } +/// If MI is a load or store of stackSlot_, it can be removed. +bool InlineSpiller::coalesceStackAccess(MachineInstr *MI) { + int FI = 0; + unsigned reg; + if (!(reg = tii_.isLoadFromStackSlot(MI, FI)) && + !(reg = tii_.isStoreToStackSlot(MI, FI))) + return false; + + // We have a stack access. Is it the right register and slot? + if (reg != li_->reg || FI != stackSlot_) + return false; + + DEBUG(dbgs() << "Coalescing stack access: " << *MI); + lis_.RemoveMachineInstrFromMaps(MI); + MI->eraseFromParent(); + return true; +} + /// foldMemoryOperand - Try folding stack slot references in Ops into MI. /// Return true on success, and MI will be erased. bool InlineSpiller::foldMemoryOperand(MachineBasicBlock::iterator MI, @@ -399,6 +418,10 @@ continue; } + // Stack slot accesses may coalesce away. + if (coalesceStackAccess(MI)) + continue; + // Analyze instruction. bool Reads, Writes; SmallVector Ops; From dpatel at apple.com Wed Aug 4 17:39:39 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 04 Aug 2010 22:39:39 -0000 Subject: [llvm-commits] [llvm] r110267 - /llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Message-ID: <20100804223939.87F552A6C12C@llvm.org> Author: dpatel Date: Wed Aug 4 17:39:39 2010 New Revision: 110267 URL: http://llvm.org/viewvc/llvm-project?rev=110267&view=rev Log: Implement target specific getDebugValueLocation(). Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp?rev=110267&r1=110266&r2=110267&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Wed Aug 4 17:39:39 2010 @@ -47,6 +47,7 @@ #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" #include @@ -205,6 +206,18 @@ void EmitStartOfAsmFile(Module &M); void EmitEndOfAsmFile(Module &M); + MachineLocation getDebugValueLocation(const MachineInstr *MI) const { + MachineLocation Location; + assert (MI->getNumOperands() == 4 && "Invalid no. of machine operands!"); + // Frame address. Currently handles register +- offset only. + if (MI->getOperand(0).isReg() && MI->getOperand(1).isImm()) + Location.set(MI->getOperand(0).getReg(), MI->getOperand(1).getImm()); + else { + DEBUG(dbgs() << "DBG_VALUE instruction ignored! " << *MI << "\n"); + } + return Location; + } + virtual unsigned getISAEncoding() { // ARM/Darwin adds ISA to the DWARF info for each function. if (!Subtarget->isTargetDarwin()) From eli.friedman at gmail.com Wed Aug 4 17:40:58 2010 From: eli.friedman at gmail.com (Eli Friedman) Date: Wed, 04 Aug 2010 22:40:58 -0000 Subject: [llvm-commits] [llvm] r110268 - in /llvm/trunk: lib/Target/X86/X86ISelDAGToDAG.cpp test/CodeGen/X86/2010-08-04-MaskedSignedCompare.ll Message-ID: <20100804224058.6E8BB2A6C12C@llvm.org> Author: efriedma Date: Wed Aug 4 17:40:58 2010 New Revision: 110268 URL: http://llvm.org/viewvc/llvm-project?rev=110268&view=rev Log: PR7814: Truncates cannot be ignored for signed comparisons. Added: llvm/trunk/test/CodeGen/X86/2010-08-04-MaskedSignedCompare.ll Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=110268&r1=110267&r2=110268&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Aug 4 17:40:58 2010 @@ -1841,7 +1841,8 @@ // Look for (X86cmp (and $op, $imm), 0) and see if we can convert it to // use a smaller encoding. - if (N0.getOpcode() == ISD::TRUNCATE && N0.hasOneUse()) + if (N0.getOpcode() == ISD::TRUNCATE && N0.hasOneUse() && + HasNoSignedComparisonUses(Node)) // Look past the truncate if CMP is the only use of it. N0 = N0.getOperand(0); if (N0.getNode()->getOpcode() == ISD::AND && N0.getNode()->hasOneUse() && Added: llvm/trunk/test/CodeGen/X86/2010-08-04-MaskedSignedCompare.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-08-04-MaskedSignedCompare.ll?rev=110268&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2010-08-04-MaskedSignedCompare.ll (added) +++ llvm/trunk/test/CodeGen/X86/2010-08-04-MaskedSignedCompare.ll Wed Aug 4 17:40:58 2010 @@ -0,0 +1,36 @@ +; RUN: llc < %s -march=x86-64 | FileCheck %s +; PR7814 + + at g_16 = global i64 -3738643449681751625, align 8 ; [#uses=1] + at g_38 = global i32 0, align 4 ; [#uses=2] + at .str = private constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] + +define i32 @main() nounwind { +entry: + %tmp = load i64* @g_16 ; [#uses=1] + %not.lnot = icmp ne i64 %tmp, 0 ; [#uses=1] + %conv = sext i1 %not.lnot to i64 ; [#uses=1] + %and = and i64 %conv, 150 ; [#uses=1] + %conv.i = trunc i64 %and to i8 ; [#uses=1] + %cmp = icmp sgt i8 %conv.i, 0 ; [#uses=1] + br i1 %cmp, label %if.then, label %entry.if.end_crit_edge + +; CHECK: andl $150 +; CHECK-NEXT: testb +; CHECK-NEXT: jg + +entry.if.end_crit_edge: ; preds = %entry + %tmp4.pre = load i32* @g_38 ; [#uses=1] + br label %if.end + +if.then: ; preds = %entry + store i32 1, i32* @g_38 + br label %if.end + +if.end: ; preds = %entry.if.end_crit_edge, %if.then + %tmp4 = phi i32 [ %tmp4.pre, %entry.if.end_crit_edge ], [ 1, %if.then ] ; [#uses=1] + %call5 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %tmp4) nounwind ; [#uses=0] + ret i32 0 +} + +declare i32 @printf(i8* nocapture, ...) nounwind From grosbach at apple.com Wed Aug 4 17:46:09 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 04 Aug 2010 22:46:09 -0000 Subject: [llvm-commits] [llvm] r110269 - /llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Message-ID: <20100804224609.7C0932A6C12C@llvm.org> Author: grosbach Date: Wed Aug 4 17:46:09 2010 New Revision: 110269 URL: http://llvm.org/viewvc/llvm-project?rev=110269&view=rev Log: and back in. false alarm on the tests from another unrelated local change. Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=110269&r1=110268&r2=110269&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Wed Aug 4 17:46:09 2010 @@ -851,13 +851,18 @@ // slot of the previous FP. Also, if we have variable sized objects in the // function, stack slot references will often be negative, and some of // our instructions are positive-offset only, so conservatively consider - // that case to want a spill slot (or register) as well. + // that case to want a spill slot (or register) as well. Similarly, if + // the function adjusts the stack pointer during execution and the + // adjustments aren't already part of our stack size estimate, our offset + // calculations may be off, so be conservative. // FIXME: We could add logic to be more precise about negative offsets // and which instructions will need a scratch register for them. Is it // worth the effort and added fragility? bool BigStack = (RS && (estimateStackSize(MF) + (hasFP(MF) ? 4:0) >= - estimateRSStackSizeLimit(MF))) || MFI->hasVarSizedObjects(); + estimateRSStackSizeLimit(MF)) + || MFI->hasVarSizedObjects() + || (MFI->adjustsStack() && !canSimplifyCallFramePseudos(MF))); bool ExtraCSSpill = false; if (BigStack || !CanEliminateFrame || cannotEliminateFrame(MF)) { From gohman at apple.com Wed Aug 4 17:56:30 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 22:56:30 -0000 Subject: [llvm-commits] [llvm] r110270 - in /llvm/trunk: lib/Analysis/AliasAnalysisEvaluator.cpp lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/args-rets-allocas-loads.ll test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Message-ID: <20100804225630.194BF2A6C12C@llvm.org> Author: djg Date: Wed Aug 4 17:56:29 2010 New Revision: 110270 URL: http://llvm.org/viewvc/llvm-project?rev=110270&view=rev Log: The two-callsite form of AliasAnalysis::getModRefInfo is documented to return Ref if the left callsite only reads memory read or written by the right callsite; fix BasicAliasAnalysis to implement this. Add AliasAnalysisEvaluator support for testing the two-callsite form of getModRefInfo. Added: llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=110270&r1=110269&r2=110270&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Wed Aug 4 17:56:29 2010 @@ -107,6 +107,15 @@ } } +static inline void +PrintModRefResults(const char *Msg, bool P, CallSite CSA, CallSite CSB, + Module *M) { + if (P) { + errs() << " " << Msg << ": " << *CSA.getInstruction() + << " <-> " << *CSB.getInstruction() << '\n'; + } +} + static inline bool isInterestingPointer(Value *V) { return V->getType()->isPointerTy() && !isa(V); @@ -209,6 +218,29 @@ } } + // Mod/ref alias analysis: compare all pairs of calls + for (SetVector::iterator C = CallSites.begin(), + Ce = CallSites.end(); C != Ce; ++C) { + for (SetVector::iterator D = CallSites.begin(); D != Ce; ++D) { + if (D == C) + continue; + switch (AA.getModRefInfo(*C, *D)) { + case AliasAnalysis::NoModRef: + PrintModRefResults("NoModRef", PrintNoModRef, *C, *D, F.getParent()); + ++NoModRef; break; + case AliasAnalysis::Mod: + PrintModRefResults(" Mod", PrintMod, *C, *D, F.getParent()); + ++Mod; break; + case AliasAnalysis::Ref: + PrintModRefResults(" Ref", PrintRef, *C, *D, F.getParent()); + ++Ref; break; + case AliasAnalysis::ModRef: + PrintModRefResults(" ModRef", PrintModRef, *C, *D, F.getParent()); + ++ModRef; break; + } + } + } + return false; } Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110270&r1=110269&r2=110270&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Aug 4 17:56:29 2010 @@ -425,8 +425,8 @@ ModRefBehavior CS2B = AliasAnalysis::getModRefBehavior(CS2); if (CS2B == DoesNotAccessMemory) return NoModRef; - // If they both only read from memory, just return ref. - if (CS1B == OnlyReadsMemory && CS2B == OnlyReadsMemory) + // If CS1 only reads from memory, just return ref. + if (CS1B == OnlyReadsMemory) return Ref; // Otherwise, fall back to NoAA (mod+ref). Modified: llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll?rev=110270&r1=110269&r2=110270&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll Wed Aug 4 17:56:29 2010 @@ -302,9 +302,9 @@ ; CHECK: 36 may alias responses (30.0%) ; CHECK: 0 must alias responses (0.0%) ; CHECK: Alias Analysis Evaluator Pointer Alias Summary: 70%/30%/0% -; CHECK: 128 Total ModRef Queries Performed -; CHECK: 44 no mod/ref responses (34.3%) +; CHECK: 184 Total ModRef Queries Performed +; CHECK: 44 no mod/ref responses (23.9%) ; CHECK: 0 mod responses (0.0%) ; CHECK: 0 ref responses (0.0%) -; CHECK: 84 mod & ref responses (65.6%) -; CHECK: Alias Analysis Evaluator Mod/Ref Summary: 34%/0%/0%/65% +; CHECK: 140 mod & ref responses (76.0%) +; CHECK: Alias Analysis Evaluator Mod/Ref Summary: 23%/0%/0%/76% Added: llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll?rev=110270&view=auto ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll (added) +++ llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Wed Aug 4 17:56:29 2010 @@ -0,0 +1,12 @@ +; RUN: opt < %s -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s + +; CHECK: {{[[:<:]]}}Ref: call void @ro() <-> call void @f0() + +declare void @f0() +declare void @ro() readonly + +define void @test() { + call void @f0() + call void @ro() + ret void +} From isanbard at gmail.com Wed Aug 4 17:57:30 2010 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 04 Aug 2010 22:57:30 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r110272 - /llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin Message-ID: <20100804225730.CE7652A6C12C@llvm.org> Author: void Date: Wed Aug 4 17:57:30 2010 New Revision: 110272 URL: http://llvm.org/viewvc/llvm-project?rev=110272&view=rev Log: Build PPC against the SDK. Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin?rev=110272&r1=110271&r2=110272&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin (original) +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin Wed Aug 4 17:57:30 2010 @@ -26,8 +26,8 @@ # APPLE LOCAL end gcov 5573505 # APPLE LOCAL 5901604 6499452 -# LLVM LOCAL begin -#MULTILIB_EXTRA_OPTS = isysroot/Developer/SDKs/MacOSX10.5.sdk mmacosx-version-min=10.5 +# LLVM LOCAL begin 8260893 +MULTILIB_EXTRA_OPTS = isysroot/Developer/SDKs/MacOSX10.6.sdk mmacosx-version-min=10.6 # LLVM LOCAL end # Export the _xlq* symbols from darwin-ldouble.c. From echristo at apple.com Wed Aug 4 18:03:05 2010 From: echristo at apple.com (Eric Christopher) Date: Wed, 04 Aug 2010 23:03:05 -0000 Subject: [llvm-commits] [llvm] r110274 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Instr64bit.td X86InstrInfo.td Message-ID: <20100804230305.4A6162A6C12C@llvm.org> Author: echristo Date: Wed Aug 4 18:03:04 2010 New Revision: 110274 URL: http://llvm.org/viewvc/llvm-project?rev=110274&view=rev Log: Make x86-64 membarriers work without sse and clean up some of the uses. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=110274&r1=110273&r2=110274&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Aug 4 18:03:04 2010 @@ -7654,9 +7654,12 @@ SDValue X86TargetLowering::LowerMEMBARRIER(SDValue Op, SelectionDAG &DAG) const{ DebugLoc dl = Op.getDebugLoc(); - if (!Subtarget->hasSSE2()) + if (!Subtarget->hasSSE2()) { + SDValue Zero = DAG.getConstant(0, + Subtarget->is64Bit() ? MVT::i64 : MVT::i32); return DAG.getNode(X86ISD::MEMBARRIER, dl, MVT::Other, Op.getOperand(0), - DAG.getConstant(0, MVT::i32)); + Zero); + } unsigned isDev = cast(Op.getOperand(5))->getZExtValue(); if(!isDev) Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=110274&r1=110273&r2=110274&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Wed Aug 4 18:03:04 2010 @@ -1619,6 +1619,13 @@ // Atomic Instructions //===----------------------------------------------------------------------===// +// TODO: Get this to fold the constant into the instruction. +let Defs = [ESP] in +def Int_MemBarrierNoSSE64 : RI<0x09, MRM1r, (outs), (ins GR64:$zero), + "lock\n\t" + "or{q}\t{$zero, (%rsp)|(%rsp), $zero}", + [(X86MemBarrierNoSSE GR64:$zero)]>, LOCK; + let Defs = [RAX, EFLAGS], Uses = [RAX] in { def LCMPXCHG64 : RI<0xB1, MRMDestMem, (outs), (ins i64mem:$ptr, GR64:$swap), "lock\n\t" Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=110274&r1=110273&r2=110274&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Wed Aug 4 18:03:04 2010 @@ -3934,8 +3934,8 @@ [(X86MemBarrier)]>, Requires<[HasSSE2]>; // TODO: Get this to fold the constant into the instruction. -let Uses = [ESP] in -def Int_MemBarrierNoSSE : I<0x0B, Pseudo, (outs), (ins GR32:$zero), +let Defs = [ESP] in +def Int_MemBarrierNoSSE : I<0x09, MRM1r, (outs), (ins GR32:$zero), "lock\n\t" "or{l}\t{$zero, (%esp)|(%esp), $zero}", [(X86MemBarrierNoSSE GR32:$zero)]>, LOCK; From gohman at apple.com Wed Aug 4 18:08:15 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 23:08:15 -0000 Subject: [llvm-commits] [llvm] r110277 - /llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Message-ID: <20100804230815.AAA242A6C12C@llvm.org> Author: djg Date: Wed Aug 4 18:08:15 2010 New Revision: 110277 URL: http://llvm.org/viewvc/llvm-project?rev=110277&view=rev Log: Delete obsolete comments. Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=110277&r1=110276&r2=110277&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Wed Aug 4 18:08:15 2010 @@ -140,17 +140,11 @@ // AccessesArguments - This function accesses function arguments in well // known (possibly volatile) ways, but does not access any other memory. - // - // Clients may use the Info parameter of getModRefBehavior to get specific - // information about how pointer arguments are used. AccessesArguments, // AccessesArgumentsAndGlobals - This function has accesses function // arguments and global variables well known (possibly volatile) ways, but // does not access any other memory. - // - // Clients may use the Info parameter of getModRefBehavior to get specific - // information about how pointer arguments are used. AccessesArgumentsAndGlobals, // OnlyReadsMemory - This function does not perform any non-local stores or From blaine at apple.com Wed Aug 4 18:34:21 2010 From: blaine at apple.com (Blaine Garst) Date: Wed, 04 Aug 2010 23:34:21 -0000 Subject: [llvm-commits] [compiler-rt] r110278 - /compiler-rt/trunk/BlocksRuntime/tests/ Message-ID: <20100804233422.4BA772A6C12C@llvm.org> Author: blaine Date: Wed Aug 4 18:34:21 2010 New Revision: 110278 URL: http://llvm.org/viewvc/llvm-project?rev=110278&view=rev Log: add unit tests Added: compiler-rt/trunk/BlocksRuntime/tests/ compiler-rt/trunk/BlocksRuntime/tests/block-static.c compiler-rt/trunk/BlocksRuntime/tests/blockimport.c compiler-rt/trunk/BlocksRuntime/tests/byrefaccess.c compiler-rt/trunk/BlocksRuntime/tests/byrefcopy.c compiler-rt/trunk/BlocksRuntime/tests/byrefcopycopy.c compiler-rt/trunk/BlocksRuntime/tests/byrefcopyinner.c compiler-rt/trunk/BlocksRuntime/tests/byrefcopyint.c compiler-rt/trunk/BlocksRuntime/tests/byrefcopystack.c compiler-rt/trunk/BlocksRuntime/tests/byrefsanity.c compiler-rt/trunk/BlocksRuntime/tests/byrefstruct.c compiler-rt/trunk/BlocksRuntime/tests/c99.c compiler-rt/trunk/BlocksRuntime/tests/cast.c compiler-rt/trunk/BlocksRuntime/tests/constassign.c compiler-rt/trunk/BlocksRuntime/tests/copy-block-literal-rdar6439600.c compiler-rt/trunk/BlocksRuntime/tests/copyconstructor.C compiler-rt/trunk/BlocksRuntime/tests/copynull.c compiler-rt/trunk/BlocksRuntime/tests/dispatch_async.c compiler-rt/trunk/BlocksRuntime/tests/dispatch_call_Block_with_release.c compiler-rt/trunk/BlocksRuntime/tests/fail.c compiler-rt/trunk/BlocksRuntime/tests/flagsisa.c compiler-rt/trunk/BlocksRuntime/tests/globalexpression.c compiler-rt/trunk/BlocksRuntime/tests/goto.c compiler-rt/trunk/BlocksRuntime/tests/hasdescriptor.c compiler-rt/trunk/BlocksRuntime/tests/josh.C compiler-rt/trunk/BlocksRuntime/tests/k-and-r.c compiler-rt/trunk/BlocksRuntime/tests/large-struct.c compiler-rt/trunk/BlocksRuntime/tests/localisglobal.c compiler-rt/trunk/BlocksRuntime/tests/macro.c compiler-rt/trunk/BlocksRuntime/tests/makefile compiler-rt/trunk/BlocksRuntime/tests/modglobal.c compiler-rt/trunk/BlocksRuntime/tests/nestedimport.c compiler-rt/trunk/BlocksRuntime/tests/nullblockisa.c compiler-rt/trunk/BlocksRuntime/tests/objectRRGC.c compiler-rt/trunk/BlocksRuntime/tests/objectassign.c compiler-rt/trunk/BlocksRuntime/tests/orbars.c compiler-rt/trunk/BlocksRuntime/tests/rdar6396238.c compiler-rt/trunk/BlocksRuntime/tests/rdar6405500.c compiler-rt/trunk/BlocksRuntime/tests/rdar6414583.c compiler-rt/trunk/BlocksRuntime/tests/recursive-block.c compiler-rt/trunk/BlocksRuntime/tests/recursive-test.c compiler-rt/trunk/BlocksRuntime/tests/recursiveassign.c compiler-rt/trunk/BlocksRuntime/tests/reference.C compiler-rt/trunk/BlocksRuntime/tests/rettypepromotion.c compiler-rt/trunk/BlocksRuntime/tests/returnfunctionptr.c compiler-rt/trunk/BlocksRuntime/tests/shorthandexpression.c compiler-rt/trunk/BlocksRuntime/tests/sizeof.c compiler-rt/trunk/BlocksRuntime/tests/small-struct.c compiler-rt/trunk/BlocksRuntime/tests/structmember.c compiler-rt/trunk/BlocksRuntime/tests/testfilerunner.h compiler-rt/trunk/BlocksRuntime/tests/testfilerunner.m compiler-rt/trunk/BlocksRuntime/tests/varargs-bad-assign.c compiler-rt/trunk/BlocksRuntime/tests/varargs.c compiler-rt/trunk/BlocksRuntime/tests/variadic.c compiler-rt/trunk/BlocksRuntime/tests/voidarg.c Added: compiler-rt/trunk/BlocksRuntime/tests/block-static.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/block-static.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/block-static.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/block-static.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,25 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// testfilerunner CONFIG + +#include + + +int main(int argc, char **argv) { + static int numberOfSquesals = 5; + + ^{ numberOfSquesals = 6; }(); + + if (numberOfSquesals == 6) { + printf("%s: success\n", argv[0]); + return 0; + } + printf("**** did not update static local, rdar://6177162\n"); + return 1; + +} + Added: compiler-rt/trunk/BlocksRuntime/tests/blockimport.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/blockimport.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/blockimport.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/blockimport.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,51 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * blockimport.c + * testObjects + * + * Created by Blaine Garst on 10/13/08. + * + */ + + +// +// pure C nothing more needed +// CONFIG rdar://6289344 + +#include +#include +#include + + + + +int main(int argc, char *argv[]) { + int i = 1; + int (^intblock)(void) = ^{ return i*10; }; + + void (^vv)(void) = ^{ + if (argc > 0) { + printf("intblock returns %d\n", intblock()); + } + }; + +#if 0 + //printf("Block dump %s\n", _Block_dump(vv)); + { + struct Block_layout *layout = (struct Block_layout *)(void *)vv; + printf("isa %p\n", layout->isa); + printf("flags %x\n", layout->flags); + printf("descriptor %p\n", layout->descriptor); + printf("descriptor->size %d\n", layout->descriptor->size); + } +#endif + void (^vvcopy)(void) = Block_copy(vv); + Block_release(vvcopy); + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/byrefaccess.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/byrefaccess.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/byrefaccess.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/byrefaccess.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,34 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// +// byrefaccess.m +// test that byref access to locals is accurate +// testObjects +// +// Created by Blaine Garst on 5/13/08. +// +// CONFIG + +#include + + +void callVoidVoid(void (^closure)(void)) { + closure(); +} + +int main(int argc, char *argv[]) { + __block int i = 10; + + callVoidVoid(^{ ++i; }); + + if (i != 11) { + printf("*** %s didn't update i\n", argv[0]); + return 1; + } + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/byrefcopy.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/byrefcopy.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/byrefcopy.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/byrefcopy.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,41 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// +// byrefcopy.m +// testObjects +// +// Created by Blaine Garst on 5/13/08. +// + +#include +#include +#include + +// CONFIG + +void callVoidVoid(void (^closure)(void)) { + closure(); +} + +int main(int argc, char *argv[]) { + int __block i = 10; + + void (^block)(void) = ^{ ++i; }; + //printf("original (old style) is %s\n", _Block_dump_old(block)); + //printf("original (new style) is %s\n", _Block_dump(block)); + void (^blockcopy)(void) = Block_copy(block); + //printf("copy is %s\n", _Block_dump(blockcopy)); + // use a copy & see that it updates i + callVoidVoid(block); + + if (i != 11) { + printf("*** %s didn't update i\n", argv[0]); + return 1; + } + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/byrefcopycopy.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/byrefcopycopy.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/byrefcopycopy.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/byrefcopycopy.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,46 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// CONFIG rdar://6255170 + +#include +#include +#include +#include +#include +#include + + +int +main(int argc, char *argv[]) +{ + __block int var = 0; + int shouldbe = 0; + void (^b)(void) = ^{ var++; /*printf("var is at %p with value %d\n", &var, var);*/ }; + __typeof(b) _b; + //printf("before copy...\n"); + b(); ++shouldbe; + size_t i; + + for (i = 0; i < 10; i++) { + _b = Block_copy(b); // make a new copy each time + assert(_b); + ++shouldbe; + _b(); // should still update the stack + Block_release(_b); + } + + //printf("after...\n"); + b(); ++shouldbe; + + if (var != shouldbe) { + printf("Hmm, var is %d but should be %d\n", var, shouldbe); + return 1; + } + printf("%s: Success!!\n", argv[0]); + + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/byrefcopyinner.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/byrefcopyinner.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/byrefcopyinner.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/byrefcopyinner.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,32 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +#include +#include + +// CONFIG rdar://6225809 +// fixed in 5623 + +int main(int argc, char *argv[]) { + __block int a = 42; + int* ap = &a; // just to keep the address on the stack. + + void (^b)(void) = ^{ + //a; // workaround, a should be implicitly imported + Block_copy(^{ + a = 2; + }); + }; + + Block_copy(b); + + if(&a == ap) { + printf("**** __block heap storage should have been created at this point\n"); + return 1; + } + printf("%s: Success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/byrefcopyint.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/byrefcopyint.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/byrefcopyint.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/byrefcopyint.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,69 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * byrefcopyint.c + * testObjects + * + * Created by Blaine Garst on 12/1/08. + * + */ + +// +// byrefcopyid.m +// testObjects +// +// Created by Blaine Garst on 5/13/08. +// + +// Tests copying of blocks with byref ints +// CONFIG rdar://6414583 -C99 + +#include +#include +#include +#include + + + + +typedef void (^voidVoid)(void); + +voidVoid dummy; + +void callVoidVoid(voidVoid closure) { + closure(); +} + + +voidVoid testRoutine(const char *whoami) { + __block int dumbo = strlen(whoami); + dummy = ^{ + //printf("incring dumbo from %d\n", dumbo); + ++dumbo; + }; + + + voidVoid copy = Block_copy(dummy); + + + return copy; +} + +int main(int argc, char *argv[]) { + voidVoid array[100]; + for (int i = 0; i < 100; ++i) { + array[i] = testRoutine(argv[0]); + array[i](); + } + for (int i = 0; i < 100; ++i) { + Block_release(array[i]); + } + + + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/byrefcopystack.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/byrefcopystack.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/byrefcopystack.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/byrefcopystack.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,41 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// +// byrefcopystack.m +// testObjects +// +// Created by Blaine Garst on 5/13/08. +// + + + +#include +#include + +// CONFIG rdar://6255170 + +void (^bumpi)(void); +int (^geti)(void); + +void setClosures() { + int __block i = 10; + bumpi = Block_copy(^{ ++i; }); + geti = Block_copy(^{ return i; }); +} + +int main(int argc, char *argv[]) { + setClosures(); + bumpi(); + int i = geti(); + + if (i != 11) { + printf("*** %s didn't update i\n", argv[0]); + return 1; + } + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/byrefsanity.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/byrefsanity.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/byrefsanity.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/byrefsanity.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,73 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// CONFIG + + +#include +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + __block int var = 0; + void (^b)(void) = ^{ var++; }; + + //sanity(b); + b(); + printf("%s: success!\n", argv[0]); + return 0; +} + + +#if 1 +/* replicated internal data structures: BEWARE, MAY CHANGE!!! */ + +enum { + BLOCK_REFCOUNT_MASK = (0xffff), + BLOCK_NEEDS_FREE = (1 << 24), + BLOCK_HAS_COPY_DISPOSE = (1 << 25), + BLOCK_NO_COPY = (1 << 26), // interim byref: no copies allowed + BLOCK_IS_GC = (1 << 27), + BLOCK_IS_GLOBAL = (1 << 28), +}; + +struct byref_id { + struct byref_id *forwarding; + int flags;//refcount; + int size; + void (*byref_keep)(struct byref_id *dst, struct byref_id *src); + void (*byref_destroy)(struct byref_id *); + int var; +}; +struct Block_basic2 { + void *isa; + int Block_flags; // int32_t + int Block_size; // XXX should be packed into Block_flags + void (*Block_invoke)(void *); + void (*Block_copy)(void *dst, void *src); + void (*Block_dispose)(void *); + struct byref_id *ref; +}; + +void sanity(void *arg) { + struct Block_basic2 *bb = (struct Block_basic2 *)arg; + if ( ! (bb->Block_flags & BLOCK_HAS_COPY_DISPOSE)) { + printf("missing copy/dispose helpers for byref data\n"); + exit(1); + } + struct byref_id *ref = bb->ref; + if (ref->forwarding != ref) { + printf("forwarding pointer should be %p but is %p\n", ref, ref->forwarding); + exit(1); + } +} +#endif + + + Added: compiler-rt/trunk/BlocksRuntime/tests/byrefstruct.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/byrefstruct.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/byrefstruct.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/byrefstruct.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,57 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*- +// CONFIG + +#import +#import +#import + +typedef struct { + unsigned long ps[30]; + int qs[30]; +} BobTheStruct; + +int main (int argc, const char * argv[]) { + __block BobTheStruct fiddly; + BobTheStruct copy; + + void (^incrementFiddly)() = ^{ + int i; + for(i=0; i<30; i++) { + fiddly.ps[i]++; + fiddly.qs[i]++; + } + }; + + memset(&fiddly, 0xA5, sizeof(fiddly)); + memset(©, 0x2A, sizeof(copy)); + + int i; + for(i=0; i<30; i++) { + fiddly.ps[i] = i * i * i; + fiddly.qs[i] = -i * i * i; + } + + copy = fiddly; + incrementFiddly(); + + if ( © == &fiddly ) { + printf("%s: struct wasn't copied.", argv[0]); + exit(1); + } + for(i=0; i<30; i++) { + //printf("[%d]: fiddly.ps: %lu, copy.ps: %lu, fiddly.qs: %d, copy.qs: %d\n", i, fiddly.ps[i], copy.ps[i], fiddly.qs[i], copy.qs[i]); + if ( (fiddly.ps[i] != copy.ps[i] + 1) || (fiddly.qs[i] != copy.qs[i] + 1) ) { + printf("%s: struct contents were not incremented.", argv[0]); + exit(1); + } + } + + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/c99.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/c99.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/c99.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/c99.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,20 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// +// c99.m +// +// CONFIG C99 rdar://problem/6399225 + +#import +#import + +int main(int argc, char *argv[]) { + void (^blockA)(void) = ^ { ; }; + blockA(); + printf("%s: success\n", argv[0]); + exit(0); +} Added: compiler-rt/trunk/BlocksRuntime/tests/cast.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/cast.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/cast.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/cast.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,37 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * cast.c + * testObjects + * + * Created by Blaine Garst on 2/17/09. + * + */ + +// PURPOSE should allow casting of a Block reference to an arbitrary pointer and back +// CONFIG open + +#include + + + +int main(int argc, char *argv[]) { + + void (^aBlock)(void); + int *ip; + char *cp; + double *dp; + + ip = (int *)aBlock; + cp = (char *)aBlock; + dp = (double *)aBlock; + aBlock = (void (^)(void))ip; + aBlock = (void (^)(void))cp; + aBlock = (void (^)(void))dp; + printf("%s: success", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/constassign.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/constassign.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/constassign.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/constassign.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,28 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// +// constassign.c +// bocktest +// +// Created by Blaine Garst on 3/21/08. +// +// shouldn't be able to assign to a const pointer +// CONFIG error: assignment of read-only + +#import + +void foo(void) { printf("I'm in foo\n"); } +void bar(void) { printf("I'm in bar\n"); } + +int main(int argc, char *argv[]) { + void (*const fptr)(void) = foo; + void (^const blockA)(void) = ^ { printf("hello\n"); }; + blockA = ^ { printf("world\n"); } ; + fptr = bar; + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/copy-block-literal-rdar6439600.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/copy-block-literal-rdar6439600.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/copy-block-literal-rdar6439600.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/copy-block-literal-rdar6439600.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,29 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// CONFIG open rdar://6439600 + +#import +#import + +#define NUMBER_OF_BLOCKS 100 +int main (int argc, const char * argv[]) { + int (^x[NUMBER_OF_BLOCKS])(); + int i; + + for(i=0; i +#include + +// CONFIG C++ rdar://6243400,rdar://6289367 + + +int constructors = 0; +int destructors = 0; + + +#define CONST const + +class TestObject +{ +public: + TestObject(CONST TestObject& inObj); + TestObject(); + ~TestObject(); + + TestObject& operator=(CONST TestObject& inObj); + + int version() CONST { return _version; } +private: + mutable int _version; +}; + +TestObject::TestObject(CONST TestObject& inObj) + +{ + ++constructors; + _version = inObj._version; + //printf("%p (%d) -- TestObject(const TestObject&) called\n", this, _version); +} + + +TestObject::TestObject() +{ + _version = ++constructors; + //printf("%p (%d) -- TestObject() called\n", this, _version); +} + + +TestObject::~TestObject() +{ + //printf("%p -- ~TestObject() called\n", this); + ++destructors; +} + + +TestObject& TestObject::operator=(CONST TestObject& inObj) +{ + //printf("%p -- operator= called\n", this); + _version = inObj._version; + return *this; +} + + + +void testRoutine() { + TestObject one; + + void (^b)(void) = ^{ printf("my const copy of one is %d\n", one.version()); }; +} + + + +int main(int argc, char *argv[]) { + testRoutine(); + if (constructors == 0) { + printf("No copy constructors!!!\n"); + return 1; + } + if (constructors != destructors) { + printf("%d constructors but only %d destructors\n", constructors, destructors); + return 1; + } + printf("%s:success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/copynull.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/copynull.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/copynull.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/copynull.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,37 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * copynull.c + * testObjects + * + * Created by Blaine Garst on 10/15/08. + * + */ + +#import +#import +#import + +// CONFIG rdar://6295848 + +int main(int argc, char *argv[]) { + + void (^block)(void) = (void (^)(void))0; + void (^blockcopy)(void) = Block_copy(block); + + if (blockcopy != (void (^)(void))0) { + printf("whoops, somehow we copied NULL!\n"); + return 1; + } + // make sure we can also + Block_release(blockcopy); + // and more secretly + //_Block_destroy(blockcopy); + + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/dispatch_async.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/dispatch_async.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/dispatch_async.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/dispatch_async.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,57 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +#include + +#include +#include +//#import +#include + +// CONFIG rdar://problem/6371811 + +const char *whoami = "nobody"; + +void EnqueueStuff(dispatch_queue_t q) +{ + __block CFIndex counter; + + // above call has a side effect: it works around: + // __block variables not implicitly imported into intermediate scopes + dispatch_async(q, ^{ + counter = 0; + }); + + + dispatch_async(q, ^{ + //printf("outer block.\n"); + counter++; + dispatch_async(q, ^{ + //printf("inner block.\n"); + counter--; + if(counter == 0) { + printf("%s: success\n", whoami); + exit(0); + } + }); + if(counter == 0) { + printf("already done? inconceivable!\n"); + exit(1); + } + }); +} + +int main (int argc, const char * argv[]) { + dispatch_queue_t q = dispatch_queue_create("queue", NULL); + + whoami = argv[0]; + + EnqueueStuff(q); + + dispatch_main(); + printf("shouldn't get here\n"); + return 1; +} Added: compiler-rt/trunk/BlocksRuntime/tests/dispatch_call_Block_with_release.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/dispatch_call_Block_with_release.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/dispatch_call_Block_with_release.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/dispatch_call_Block_with_release.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,31 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +#include +#include + +// CONFIG + +void callsomething(const char *format, int argument) { +} + +void +dispatch_call_Block_with_release2(void *block) +{ + void (^b)(void) = (void (^)(void))block; + b(); + Block_release(b); +} + +int main(int argc, char *argv[]) { + void (^b1)(void) = ^{ callsomething("argc is %d\n", argc); }; + void (^b2)(void) = ^{ callsomething("hellow world\n", 0); }; // global block now + + dispatch_call_Block_with_release2(Block_copy(b1)); + dispatch_call_Block_with_release2(Block_copy(b2)); + printf("%s: Success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/fail.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/fail.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/fail.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/fail.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,107 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * fail.c + * testObjects + * + * Created by Blaine Garst on 9/16/08. + * + */ +#include +#include +#include +#include +#include +#include + + +bool readfile(char *buffer, const char *from) { + int fd = open(from, 0); + if (fd < 0) return false; + int count = read(fd, buffer, 512); + if (count < 0) return false; + buffer[count] = 0; // zap newline + return true; +} + +// basic idea, take compiler args, run compiler, and verify that expected failure matches any existing one + +int main(int argc, char *argv[]) { + if (argc == 1) return 0; + char *copy[argc+1]; // make a copy + // find and strip off -e "errorfile" + char *errorfile = NULL; + int counter = 0, i = 0; + for (i = 1; i < argc; ++i) { // skip 0 arg which is "fail" + if (!strncmp(argv[i], "-e", 2)) { + errorfile = argv[++i]; + } + else { + copy[counter++] = argv[i]; + } + } + copy[counter] = NULL; + pid_t child = fork(); + char buffer[512]; + if (child == 0) { + // in child + sprintf(buffer, "/tmp/errorfile_%d", getpid()); + close(1); + int fd = creat(buffer, 0777); + if (fd != 1) { + fprintf(stderr, "didn't open custom error file %s as 1, got %d\n", buffer, fd); + exit(1); + } + close(2); + dup(1); + int result = execv(copy[0], copy); + exit(10); + } + if (child < 0) { + printf("fork failed\n"); + exit(1); + } + int status = 0; + pid_t deadchild = wait(&status); + if (deadchild != child) { + printf("wait got %d instead of %d\n", deadchild, child); + exit(1); + } + if (WEXITSTATUS(status) == 0) { + printf("compiler exited normally, not good under these circumstances\n"); + exit(1); + } + //printf("exit status of child %d was %d\n", child, WEXITSTATUS(status)); + sprintf(buffer, "/tmp/errorfile_%d", child); + if (errorfile) { + //printf("ignoring error file: %s\n", errorfile); + char desired[512]; + char got[512]; + bool gotErrorFile = readfile(desired, errorfile); + bool gotOutput = readfile(got, buffer); + if (!gotErrorFile && gotOutput) { + printf("didn't read errorfile %s, it should have something from\n*****\n%s\n*****\nin it.\n", + errorfile, got); + exit(1); + } + else if (gotErrorFile && gotOutput) { + char *where = strstr(got, desired); + if (!where) { + printf("didn't find contents of %s in %s\n", errorfile, buffer); + exit(1); + } + } + else { + printf("errorfile %s and output %s inconsistent\n", errorfile, buffer); + exit(1); + } + } + unlink(buffer); + printf("success\n"); + exit(0); +} + Added: compiler-rt/trunk/BlocksRuntime/tests/flagsisa.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/flagsisa.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/flagsisa.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/flagsisa.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,21 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +#include + +/* CONFIG rdar://6310599 + */ + +int main(int argc, char *argv[]) +{ + __block int flags; + __block void *isa; + + ^{ flags=1; isa = (void *)isa; }; + printf("%s: success\n", argv[0]); + return 0; +} + Added: compiler-rt/trunk/BlocksRuntime/tests/globalexpression.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/globalexpression.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/globalexpression.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/globalexpression.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,42 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// testfilerunner CONFIG + +#import +#import + +int global; + +void (^gblock)(int) = ^(int x){ global = x; }; + +int main(int argc, char *argv[]) { + gblock(1); + if (global != 1) { + printf("%s: *** did not set global to 1\n", argv[0]); + return 1; + } + void (^gblockcopy)(int) = Block_copy(gblock); + if (gblockcopy != gblock) { + printf("global copy %p not a no-op %p\n", (void *)gblockcopy, (void *)gblock); + return 1; + } + Block_release(gblockcopy); + gblock(3); + if (global != 3) { + printf("%s: *** did not set global to 3\n", argv[0]); + return 1; + } + gblockcopy = Block_copy(gblock); + gblockcopy(5); + if (global != 5) { + printf("%s: *** did not set global to 5\n", argv[0]); + return 1; + } + printf("%s: Success!\n", argv[0]); + return 0; +} + Added: compiler-rt/trunk/BlocksRuntime/tests/goto.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/goto.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/goto.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/goto.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,34 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * goto.c + * testObjects + * + * Created by Blaine Garst on 10/17/08. + * + */ + +// CONFIG rdar://6289031 + +#include + +int main(int argc, char *argv[]) +{ + __block int val = 0; + + ^{ val = 1; }(); + + if (val == 0) { + goto out_bad; // error: local byref variable val is in the scope of this goto + } + + printf("%s: Success!\n", argv[0]); + return 0; +out_bad: + printf("%s: val not updated!\n", argv[0]); + return 1; +} Added: compiler-rt/trunk/BlocksRuntime/tests/hasdescriptor.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/hasdescriptor.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/hasdescriptor.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/hasdescriptor.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,29 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + + + +// CONFIG C + +#include +#include + + +int main(int argc, char *argv[]) { + void (^inner)(void) = ^ { printf("argc was %d\n", argc); }; + void (^outer)(void) = ^{ + inner(); + inner(); + }; + //printf("size of inner is %ld\n", Block_size(inner)); + //printf("size of outer is %ld\n", Block_size(outer)); + if (Block_size(inner) != Block_size(outer)) { + printf("not the same size, using old compiler??\n"); + return 1; + } + printf("%s: Success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/josh.C URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/josh.C?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/josh.C (added) +++ compiler-rt/trunk/BlocksRuntime/tests/josh.C Wed Aug 4 18:34:21 2010 @@ -0,0 +1,32 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// CONFIG C++ GC RR open rdar://6347910 + + + +struct MyStruct { + int something; +}; + +struct TestObject { + + void test(void){ + { + MyStruct first; // works + } + void (^b)(void) = ^{ + MyStruct inner; // fails to compile! + }; + } +}; + + + +int main(int argc, char *argv[]) { + printf("%s: Success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/k-and-r.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/k-and-r.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/k-and-r.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/k-and-r.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,33 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*- +// CONFIG error: incompatible block pointer types assigning + +#import +#import + +int main(int argc, char *argv[]) { +#ifndef __cplusplus + char (^rot13)(); + rot13 = ^(char c) { return (char)(((c - 'a' + 13) % 26) + 'a'); }; + char n = rot13('a'); + char c = rot13('p'); + if ( n != 'n' || c != 'c' ) { + printf("%s: rot13('a') returned %c, rot13('p') returns %c\n", argv[0], n, c); + exit(1); + } +#else +// yield characteristic error message for C++ +#error incompatible block pointer types assigning +#endif +#ifndef __clang__ +// yield characteristic error message for C++ +#error incompatible block pointer types assigning +#endif + printf("%s: success\n", argv[0]); + exit(0); +} Added: compiler-rt/trunk/BlocksRuntime/tests/large-struct.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/large-struct.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/large-struct.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/large-struct.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,51 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*- +// CONFIG + +#import +#import +#import + +typedef struct { + unsigned long ps[30]; + int qs[30]; +} BobTheStruct; + +int main (int argc, const char * argv[]) { + BobTheStruct inny; + BobTheStruct outty; + BobTheStruct (^copyStruct)(BobTheStruct); + int i; + + memset(&inny, 0xA5, sizeof(inny)); + memset(&outty, 0x2A, sizeof(outty)); + + for(i=0; i<30; i++) { + inny.ps[i] = i * i * i; + inny.qs[i] = -i * i * i; + } + + copyStruct = ^(BobTheStruct aBigStruct){ return aBigStruct; }; // pass-by-value intrinsically copies the argument + + outty = copyStruct(inny); + + if ( &inny == &outty ) { + printf("%s: struct wasn't copied.", argv[0]); + exit(1); + } + for(i=0; i<30; i++) { + if ( (inny.ps[i] != outty.ps[i]) || (inny.qs[i] != outty.qs[i]) ) { + printf("%s: struct contents did not match.", argv[0]); + exit(1); + } + } + + printf("%s: success\n", argv[0]); + + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/localisglobal.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/localisglobal.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/localisglobal.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/localisglobal.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,42 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * localisglobal.c + * testObjects + * + * Created by Blaine Garst on 9/29/08. + * + * works in all configurations + * CONFIG rdar://6230297 + */ + +#include + +void (^global)(void) = ^{ printf("hello world\n"); }; + +int aresame(void *first, void *second) { + long *f = (long *)first; + long *s = (long *)second; + return *f == *s; +} +int main(int argc, char *argv[]) { + int i = 10; + void (^local)(void) = ^ { printf("hi %d\n", i); }; + void (^localisglobal)(void) = ^ { printf("hi\n"); }; + + if (aresame(local, localisglobal)) { + printf("local block could be global, but isn't\n"); + return 1; + } + if (!aresame(global, localisglobal)) { + printf("local block is not global, not stack, what is it??\n"); + return 1; + } + printf("%s: success\n", argv[0]); + return 0; + +} Added: compiler-rt/trunk/BlocksRuntime/tests/macro.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/macro.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/macro.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/macro.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,14 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// CONFIG open rdar://6718399 +#include + +void foo() { + void (^bbb)(void) = Block_copy(^ { + int j, cnt; + }); +} Added: compiler-rt/trunk/BlocksRuntime/tests/makefile URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/makefile?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/makefile (added) +++ compiler-rt/trunk/BlocksRuntime/tests/makefile Wed Aug 4 18:34:21 2010 @@ -0,0 +1,70 @@ +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +CCDIR=/usr/bin +#CCDIR=/Volumes/Keep/gcc/usr/bin + +all: std + +clean: + rm -fr *.dSYM *.o *-bin testfilerunner + +TFR = ~public/bin/testfilerunner + +testfilerunner: testfilerunner.h testfilerunner.m + gcc -fobjc-gc-only -g -arch x86_64 -arch i386 -std=gnu99 testfilerunner.m -o testfilerunner -framework Foundation + +tests: + grep CONFIG *.[cmCM] | $(TFR) $(CCDIR) -- + +open: + grep CONFIG *.[cmCM] | $(TFR) $(CCDIR) -open -- + +fast: + grep CONFIG *.[cmCM] | $(TFR) -fast $(CCDIR) -- + +std: + grep CONFIG *.[cmCM] | $(TFR) -- + +clang: + grep CONFIG *.[cmCM] | $(TFR) -clang -fast -- + +fastd: + grep CONFIG *.[cmCM] | $(TFR) -fast -- + + +# Hack Alert: arguably most of the following belongs in libclosure's Makefile; sticking it here until I get around to grokking what goes on in that file. +sudid: + @echo Enabling sudo: # Hack Alert: enable sudo first thing so we don't hang at the password prompt later + @sudo echo Thanks + + +RootsDirectory ?= /tmp/ +# Note: the libsystem project (built by the libsystemroot target below) uses the ALTUSRLOCALLIBSYSTEM variable, so we use it here to maintain parity +ALTUSRLOCALLIBSYSTEM ?= $(RootsDirectory)/alt-usr-local-lib-system/ +altusrlocallibsystem: + ditto /usr/local/lib/system $(ALTUSRLOCALLIBSYSTEM) # FIXME: conditionalize this copy + + +# ER: option to not require extra privileges (-nosudo or somesuch) +Buildit ?= ~rc/bin/buildit -rootsDirectory $(RootsDirectory) -arch i386 -arch ppc -arch x86_64 +blocksroot: sudid clean altusrlocallibsystem + sudo $(Buildit) .. + ditto $(RootsDirectory)/libclosure.roots/libclosure~dst/usr/local/lib/system $(ALTUSRLOCALLIBSYSTEM) + + +LibsystemVersion ?= 121 +LibsystemPath ?= ~rc/Software/SnowLeopard/Projects/Libsystem/Libsystem-$(LibsystemVersion) +LibsystemTmpPath ?= $(RootsDirectory)/Libsystem-$(LibsystemVersion) +libsystemroot: blocksroot + ditto $(LibsystemPath) $(LibsystemTmpPath) # FIXME: conditionalize this copy + sudo ALTUSRLOCALLIBSYSTEM=$(ALTUSRLOCALLIBSYSTEM) $(Buildit) $(LibsystemTmpPath) + + +# Defaults to product of the libsystemroot target but does not automatically rebuild that, make both targets if you want a fresh root +LibsystemRootPath ?= $(RootsDirectory)/Libsystem-$(LibsystemVersion).roots/Libsystem-$(LibsystemVersion)~dst/usr/lib/ +roottests: + grep CONFIG *.[cmCM] | $(TFR) -dyld $(LibsystemRootPath) -- # FIXME: figure out if I can "call" the std target instead of duplicating it + Added: compiler-rt/trunk/BlocksRuntime/tests/modglobal.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/modglobal.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/modglobal.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/modglobal.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,18 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +#include + +// CONFIG + +int AGlobal; + +int main(int argc, char *argv[]) { + void (^f)(void) = ^ { AGlobal++; }; + + printf("%s: success\n", argv[0]); + return 0; + +} Added: compiler-rt/trunk/BlocksRuntime/tests/nestedimport.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/nestedimport.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/nestedimport.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/nestedimport.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,44 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// +// nestedimport.m +// testObjects +// +// Created by Blaine Garst on 6/24/08. +// +// pure C nothing more needed +// CONFIG + + +#include +#include + + +int Global = 0; + +void callVoidVoid(void (^closure)(void)) { + closure(); +} + +int main(int argc, char *argv[]) { + int i = 1; + + void (^vv)(void) = ^{ + if (argc > 0) { + callVoidVoid(^{ Global = i; }); + } + }; + + i = 2; + vv(); + if (Global != 1) { + printf("%s: error, Global not set to captured value\n", argv[0]); + exit(1); + } + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/nullblockisa.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/nullblockisa.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/nullblockisa.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/nullblockisa.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,43 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// +// nullblockisa.m +// testObjects +// +// Created by Blaine Garst on 9/24/08. +// +// CONFIG rdar://6244520 + + + +#include +#include +#include + + +void check(void (^b)(void)) { + struct _custom { + struct Block_layout layout; + struct Block_byref *innerp; + } *custom = (struct _custom *)(void *)(b); + //printf("block is at %p, size is %lx, inner is %p\n", (void *)b, Block_size(b), innerp); + if (custom->innerp->isa != (void *)NULL) { + printf("not a NULL __block isa\n"); + exit(1); + } + return; +} + +int main(int argc, char *argv[]) { + + __block int i; + + check(^{ printf("%d\n", ++i); }); + printf("%s: success\n", argv[0]); + return 0; +} + Added: compiler-rt/trunk/BlocksRuntime/tests/objectRRGC.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/objectRRGC.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/objectRRGC.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/objectRRGC.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,77 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * objectRRGC.c + * testObjects + * + * Created by Blaine Garst on 10/31/08. + * + * Test that the runtime honors the new callouts properly for retain/release and GC + * CON FIG C rdar://6175959 + */ + + + +#include +#include + + +int AssignCalled = 0; +int DisposeCalled = 0; + +// local copy instead of libSystem.B.dylib copy +void _Block_object_assign(void *destAddr, const void *object, const int isWeak) { + //printf("_Block_object_assign(%p, %p, %d) called\n", destAddr, object, isWeak); + AssignCalled = 1; +} + +void _Block_object_dispose(const void *object, const int isWeak) { + //printf("_Block_object_dispose(%p, %d) called\n", object, isWeak); + DisposeCalled = 1; +} + +struct MyStruct { + long isa; + long field; +}; + +typedef struct MyStruct *__attribute__((NSObject)) MyStruct_t; + +int main(int argc, char *argv[]) { + // create a block + struct MyStruct X; + MyStruct_t xp = (MyStruct_t)&X; + xp->field = 10; + void (^myBlock)(void) = ^{ printf("field is %ld\n", xp->field); }; + // should be a copy helper generated with a calls to above routines + // Lets find out! + struct Block_layout *bl = (struct Block_layout *)(void *)myBlock; + if ((bl->flags & BLOCK_HAS_DESCRIPTOR) != BLOCK_HAS_DESCRIPTOR) { + printf("using old runtime layout!\n"); + return 1; + } + if ((bl->flags & BLOCK_HAS_COPY_DISPOSE) != BLOCK_HAS_COPY_DISPOSE) { + printf("no copy dispose!!!!\n"); + return 1; + } + // call helper routines directly. These will, in turn, we hope, call the stubs above + long destBuffer[256]; + //printf("destbuffer is at %p, block at %p\n", destBuffer, (void *)bl); + //printf("dump is %s\n", _Block_dump(myBlock)); + bl->descriptor->copy(destBuffer, bl); + bl->descriptor->dispose(bl); + if (AssignCalled == 0) { + printf("did not call assign helper!\n"); + return 1; + } + if (DisposeCalled == 0) { + printf("did not call dispose helper\n"); + return 1; + } + printf("%s: Success!\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/objectassign.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/objectassign.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/objectassign.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/objectassign.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,76 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * objectassign.c + * testObjects + * + * Created by Blaine Garst on 10/28/08. + * + * This just tests that the compiler is issuing the proper helper routines + * CONFIG C rdar://6175959 + */ + + +#include +#include + + +int AssignCalled = 0; +int DisposeCalled = 0; + +// local copy instead of libSystem.B.dylib copy +void _Block_object_assign(void *destAddr, const void *object, const int isWeak) { + //printf("_Block_object_assign(%p, %p, %d) called\n", destAddr, object, isWeak); + AssignCalled = 1; +} + +void _Block_object_dispose(const void *object, const int isWeak) { + //printf("_Block_object_dispose(%p, %d) called\n", object, isWeak); + DisposeCalled = 1; +} + +struct MyStruct { + long isa; + long field; +}; + +typedef struct MyStruct *__attribute__((NSObject)) MyStruct_t; + +int main(int argc, char *argv[]) { + if (__APPLE_CC__ < 5627) { + printf("need compiler version %d, have %d\n", 5627, __APPLE_CC__); + return 0; + } + // create a block + struct MyStruct X; + MyStruct_t xp = (MyStruct_t)&X; + xp->field = 10; + void (^myBlock)(void) = ^{ printf("field is %ld\n", xp->field); }; + // should be a copy helper generated with a calls to above routines + // Lets find out! + struct Block_layout *bl = (struct Block_layout *)(void *)myBlock; + if ((bl->flags & BLOCK_HAS_COPY_DISPOSE) != BLOCK_HAS_COPY_DISPOSE) { + printf("no copy dispose!!!!\n"); + return 1; + } + // call helper routines directly. These will, in turn, we hope, call the stubs above + long destBuffer[256]; + //printf("destbuffer is at %p, block at %p\n", destBuffer, (void *)bl); + //printf("dump is %s\n", _Block_dump(myBlock)); + bl->descriptor->copy(destBuffer, bl); + bl->descriptor->dispose(bl); + if (AssignCalled == 0) { + printf("did not call assign helper!\n"); + return 1; + } + if (DisposeCalled == 0) { + printf("did not call dispose helper\n"); + return 1; + } + printf("%s: Success!\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/orbars.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/orbars.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/orbars.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/orbars.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,23 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * orbars.c + * testObjects + * + * Created by Blaine Garst on 9/17/08. + * + * CONFIG rdar://6276695 error: before ???|??? token + */ + +#include + +int main(int argc, char *argv[]) { + int i = 10; + void (^b)(void) = ^(void){ | i | printf("hello world, %d\n", ++i); }; + printf("%s: success :-(\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/rdar6396238.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/rdar6396238.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/rdar6396238.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/rdar6396238.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,32 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// CONFIG rdar://6396238 + +#include +#include + +static int count = 0; + +void (^mkblock(void))(void) +{ + count++; + return ^{ + count++; + }; +} + +int main (int argc, const char * argv[]) { + mkblock()(); + if (count != 2) { + printf("%s: failure, 2 != %d\n", argv[0], count); + exit(1); + } else { + printf("%s: success\n", argv[0]); + exit(0); + } + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/rdar6405500.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/rdar6405500.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/rdar6405500.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/rdar6405500.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,29 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// CONFIG rdar://6405500 + +#include +#include +#import +#import + +int main (int argc, const char * argv[]) { + __block void (^blockFu)(size_t t); + blockFu = ^(size_t t){ + if (t == 20) { + printf("%s: success\n", argv[0]); + exit(0); + } else + dispatch_async(dispatch_get_main_queue(), ^{ blockFu(20); }); + }; + + dispatch_apply(10, dispatch_get_concurrent_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT), blockFu); + + dispatch_main(); + printf("shouldn't get here\n"); + return 1; +} Added: compiler-rt/trunk/BlocksRuntime/tests/rdar6414583.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/rdar6414583.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/rdar6414583.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/rdar6414583.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,31 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// CONFIG rdar://6414583 + +// a smaller case of byrefcopyint + +#include +#include +#include + +int main(int argc, char *argv[]) { + __block int c = 1; + + //printf("&c = %p - c = %i\n", &c, c); + + int i; + for(i =0; i < 2; i++) { + dispatch_block_t block = Block_copy(^{ c = i; }); + + block(); +// printf("%i: &c = %p - c = %i\n", i, &c, c); + + Block_release(block); + } + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/recursive-block.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/recursive-block.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/recursive-block.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/recursive-block.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,55 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +#include +#include +#include +#include + +// CONFIG + + +int cumulation = 0; + +int doSomething(int i) { + cumulation += i; + return cumulation; +} + +void dirtyStack() { + int i = random(); + int j = doSomething(i); + int k = doSomething(j); + doSomething(i + j + k); +} + +typedef void (^voidVoid)(void); + +voidVoid testFunction() { + int i = random(); + __block voidVoid inner = ^{ doSomething(i); }; + //printf("inner, on stack, is %p\n", (void*)inner); + /*__block*/ voidVoid outer = ^{ + //printf("will call inner block %p\n", (void *)inner); + inner(); + }; + //printf("outer looks like: %s\n", _Block_dump(outer)); + voidVoid result = Block_copy(outer); + //Block_release(inner); + return result; +} + + +int main(int argc, char **argv) { + voidVoid block = testFunction(); + dirtyStack(); + block(); + Block_release(block); + + printf("%s: success\n", argv[0]); + + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/recursive-test.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/recursive-test.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/recursive-test.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/recursive-test.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,74 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// CONFIG open rdar://6416474 +// was rdar://5847976 +// was rdar://6348320 + +#include +#include + +int verbose = 0; + +int main(int argc, char* argv[]) { + + if (argc > 1) verbose = 1; + + __block void (^recursive_local_block)(int); + + if (verbose) printf("recursive_local_block is a local recursive block\n"); + recursive_local_block = ^(int i) { + if (verbose) printf("%d\n", i); + if (i > 0) { + recursive_local_block(i - 1); + } + }; + + if (verbose) printf("recursive_local_block's address is %p, running it:\n", (void*)recursive_local_block); + recursive_local_block(5); + + if (verbose) printf("Creating other_local_block: a local block that calls recursive_local_block\n"); + + void (^other_local_block)(int) = ^(int i) { + if (verbose) printf("other_local_block running\n"); + recursive_local_block(i); + }; + + if (verbose) printf("other_local_block's address is %p, running it:\n", (void*)other_local_block); + + other_local_block(5); + +#if __APPLE_CC__ >= 5627 + if (verbose) printf("Creating other_copied_block: a Block_copy of a block that will call recursive_local_block\n"); + + void (^other_copied_block)(int) = Block_copy(^(int i) { + if (verbose) printf("other_copied_block running\n"); + recursive_local_block(i); + }); + + if (verbose) printf("other_copied_block's address is %p, running it:\n", (void*)other_copied_block); + + other_copied_block(5); +#endif + + __block void (^recursive_copy_block)(int); + + if (verbose) printf("Creating recursive_copy_block: a Block_copy of a block that will call recursive_copy_block recursively\n"); + + recursive_copy_block = Block_copy(^(int i) { + if (verbose) printf("%d\n", i); + if (i > 0) { + recursive_copy_block(i - 1); + } + }); + + if (verbose) printf("recursive_copy_block's address is %p, running it:\n", (void*)recursive_copy_block); + + recursive_copy_block(5); + + printf("%s: Success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/recursiveassign.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/recursiveassign.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/recursiveassign.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/recursiveassign.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,44 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * recursiveassign.c + * testObjects + * + * Created by Blaine Garst on 12/3/08. + * + */ + +// CONFIG rdar://6639533 + +// The compiler is prefetching x->forwarding before evaluting code that recomputes forwarding and so the value goes to a place that is never seen again. + +#include +#include +#include + + +int main(int argc, char* argv[]) { + + __block void (^recursive_copy_block)(int) = ^(int arg) { printf("got wrong Block\n"); exit(1); }; + + + recursive_copy_block = Block_copy(^(int i) { + if (i > 0) { + recursive_copy_block(i - 1); + } + else { + printf("done!\n"); + } + }); + + + recursive_copy_block(5); + + printf("%s: Success\n", argv[0]); + return 0; +} + Added: compiler-rt/trunk/BlocksRuntime/tests/reference.C URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/reference.C?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/reference.C (added) +++ compiler-rt/trunk/BlocksRuntime/tests/reference.C Wed Aug 4 18:34:21 2010 @@ -0,0 +1,95 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +#import +#import +#import + +// CONFIG C++ + +int recovered = 0; + + + +int constructors = 0; +int destructors = 0; + +#define CONST const + +class TestObject +{ +public: + TestObject(CONST TestObject& inObj); + TestObject(); + ~TestObject(); + + TestObject& operator=(CONST TestObject& inObj); + + void test(void); + + int version() CONST { return _version; } +private: + mutable int _version; +}; + +TestObject::TestObject(CONST TestObject& inObj) + +{ + ++constructors; + _version = inObj._version; + //printf("%p (%d) -- TestObject(const TestObject&) called", this, _version); +} + + +TestObject::TestObject() +{ + _version = ++constructors; + //printf("%p (%d) -- TestObject() called\n", this, _version); +} + + +TestObject::~TestObject() +{ + //printf("%p -- ~TestObject() called\n", this); + ++destructors; +} + +#if 1 +TestObject& TestObject::operator=(CONST TestObject& inObj) +{ + //printf("%p -- operator= called", this); + _version = inObj._version; + return *this; +} +#endif + +void TestObject::test(void) { + void (^b)(void) = ^{ recovered = _version; }; + void (^b2)(void) = Block_copy(b); + b2(); + Block_release(b2); +} + + + +void testRoutine() { + TestObject one; + + + one.test(); +} + + + +int main(int argc, char *argv[]) { + testRoutine(); + if (recovered == 1) { + printf("%s: success\n", argv[0]); + exit(0); + } + printf("%s: *** didn't recover byref block variable\n", argv[0]); + exit(1); +} Added: compiler-rt/trunk/BlocksRuntime/tests/rettypepromotion.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/rettypepromotion.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/rettypepromotion.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/rettypepromotion.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,36 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * rettypepromotion.c + * testObjects + * + * Created by Blaine Garst on 11/3/08. + * + */ + +// CONFIG error: +// C++ and C give different errors so we don't check for an exact match. +// The error is that enum's are defined to be ints, always, even if defined with explicit long values + + +#include +#include + +enum { LESS = -1, EQUAL, GREATER }; + +void sortWithBlock(long (^comp)(void *arg1, void *arg2)) { +} + +int main(int argc, char *argv[]) { + sortWithBlock(^(void *arg1, void *arg2) { + if (random()) return LESS; + if (random()) return EQUAL; + if (random()) return GREATER; + }); + printf("%s: Success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/returnfunctionptr.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/returnfunctionptr.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/returnfunctionptr.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/returnfunctionptr.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,23 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + + +// CONFIG rdar://6339747 but wasn't + +#include + +int (*funcptr)(long); + +int (*(^b)(char))(long); + +int main(int argc, char *argv[]) { + // implicit is fine + b = ^(char x) { return funcptr; }; + // explicit never parses + b = ^int (*(char x))(long) { return funcptr; }; + printf("%s: Success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/shorthandexpression.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/shorthandexpression.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/shorthandexpression.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/shorthandexpression.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,24 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * shorthandexpression.c + * testObjects + * + * Created by Blaine Garst on 9/16/08. + * + * CONFIG error: + */ + + +void foo() { + void (^b)(void) = ^(void)printf("hello world\n"); +} + +int main(int argc, char *argv[]) { + printf("%s: this shouldn't compile\n", argv[0]); + return 1; +} Added: compiler-rt/trunk/BlocksRuntime/tests/sizeof.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/sizeof.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/sizeof.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/sizeof.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,26 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * sizeof.c + * testObjects + * + * Created by Blaine Garst on 2/17/09. + * + */ + +#include + +// CONFIG error: + +int main(int argc, char *argv[]) { + + void (^aBlock)(void) = ^{ printf("hellow world\n"); }; + + printf("the size of a block is %ld\n", sizeof(*aBlock)); + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/small-struct.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/small-struct.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/small-struct.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/small-struct.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,45 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*- +// CONFIG + +#import +#import +#import + +typedef struct { + int a; + int b; +} MiniStruct; + +int main (int argc, const char * argv[]) { + MiniStruct inny; + MiniStruct outty; + MiniStruct (^copyStruct)(MiniStruct); + + memset(&inny, 0xA5, sizeof(inny)); + memset(&outty, 0x2A, sizeof(outty)); + + inny.a = 12; + inny.b = 42; + + copyStruct = ^(MiniStruct aTinyStruct){ return aTinyStruct; }; // pass-by-value intrinsically copies the argument + + outty = copyStruct(inny); + + if ( &inny == &outty ) { + printf("%s: struct wasn't copied.", argv[0]); + exit(1); + } + if ( (inny.a != outty.a) || (inny.b != outty.b) ) { + printf("%s: struct contents did not match.", argv[0]); + exit(1); + } + + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/structmember.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/structmember.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/structmember.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/structmember.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,45 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * structmember.c + * testObjects + * + * Created by Blaine Garst on 9/30/08. + * CONFIG + */ +#include +#include +#include + +// CONFIG + +int main(int argc, char *argv[]) { + struct stuff { + long int a; + long int b; + long int c; + } localStuff = { 10, 20, 30 }; + int d; + + void (^a)(void) = ^ { printf("d is %d", d); }; + void (^b)(void) = ^ { printf("d is %d, localStuff.a is %lu", d, localStuff.a); }; + + unsigned nominalsize = Block_size(b) - Block_size(a); +#if __cplusplus__ + // need copy+dispose helper for C++ structures + nominalsize += 2*sizeof(void*); +#endif + if ((Block_size(b) - Block_size(a)) != nominalsize) { + printf("sizeof a is %ld, sizeof b is %ld, expected %d\n", Block_size(a), Block_size(b), nominalsize); + printf("dump of b is %s\n", _Block_dump(b)); + return 1; + } + printf("%s: Success\n", argv[0]); + return 0; +} + + Added: compiler-rt/trunk/BlocksRuntime/tests/testfilerunner.h URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/testfilerunner.h?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/testfilerunner.h (added) +++ compiler-rt/trunk/BlocksRuntime/tests/testfilerunner.h Wed Aug 4 18:34:21 2010 @@ -0,0 +1,110 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// +// testfilerunner.h +// testObjects +// +// Created by Blaine Garst on 9/24/08. +// + +#import + +/* + variations: + four source types: C, ObjC, C++, ObjC++, + and for ObjC or ObjC++ we have + RR and GC capabilities + we assume C++ friendly includes for C/ObjC even if C++ isn't used + + + four compilers: C, ObjC, C++, ObjC++ + and for ObjC or ObjC++ we can compile + RR, RR+GC, GC+RR, GC + although to test RR+GC we need to build a shell "main" in both modes + and/or run with GC disabled if possible. + + To maximize coverage we mark files with capabilities and then ask them to be + compiled with each variation of compiler and option. + If the file doesn't have the capability it politely refuses. +*/ + +enum options { + Do64 = (1 << 0), + DoCPP = (1 << 1), + DoOBJC = (1 << 3), + DoGC = (1 << 4), + DoRR = (1 << 5), + DoRRGC = (1 << 6), // -fobjc-gc but main w/o so it runs in RR mode + DoGCRR = (1 << 7), // -fobjc-gc & run GC mode + + //DoDashG = (1 << 8), + DoDashO = (1 << 9), + DoDashOs = (1 << 10), + DoDashO2 = (1 << 11), + + DoC99 = (1 << 12), // -std=c99 +}; + + + at class TestFileExeGenerator; + +// this class will actually compile and/or run a target binary +// XXX we don't track which dynamic libraries requested/used nor set them up + at interface TestFileExe : NSObject { + NSPointerArray *compileLine; + int options; + bool shouldFail; + TestFileExeGenerator *generator; + __strong char *binaryName; + __strong char *sourceName; + __strong char *libraryPath; + __strong char *frameworkPath; +} + at property int options; + at property(assign) NSPointerArray *compileLine; + at property(assign) TestFileExeGenerator *generator; + at property bool shouldFail; + at property __strong char *binaryName; + at property __strong char *sourceName; + at property __strong char *libraryPath; + at property __strong char *frameworkPath; +- (bool) compileUnlessExists:(bool)skip; +- (bool) run; + at property(readonly) __strong char *radar; + at end + +// this class generates an appropriate set of configurations to compile +// we don't track which gcc we use but we should XXX + at interface TestFileExeGenerator : NSObject { + bool hasObjC; + bool hasRR; + bool hasGC; + bool hasCPlusPlus; + bool wantsC99; + bool wants64; + bool wants32; + bool supposedToNotCompile; + bool open; // this problem is still open - e.g. unresolved + __strong char *radar; // for things already known to go wrong + __strong char *filename; + __strong char *compilerPath; + __strong char *errorString; + __strong char *warningString; + NSPointerArray *extraLibraries; +} + at property bool hasObjC, hasRR, hasGC, hasCPlusPlus, wantsC99, supposedToNotCompile, open, wants32, wants64; + at property(assign) __strong char *radar; + at property __strong char *filename; + at property __strong char *compilerPath; + at property __strong char *errorString; + at property __strong char *warningString; +- (TestFileExe *)lineForOptions:(int)options; // nil if no can do ++ (NSArray *)generatorsFromFILE:(FILE *)fd; ++ (NSArray *)generatorsFromPath:(NSString *)path; + at end + + Added: compiler-rt/trunk/BlocksRuntime/tests/testfilerunner.m URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/testfilerunner.m?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/testfilerunner.m (added) +++ compiler-rt/trunk/BlocksRuntime/tests/testfilerunner.m Wed Aug 4 18:34:21 2010 @@ -0,0 +1,805 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// +// testfilerunner.m +// testObjects +// +// Created by Blaine Garst on 9/24/08. +// + +#import "testfilerunner.h" +#import +#include +#include +#include +#include +#include +#include + +bool Everything = false; // do it also with 3 levels of optimization +bool DoClang = false; + +static bool isDirectory(char *path); +static bool isExecutable(char *path); +static bool isYounger(char *source, char *binary); +static bool readErrorFile(char *buffer, const char *from); + +__strong char *gcstrcpy2(__strong const char *arg, char *endp) { + unsigned size = endp - arg + 1; + __strong char *result = NSAllocateCollectable(size, 0); + strncpy(result, arg, size); + result[size-1] = 0; + return result; +} +__strong char *gcstrcpy1(__strong char *arg) { + unsigned size = strlen(arg) + 1; + __strong char *result = NSAllocateCollectable(size, 0); + strncpy(result, arg, size); + result[size-1] = 0; + return result; +} + + at implementation TestFileExe + + at synthesize options, compileLine, shouldFail, binaryName, sourceName; + at synthesize generator; + at synthesize libraryPath, frameworkPath; + +- (NSString *)description { + NSMutableString *result = [NSMutableString new]; + if (shouldFail) [result appendString:@"fail"]; + for (id x in compileLine) { + [result appendString:[NSString stringWithFormat:@" %s", (char *)x]]; + } + return result; +} + +- (__strong char *)radar { + return generator.radar; +} + +- (bool) compileUnlessExists:(bool)skip { + if (shouldFail) { + printf("don't use this to compile anymore!\n"); + return false; + } + if (skip && isExecutable(binaryName) && !isYounger(sourceName, binaryName)) return true; + int argc = [compileLine count]; + char *argv[argc+1]; + for (int i = 0; i < argc; ++i) + argv[i] = (char *)[compileLine pointerAtIndex:i]; + argv[argc] = NULL; + pid_t child = fork(); + if (child == 0) { + execv(argv[0], argv); + exit(10); // shouldn't happen + } + if (child < 0) { + printf("fork failed\n"); + return false; + } + int status = 0; + pid_t deadchild = wait(&status); + if (deadchild != child) { + printf("wait got %d instead of %d\n", deadchild, child); + exit(1); + } + if (WEXITSTATUS(status) == 0) { + return true; + } + printf("run failed\n"); + return false; +} + +bool lookforIn(char *lookfor, const char *format, pid_t child) { + char buffer[512]; + char got[512]; + sprintf(buffer, format, child); + bool gotOutput = readErrorFile(got, buffer); + if (!gotOutput) { + printf("**** didn't get an output file %s to analyze!!??\n", buffer); + return false; + } + char *where = strstr(got, lookfor); + if (!where) { + printf("didn't find '%s' in output file %s\n", lookfor, buffer); + return false; + } + unlink(buffer); + return true; +} + +- (bool) compileWithExpectedFailure { + if (!shouldFail) { + printf("Why am I being called?\n"); + return false; + } + int argc = [compileLine count]; + char *argv[argc+1]; + for (int i = 0; i < argc; ++i) + argv[i] = (char *)[compileLine pointerAtIndex:i]; + argv[argc] = NULL; + pid_t child = fork(); + char buffer[512]; + if (child == 0) { + // in child + sprintf(buffer, "/tmp/errorfile_%d", getpid()); + close(1); + int fd = creat(buffer, 0777); + if (fd != 1) { + fprintf(stderr, "didn't open custom error file %s as 1, got %d\n", buffer, fd); + exit(1); + } + close(2); + dup(1); + int result = execv(argv[0], argv); + exit(10); + } + if (child < 0) { + printf("fork failed\n"); + return false; + } + int status = 0; + pid_t deadchild = wait(&status); + if (deadchild != child) { + printf("wait got %d instead of %d\n", deadchild, child); + exit(11); + } + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) == 0) { + return false; + } + } + else { + printf("***** compiler borked/ICEd/died unexpectedly (status %x)\n", status); + return false; + } + char *error = generator.errorString; + + if (!error) return true; +#if 0 + char got[512]; + sprintf(buffer, "/tmp/errorfile_%d", child); + bool gotOutput = readErrorFile(got, buffer); + if (!gotOutput) { + printf("**** didn't get an error file %s to analyze!!??\n", buffer); + return false; + } + char *where = strstr(got, error); + if (!where) { + printf("didn't find '%s' in error file %s\n", error, buffer); + return false; + } + unlink(buffer); +#else + if (!lookforIn(error, "/tmp/errorfile_%d", child)) return false; +#endif + return true; +} + +- (bool) run { + if (shouldFail) return true; + if (sizeof(long) == 4 && options & Do64) { + return true; // skip 64-bit tests + } + int argc = 1; + char *argv[argc+1]; + argv[0] = binaryName; + argv[argc] = NULL; + pid_t child = fork(); + if (child == 0) { + // set up environment + char lpath[1024]; + char fpath[1024]; + char *myenv[3]; + int counter = 0; + if (libraryPath) { + sprintf(lpath, "DYLD_LIBRARY_PATH=%s", libraryPath); + myenv[counter++] = lpath; + } + if (frameworkPath) { + sprintf(fpath, "DYLD_FRAMEWORK_PATH=%s", frameworkPath); + myenv[counter++] = fpath; + } + myenv[counter] = NULL; + if (generator.warningString) { + // set up stdout/stderr + char outfile[1024]; + sprintf(outfile, "/tmp/stdout_%d", getpid()); + close(2); + close(1); + creat(outfile, 0700); + dup(1); + } + execve(argv[0], argv, myenv); + exit(10); // shouldn't happen + } + if (child < 0) { + printf("fork failed\n"); + return false; + } + int status = 0; + pid_t deadchild = wait(&status); + if (deadchild != child) { + printf("wait got %d instead of %d\n", deadchild, child); + exit(1); + } + if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { + if (generator.warningString) { + if (!lookforIn(generator.warningString, "/tmp/stdout_%d", child)) return false; + } + return true; + } + printf("**** run failed for %s\n", binaryName); + return false; +} + + at end + + at implementation TestFileExeGenerator + at synthesize filename, compilerPath, errorString; + at synthesize hasObjC, hasRR, hasGC, hasCPlusPlus, wantsC99, supposedToNotCompile, open, wants32, wants64; + at synthesize radar; + at synthesize warningString; + +- (void)setFilename:(__strong char *)name { + filename = gcstrcpy1(name); +} +- (void)setCompilerPath:(__strong char *)name { + compilerPath = gcstrcpy1(name); +} + +- (void)forMostThings:(NSMutableArray *)lines options:(int)options { + TestFileExe *item = nil; + item = [self lineForOptions:options]; + if (item) [lines addObject:item]; + item = [self lineForOptions:options|Do64]; + if (item) [lines addObject:item]; + item = [self lineForOptions:options|DoCPP]; + if (item) [lines addObject:item]; + item = [self lineForOptions:options|Do64|DoCPP]; + if (item) [lines addObject:item]; +} + +/* + DoDashG = (1 << 8), + DoDashO = (1 << 9), + DoDashOs = (1 << 10), + DoDashO2 = (1 << 11), +*/ + +- (void)forAllThings:(NSMutableArray *)lines options:(int)options { + [self forMostThings:lines options:options]; + if (!Everything) { + return; + } + // now do it with three explicit optimization flags + [self forMostThings:lines options:options | DoDashO]; + [self forMostThings:lines options:options | DoDashOs]; + [self forMostThings:lines options:options | DoDashO2]; +} + +- (NSArray *)allLines { + NSMutableArray *result = [NSMutableArray new]; + TestFileExe *item = nil; + + int options = 0; + [self forAllThings:result options:0]; + [self forAllThings:result options:DoOBJC | DoRR]; + [self forAllThings:result options:DoOBJC | DoGC]; + [self forAllThings:result options:DoOBJC | DoGCRR]; + //[self forAllThings:result options:DoOBJC | DoRRGC]; + + return result; +} + +- (void)addLibrary:(const char *)dashLSomething { + if (!extraLibraries) { + extraLibraries = [NSPointerArray pointerArrayWithOptions: + NSPointerFunctionsStrongMemory | + NSPointerFunctionsCStringPersonality]; + } + [extraLibraries addPointer:(void *)dashLSomething]; +} + +- (TestFileExe *)lineForOptions:(int)options { // nil if no can do + if (hasObjC && !(options & DoOBJC)) return nil; + if (hasCPlusPlus && !(options & DoCPP)) return nil; + if (hasObjC) { + if (!hasGC && (options & (DoGC|DoGCRR))) return nil; // not smart enough + if (!hasRR && (options & (DoRR|DoRRGC))) return nil; + } + NSPointerArray *pa = [NSPointerArray pointerArrayWithOptions: + NSPointerFunctionsStrongMemory | + NSPointerFunctionsCStringPersonality]; + // construct path + char path[512]; + path[0] = 0; + if (!compilerPath) compilerPath = "/usr/bin"; + if (compilerPath) { + strcat(path, compilerPath); + strcat(path, "/"); + } + if (options & DoCPP) { + strcat(path, DoClang ? "clang++" : "g++-4.2"); + } + else { + strcat(path, DoClang ? "clang" : "gcc-4.2"); + } + [pa addPointer:gcstrcpy1(path)]; + if (options & DoOBJC) { + if (options & DoCPP) { + [pa addPointer:"-ObjC++"]; + } + else { + [pa addPointer:"-ObjC"]; + } + } + [pa addPointer:"-g"]; + if (options & DoDashO) [pa addPointer:"-O"]; + else if (options & DoDashO2) [pa addPointer:"-O2"]; + else if (options & DoDashOs) [pa addPointer:"-Os"]; + if (wantsC99 && (! (options & DoCPP))) { + [pa addPointer:"-std=c99"]; + [pa addPointer:"-fblocks"]; + } + [pa addPointer:"-arch"]; + [pa addPointer: (options & Do64) ? "x86_64" : "i386"]; + + if (options & DoOBJC) { + switch (options & (DoRR|DoGC|DoGCRR|DoRRGC)) { + case DoRR: + break; + case DoGC: + [pa addPointer:"-fobjc-gc-only"]; + break; + case DoGCRR: + [pa addPointer:"-fobjc-gc"]; + break; + case DoRRGC: + printf("DoRRGC unsupported right now\n"); + [pa addPointer:"-c"]; + return nil; + } + [pa addPointer:"-framework"]; + [pa addPointer:"Foundation"]; + } + [pa addPointer:gcstrcpy1(filename)]; + [pa addPointer:"-o"]; + + path[0] = 0; + strcat(path, filename); + strcat(path, "."); + strcat(path, (options & Do64) ? "64" : "32"); + if (options & DoOBJC) { + switch (options & (DoRR|DoGC|DoGCRR|DoRRGC)) { + case DoRR: strcat(path, "-rr"); break; + case DoGC: strcat(path, "-gconly"); break; + case DoGCRR: strcat(path, "-gcrr"); break; + case DoRRGC: strcat(path, "-rrgc"); break; + } + } + if (options & DoCPP) strcat(path, "++"); + if (options & DoDashO) strcat(path, "-O"); + else if (options & DoDashO2) strcat(path, "-O2"); + else if (options & DoDashOs) strcat(path, "-Os"); + if (wantsC99) strcat(path, "-C99"); + strcat(path, DoClang ? "-clang" : "-gcc"); + strcat(path, "-bin"); + TestFileExe *result = [TestFileExe new]; + result.binaryName = gcstrcpy1(path); // could snarf copy in pa + [pa addPointer:result.binaryName]; + for (id cString in extraLibraries) { + [pa addPointer:cString]; + } + + result.sourceName = gcstrcpy1(filename); // could snarf copy in pa + result.compileLine = pa; + result.options = options; + result.shouldFail = supposedToNotCompile; + result.generator = self; + return result; +} + ++ (NSArray *)generatorsFromPath:(NSString *)path { + FILE *fp = fopen([path fileSystemRepresentation], "r"); + if (fp == NULL) return nil; + NSArray *result = [self generatorsFromFILE:fp]; + fclose(fp); + return result; +} + +#define LOOKFOR "CON" "FIG" + +char *__strong parseRadar(char *line) { + line = strstr(line, "rdar:"); // returns beginning + char *endp = line + strlen("rdar:"); + while (*endp && *endp != ' ' && *endp != '\n') + ++endp; + return gcstrcpy2(line, endp); +} + +- (void)parseLibraries:(const char *)line { + start: + line = strstr(line, "-l"); + char *endp = (char *)line + 2; + while (*endp && *endp != ' ' && *endp != '\n') + ++endp; + [self addLibrary:gcstrcpy2(line, endp)]; + if (strstr(endp, "-l")) { + line = endp; + goto start; + } +} + ++ (TestFileExeGenerator *)generatorFromLine:(char *)line filename:(char *)filename { + TestFileExeGenerator *item = [TestFileExeGenerator new]; + item.filename = gcstrcpy1(filename); + if (strstr(line, "GC")) item.hasGC = true; + if (strstr(line, "RR")) item.hasRR = true; + if (strstr(line, "C++")) item.hasCPlusPlus = true; + if (strstr(line, "-C99")) { + item.wantsC99 = true; + } + if (strstr(line, "64")) item.wants64 = true; + if (strstr(line, "32")) item.wants32 = true; + if (strstr(line, "-l")) [item parseLibraries:line]; + if (strstr(line, "open")) item.open = true; + if (strstr(line, "FAIL")) item.supposedToNotCompile = true; // old + // compile time error + if (strstr(line, "error:")) { + item.supposedToNotCompile = true; + // zap newline + char *error = strstr(line, "error:") + strlen("error:"); + // make sure we have something before the newline + char *newline = strstr(error, "\n"); + if (newline && ((newline-error) > 1)) { + *newline = 0; + item.errorString = gcstrcpy1(strstr(line, "error:") + strlen("error: ")); + } + } + // run time warning + if (strstr(line, "runtime:")) { + // zap newline + char *error = strstr(line, "runtime:") + strlen("runtime:"); + // make sure we have something before the newline + char *newline = strstr(error, "\n"); + if (newline && ((newline-error) > 1)) { + *newline = 0; + item.warningString = gcstrcpy1(strstr(line, "runtime:") + strlen("runtime:")); + } + } + if (strstr(line, "rdar:")) item.radar = parseRadar(line); + if (item.hasGC || item.hasRR) item.hasObjC = true; + if (!item.wants32 && !item.wants64) { // give them both if they ask for neither + item.wants32 = item.wants64 = true; + } + return item; +} + ++ (NSArray *)generatorsFromFILE:(FILE *)fp { + NSMutableArray *result = [NSMutableArray new]; + // pretend this is a grep LOOKFOR *.[cmCM][cmCM] input + // look for + // filename: ... LOOKFOR [GC] [RR] [C++] [FAIL ...] + char buf[512]; + while (fgets(buf, 512, fp)) { + char *config = strstr(buf, LOOKFOR); + if (!config) continue; + char *filename = buf; + char *end = strchr(buf, ':'); + *end = 0; + [result addObject:[self generatorFromLine:config filename:filename]]; + } + return result; +} + ++ (TestFileExeGenerator *)generatorFromFilename:(char *)filename { + FILE *fp = fopen(filename, "r"); + if (!fp) { + printf("didn't open %s!!\n", filename); + return nil; + } + char buf[512]; + while (fgets(buf, 512, fp)) { + char *config = strstr(buf, LOOKFOR); + if (!config) continue; + fclose(fp); + return [self generatorFromLine:config filename:filename]; + } + fclose(fp); + // guess from filename + char *ext = strrchr(filename, '.'); + if (!ext) return nil; + TestFileExeGenerator *result = [TestFileExeGenerator new]; + result.filename = gcstrcpy1(filename); + if (!strncmp(ext, ".m", 2)) { + result.hasObjC = true; + result.hasRR = true; + result.hasGC = true; + } + else if (!strcmp(ext, ".c")) { + ; + } + else if (!strcmp(ext, ".M") || !strcmp(ext, ".mm")) { + result.hasObjC = true; + result.hasRR = true; + result.hasGC = true; + result.hasCPlusPlus = true; + } + else if (!strcmp(ext, ".cc") + || !strcmp(ext, ".cp") + || !strcmp(ext, ".cxx") + || !strcmp(ext, ".cpp") + || !strcmp(ext, ".CPP") + || !strcmp(ext, ".c++") + || !strcmp(ext, ".C")) { + result.hasCPlusPlus = true; + } + else { + printf("unknown extension, file %s ignored\n", filename); + result = nil; + } + return result; + +} + +- (NSString *)description { + return [NSString stringWithFormat:@"%s: %s%s%s%s%s%s", + filename, + LOOKFOR, + hasGC ? " GC" : "", + hasRR ? " RR" : "", + hasCPlusPlus ? " C++" : "", + wantsC99 ? "C99" : "", + supposedToNotCompile ? " FAIL" : ""]; +} + + at end + +void printDetails(NSArray *failures, const char *whatAreThey) { + if ([failures count]) { + NSMutableString *output = [NSMutableString new]; + printf("%s:\n", whatAreThey); + for (TestFileExe *line in failures) { + printf("%s", line.binaryName); + char *radar = line.generator.radar; + if (radar) + printf(" (due to %s?),", radar); + printf(" recompile via:\n%s\n\n", line.description.UTF8String); + } + printf("\n"); + } +} + +void help(const char *whoami) { + printf("Usage: %s [-fast] [-e] [-dyld librarypath] [gcc4.2dir] [-- | source1 ...]\n", whoami); + printf(" -fast don't recompile if binary younger than source\n"); + printf(" -open only run tests that are thought to still be unresolved\n"); + printf(" -clang use the clang and clang++ compilers\n"); + printf(" -e compile all variations also with -Os, -O2, -O3\n"); + printf(" -dyld p override DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH to p when running tests\n"); + printf(" directory containing gcc-4.2 (or clang) that you wish to use to compile the tests\n"); + printf(" -- assume stdin is a grep CON" "FIG across the test sources\n"); + printf(" otherwise treat each remaining argument as a single test file source\n"); + printf("%s will compile and run individual test files under a variety of compilers, c, obj-c, c++, and objc++\n", whoami); + printf(" .c files are compiled with all four compilers\n"); + printf(" .m files are compiled with objc and objc++ compilers\n"); + printf(" .C files are compiled with c++ and objc++ compilers\n"); + printf(" .M files are compiled only with the objc++ compiler\n"); + printf("(actually all forms of extensions recognized by the compilers are honored, .cc, .c++ etc.)\n"); + printf("\nTest files should run to completion with no output and exit (return) 0 on success.\n"); + printf("Further they should be able to be compiled and run with GC on or off and by the C++ compilers\n"); + printf("A line containing the string CON" "FIG within the source enables restrictions to the above assumptions\n"); + printf("and other options.\n"); + printf("Following CON" "FIG the string\n"); + printf(" C++ restricts the test to only be run by c++ and objc++ compilers\n"); + printf(" GC restricts the test to only be compiled and run with GC on\n"); + printf(" RR (retain/release) restricts the test to only be compiled and run with GC off\n"); + printf("Additionally,\n"); + printf(" -C99 restricts the C versions of the test to -fstd=c99 -fblocks\n"); + printf(" -O adds the -O optimization level\n"); + printf(" -O2 adds the -O2 optimization level\n"); + printf(" -Os adds the -Os optimization level\n"); + printf("Files that are known to exhibit unresolved problems can provide the term \"open\" and this can"); + printf("in turn allow highlighting of fixes that have regressed as well as identify that fixes are now available.\n"); + printf("Files that exhibit known bugs may provide\n"); + printf(" rdar://whatever such that if they fail the rdar will get cited\n"); + printf("Files that are expected to fail to compile should provide, as their last token sequence,\n"); + printf(" error:\n"); + printf(" or error: substring to match.\n"); + printf("Files that are expected to produce a runtime error message should provide, as their last token sequence,\n"); + printf(" warning: string to match\n"); + printf("\n%s will compile and run all configurations of the test files and report a summary at the end. Good luck.\n", whoami); + printf(" Blaine Garst blaine at apple.com\n"); +} + +int main(int argc, char *argv[]) { + printf("running on %s-bit architecture\n", sizeof(long) == 4 ? "32" : "64"); + char *compilerDir = "/usr/bin"; + NSMutableArray *generators = [NSMutableArray new]; + bool doFast = false; + bool doStdin = false; + bool onlyOpen = false; + char *libraryPath = getenv("DYLD_LIBRARY_PATH"); + char *frameworkPath = getenv("DYLD_FRAMEWORK_PATH"); + // process options + while (argc > 1) { + if (!strcmp(argv[1], "-fast")) { + doFast = true; + --argc; + ++argv; + } + else if (!strcmp(argv[1], "-dyld")) { + doFast = true; + --argc; + ++argv; + frameworkPath = argv[1]; + libraryPath = argv[1]; + --argc; + ++argv; + } + else if (!strcmp(argv[1], "-open")) { + onlyOpen = true; + --argc; + ++argv; + } + else if (!strcmp(argv[1], "-clang")) { + DoClang = true; + --argc; + ++argv; + } + else if (!strcmp(argv[1], "-e")) { + Everything = true; + --argc; + ++argv; + } + else if (!strcmp(argv[1], "--")) { + doStdin = true; + --argc; + ++argv; + } + else if (!strcmp(argv[1], "-")) { + help(argv[0]); + return 1; + } + else if (argc > 1 && isDirectory(argv[1])) { + compilerDir = argv[1]; + ++argv; + --argc; + } + else + break; + } + // process remaining arguments, or stdin + if (argc == 1) { + if (doStdin) + generators = (NSMutableArray *)[TestFileExeGenerator generatorsFromFILE:stdin]; + else { + help(argv[0]); + return 1; + } + } + else while (argc > 1) { + TestFileExeGenerator *generator = [TestFileExeGenerator generatorFromFilename:argv[1]]; + if (generator) [generators addObject:generator]; + ++argv; + --argc; + } + // see if we can generate all possibilities + NSMutableArray *failureToCompile = [NSMutableArray new]; + NSMutableArray *failureToFailToCompile = [NSMutableArray new]; + NSMutableArray *failureToRun = [NSMutableArray new]; + NSMutableArray *successes = [NSMutableArray new]; + for (TestFileExeGenerator *generator in generators) { + //NSLog(@"got %@", generator); + if (onlyOpen && !generator.open) { + //printf("skipping resolved test %s\n", generator.filename); + continue; // skip closed if onlyOpen + } + if (!onlyOpen && generator.open) { + //printf("skipping open test %s\n", generator.filename); + continue; // skip open if not asked for onlyOpen + } + generator.compilerPath = compilerDir; + NSArray *tests = [generator allLines]; + for (TestFileExe *line in tests) { + line.frameworkPath = frameworkPath; // tell generators about it instead XXX + line.libraryPath = libraryPath; // tell generators about it instead XXX + if ([line shouldFail]) { + if (doFast) continue; // don't recompile & don't count as success + if ([line compileWithExpectedFailure]) { + [successes addObject:line]; + } + else + [failureToFailToCompile addObject:line]; + } + else if ([line compileUnlessExists:doFast]) { + if ([line run]) { + printf("%s ran successfully\n", line.binaryName); + [successes addObject:line]; + } + else { + [failureToRun addObject:line]; + } + } + else { + [failureToCompile addObject:line]; + } + } + } + printf("\n--- results ---\n\n%lu successes\n%lu unexpected compile failures\n%lu failure to fail to compile errors\n%lu run failures\n", + [successes count], [failureToCompile count], [failureToFailToCompile count], [failureToRun count]); + printDetails(failureToCompile, "unexpected compile failures"); + printDetails(failureToFailToCompile, "should have failed to compile but didn't failures"); + printDetails(failureToRun, "run failures"); + + if (onlyOpen && [successes count]) { + NSMutableSet *radars = [NSMutableSet new]; + printf("The following tests ran successfully suggesting that they are now resolved:\n"); + for (TestFileExe *line in successes) { + printf("%s\n", line.binaryName); + if (line.radar) [radars addObject:line.generator]; + } + if ([radars count]) { + printf("The following radars may be resolved:\n"); + for (TestFileExeGenerator *line in radars) { + printf("%s\n", line.radar); + } + } + } + + return [failureToCompile count] + [failureToRun count]; +} + +#include + +static bool isDirectory(char *path) { + struct stat statb; + int retval = stat(path, &statb); + if (retval != 0) return false; + if (statb.st_mode & S_IFDIR) return true; + return false; +} + +static bool isExecutable(char *path) { + struct stat statb; + int retval = stat(path, &statb); + if (retval != 0) return false; + if (!(statb.st_mode & S_IFREG)) return false; + if (statb.st_mode & S_IXUSR) return true; + return false; +} + +static bool isYounger(char *source, char *binary) { + struct stat statb; + int retval = stat(binary, &statb); + if (retval != 0) return true; // if doesn't exit, lie + + struct stat stata; + retval = stat(source, &stata); + if (retval != 0) return true; // we're hosed + // the greater the timeval the younger it is + if (stata.st_mtimespec.tv_sec > statb.st_mtimespec.tv_sec) return true; + if (stata.st_mtimespec.tv_nsec > statb.st_mtimespec.tv_nsec) return true; + return false; +} + +static bool readErrorFile(char *buffer, const char *from) { + int fd = open(from, 0); + if (fd < 0) { + printf("didn't open %s, (might not have been created?)\n", buffer); + return false; + } + int count = read(fd, buffer, 512); + if (count < 1) { + printf("read error on %s\n", buffer); + return false; + } + buffer[count-1] = 0; // zap newline + return true; +} Added: compiler-rt/trunk/BlocksRuntime/tests/varargs-bad-assign.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/varargs-bad-assign.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/varargs-bad-assign.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/varargs-bad-assign.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,44 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*- +// HACK ALERT: gcc and g++ give different errors, referencing the line number to ensure that it checks for the right error; MUST KEEP IN SYNC WITH THE TEST +// CONFIG 27: error: + +#import +#import +#import +#import + + +int main (int argc, const char * argv[]) { + int (^sumn)(int n, ...); + int six = 0; + + sumn = ^(int a, int b, int n, ...){ + int result = 0; + va_list numbers; + int i; + + va_start(numbers, n); + for (i = 0 ; i < n ; i++) { + result += va_arg(numbers, int); + } + va_end(numbers); + + return result; + }; + + six = sumn(3, 1, 2, 3); + + if ( six != 6 ) { + printf("%s: Expected 6 but got %d\n", argv[0], six); + exit(1); + } + + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/varargs.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/varargs.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/varargs.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/varargs.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,39 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*- +// CONFIG + +#import +#import +#import +#import + + +int main (int argc, const char * argv[]) { + int (^sumn)(int n, ...) = ^(int n, ...){ + int result = 0; + va_list numbers; + int i; + + va_start(numbers, n); + for (i = 0 ; i < n ; i++) { + result += va_arg(numbers, int); + } + va_end(numbers); + + return result; + }; + int six = sumn(3, 1, 2, 3); + + if ( six != 6 ) { + printf("%s: Expected 6 but got %d\n", argv[0], six); + exit(1); + } + + printf("%s: success\n", argv[0]); + return 0; +} Added: compiler-rt/trunk/BlocksRuntime/tests/variadic.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/variadic.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/variadic.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/variadic.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,66 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * variadic.c + * testObjects + * + * Created by Blaine Garst on 2/17/09. + * + */ + +// PURPOSE Test that variadic arguments compile and work for Blocks +// CONFIG + +#include +#include + +int main(int argc, char *argv[]) { + + long (^addthem)(const char *, ...) = ^long (const char *format, ...){ + va_list argp; + const char *p; + int i; + char c; + double d; + long result = 0; + va_start(argp, format); + //printf("starting...\n"); + for (p = format; *p; p++) switch (*p) { + case 'i': + i = va_arg(argp, int); + //printf("i: %d\n", i); + result += i; + break; + case 'd': + d = va_arg(argp, double); + //printf("d: %g\n", d); + result += (int)d; + break; + case 'c': + c = va_arg(argp, int); + //printf("c: '%c'\n", c); + result += c; + break; + } + //printf("...done\n\n"); + return result; + }; + long testresult = addthem("ii", 10, 20); + if (testresult != 30) { + printf("got wrong result: %ld\n", testresult); + return 1; + } + testresult = addthem("idc", 30, 40.0, 'a'); + if (testresult != (70+'a')) { + printf("got different wrong result: %ld\n", testresult); + return 1; + } + printf("%s: Success\n", argv[0]); + return 0; +} + + Added: compiler-rt/trunk/BlocksRuntime/tests/voidarg.c URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/tests/voidarg.c?rev=110278&view=auto ============================================================================== --- compiler-rt/trunk/BlocksRuntime/tests/voidarg.c (added) +++ compiler-rt/trunk/BlocksRuntime/tests/voidarg.c Wed Aug 4 18:34:21 2010 @@ -0,0 +1,27 @@ +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +/* + * voidarg.c + * testObjects + * + * Created by Blaine Garst on 2/17/09. + * + */ + +// PURPOSE should complain about missing 'void' but both GCC and clang are supporting K&R instead +// CONFIG open error: + +#include + +int Global; + +void (^globalBlock)() = ^{ ++Global; }; // should be void (^gb)(void) = ... + +int main(int argc, char *argv[]) { + printf("%s: success", argv[0]); + return 0; +} From isanbard at gmail.com Wed Aug 4 18:36:02 2010 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 04 Aug 2010 23:36:02 -0000 Subject: [llvm-commits] [llvm] r110279 - in /llvm/trunk: lib/CodeGen/LLVMTargetMachine.cpp test/CodeGen/X86/2010-08-04-MingWCrash.ll Message-ID: <20100804233602.5B6762A6C12C@llvm.org> Author: void Date: Wed Aug 4 18:36:02 2010 New Revision: 110279 URL: http://llvm.org/viewvc/llvm-project?rev=110279&view=rev Log: The lower invoke pass needs to have unreachable code elimination run after it because it could create such things. This fixes a MingW buildbot test failure. Added: llvm/trunk/test/CodeGen/X86/2010-08-04-MingWCrash.ll Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=110279&r1=110278&r2=110279&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Wed Aug 4 18:36:02 2010 @@ -288,13 +288,15 @@ // pad is shared by multiple invokes and is also a target of a normal // edge from elsewhere. PM.add(createSjLjEHPass(getTargetLowering())); - PM.add(createDwarfEHPass(this, OptLevel==CodeGenOpt::None)); - break; + // FALLTHROUGH case ExceptionHandling::Dwarf: PM.add(createDwarfEHPass(this, OptLevel==CodeGenOpt::None)); break; case ExceptionHandling::None: PM.add(createLowerInvokePass(getTargetLowering())); + + // The lower invoke pass may create unreachable code. Remove it. + PM.add(createUnreachableBlockEliminationPass()); break; } Added: llvm/trunk/test/CodeGen/X86/2010-08-04-MingWCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-08-04-MingWCrash.ll?rev=110279&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2010-08-04-MingWCrash.ll (added) +++ llvm/trunk/test/CodeGen/X86/2010-08-04-MingWCrash.ll Wed Aug 4 18:36:02 2010 @@ -0,0 +1,39 @@ +; RUN: llc < %s -mtriple=i386-pc-mingw32 + +define void @func() nounwind { +invoke.cont: + %call = tail call i8* @malloc() + %a = invoke i32 @bar() + to label %bb1 unwind label %lpad + +bb1: + ret void + +lpad: + %exn = tail call i8* @llvm.eh.exception() nounwind + %eh.selector = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %exn, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i32 1, i8* null) nounwind + %ehspec.fails = icmp slt i32 %eh.selector, 0 + br i1 %ehspec.fails, label %ehspec.unexpected, label %cleanup + +cleanup: + tail call void @_Unwind_Resume_or_Rethrow(i8* %exn) noreturn nounwind + unreachable + +ehspec.unexpected: + tail call void @__cxa_call_unexpected(i8* %exn) noreturn nounwind + unreachable +} + +declare noalias i8* @malloc() + +declare i8* @llvm.eh.exception() nounwind readonly + +declare i32 @__gxx_personality_v0(...) + +declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind + +declare void @_Unwind_Resume_or_Rethrow(i8*) + +declare void @__cxa_call_unexpected(i8*) + +declare i32 @bar() From gohman at apple.com Wed Aug 4 18:37:55 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 23:37:55 -0000 Subject: [llvm-commits] [llvm] r110280 - in /llvm/trunk: lib/Analysis/AliasAnalysisEvaluator.cpp test/Analysis/BasicAA/args-rets-allocas-loads.ll test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Message-ID: <20100804233755.B7D662A6C12C@llvm.org> Author: djg Date: Wed Aug 4 18:37:55 2010 New Revision: 110280 URL: http://llvm.org/viewvc/llvm-project?rev=110280&view=rev Log: The trouble with testing for "ModRef" and "NoModRef" is that one is a suffix of the other, and FileCheck accepts superstrings. Adjust the output to avoid this problem. Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=110280&r1=110279&r2=110280&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Wed Aug 4 18:37:55 2010 @@ -204,13 +204,13 @@ PrintModRefResults("NoModRef", PrintNoModRef, I, *V, F.getParent()); ++NoModRef; break; case AliasAnalysis::Mod: - PrintModRefResults(" Mod", PrintMod, I, *V, F.getParent()); + PrintModRefResults("Just Mod", PrintMod, I, *V, F.getParent()); ++Mod; break; case AliasAnalysis::Ref: - PrintModRefResults(" Ref", PrintRef, I, *V, F.getParent()); + PrintModRefResults("Just Ref", PrintRef, I, *V, F.getParent()); ++Ref; break; case AliasAnalysis::ModRef: - PrintModRefResults(" ModRef", PrintModRef, I, *V, F.getParent()); + PrintModRefResults("Both ModRef", PrintModRef, I, *V, F.getParent()); ++ModRef; break; default: errs() << "Unknown alias query result!\n"; @@ -229,13 +229,13 @@ PrintModRefResults("NoModRef", PrintNoModRef, *C, *D, F.getParent()); ++NoModRef; break; case AliasAnalysis::Mod: - PrintModRefResults(" Mod", PrintMod, *C, *D, F.getParent()); + PrintModRefResults("Just Mod", PrintMod, *C, *D, F.getParent()); ++Mod; break; case AliasAnalysis::Ref: - PrintModRefResults(" Ref", PrintRef, *C, *D, F.getParent()); + PrintModRefResults("Just Ref", PrintRef, *C, *D, F.getParent()); ++Ref; break; case AliasAnalysis::ModRef: - PrintModRefResults(" ModRef", PrintModRef, *C, *D, F.getParent()); + PrintModRefResults("Both ModRef", PrintModRef, *C, *D, F.getParent()); ++ModRef; break; } } Modified: llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll?rev=110280&r1=110279&r2=110280&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/args-rets-allocas-loads.ll Wed Aug 4 18:37:55 2010 @@ -168,132 +168,132 @@ ; CHECK: NoAlias: double* %noalias_ret_a1, double* %normal_ret_a0 ; CHECK: NoAlias: double* %noalias_ret_a1, double* %normal_ret_a1 ; CHECK: NoAlias: double* %noalias_ret_a0, double* %noalias_ret_a1 -; CHECK: ModRef: Ptr: double* %arg_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %arg_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %arg_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %arg_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double** %indirect_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double** %indirect_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %loaded_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %loaded_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double** %indirect_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double** %indirect_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %loaded_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %loaded_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %normal_ret_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %normal_ret_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> %normal_ret_a0 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %arg_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %arg_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %arg_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %arg_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double** %indirect_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double** %indirect_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %loaded_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %loaded_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double** %indirect_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double** %indirect_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %loaded_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %loaded_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %normal_ret_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %normal_ret_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> %normal_ret_a1 = call double* @normal_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %arg_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %arg_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %arg_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %arg_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double** %indirect_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double** %indirect_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %loaded_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %loaded_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double** %indirect_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double** %indirect_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %loaded_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %loaded_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %noalias_ret_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %normal_ret_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %normal_ret_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %noalias_ret_a0 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> %noalias_ret_a0 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %arg_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %arg_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %arg_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %arg_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double** %indirect_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double** %indirect_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %loaded_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %loaded_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double** %indirect_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double** %indirect_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %loaded_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %loaded_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %normal_ret_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %normal_ret_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] ; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %noalias_ret_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] -; CHECK: ModRef: Ptr: double* %arg_a0 <-> call void @callee(double* %escape_alloca_a0) -; CHECK: ModRef: Ptr: double* %arg_a1 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %noalias_ret_a1 <-> %noalias_ret_a1 = call double* @noalias_returner() ; [#uses=1] +; CHECK: Both ModRef: Ptr: double* %arg_a0 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %arg_a1 <-> call void @callee(double* %escape_alloca_a0) ; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @callee(double* %escape_alloca_a0) ; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @callee(double* %escape_alloca_a0) -; CHECK: ModRef: Ptr: double** %indirect_a0 <-> call void @callee(double* %escape_alloca_a0) -; CHECK: ModRef: Ptr: double** %indirect_a1 <-> call void @callee(double* %escape_alloca_a0) -; CHECK: ModRef: Ptr: double* %loaded_a0 <-> call void @callee(double* %escape_alloca_a0) -; CHECK: ModRef: Ptr: double* %loaded_a1 <-> call void @callee(double* %escape_alloca_a0) -; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @callee(double* %escape_alloca_a0) -; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: Both ModRef: Ptr: double** %indirect_a0 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: Both ModRef: Ptr: double** %indirect_a1 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %loaded_a0 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %loaded_a1 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a0 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a1 <-> call void @callee(double* %escape_alloca_a0) ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> call void @callee(double* %escape_alloca_a0) ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> call void @callee(double* %escape_alloca_a0) -; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> call void @callee(double* %escape_alloca_a0) -; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %normal_ret_a0 <-> call void @callee(double* %escape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %normal_ret_a1 <-> call void @callee(double* %escape_alloca_a0) ; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @callee(double* %escape_alloca_a0) ; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @callee(double* %escape_alloca_a0) -; CHECK: ModRef: Ptr: double* %arg_a0 <-> call void @callee(double* %escape_alloca_a1) -; CHECK: ModRef: Ptr: double* %arg_a1 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %arg_a0 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %arg_a1 <-> call void @callee(double* %escape_alloca_a1) ; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @callee(double* %escape_alloca_a1) ; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @callee(double* %escape_alloca_a1) -; CHECK: ModRef: Ptr: double** %indirect_a0 <-> call void @callee(double* %escape_alloca_a1) -; CHECK: ModRef: Ptr: double** %indirect_a1 <-> call void @callee(double* %escape_alloca_a1) -; CHECK: ModRef: Ptr: double* %loaded_a0 <-> call void @callee(double* %escape_alloca_a1) -; CHECK: ModRef: Ptr: double* %loaded_a1 <-> call void @callee(double* %escape_alloca_a1) -; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @callee(double* %escape_alloca_a1) -; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: Both ModRef: Ptr: double** %indirect_a0 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: Both ModRef: Ptr: double** %indirect_a1 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %loaded_a0 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %loaded_a1 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a0 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a1 <-> call void @callee(double* %escape_alloca_a1) ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> call void @callee(double* %escape_alloca_a1) ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> call void @callee(double* %escape_alloca_a1) -; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> call void @callee(double* %escape_alloca_a1) -; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %normal_ret_a0 <-> call void @callee(double* %escape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %normal_ret_a1 <-> call void @callee(double* %escape_alloca_a1) ; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @callee(double* %escape_alloca_a1) ; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @callee(double* %escape_alloca_a1) -; CHECK: ModRef: Ptr: double* %arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; CHECK: ModRef: Ptr: double* %arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) ; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) ; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; CHECK: ModRef: Ptr: double** %indirect_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; CHECK: ModRef: Ptr: double** %indirect_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; CHECK: ModRef: Ptr: double* %loaded_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; CHECK: ModRef: Ptr: double* %loaded_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; CHECK: ModRef: Ptr: double* %noescape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: Both ModRef: Ptr: double** %indirect_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: Both ModRef: Ptr: double** %indirect_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %loaded_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %loaded_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %noescape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %normal_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) +; CHECK: Both ModRef: Ptr: double* %normal_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) ; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a0) ; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a0) -; CHECK: ModRef: Ptr: double* %arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; CHECK: ModRef: Ptr: double* %arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) ; CHECK: NoModRef: Ptr: double* %noalias_arg_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) ; CHECK: NoModRef: Ptr: double* %noalias_arg_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; CHECK: ModRef: Ptr: double** %indirect_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; CHECK: ModRef: Ptr: double** %indirect_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; CHECK: ModRef: Ptr: double* %loaded_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; CHECK: ModRef: Ptr: double* %loaded_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; CHECK: ModRef: Ptr: double* %escape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; CHECK: ModRef: Ptr: double* %escape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: Both ModRef: Ptr: double** %indirect_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: Both ModRef: Ptr: double** %indirect_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %loaded_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %loaded_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %escape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) ; CHECK: NoModRef: Ptr: double* %noescape_alloca_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; CHECK: ModRef: Ptr: double* %noescape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; CHECK: ModRef: Ptr: double* %normal_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) -; CHECK: ModRef: Ptr: double* %normal_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %noescape_alloca_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %normal_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) +; CHECK: Both ModRef: Ptr: double* %normal_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) ; CHECK: NoModRef: Ptr: double* %noalias_ret_a0 <-> call void @nocap_callee(double* %noescape_alloca_a1) ; CHECK: NoModRef: Ptr: double* %noalias_ret_a1 <-> call void @nocap_callee(double* %noescape_alloca_a1) ; CHECK: ===== Alias Analysis Evaluator Report ===== Modified: llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll?rev=110280&r1=110279&r2=110280&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Wed Aug 4 18:37:55 2010 @@ -1,6 +1,6 @@ ; RUN: opt < %s -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s -; CHECK: {{[[:<:]]}}Ref: call void @ro() <-> call void @f0() +; CHECK: Just Ref: call void @ro() <-> call void @f0() declare void @f0() declare void @ro() readonly From gohman at apple.com Wed Aug 4 18:43:56 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 23:43:56 -0000 Subject: [llvm-commits] [llvm] r110283 - /llvm/trunk/test/MC/COFF/ Message-ID: <20100804234356.13DDE2A6C12C@llvm.org> Author: djg Date: Wed Aug 4 18:43:55 2010 New Revision: 110283 URL: http://llvm.org/viewvc/llvm-project?rev=110283&view=rev Log: svn:ignore Modified: llvm/trunk/test/MC/COFF/ (props changed) Propchange: llvm/trunk/test/MC/COFF/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Wed Aug 4 18:43:55 2010 @@ -0,0 +1 @@ +Output From gohman at apple.com Wed Aug 4 18:44:23 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 04 Aug 2010 23:44:23 -0000 Subject: [llvm-commits] [llvm] r110284 - /llvm/trunk/test/Transforms/LowerAtomic/ Message-ID: <20100804234423.CCEFC2A6C12C@llvm.org> Author: djg Date: Wed Aug 4 18:44:23 2010 New Revision: 110284 URL: http://llvm.org/viewvc/llvm-project?rev=110284&view=rev Log: svn:ignore Modified: llvm/trunk/test/Transforms/LowerAtomic/ (props changed) Propchange: llvm/trunk/test/Transforms/LowerAtomic/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Wed Aug 4 18:44:23 2010 @@ -0,0 +1 @@ +Output From rafael.espindola at gmail.com Wed Aug 4 19:29:05 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Thu, 05 Aug 2010 00:29:05 -0000 Subject: [llvm-commits] [llvm] r110291 - in /llvm/trunk/tools/bugpoint: BugDriver.h CrashDebugger.cpp FindBugs.cpp Miscompilation.cpp OptimizerDriver.cpp Message-ID: <20100805002905.2B23D2A6C12C@llvm.org> Author: rafael Date: Wed Aug 4 19:29:04 2010 New Revision: 110291 URL: http://llvm.org/viewvc/llvm-project?rev=110291&view=rev Log: Make EmitProgressBitcode const and add a Module argument to runPasses. Use that argument to simplify runPassesOn. Modified: llvm/trunk/tools/bugpoint/BugDriver.h llvm/trunk/tools/bugpoint/CrashDebugger.cpp llvm/trunk/tools/bugpoint/FindBugs.cpp llvm/trunk/tools/bugpoint/Miscompilation.cpp llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Modified: llvm/trunk/tools/bugpoint/BugDriver.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.h?rev=110291&r1=110290&r2=110291&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/BugDriver.h (original) +++ llvm/trunk/tools/bugpoint/BugDriver.h Wed Aug 4 19:29:04 2010 @@ -213,7 +213,7 @@ /// "bugpoint-ID.bc". /// void EmitProgressBitcode(const Module *M, const std::string &ID, - bool NoFlyer = false); + bool NoFlyer = false) const; /// deleteInstructionFromProgram - This method clones the current Program and /// deletes the specified instruction from the cloned module. It then runs a @@ -261,7 +261,8 @@ /// or failed, unless Quiet is set. ExtraArgs specifies additional arguments /// to pass to the child bugpoint instance. /// - bool runPasses(const std::vector &PassesToRun, + bool runPasses(Module *Program, + const std::vector &PassesToRun, std::string &OutputFilename, bool DeleteOutput = false, bool Quiet = false, unsigned NumExtraArgs = 0, const char * const *ExtraArgs = NULL) const; @@ -289,7 +290,7 @@ bool runPasses(const std::vector &PassesToRun, bool DeleteOutput = true) const { std::string Filename; - return runPasses(PassesToRun, Filename, DeleteOutput); + return runPasses(Program, PassesToRun, Filename, DeleteOutput); } /// runAsChild - The actual "runPasses" guts that runs in a child process. Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CrashDebugger.cpp?rev=110291&r1=110290&r2=110291&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original) +++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Wed Aug 4 19:29:04 2010 @@ -68,7 +68,7 @@ outs() << "Checking to see if these passes crash: " << getPassesString(Prefix) << ": "; std::string PfxOutput; - if (BD.runPasses(Prefix, PfxOutput)) + if (BD.runPasses(BD.getProgram(), Prefix, PfxOutput)) return KeepPrefix; PrefixOutput.set(PfxOutput); Modified: llvm/trunk/tools/bugpoint/FindBugs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/FindBugs.cpp?rev=110291&r1=110290&r2=110291&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/FindBugs.cpp (original) +++ llvm/trunk/tools/bugpoint/FindBugs.cpp Wed Aug 4 19:29:04 2010 @@ -62,7 +62,7 @@ } std::string Filename; - if(runPasses(PassesToRun, Filename, false)) { + if(runPasses(Program, PassesToRun, Filename, false)) { outs() << "\n"; outs() << "Optimizer passes caused failure!\n\n"; debugOptimizerCrash(); Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=110291&r1=110290&r2=110291&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original) +++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Wed Aug 4 19:29:04 2010 @@ -67,7 +67,8 @@ << "' compiles correctly: "; std::string BitcodeResult; - if (BD.runPasses(Suffix, BitcodeResult, false/*delete*/, true/*quiet*/)) { + if (BD.runPasses(BD.getProgram(), Suffix, BitcodeResult, false/*delete*/, + true/*quiet*/)) { errs() << " Error running this sequence of passes" << " on the input program!\n"; BD.setPassesToRun(Suffix); @@ -104,7 +105,8 @@ // kept passes, we can update our bitcode file to include the result of the // prefix passes, then discard the prefix passes. // - if (BD.runPasses(Prefix, BitcodeResult, false/*delete*/, true/*quiet*/)) { + if (BD.runPasses(BD.getProgram(), Prefix, BitcodeResult, false/*delete*/, + true/*quiet*/)) { errs() << " Error running this sequence of passes" << " on the input program!\n"; BD.setPassesToRun(Prefix); @@ -144,7 +146,8 @@ << getPassesString(Prefix) << "' passes: "; OwningPtr OriginalInput(BD.swapProgramIn(PrefixOutput.take())); - if (BD.runPasses(Suffix, BitcodeResult, false/*delete*/, true/*quiet*/)) { + if (BD.runPasses(BD.getProgram(), Suffix, BitcodeResult, false/*delete*/, + true/*quiet*/)) { errs() << " Error running this sequence of passes" << " on the input program!\n"; BD.setPassesToRun(Suffix); Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=110291&r1=110290&r2=110291&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Wed Aug 4 19:29:04 2010 @@ -66,7 +66,8 @@ /// to a file named "bugpoint-ID.bc". /// void BugDriver::EmitProgressBitcode(const Module *M, - const std::string &ID, bool NoFlyer) { + const std::string &ID, + bool NoFlyer) const { // Output the input to the current pass to a bitcode file, emit a message // telling the user how to reproduce it: opt -foo blah.bc // @@ -125,7 +126,8 @@ /// outs() a single line message indicating whether compilation was successful /// or failed. /// -bool BugDriver::runPasses(const std::vector &Passes, +bool BugDriver::runPasses(Module *Program, + const std::vector &Passes, std::string &OutputFilename, bool DeleteOutput, bool Quiet, unsigned NumExtraArgs, const char * const *ExtraArgs) const { @@ -239,24 +241,19 @@ const std::vector &Passes, bool AutoDebugCrashes, unsigned NumExtraArgs, const char * const *ExtraArgs) { - Module *OldProgram = swapProgramIn(M); std::string BitcodeResult; - if (runPasses(Passes, BitcodeResult, false/*delete*/, true/*quiet*/, + if (runPasses(M, Passes, BitcodeResult, false/*delete*/, true/*quiet*/, NumExtraArgs, ExtraArgs)) { if (AutoDebugCrashes) { errs() << " Error running this sequence of passes" << " on the input program!\n"; - delete OldProgram; - EmitProgressBitcode(Program, "pass-error", false); + delete swapProgramIn(M); + EmitProgressBitcode(M, "pass-error", false); exit(debugOptimizerCrash()); } - swapProgramIn(OldProgram); return 0; } - // Restore the current program. - swapProgramIn(OldProgram); - Module *Ret = ParseInputFile(BitcodeResult, Context); if (Ret == 0) { errs() << getToolName() << ": Error reading bitcode file '" From bob.wilson at apple.com Wed Aug 4 19:34:42 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Thu, 05 Aug 2010 00:34:42 -0000 Subject: [llvm-commits] [llvm] r110292 - in /llvm/trunk: lib/Target/ARM/ARMAsmPrinter.cpp lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp test/MC/Disassembler/arm-tests.txt Message-ID: <20100805003442.72EF82A6C12C@llvm.org> Author: bwilson Date: Wed Aug 4 19:34:42 2010 New Revision: 110292 URL: http://llvm.org/viewvc/llvm-project?rev=110292&view=rev Log: ARM "rrx" shift operands do not have an immediate. PR7790. Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp llvm/trunk/test/MC/Disassembler/arm-tests.txt Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp?rev=110292&r1=110291&r2=110292&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Wed Aug 4 19:34:42 2010 @@ -468,15 +468,13 @@ O << getRegisterName(MO1.getReg()); // Print the shift opc. - O << ", " - << ARM_AM::getShiftOpcStr(ARM_AM::getSORegShOp(MO3.getImm())) - << " "; - + ARM_AM::ShiftOpc ShOpc = ARM_AM::getSORegShOp(MO3.getImm()); + O << ", " << ARM_AM::getShiftOpcStr(ShOpc); if (MO2.getReg()) { - O << getRegisterName(MO2.getReg()); + O << ' ' << getRegisterName(MO2.getReg()); assert(ARM_AM::getSORegOffset(MO3.getImm()) == 0); - } else { - O << "#" << ARM_AM::getSORegOffset(MO3.getImm()); + } else if (ShOpc != ARM_AM::rrx) { + O << " #" << ARM_AM::getSORegOffset(MO3.getImm()); } } @@ -767,12 +765,11 @@ O << getRegisterName(Reg); // Print the shift opc. - O << ", " - << ARM_AM::getShiftOpcStr(ARM_AM::getSORegShOp(MO2.getImm())) - << " "; - assert(MO2.isImm() && "Not a valid t2_so_reg value!"); - O << "#" << ARM_AM::getSORegOffset(MO2.getImm()); + ARM_AM::ShiftOpc ShOpc = ARM_AM::getSORegShOp(MO2.getImm()); + O << ", " << ARM_AM::getShiftOpcStr(ShOpc); + if (ShOpc != ARM_AM::rrx) + O << " #" << ARM_AM::getSORegOffset(MO2.getImm()); } void ARMAsmPrinter::printT2AddrModeImm12Operand(const MachineInstr *MI, Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp?rev=110292&r1=110291&r2=110292&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp Wed Aug 4 19:34:42 2010 @@ -278,15 +278,13 @@ O << getRegisterName(MO1.getReg()); // Print the shift opc. - O << ", " - << ARM_AM::getShiftOpcStr(ARM_AM::getSORegShOp(MO3.getImm())) - << ' '; - + ARM_AM::ShiftOpc ShOpc = ARM_AM::getSORegShOp(MO3.getImm()); + O << ", " << ARM_AM::getShiftOpcStr(ShOpc); if (MO2.getReg()) { - O << getRegisterName(MO2.getReg()); + O << ' ' << getRegisterName(MO2.getReg()); assert(ARM_AM::getSORegOffset(MO3.getImm()) == 0); - } else { - O << "#" << ARM_AM::getSORegOffset(MO3.getImm()); + } else if (ShOpc != ARM_AM::rrx) { + O << " #" << ARM_AM::getSORegOffset(MO3.getImm()); } } @@ -669,12 +667,11 @@ O << getRegisterName(Reg); // Print the shift opc. - O << ", " - << ARM_AM::getShiftOpcStr(ARM_AM::getSORegShOp(MO2.getImm())) - << " "; - assert(MO2.isImm() && "Not a valid t2_so_reg value!"); - O << "#" << ARM_AM::getSORegOffset(MO2.getImm()); + ARM_AM::ShiftOpc ShOpc = ARM_AM::getSORegShOp(MO2.getImm()); + O << ", " << ARM_AM::getShiftOpcStr(ShOpc); + if (ShOpc != ARM_AM::rrx) + O << " #" << ARM_AM::getSORegOffset(MO2.getImm()); } void ARMInstPrinter::printT2AddrModeImm12Operand(const MCInst *MI, Modified: llvm/trunk/test/MC/Disassembler/arm-tests.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/arm-tests.txt?rev=110292&r1=110291&r2=110292&view=diff ============================================================================== --- llvm/trunk/test/MC/Disassembler/arm-tests.txt (original) +++ llvm/trunk/test/MC/Disassembler/arm-tests.txt Wed Aug 4 19:34:42 2010 @@ -42,6 +42,10 @@ # CHECK: mvnpls r7, #245, 2 0xf5 0x71 0xf0 0x53 +# CHECK-NOT: orr r7, r8, r7, rrx #0 +# CHECK: orr r7, r8, r7, rrx +0x67 0x70 0x88 0xe1 + # CHECK: pkhbt r8, r9, r10, lsl #4 0x1a 0x82 0x89 0xe6 From gohman at apple.com Wed Aug 4 19:43:10 2010 From: gohman at apple.com (Dan Gohman) Date: Thu, 05 Aug 2010 00:43:10 -0000 Subject: [llvm-commits] [llvm] r110293 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Message-ID: <20100805004310.95E282A6C12C@llvm.org> Author: djg Date: Wed Aug 4 19:43:10 2010 New Revision: 110293 URL: http://llvm.org/viewvc/llvm-project?rev=110293&view=rev Log: Revert r110270 for now. It appears to uncover a memdep bug. Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110293&r1=110292&r2=110293&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Aug 4 19:43:10 2010 @@ -425,8 +425,8 @@ ModRefBehavior CS2B = AliasAnalysis::getModRefBehavior(CS2); if (CS2B == DoesNotAccessMemory) return NoModRef; - // If CS1 only reads from memory, just return ref. - if (CS1B == OnlyReadsMemory) + // If they both only read from memory, just return ref. + if (CS1B == OnlyReadsMemory && CS2B == OnlyReadsMemory) return Ref; // Otherwise, fall back to NoAA (mod+ref). Modified: llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll?rev=110293&r1=110292&r2=110293&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Wed Aug 4 19:43:10 2010 @@ -1,4 +1,5 @@ ; RUN: opt < %s -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s +; XFAIL: * ; CHECK: Just Ref: call void @ro() <-> call void @f0() From ofv at wanadoo.es Wed Aug 4 20:25:48 2010 From: ofv at wanadoo.es (Oscar Fuentes) Date: Thu, 05 Aug 2010 01:25:48 -0000 Subject: [llvm-commits] [llvm] r110296 - in /llvm/trunk: CMakeLists.txt cmake/modules/ChooseMSVCCRT.cmake Message-ID: <20100805012548.45C7A2A6C12E@llvm.org> Author: ofv Date: Wed Aug 4 20:25:48 2010 New Revision: 110296 URL: http://llvm.org/viewvc/llvm-project?rev=110296&view=rev Log: New system for choosing CRT type on MSVC. Is setted on a per build type basis. This is useful for generators that comprise several build types, i.e. VC++ solutions. Added: llvm/trunk/cmake/modules/ChooseMSVCCRT.cmake Modified: llvm/trunk/CMakeLists.txt Modified: llvm/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=110296&r1=110295&r2=110296&view=diff ============================================================================== --- llvm/trunk/CMakeLists.txt (original) +++ llvm/trunk/CMakeLists.txt Wed Aug 4 20:25:48 2010 @@ -217,17 +217,8 @@ endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 ) if( MSVC ) - # List of valid CRTs for MSVC - set(MSVC_CRT - MD - MDd - MT - MTd) - - set(LLVM_USE_CRT "" CACHE STRING "Specify VC++ CRT to use for debug/release configurations.") - # Lets the GUI show a drop-down list of possible values, including - # an empty string as the default: - set_property(CACHE LLVM_USE_CRT PROPERTY STRINGS "";${MSVC_CRT}) + include(ChooseMSVCCRT) + add_llvm_definitions( -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS ) add_llvm_definitions( -D_SCL_SECURE_NO_WARNINGS -DCRT_NONSTDC_NO_WARNINGS ) add_llvm_definitions( -D_SCL_SECURE_NO_DEPRECATE ) @@ -237,15 +228,6 @@ # Suppress 'new behavior: elements of array 'array' will be default initialized' add_llvm_definitions( -wd4351 ) - if (NOT ${LLVM_USE_CRT} STREQUAL "") - list(FIND MSVC_CRT ${LLVM_USE_CRT} idx) - if (idx LESS 0) - message(FATAL_ERROR "Invalid value for LLVM_USE_CRT: ${LLVM_USE_CRT}. Valid options are one of: ${MSVC_CRT}") - endif (idx LESS 0) - add_llvm_definitions("/${LLVM_USE_CRT}") - message(STATUS "Using VC++ CRT: ${LLVM_USE_CRT}") - endif (NOT ${LLVM_USE_CRT} STREQUAL "") - # Enable warnings if (LLVM_ENABLE_WARNINGS) add_llvm_definitions( /W4 /Wall ) Added: llvm/trunk/cmake/modules/ChooseMSVCCRT.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/ChooseMSVCCRT.cmake?rev=110296&view=auto ============================================================================== --- llvm/trunk/cmake/modules/ChooseMSVCCRT.cmake (added) +++ llvm/trunk/cmake/modules/ChooseMSVCCRT.cmake Wed Aug 4 20:25:48 2010 @@ -0,0 +1,106 @@ +# The macro choose_msvc_crt() takes a list of possible +# C runtimes to choose from, in the form of compiler flags, +# to present to the user. (MTd for /MTd, etc) +# +# The macro is invoked at the end of the file. +# +# CMake already sets CRT flags in the CMAKE_CXX_FLAGS_* and +# CMAKE_C_FLAGS_* variables by default. To let the user +# override that for each build type: +# 1. Detect which CRT is already selected, and reflect this in +# LLVM_USE_CRT_* so the user can have a better idea of what +# changes they're making. +# 2. Replace the flags in both variables with the new flag via a regex. +# 3. set() the variables back into the cache so the changes +# are user-visible. + +### Helper macros: ### +macro(make_crt_regex regex crts) + set(${regex} "") + foreach(crt ${${crts}}) + # Trying to match the beginning or end of the string with stuff + # like [ ^]+ didn't work, so use a bunch of parentheses instead. + set(${regex} "${${regex}}|(^| +)/${crt}($| +)") + endforeach(crt) + string(REGEX REPLACE "^\\|" "" ${regex} "${${regex}}") +endmacro(make_crt_regex) + +macro(get_current_crt crt_current regex flagsvar) + # Find the selected-by-CMake CRT for each build type, if any. + # Strip off the leading slash and any whitespace. + string(REGEX MATCH "${${regex}}" ${crt_current} "${${flagsvar}}") + string(REPLACE "/" " " ${crt_current} "${${crt_current}}") + string(STRIP "${${crt_current}}" ${crt_current}) +endmacro(get_current_crt) + +# Replaces or adds a flag to a variable. +# Expects 'flag' to be padded with spaces. +macro(set_flag_in_var flagsvar regex flag) + string(REGEX MATCH "${${regex}}" current_flag "${${flagsvar}}") + if("${current_flag}" STREQUAL "") + set(${flagsvar} "${${flagsvar}}${${flag}}") + else() + string(REGEX REPLACE "${${regex}}" "${${flag}}" ${flagsvar} "${${flagsvar}}") + endif() + string(STRIP "${${flagsvar}}" ${flagsvar}) + # Make sure this change gets reflected in the cache/gui. + # CMake requires the docstring parameter whenever set() touches the cache, + # so get the existing docstring and re-use that. + get_property(flagsvar_docs CACHE ${flagsvar} PROPERTY HELPSTRING) + set(${flagsvar} "${${flagsvar}}" CACHE STRING "${flagsvar_docs}" FORCE) +endmacro(set_flag_in_var) + + +macro(choose_msvc_crt MSVC_CRT) + if(LLVM_USE_CRT) + message(FATAL_ERROR + "LLVM_USE_CRT is deprecated. Use the CMAKE_BUILD_TYPE-specific +variables (LLVM_USE_CRT_DEBUG, etc) instead.") + endif() + + make_crt_regex(MSVC_CRT_REGEX ${MSVC_CRT}) + + foreach(build_type ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER "${build_type}" build) + if (NOT LLVM_USE_CRT_${build}) + get_current_crt(LLVM_USE_CRT_${build} + MSVC_CRT_REGEX + CMAKE_CXX_FLAGS_${build}) + set(LLVM_USE_CRT_${build} + "${LLVM_USE_CRT_${build}}" + CACHE STRING "Specify VC++ CRT to use for ${build_type} configurations." + FORCE) + set_property(CACHE LLVM_USE_CRT_${build} + PROPERTY STRINGS "";${${MSVC_CRT}}) + endif(NOT LLVM_USE_CRT_${build}) + endforeach(build_type) + + foreach(build_type ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER "${build_type}" build) + if ("${LLVM_USE_CRT_${build}}" STREQUAL "") + set(flag_string " ") + else() + set(flag_string " /${LLVM_USE_CRT_${build}} ") + list(FIND ${MSVC_CRT} ${LLVM_USE_CRT_${build}} idx) + if (idx LESS 0) + message(FATAL_ERROR + "Invalid value for LLVM_USE_CRT_${build}: ${LLVM_USE_CRT_${build}}. Valid options are one of: ${${MSVC_CRT}}") + endif (idx LESS 0) + message(STATUS "Using ${build_type} VC++ CRT: ${LLVM_USE_CRT_${build}}") + endif() + foreach(lang C CXX) + set_flag_in_var(CMAKE_${lang}_FLAGS_${build} MSVC_CRT_REGEX flag_string) + endforeach(lang) + endforeach(build_type) +endmacro(choose_msvc_crt MSVC_CRT) + + +# List of valid CRTs for MSVC +set(MSVC_CRT + MD + MDd + MT + MTd) + +choose_msvc_crt(MSVC_CRT) + From rafael.espindola at gmail.com Wed Aug 4 21:16:32 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Thu, 05 Aug 2010 02:16:32 -0000 Subject: [llvm-commits] [llvm] r110300 - in /llvm/trunk/tools/bugpoint: BugDriver.cpp BugDriver.h CrashDebugger.cpp Message-ID: <20100805021632.A65142A6C12C@llvm.org> Author: rafael Date: Wed Aug 4 21:16:32 2010 New Revision: 110300 URL: http://llvm.org/viewvc/llvm-project?rev=110300&view=rev Log: Add a Module argument to the remaining runPasses methods and mark getContext const. Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp llvm/trunk/tools/bugpoint/BugDriver.h llvm/trunk/tools/bugpoint/CrashDebugger.cpp Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.cpp?rev=110300&r1=110299&r2=110300&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/BugDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/BugDriver.cpp Wed Aug 4 21:16:32 2010 @@ -172,7 +172,7 @@ // miscompilation. if (!PassesToRun.empty()) { outs() << "Running selected passes on program to test for crash: "; - if (runPasses(PassesToRun)) + if (runPasses(Program, PassesToRun)) return debugOptimizerCrash(); } Modified: llvm/trunk/tools/bugpoint/BugDriver.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.h?rev=110300&r1=110299&r2=110300&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/BugDriver.h (original) +++ llvm/trunk/tools/bugpoint/BugDriver.h Wed Aug 4 21:16:32 2010 @@ -69,7 +69,7 @@ const char *getToolName() const { return ToolName; } - LLVMContext& getContext() { return Context; } + LLVMContext& getContext() const { return Context; } // Set up methods... these methods are used to copy information about the // command line arguments into instance variables of BugDriver. @@ -132,12 +132,8 @@ /// runPasses - Run all of the passes in the "PassesToRun" list, discard the /// output, and return true if any of the passes crashed. - bool runPasses(Module *M = 0) { - if (M == 0) M = Program; - std::swap(M, Program); - bool Result = runPasses(PassesToRun); - std::swap(M, Program); - return Result; + bool runPasses(Module *M) const { + return runPasses(M, PassesToRun); } Module *getProgram() const { return Program; } @@ -287,10 +283,11 @@ /// false indicating whether or not the optimizer crashed on the specified /// input (true = crashed). /// - bool runPasses(const std::vector &PassesToRun, + bool runPasses(Module *M, + const std::vector &PassesToRun, bool DeleteOutput = true) const { std::string Filename; - return runPasses(Program, PassesToRun, Filename, DeleteOutput); + return runPasses(M, PassesToRun, Filename, DeleteOutput); } /// runAsChild - The actual "runPasses" guts that runs in a child process. Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CrashDebugger.cpp?rev=110300&r1=110299&r2=110300&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original) +++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Wed Aug 4 21:16:32 2010 @@ -86,7 +86,7 @@ outs() << "Checking to see if these passes crash: " << getPassesString(Suffix) << ": "; - if (BD.runPasses(Suffix)) { + if (BD.runPasses(BD.getProgram(), Suffix)) { delete OrigProgram; // The suffix crashes alone... return KeepSuffix; } From ofv at wanadoo.es Wed Aug 4 21:22:51 2010 From: ofv at wanadoo.es (Oscar Fuentes) Date: Thu, 05 Aug 2010 02:22:51 -0000 Subject: [llvm-commits] [llvm] r110301 - /llvm/trunk/cmake/modules/VersionFromVCS.cmake Message-ID: <20100805022251.7D8872A6C12C@llvm.org> Author: ofv Date: Wed Aug 4 21:22:51 2010 New Revision: 110301 URL: http://llvm.org/viewvc/llvm-project?rev=110301&view=rev Log: When building from git, add ref-id to PACKAGE_VERSION Modified: llvm/trunk/cmake/modules/VersionFromVCS.cmake Modified: llvm/trunk/cmake/modules/VersionFromVCS.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/VersionFromVCS.cmake?rev=110301&r1=110300&r2=110301&view=diff ============================================================================== --- llvm/trunk/cmake/modules/VersionFromVCS.cmake (original) +++ llvm/trunk/cmake/modules/VersionFromVCS.cmake Wed Aug 4 21:22:51 2010 @@ -15,6 +15,19 @@ endif() elseif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git ) set(result "${result}git") + # Try to get a ref-id + find_program(git_executable NAMES git git.exe git.cmd) + if( git_executable ) + execute_process(COMMAND ${git_executable} show-ref HEAD + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + TIMEOUT 5 + RESULT_VARIABLE git_result + OUTPUT_VARIABLE git_output) + if( git_result EQUAL 0 ) + string(SUBSTRING ${git_output} 0 7 git_ref_id) + set(result "${result}-${git_ref_id}") + endif() + endif() endif() set(${VERS} ${result} PARENT_SCOPE) endfunction(add_version_info_from_vcs) From bob.wilson at apple.com Wed Aug 4 21:28:12 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Thu, 05 Aug 2010 02:28:12 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r110302 - in /llvm-gcc-4.2/trunk: ChangeLog.apple build_gcc gcc/ChangeLog.apple gcc/Makefile.in gcc/config.gcc gcc/ginclude/ppc_intrinsics.h gcc/testsuite/ChangeLog.apple gcc/testsuite/gcc.apple/ppc_intrinsics-1.c gcc/testsuite/gcc.apple/ppc_intrinsics-2.c gcc/timevar.c more-hdrs/ Message-ID: <20100805022812.7DA942A6C12C@llvm.org> Author: bwilson Date: Wed Aug 4 21:28:12 2010 New Revision: 110302 URL: http://llvm.org/viewvc/llvm-project?rev=110302&view=rev Log: Merge changes from Apple's gcc-4.2 to remove "more-hdrs" files. Added: llvm-gcc-4.2/trunk/gcc/ginclude/ppc_intrinsics.h - copied unchanged from r110287, llvm-gcc-4.2/trunk/more-hdrs/ppc_intrinsics.h Removed: llvm-gcc-4.2/trunk/more-hdrs/ Modified: llvm-gcc-4.2/trunk/ChangeLog.apple llvm-gcc-4.2/trunk/build_gcc llvm-gcc-4.2/trunk/gcc/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/Makefile.in llvm-gcc-4.2/trunk/gcc/config.gcc llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ppc_intrinsics-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ppc_intrinsics-2.c llvm-gcc-4.2/trunk/gcc/timevar.c Modified: llvm-gcc-4.2/trunk/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/ChangeLog.apple?rev=110302&r1=110301&r2=110302&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/ChangeLog.apple Wed Aug 4 21:28:12 2010 @@ -1,3 +1,14 @@ +2010-07-29 Bob Wilson + + Radar 7982386 + * mode-hdrs: Remove this directory and all its contents. + * build_gcc: Stop installing files from more-hdrs. + +2010-07-29 Bob Wilson + + Radar 7982386 + * more-hdrs/ppc_intrinsics.h: Moved to gcc/config/rs6000. + 2010-06-28 Jim Grosbach Radar 7449793 Modified: llvm-gcc-4.2/trunk/build_gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build_gcc?rev=110302&r1=110301&r2=110302&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/build_gcc (original) +++ llvm-gcc-4.2/trunk/build_gcc Wed Aug 4 21:28:12 2010 @@ -583,30 +583,6 @@ done fi -# include -HEADERPATH=$DEST_ROOT/include/gcc/darwin/$MAJ_VERS -mkdir -p .$HEADERPATH || exit 1 - -# Some headers are installed from more-hdrs/. They all share -# one common feature: they shouldn't be installed here. Sometimes, -# they should be part of FSF GCC and installed from there; sometimes, -# they should be installed by some completely different package; sometimes, -# they only exist for codewarrior compatibility and codewarrior should provide -# its own. We take care not to install the headers if Libc is already -# providing them. -cd $SRC_DIR/more-hdrs -for h in `echo *.h` ; do - if [ ! -f /usr/include/$h -o -L /usr/include/$h ] ; then - cp -R $h $DEST_DIR$HEADERPATH/$h || exit 1 - for t in $TARGETS ; do - THEADERPATH=$DEST_DIR$DEST_ROOT/lib/gcc/${t}-apple-darwin$DARWIN_VERS/$VERS/include - [ -f $THEADERPATH/$h ] || \ - ln -s ../../../../../include/gcc/darwin/$MAJ_VERS/$h $THEADERPATH/$h || \ - exit 1 - done - fi -done - # Add extra man page symlinks for 'c++' and for arch-specific names. MDIR=$DEST_DIR$DEST_ROOT/share/man/man1 if [ $BUILD_CXX -eq 1 ]; then Modified: llvm-gcc-4.2/trunk/gcc/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ChangeLog.apple?rev=110302&r1=110301&r2=110302&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/ChangeLog.apple Wed Aug 4 21:28:12 2010 @@ -1,3 +1,19 @@ +2010-08-04 Bob Wilson + + Radar 7982386 + * config/rs6000/ppc_intrinsics.h: Moved again from here to... + * ginclude/ppc_intrinsics.h: ...here. + * timevar.c: Update path to ppc_intrinsics.h. + * Makefile.in (USER_H): Add ppc_intrinsics.h. + * config.gcc: Revert previous change for ppc_intrinsics.h. + +2010-07-29 Bob Wilson + + Radar 7982386 + * config/rs6000/ppc_intrinsics.h: Moved here from top-level more-hdrs. + * config.gcc: Add ppc_intrinsics.h to extra_headers. + * timevar.c: Update path to ppc_intrinsics.h. + 2010-06-28 Jim Grosbach Radar 7449793 Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/Makefile.in?rev=110302&r1=110301&r2=110302&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/Makefile.in (original) +++ llvm-gcc-4.2/trunk/gcc/Makefile.in Wed Aug 4 21:28:12 2010 @@ -371,10 +371,12 @@ # Header files that are made available under the same name # to programs compiled with GCC. +# APPLE LOCAL begin ppc_intrinsics.h 7982386 # APPLE LOCAL begin mainline 2007-06-12 2872232 USER_H = $(srcdir)/ginclude/decfloat.h \ $(srcdir)/ginclude/float.h \ $(srcdir)/ginclude/iso646.h \ + $(srcdir)/ginclude/ppc_intrinsics.h \ $(srcdir)/ginclude/stdarg.h \ $(srcdir)/ginclude/stdbool.h \ $(srcdir)/ginclude/stddef.h \ @@ -382,6 +384,7 @@ $(srcdir)/ginclude/varargs.h \ $(EXTRA_HEADERS) # APPLE LOCAL end mainline 2007-06-12 2872232 +# APPLE LOCAL end ppc_intrinsics.h 7982386 UNWIND_H = $(srcdir)/unwind-generic.h Modified: llvm-gcc-4.2/trunk/gcc/config.gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config.gcc?rev=110302&r1=110301&r2=110302&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config.gcc (original) +++ llvm-gcc-4.2/trunk/gcc/config.gcc Wed Aug 4 21:28:12 2010 @@ -1839,7 +1839,7 @@ *-darwin[0-6]*) ;; esac - extra_headers=altivec.h + extra_headers="altivec.h" ;; powerpc64-*-darwin*) tm_file="${tm_file} ${cpu_type}/darwin8.h ${cpu_type}/darwin64.h" @@ -1847,7 +1847,7 @@ tmake_file="${tmake_file} t-slibgcc-darwin" extra_options="${extra_options} ${cpu_type}/darwin.opt" # We're omitting t-darwin8 to avoid building any multilibs - extra_headers=altivec.h + extra_headers="altivec.h" ;; powerpc*-*-freebsd*) tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} rs6000/sysv4.h rs6000/freebsd.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple?rev=110302&r1=110301&r2=110302&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple Wed Aug 4 21:28:12 2010 @@ -1,3 +1,9 @@ +2010-07-29 Bob Wilson + + Radar 7982386 + * gcc.apple/ppc_intrinsics-1.c: Remove -I option to more-hdrs directory. + * gcc.apple/ppc_intrinsics-2.c: Likewise. + 2010-04-02 Fariborz Jahanian Radar 7591784 Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ppc_intrinsics-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ppc_intrinsics-1.c?rev=110302&r1=110301&r2=110302&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ppc_intrinsics-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ppc_intrinsics-1.c Wed Aug 4 21:28:12 2010 @@ -1,4 +1,3 @@ -/* { dg-options "-I ${srcdir}/../../more-hdrs" } */ /* { dg-do compile { target "powerpc*-*-darwin*" } } */ /* Radar 3208244 */ #include "ppc_intrinsics.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ppc_intrinsics-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ppc_intrinsics-2.c?rev=110302&r1=110301&r2=110302&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ppc_intrinsics-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ppc_intrinsics-2.c Wed Aug 4 21:28:12 2010 @@ -1,4 +1,4 @@ -/* { dg-options "-I ${srcdir}/../../more-hdrs -Wshorten-64-to-32 -Wno-long-long" } */ +/* { dg-options "-Wshorten-64-to-32 -Wno-long-long" } */ /* { dg-do run { target "powerpc*-*-darwin*" } } */ #include "ppc_intrinsics.h" #include Modified: llvm-gcc-4.2/trunk/gcc/timevar.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/timevar.c?rev=110302&r1=110301&r2=110302&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/timevar.c (original) +++ llvm-gcc-4.2/trunk/gcc/timevar.c Wed Aug 4 21:28:12 2010 @@ -85,7 +85,7 @@ clock time. Use PPC intrinsics if possible. */ #if defined(__APPLE__) && defined(__POWERPC__) && HAVE_MACH_TIME #if __POWERPC__ -# include "../more-hdrs/ppc_intrinsics.h" +# include "ginclude/ppc_intrinsics.h" # define HAVE_WALL_TIME # define USE_PPC_INTRINSICS static inline double From rafael.espindola at gmail.com Wed Aug 4 22:00:22 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Thu, 05 Aug 2010 03:00:22 -0000 Subject: [llvm-commits] [llvm] r110306 - in /llvm/trunk/tools/bugpoint: BugDriver.h CrashDebugger.cpp ExecutionDriver.cpp Message-ID: <20100805030022.6D7AB2A6C12C@llvm.org> Author: rafael Date: Wed Aug 4 22:00:22 2010 New Revision: 110306 URL: http://llvm.org/viewvc/llvm-project?rev=110306&view=rev Log: Add const to compileProgram and to the various test functions in CrashDebugger. Modified: llvm/trunk/tools/bugpoint/BugDriver.h llvm/trunk/tools/bugpoint/CrashDebugger.cpp llvm/trunk/tools/bugpoint/ExecutionDriver.cpp Modified: llvm/trunk/tools/bugpoint/BugDriver.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.h?rev=110306&r1=110305&r2=110306&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/BugDriver.h (original) +++ llvm/trunk/tools/bugpoint/BugDriver.h Wed Aug 4 22:00:22 2010 @@ -165,7 +165,7 @@ /// setting Error if an error occurs. This is used for code generation /// crash testing. /// - void compileProgram(Module *M, std::string *Error); + void compileProgram(Module *M, std::string *Error) const; /// executeProgram - This method runs "Program", capturing the output of the /// program to a file. A recommended filename may be optionally specified. Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CrashDebugger.cpp?rev=110306&r1=110305&r2=110306&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original) +++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Wed Aug 4 22:00:22 2010 @@ -106,10 +106,10 @@ /// class ReduceCrashingGlobalVariables : public ListReducer { BugDriver &BD; - bool (*TestFn)(BugDriver &, Module *); + bool (*TestFn)(const BugDriver &, Module *); public: ReduceCrashingGlobalVariables(BugDriver &bd, - bool (*testFn)(BugDriver &, Module *)) + bool (*testFn)(const BugDriver &, Module *)) : BD(bd), TestFn(testFn) {} virtual TestResult doTest(std::vector &Prefix, @@ -176,10 +176,10 @@ /// class ReduceCrashingFunctions : public ListReducer { BugDriver &BD; - bool (*TestFn)(BugDriver &, Module *); + bool (*TestFn)(const BugDriver &, Module *); public: ReduceCrashingFunctions(BugDriver &bd, - bool (*testFn)(BugDriver &, Module *)) + bool (*testFn)(const BugDriver &, Module *)) : BD(bd), TestFn(testFn) {} virtual TestResult doTest(std::vector &Prefix, @@ -249,9 +249,10 @@ /// class ReduceCrashingBlocks : public ListReducer { BugDriver &BD; - bool (*TestFn)(BugDriver &, Module *); + bool (*TestFn)(const BugDriver &, Module *); public: - ReduceCrashingBlocks(BugDriver &bd, bool (*testFn)(BugDriver &, Module *)) + ReduceCrashingBlocks(BugDriver &bd, + bool (*testFn)(const BugDriver &, Module *)) : BD(bd), TestFn(testFn) {} virtual TestResult doTest(std::vector &Prefix, @@ -348,10 +349,10 @@ /// class ReduceCrashingInstructions : public ListReducer { BugDriver &BD; - bool (*TestFn)(BugDriver &, Module *); + bool (*TestFn)(const BugDriver &, Module *); public: - ReduceCrashingInstructions(BugDriver &bd, bool (*testFn)(BugDriver &, - Module *)) + ReduceCrashingInstructions(BugDriver &bd, + bool (*testFn)(const BugDriver &, Module *)) : BD(bd), TestFn(testFn) {} virtual TestResult doTest(std::vector &Prefix, @@ -422,7 +423,8 @@ /// DebugACrash - Given a predicate that determines whether a component crashes /// on a program, try to destructively reduce the program while still keeping /// the predicate true. -static bool DebugACrash(BugDriver &BD, bool (*TestFn)(BugDriver &, Module *), +static bool DebugACrash(BugDriver &BD, + bool (*TestFn)(const BugDriver &, Module *), std::string &Error) { // See if we can get away with nuking some of the global variable initializers // in the program... @@ -607,7 +609,7 @@ return false; } -static bool TestForOptimizerCrash(BugDriver &BD, Module *M) { +static bool TestForOptimizerCrash(const BugDriver &BD, Module *M) { return BD.runPasses(M); } @@ -635,7 +637,7 @@ return Success; } -static bool TestForCodeGenCrash(BugDriver &BD, Module *M) { +static bool TestForCodeGenCrash(const BugDriver &BD, Module *M) { std::string Error; BD.compileProgram(M, &Error); if (!Error.empty()) { Modified: llvm/trunk/tools/bugpoint/ExecutionDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExecutionDriver.cpp?rev=110306&r1=110305&r2=110306&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ExecutionDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/ExecutionDriver.cpp Wed Aug 4 22:00:22 2010 @@ -293,7 +293,7 @@ /// setting Error if an error occurs. This is used for code generation /// crash testing. /// -void BugDriver::compileProgram(Module *M, std::string *Error) { +void BugDriver::compileProgram(Module *M, std::string *Error) const { // Emit the program to a bitcode file... sys::Path BitcodeFile (OutputPrefix + "-test-program.bc"); std::string ErrMsg; From chandlerc at gmail.com Wed Aug 4 22:04:21 2010 From: chandlerc at gmail.com (Chandler Carruth) Date: Thu, 05 Aug 2010 03:04:21 -0000 Subject: [llvm-commits] [llvm] r110307 - /llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Message-ID: <20100805030421.601FD2A6C12C@llvm.org> Author: chandlerc Date: Wed Aug 4 22:04:21 2010 New Revision: 110307 URL: http://llvm.org/viewvc/llvm-project?rev=110307&view=rev Log: Silence a GCC warning about && and || without explicit parentheses. This preserves the existing behavior, as it seems a concious choice to allow RS to be null and BigStack marked true. Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=110307&r1=110306&r2=110307&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Wed Aug 4 22:04:21 2010 @@ -860,9 +860,9 @@ // worth the effort and added fragility? bool BigStack = (RS && (estimateStackSize(MF) + (hasFP(MF) ? 4:0) >= - estimateRSStackSizeLimit(MF)) - || MFI->hasVarSizedObjects() - || (MFI->adjustsStack() && !canSimplifyCallFramePseudos(MF))); + estimateRSStackSizeLimit(MF))) + || MFI->hasVarSizedObjects() + || (MFI->adjustsStack() && !canSimplifyCallFramePseudos(MF)); bool ExtraCSSpill = false; if (BigStack || !CanEliminateFrame || cannotEliminateFrame(MF)) { From espindola at google.com Wed Aug 4 22:26:53 2010 From: espindola at google.com (Rafael Espindola) Date: Wed, 4 Aug 2010 23:26:53 -0400 Subject: [llvm-commits] [llvm] r110307 - /llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp In-Reply-To: <20100805030421.601FD2A6C12C@llvm.org> References: <20100805030421.601FD2A6C12C@llvm.org> Message-ID: It looks like the code assumes that BigStack -> RS != NULL. I am not sure if that is an independent bug, but if it is not the attached patch should make the assumption clear. Cheers, -- Rafael ?vila de Esp?ndola -------------- next part -------------- A non-text attachment was scrubbed... Name: t.patch Type: text/x-patch Size: 1116 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100804/25d14c17/attachment.bin From rafael.espindola at gmail.com Wed Aug 4 22:35:01 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Thu, 05 Aug 2010 03:35:01 -0000 Subject: [llvm-commits] [llvm] r110311 - /llvm/trunk/test/Makefile Message-ID: <20100805033501.441A72A6C12C@llvm.org> Author: rafael Date: Wed Aug 4 22:35:01 2010 New Revision: 110311 URL: http://llvm.org/viewvc/llvm-project?rev=110311&view=rev Log: check-lit was failing again on F13 64 bits :-( Modified: llvm/trunk/test/Makefile Modified: llvm/trunk/test/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Makefile?rev=110311&r1=110310&r2=110311&view=diff ============================================================================== --- llvm/trunk/test/Makefile (original) +++ llvm/trunk/test/Makefile Wed Aug 4 22:35:01 2010 @@ -84,8 +84,8 @@ ifeq ($(HOST_OS),AuroraUX) ULIMIT=ulimit -t 600 ; ulimit -d 512000 ; ulimit -v 512000 ; else # !AuroraUX -# Fedora 13 x86-64 python fails with -v 51200 -ULIMIT=ulimit -t 600 ; ulimit -d 512000 ; ulimit -m 512000 ; ulimit -v 768000 ; +# Fedora 13 x86-64 python fails with -v 76800 +ULIMIT=ulimit -t 600 ; ulimit -d 512000 ; ulimit -m 512000 ; ulimit -v 1024000 ; endif # AuroraUX endif # SunOS From nicholas at mxc.ca Thu Aug 5 02:18:33 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Thu, 05 Aug 2010 00:18:33 -0700 Subject: [llvm-commits] turn on function merging In-Reply-To: References: <4C396EC3.40709@mxc.ca> Message-ID: <4C5A65C9.1010403@mxc.ca> Chris Lattner wrote: > > On Jul 11, 2010, at 12:12 AM, Nick Lewycky wrote: > >> I'd like to turn on the function merging pass by default (patch attached). Function merging is already in the tree and I've been testing it locally for a while. It works great and doesn't do undue harm to my build times. >> >> Functions are merged when they are identical under a comparison that treats all pointers as equivalent. So i8* and i32* are considered equivalent types, so long as you never load one which would produce an i8 as that's different from i32. > > Here is some general code review comments: > > Please comment the code, each method should get a function comment. The linkage code needs comments explaining what is going on. > > Please rename 'hash' and 'fold' to something less generic, and give AliasGToF a longer name that says what it does. The compare methods should be static or const. > > Stuff like this: > > SmallVector Indices1, Indices2; > for (GetElementPtrInst::const_op_iterator I = GEP1->idx_begin(), > E = GEP1->idx_end(); I != E; ++I) { > Indices1.push_back(*I); > } > for (GetElementPtrInst::const_op_iterator I = GEP2->idx_begin(), > E = GEP2->idx_end(); I != E; ++I) { > Indices2.push_back(*I); > } > > Should be able to be written as: > > SmallVector Indices1(GEP1->idx_begin(), GEP1->idx_end()); > SmallVector Indices2(GEP2->idx_begin(), GEP2->idx_end()); > > > I don't understand this logic: > bool MergeFunctions::compare(const Value *V1, const Value *V2) { > if (V1 == LHS || V1 == RHS) > if (V2 == LHS || V2 == RHS) > return true; > > Also, related to that, making LHS and RHS be members of the MergeFunctions pass is kinda gross. It would be better to split the comparison stuff out to its own trivial comparison class, using a pattern like this: > > class FunctionComparisonator { > Function *LHS, *RHS; > ... > public: > FunctionComparisonator(...); > > bool Compare(); > private: > ... > }; > > if (FunctionComparisonator(LHSFunc, RHSFunc).Compare()) ... > > That will also partition the comparison logic cleanly from the pass and transformation mechanics. > > > This is some seriously crazy indentation, it hurts: :) > > } > } break; > } break; > > > It's unclear to me why you use "std::map > " as your hashing/uniquing data structure instead of a densemap. Wouldn't it substantially simplify the code to use DenseMap where YourType just contains a Function* and a cached hash? Then you just define your hash and equality predicates and the hash table does everything else? Sorry Chris, I don't follow this one at all. Firstly, DenseMap isn't valid, it has to be DenseMap. Then I can't put my key and my value in a single object. And how does DenseMap handle the multi-nature of the set? What am I missing? > I'll take another look after this changes go in, thanks for working on this! > > -Chris > > From bob.wilson at apple.com Thu Aug 5 10:13:49 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Thu, 05 Aug 2010 15:13:49 -0000 Subject: [llvm-commits] [test-suite] r110332 - /test-suite/trunk/MultiSource/Applications/Makefile Message-ID: <20100805151349.167A02A6C12C@llvm.org> Author: bwilson Date: Thu Aug 5 10:13:48 2010 New Revision: 110332 URL: http://llvm.org/viewvc/llvm-project?rev=110332&view=rev Log: Disable OpenSSL again. The clang-i686-linux-fnt tester is still failing. Modified: test-suite/trunk/MultiSource/Applications/Makefile Modified: test-suite/trunk/MultiSource/Applications/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/Makefile?rev=110332&r1=110331&r2=110332&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Applications/Makefile (original) +++ test-suite/trunk/MultiSource/Applications/Makefile Thu Aug 5 10:13:48 2010 @@ -5,7 +5,7 @@ include $(LEVEL)/Makefile.config PARALLEL_DIRS = Burg aha sgefa siod d spiff treecc SPASS \ - oggenc JM viterbi SIBsim4 ClamAV sqlite3 lemon OpenSSL + oggenc JM viterbi SIBsim4 ClamAV sqlite3 lemon ifndef DISABLE_CXX PARALLEL_DIRS += lambda-0.1.3 hbd hexxagon minisat endif From rafael.espindola at gmail.com Thu Aug 5 10:25:38 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Thu, 05 Aug 2010 15:25:38 -0000 Subject: [llvm-commits] [llvm] r110333 - in /llvm/trunk/tools/bugpoint: BugDriver.cpp BugDriver.h OptimizerDriver.cpp bugpoint.cpp Message-ID: <20100805152538.50CAA2A6C12C@llvm.org> Author: rafael Date: Thu Aug 5 10:25:38 2010 New Revision: 110333 URL: http://llvm.org/viewvc/llvm-project?rev=110333&view=rev Log: Run opt instead of bugpoint itself. Fixes PR753. Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp llvm/trunk/tools/bugpoint/BugDriver.h llvm/trunk/tools/bugpoint/OptimizerDriver.cpp llvm/trunk/tools/bugpoint/bugpoint.cpp Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.cpp?rev=110333&r1=110332&r2=110333&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/BugDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/BugDriver.cpp Thu Aug 5 10:25:38 2010 @@ -66,12 +66,12 @@ return Result; } -BugDriver::BugDriver(const char *toolname, bool as_child, bool find_bugs, +BugDriver::BugDriver(const char *toolname, bool find_bugs, unsigned timeout, unsigned memlimit, bool use_valgrind, LLVMContext& ctxt) : Context(ctxt), ToolName(toolname), ReferenceOutputFile(OutputFile), Program(0), Interpreter(0), SafeInterpreter(0), gcc(0), - run_as_child(as_child), run_find_bugs(find_bugs), Timeout(timeout), + run_find_bugs(find_bugs), Timeout(timeout), MemoryLimit(memlimit), UseValgrind(use_valgrind) {} BugDriver::~BugDriver() { @@ -119,15 +119,13 @@ Program = ParseInputFile(Filenames[0], Context); if (Program == 0) return true; - if (!run_as_child) - outs() << "Read input file : '" << Filenames[0] << "'\n"; + outs() << "Read input file : '" << Filenames[0] << "'\n"; for (unsigned i = 1, e = Filenames.size(); i != e; ++i) { std::auto_ptr M(ParseInputFile(Filenames[i], Context)); if (M.get() == 0) return true; - if (!run_as_child) - outs() << "Linking in input file: '" << Filenames[i] << "'\n"; + outs() << "Linking in input file: '" << Filenames[i] << "'\n"; std::string ErrorMessage; if (Linker::LinkModules(Program, M.get(), &ErrorMessage)) { errs() << ToolName << ": error linking in '" << Filenames[i] << "': " @@ -136,8 +134,7 @@ } } - if (!run_as_child) - outs() << "*** All input ok\n"; + outs() << "*** All input ok\n"; // All input files read successfully! return false; @@ -149,14 +146,6 @@ /// variables are set up from command line arguments. /// bool BugDriver::run(std::string &ErrMsg) { - // The first thing to do is determine if we're running as a child. If we are, - // then what to do is very narrow. This form of invocation is only called - // from the runPasses method to actually run those passes in a child process. - if (run_as_child) { - // Execute the passes - return runPassesAsChild(PassesToRun); - } - if (run_find_bugs) { // Rearrange the passes and apply them to the program. Repeat this process // until the user kills the program or we find a bug. Modified: llvm/trunk/tools/bugpoint/BugDriver.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.h?rev=110333&r1=110332&r2=110333&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/BugDriver.h (original) +++ llvm/trunk/tools/bugpoint/BugDriver.h Thu Aug 5 10:25:38 2010 @@ -51,7 +51,6 @@ AbstractInterpreter *Interpreter; // How to run the program AbstractInterpreter *SafeInterpreter; // To generate reference output, etc. GCC *gcc; - bool run_as_child; bool run_find_bugs; unsigned Timeout; unsigned MemoryLimit; @@ -62,7 +61,7 @@ friend class ReduceMisCodegenFunctions; public: - BugDriver(const char *toolname, bool as_child, bool find_bugs, + BugDriver(const char *toolname, bool find_bugs, unsigned timeout, unsigned memlimit, bool use_valgrind, LLVMContext& ctxt); ~BugDriver(); @@ -290,9 +289,6 @@ return runPasses(M, PassesToRun, Filename, DeleteOutput); } - /// runAsChild - The actual "runPasses" guts that runs in a child process. - int runPassesAsChild(const std::vector &PassesToRun); - /// initializeExecutionEnvironment - This method is used to set up the /// environment for executing LLVM programs. /// Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=110333&r1=110332&r2=110333&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Thu Aug 5 10:25:38 2010 @@ -27,6 +27,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Path.h" #include "llvm/System/Program.h" @@ -85,37 +86,6 @@ outs() << getPassesString(PassesToRun) << "\n"; } -int BugDriver::runPassesAsChild(const std::vector &Passes) { - std::string ErrInfo; - raw_fd_ostream OutFile(ChildOutput.c_str(), ErrInfo, - raw_fd_ostream::F_Binary); - if (!ErrInfo.empty()) { - errs() << "Error opening bitcode file: " << ChildOutput << "\n"; - return 1; - } - - PassManager PM; - // Make sure that the appropriate target data is always used... - PM.add(new TargetData(Program)); - - for (unsigned i = 0, e = Passes.size(); i != e; ++i) { - if (Passes[i]->getNormalCtor()) - PM.add(Passes[i]->getNormalCtor()()); - else - errs() << "Cannot create pass yet: " << Passes[i]->getPassName() << "\n"; - } - // Check that the module is well formed on completion of optimization - PM.add(createVerifierPass()); - - // Write bitcode out to disk as the last step... - PM.add(createBitcodeWriterPass(OutFile)); - - // Run all queued passes. - PM.run(*Program); - - return 0; -} - cl::opt SilencePasses("silence-passes", cl::desc("Suppress output of running passes (both stdout and stderr)")); /// runPasses - Run the specified passes on Program, outputting a bitcode file @@ -164,17 +134,25 @@ // setup the child process' arguments SmallVector Args; - sys::Path tool = sys::Program::FindProgramByName(ToolName); + std::string Opt; + llvm::StringRef TN(ToolName); + if (TN.find('/') == llvm::StringRef::npos) { + Opt = ToolName; + } else { + std::pair P = TN.rsplit('/'); + Opt = P.first.str() + "/" + "opt"; + } + + sys::Path tool = sys::Program::FindProgramByName(Opt); if (UseValgrind) { Args.push_back("valgrind"); Args.push_back("--error-exitcode=1"); Args.push_back("-q"); Args.push_back(tool.c_str()); } else - Args.push_back(ToolName); + Args.push_back(Opt.c_str()); - Args.push_back("-as-child"); - Args.push_back("-child-output"); + Args.push_back("-o"); Args.push_back(OutputFilename.c_str()); std::vector pass_args; for (unsigned i = 0, e = PluginLoader::getNumPlugins(); i != e; ++i) { @@ -192,6 +170,12 @@ Args.push_back(*ExtraArgs); Args.push_back(0); + DEBUG(errs() << "\nAbout to run:\t"; + for (unsigned i = 0, e = Args.size()-1; i != e; ++i) + errs() << " " << Args[i]; + errs() << "\n"; + ); + sys::Path prog; if (UseValgrind) prog = sys::Program::FindProgramByName("valgrind"); Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=110333&r1=110332&r2=110333&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/bugpoint.cpp (original) +++ llvm/trunk/tools/bugpoint/bugpoint.cpp Thu Aug 5 10:25:38 2010 @@ -29,13 +29,6 @@ #include "llvm/LinkAllVMCore.h" using namespace llvm; -// AsChild - Specifies that this invocation of bugpoint is being generated -// from a parent process. It is not intended to be used by users so the -// option is hidden. -static cl::opt -AsChild("as-child", cl::desc("Run bugpoint as child process"), - cl::ReallyHidden); - static cl::opt FindBugs("find-bugs", cl::desc("Run many different optimization sequences " "on program to find bugs"), cl::init(false)); @@ -123,7 +116,7 @@ MemoryLimit = 100; } - BugDriver D(argv[0], AsChild, FindBugs, TimeoutValue, MemoryLimit, + BugDriver D(argv[0], FindBugs, TimeoutValue, MemoryLimit, UseValgrind, Context); if (D.addSources(InputFilenames)) return 1; From daniel at zuster.org Thu Aug 5 10:38:58 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 05 Aug 2010 15:38:58 -0000 Subject: [llvm-commits] [zorg] r110334 - /zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py Message-ID: <20100805153859.066142A6C12C@llvm.org> Author: ddunbar Date: Thu Aug 5 10:38:58 2010 New Revision: 110334 URL: http://llvm.org/viewvc/llvm-project?rev=110334&view=rev Log: buildbot: Add 'llvmgccdir' argument for LLVMBuilder. Modified: zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py Modified: zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py?rev=110334&r1=110333&r2=110334&view=diff ============================================================================== --- zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py (original) +++ zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py Thu Aug 5 10:38:58 2010 @@ -16,7 +16,7 @@ valgrindLeakCheck=False, valgrindSuppressions=None, jobs='%(jobs)s', timeout=20, make='make', enable_shared=False, enable_targets=None, defaultBranch='trunk', - config_name='Debug+Asserts'): + llvmgccdir=None, config_name='Debug+Asserts'): f = buildbot.process.factory.BuildFactory() # Determine the build directory. @@ -33,10 +33,14 @@ workdir='llvm')) # Force without llvm-gcc so we don't run afoul of Frontend test failures. - configure_args = ["./configure", "--without-llvmgcc", "--without-llvmgxx"] + configure_args = ["./configure"] + if llvmgccdir: + configure_args += ['--with-llvmgccdir=%s' % llvmgccdir] + else: + configure_args += ["--without-llvmgcc", "--without-llvmgxx"] configure_args += getConfigArgs(config_name) if enable_targets is not None: - configure_args.append('--enable-targets %s' % enable_targets) + configure_args.append('--enable-targets=%s' % enable_targets) if triple: configure_args += ['--build=%s' % triple, '--host=%s' % triple, From daniel at zuster.org Thu Aug 5 10:40:04 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 05 Aug 2010 15:40:04 -0000 Subject: [llvm-commits] [zorg] r110335 - /zorg/trunk/zorg/buildbot/builders/KLEEBuilder.py Message-ID: <20100805154004.BC87D2A6C12C@llvm.org> Author: ddunbar Date: Thu Aug 5 10:40:04 2010 New Revision: 110335 URL: http://llvm.org/viewvc/llvm-project?rev=110335&view=rev Log: buildbot: Tweak KLEE base config, and add test step. Modified: zorg/trunk/zorg/buildbot/builders/KLEEBuilder.py Modified: zorg/trunk/zorg/buildbot/builders/KLEEBuilder.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/KLEEBuilder.py?rev=110335&r1=110334&r2=110335&view=diff ============================================================================== --- zorg/trunk/zorg/buildbot/builders/KLEEBuilder.py (original) +++ zorg/trunk/zorg/buildbot/builders/KLEEBuilder.py Thu Aug 5 10:40:04 2010 @@ -13,6 +13,8 @@ import LLVMBuilder from Util import getConfigArgs +from zorg.buildbot.commands.DejaGNUCommand import DejaGNUCommand + def getKLEEBuildFactory(triple, jobs='%(jobs)d', llvm_branch='trunk', config_name='Release+Asserts', clean=True, llvmgccdir=None, *args, **kwargs): @@ -31,12 +33,14 @@ if llvm_branch == 'trunk': f = ClangBuilder.getClangBuildFactory(triple, jobs=jobs, stage1_config=config_name, extra_configure_args=['--with-built-clang', - '--enable-targets=host'], + '--enable-targets=host', + '--with-llvmcc=clang'], clean=clean, test=False, *args, **kwargs) else: f = LLVMBuilder.getLLVMBuildFactory(triple, jobs=jobs, defaultBranch=llvm_branch, - config_name=config_name, enable_targets='host', - clean=clean, test=False, *args, **kwargs) + config_name=config_name, llvmgccdir=llvmgccdir, + enable_targets='x86', clean=clean, test=False, + *args, **kwargs) # Checkout sources. f.addStep(SVN(name='svn-klee', @@ -50,8 +54,6 @@ configure_args += ['--build=%s' % triple, '--host=%s' % triple, '--target=%s' % triple] - if llvmgccdir: - configure_args += ['--with-llvmgccdir=%s' % llvmgccdir] f.addStep(Configure(command=configure_args, workdir='klee', description=['configure','klee',config_name])) @@ -70,6 +72,12 @@ haltOnFailure=True, description="compile klee", workdir='klee')) - return f - + # Test. + f.addStep(DejaGNUCommand(name="test", + command=['nice', '-n', '10', + 'make', 'check'], + haltOnFailure=True, description="test klee", + workdir='klee', + logfiles={ 'dg.sum' : 'test/testrun.sum' })) + return f From daniel at zuster.org Thu Aug 5 10:40:55 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 05 Aug 2010 15:40:55 -0000 Subject: [llvm-commits] [zorg] r110336 - /zorg/trunk/buildbot/klee/master/config/builders.py Message-ID: <20100805154055.A18F32A6C12C@llvm.org> Author: ddunbar Date: Thu Aug 5 10:40:55 2010 New Revision: 110336 URL: http://llvm.org/viewvc/llvm-project?rev=110336&view=rev Log: buildbot: Add KLEE with LLVM 2.6 and LLVM 2.7 builders. Modified: zorg/trunk/buildbot/klee/master/config/builders.py Modified: zorg/trunk/buildbot/klee/master/config/builders.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/klee/master/config/builders.py?rev=110336&r1=110335&r2=110336&view=diff ============================================================================== --- zorg/trunk/buildbot/klee/master/config/builders.py (original) +++ zorg/trunk/buildbot/klee/master/config/builders.py Thu Aug 5 10:40:55 2010 @@ -1,13 +1,29 @@ -from zorg.buildbot.builders import LLVMBuilder -reload(LLVMBuilder) -from zorg.buildbot.builders import LLVMBuilder +from zorg.buildbot.builders import KLEEBuilder +reload(KLEEBuilder) +from zorg.buildbot.builders import KLEEBuilder def _get_linux_builders(): return [ - {'name': "klee-x86_64-linux", - 'slavenames': ["klee.minormatter.com"], - 'builddir': "build.klee-x86_64-linux", - 'factory': LLVMBuilder.getLLVMBuildFactory("x86_64-pc-linux-gnu", jobs=2)}, + { 'name' : "klee-x86_64-linux", + 'slavenames' : ["klee.minormatter.com"], + 'builddir' : "build.klee-x86_64-linux", + 'factory' : KLEEBuilder.getKLEEBuildFactory("x86_64-pc-linux-gnu", clean=False) }, + + { 'name' : "klee-2.7-x86_64-linux", + 'slavenames' : ["klee.minormatter.com"], + 'builddir' : "build.klee-2.7-x86_64-linux", + 'factory' : KLEEBuilder.getKLEEBuildFactory( + "x86_64-pc-linux-gnu", clean=False, + llvm_branch='tags/RELEASE_27', + llvmgccdir='/home/klee-buildslave/llvm-gcc-4.2-2.7-x86_64-linux') }, + + { 'name' : "klee-2.6-x86_64-linux", + 'slavenames' : ["klee.minormatter.com"], + 'builddir' : "build.klee-2.6-x86_64-linux", + 'factory' : KLEEBuilder.getKLEEBuildFactory( + "x86_64-pc-linux-gnu", clean=False, + llvm_branch='tags/RELEASE_26', + llvmgccdir='/home/klee-buildslave/llvm-gcc-4.2-2.6-x86_64-linux') }, ] def get_builders(): From daniel at zuster.org Thu Aug 5 10:44:15 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 05 Aug 2010 15:44:15 -0000 Subject: [llvm-commits] [llvm] r110337 - /llvm/trunk/test/MC/AsmParser/dg.exp Message-ID: <20100805154415.ECE922A6C12C@llvm.org> Author: ddunbar Date: Thu Aug 5 10:44:15 2010 New Revision: 110337 URL: http://llvm.org/viewvc/llvm-project?rev=110337&view=rev Log: tests: Mark MC/AsmParser tests as requiring x86 for now -- almost all of them rely on using a specific x86 triple to test what they want to test. Modified: llvm/trunk/test/MC/AsmParser/dg.exp Modified: llvm/trunk/test/MC/AsmParser/dg.exp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/dg.exp?rev=110337&r1=110336&r2=110337&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/dg.exp (original) +++ llvm/trunk/test/MC/AsmParser/dg.exp Thu Aug 5 10:44:15 2010 @@ -1,4 +1,5 @@ load_lib llvm.exp -RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{s}]] - +if { [llvm_supports_target X86] } { + RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{s}]] +} From daniel at zuster.org Thu Aug 5 10:45:33 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 05 Aug 2010 15:45:33 -0000 Subject: [llvm-commits] [llvm] r110338 - /llvm/trunk/test/CodeGen/X86/GC/dg.exp Message-ID: <20100805154533.99D8A2A6C12C@llvm.org> Author: ddunbar Date: Thu Aug 5 10:45:33 2010 New Revision: 110338 URL: http://llvm.org/viewvc/llvm-project?rev=110338&view=rev Log: tests: CodeGen/X86/GC tests require X86. Modified: llvm/trunk/test/CodeGen/X86/GC/dg.exp Modified: llvm/trunk/test/CodeGen/X86/GC/dg.exp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/GC/dg.exp?rev=110338&r1=110337&r2=110338&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/GC/dg.exp (original) +++ llvm/trunk/test/CodeGen/X86/GC/dg.exp Thu Aug 5 10:45:33 2010 @@ -1,3 +1,5 @@ load_lib llvm.exp -RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] +if { [llvm_supports_target X86] } { + RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] +} From bob.wilson at apple.com Thu Aug 5 11:26:32 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Thu, 05 Aug 2010 16:26:32 -0000 Subject: [llvm-commits] [llvm] r110341 - in /llvm/trunk/tools/bugpoint: BugDriver.cpp BugDriver.h OptimizerDriver.cpp bugpoint.cpp Message-ID: <20100805162632.DA9F12A6C12C@llvm.org> Author: bwilson Date: Thu Aug 5 11:26:32 2010 New Revision: 110341 URL: http://llvm.org/viewvc/llvm-project?rev=110341&view=rev Log: Revert bugpoint change due to buildbot breakage. --- Reverse-merging r110333 into '.': U tools/bugpoint/BugDriver.h U tools/bugpoint/OptimizerDriver.cpp U tools/bugpoint/bugpoint.cpp U tools/bugpoint/BugDriver.cpp Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp llvm/trunk/tools/bugpoint/BugDriver.h llvm/trunk/tools/bugpoint/OptimizerDriver.cpp llvm/trunk/tools/bugpoint/bugpoint.cpp Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.cpp?rev=110341&r1=110340&r2=110341&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/BugDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/BugDriver.cpp Thu Aug 5 11:26:32 2010 @@ -66,12 +66,12 @@ return Result; } -BugDriver::BugDriver(const char *toolname, bool find_bugs, +BugDriver::BugDriver(const char *toolname, bool as_child, bool find_bugs, unsigned timeout, unsigned memlimit, bool use_valgrind, LLVMContext& ctxt) : Context(ctxt), ToolName(toolname), ReferenceOutputFile(OutputFile), Program(0), Interpreter(0), SafeInterpreter(0), gcc(0), - run_find_bugs(find_bugs), Timeout(timeout), + run_as_child(as_child), run_find_bugs(find_bugs), Timeout(timeout), MemoryLimit(memlimit), UseValgrind(use_valgrind) {} BugDriver::~BugDriver() { @@ -119,13 +119,15 @@ Program = ParseInputFile(Filenames[0], Context); if (Program == 0) return true; - outs() << "Read input file : '" << Filenames[0] << "'\n"; + if (!run_as_child) + outs() << "Read input file : '" << Filenames[0] << "'\n"; for (unsigned i = 1, e = Filenames.size(); i != e; ++i) { std::auto_ptr M(ParseInputFile(Filenames[i], Context)); if (M.get() == 0) return true; - outs() << "Linking in input file: '" << Filenames[i] << "'\n"; + if (!run_as_child) + outs() << "Linking in input file: '" << Filenames[i] << "'\n"; std::string ErrorMessage; if (Linker::LinkModules(Program, M.get(), &ErrorMessage)) { errs() << ToolName << ": error linking in '" << Filenames[i] << "': " @@ -134,7 +136,8 @@ } } - outs() << "*** All input ok\n"; + if (!run_as_child) + outs() << "*** All input ok\n"; // All input files read successfully! return false; @@ -146,6 +149,14 @@ /// variables are set up from command line arguments. /// bool BugDriver::run(std::string &ErrMsg) { + // The first thing to do is determine if we're running as a child. If we are, + // then what to do is very narrow. This form of invocation is only called + // from the runPasses method to actually run those passes in a child process. + if (run_as_child) { + // Execute the passes + return runPassesAsChild(PassesToRun); + } + if (run_find_bugs) { // Rearrange the passes and apply them to the program. Repeat this process // until the user kills the program or we find a bug. Modified: llvm/trunk/tools/bugpoint/BugDriver.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.h?rev=110341&r1=110340&r2=110341&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/BugDriver.h (original) +++ llvm/trunk/tools/bugpoint/BugDriver.h Thu Aug 5 11:26:32 2010 @@ -51,6 +51,7 @@ AbstractInterpreter *Interpreter; // How to run the program AbstractInterpreter *SafeInterpreter; // To generate reference output, etc. GCC *gcc; + bool run_as_child; bool run_find_bugs; unsigned Timeout; unsigned MemoryLimit; @@ -61,7 +62,7 @@ friend class ReduceMisCodegenFunctions; public: - BugDriver(const char *toolname, bool find_bugs, + BugDriver(const char *toolname, bool as_child, bool find_bugs, unsigned timeout, unsigned memlimit, bool use_valgrind, LLVMContext& ctxt); ~BugDriver(); @@ -289,6 +290,9 @@ return runPasses(M, PassesToRun, Filename, DeleteOutput); } + /// runAsChild - The actual "runPasses" guts that runs in a child process. + int runPassesAsChild(const std::vector &PassesToRun); + /// initializeExecutionEnvironment - This method is used to set up the /// environment for executing LLVM programs. /// Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=110341&r1=110340&r2=110341&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Thu Aug 5 11:26:32 2010 @@ -27,7 +27,6 @@ #include "llvm/Target/TargetData.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Path.h" #include "llvm/System/Program.h" @@ -86,6 +85,37 @@ outs() << getPassesString(PassesToRun) << "\n"; } +int BugDriver::runPassesAsChild(const std::vector &Passes) { + std::string ErrInfo; + raw_fd_ostream OutFile(ChildOutput.c_str(), ErrInfo, + raw_fd_ostream::F_Binary); + if (!ErrInfo.empty()) { + errs() << "Error opening bitcode file: " << ChildOutput << "\n"; + return 1; + } + + PassManager PM; + // Make sure that the appropriate target data is always used... + PM.add(new TargetData(Program)); + + for (unsigned i = 0, e = Passes.size(); i != e; ++i) { + if (Passes[i]->getNormalCtor()) + PM.add(Passes[i]->getNormalCtor()()); + else + errs() << "Cannot create pass yet: " << Passes[i]->getPassName() << "\n"; + } + // Check that the module is well formed on completion of optimization + PM.add(createVerifierPass()); + + // Write bitcode out to disk as the last step... + PM.add(createBitcodeWriterPass(OutFile)); + + // Run all queued passes. + PM.run(*Program); + + return 0; +} + cl::opt SilencePasses("silence-passes", cl::desc("Suppress output of running passes (both stdout and stderr)")); /// runPasses - Run the specified passes on Program, outputting a bitcode file @@ -134,25 +164,17 @@ // setup the child process' arguments SmallVector Args; - std::string Opt; - llvm::StringRef TN(ToolName); - if (TN.find('/') == llvm::StringRef::npos) { - Opt = ToolName; - } else { - std::pair P = TN.rsplit('/'); - Opt = P.first.str() + "/" + "opt"; - } - - sys::Path tool = sys::Program::FindProgramByName(Opt); + sys::Path tool = sys::Program::FindProgramByName(ToolName); if (UseValgrind) { Args.push_back("valgrind"); Args.push_back("--error-exitcode=1"); Args.push_back("-q"); Args.push_back(tool.c_str()); } else - Args.push_back(Opt.c_str()); + Args.push_back(ToolName); - Args.push_back("-o"); + Args.push_back("-as-child"); + Args.push_back("-child-output"); Args.push_back(OutputFilename.c_str()); std::vector pass_args; for (unsigned i = 0, e = PluginLoader::getNumPlugins(); i != e; ++i) { @@ -170,12 +192,6 @@ Args.push_back(*ExtraArgs); Args.push_back(0); - DEBUG(errs() << "\nAbout to run:\t"; - for (unsigned i = 0, e = Args.size()-1; i != e; ++i) - errs() << " " << Args[i]; - errs() << "\n"; - ); - sys::Path prog; if (UseValgrind) prog = sys::Program::FindProgramByName("valgrind"); Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=110341&r1=110340&r2=110341&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/bugpoint.cpp (original) +++ llvm/trunk/tools/bugpoint/bugpoint.cpp Thu Aug 5 11:26:32 2010 @@ -29,6 +29,13 @@ #include "llvm/LinkAllVMCore.h" using namespace llvm; +// AsChild - Specifies that this invocation of bugpoint is being generated +// from a parent process. It is not intended to be used by users so the +// option is hidden. +static cl::opt +AsChild("as-child", cl::desc("Run bugpoint as child process"), + cl::ReallyHidden); + static cl::opt FindBugs("find-bugs", cl::desc("Run many different optimization sequences " "on program to find bugs"), cl::init(false)); @@ -116,7 +123,7 @@ MemoryLimit = 100; } - BugDriver D(argv[0], FindBugs, TimeoutValue, MemoryLimit, + BugDriver D(argv[0], AsChild, FindBugs, TimeoutValue, MemoryLimit, UseValgrind, Context); if (D.addSources(InputFilenames)) return 1; From bob.wilson at apple.com Thu Aug 5 11:27:01 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Thu, 5 Aug 2010 09:27:01 -0700 Subject: [llvm-commits] [llvm] r110333 - in /llvm/trunk/tools/bugpoint: BugDriver.cpp BugDriver.h OptimizerDriver.cpp bugpoint.cpp In-Reply-To: <20100805152538.50CAA2A6C12C@llvm.org> References: <20100805152538.50CAA2A6C12C@llvm.org> Message-ID: <2BD86A28-D6D6-49EC-945A-BA3428636A00@apple.com> This broke a bunch of buildbots. I've reverted it for now. On Aug 5, 2010, at 8:25 AM, Rafael Espindola wrote: > Author: rafael > Date: Thu Aug 5 10:25:38 2010 > New Revision: 110333 > > URL: http://llvm.org/viewvc/llvm-project?rev=110333&view=rev > Log: > Run opt instead of bugpoint itself. > > Fixes PR753. > > Modified: > llvm/trunk/tools/bugpoint/BugDriver.cpp > llvm/trunk/tools/bugpoint/BugDriver.h > llvm/trunk/tools/bugpoint/OptimizerDriver.cpp > llvm/trunk/tools/bugpoint/bugpoint.cpp > > Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.cpp?rev=110333&r1=110332&r2=110333&view=diff > ============================================================================== > --- llvm/trunk/tools/bugpoint/BugDriver.cpp (original) > +++ llvm/trunk/tools/bugpoint/BugDriver.cpp Thu Aug 5 10:25:38 2010 > @@ -66,12 +66,12 @@ > return Result; > } > > -BugDriver::BugDriver(const char *toolname, bool as_child, bool find_bugs, > +BugDriver::BugDriver(const char *toolname, bool find_bugs, > unsigned timeout, unsigned memlimit, bool use_valgrind, > LLVMContext& ctxt) > : Context(ctxt), ToolName(toolname), ReferenceOutputFile(OutputFile), > Program(0), Interpreter(0), SafeInterpreter(0), gcc(0), > - run_as_child(as_child), run_find_bugs(find_bugs), Timeout(timeout), > + run_find_bugs(find_bugs), Timeout(timeout), > MemoryLimit(memlimit), UseValgrind(use_valgrind) {} > > BugDriver::~BugDriver() { > @@ -119,15 +119,13 @@ > Program = ParseInputFile(Filenames[0], Context); > if (Program == 0) return true; > > - if (!run_as_child) > - outs() << "Read input file : '" << Filenames[0] << "'\n"; > + outs() << "Read input file : '" << Filenames[0] << "'\n"; > > for (unsigned i = 1, e = Filenames.size(); i != e; ++i) { > std::auto_ptr M(ParseInputFile(Filenames[i], Context)); > if (M.get() == 0) return true; > > - if (!run_as_child) > - outs() << "Linking in input file: '" << Filenames[i] << "'\n"; > + outs() << "Linking in input file: '" << Filenames[i] << "'\n"; > std::string ErrorMessage; > if (Linker::LinkModules(Program, M.get(), &ErrorMessage)) { > errs() << ToolName << ": error linking in '" << Filenames[i] << "': " > @@ -136,8 +134,7 @@ > } > } > > - if (!run_as_child) > - outs() << "*** All input ok\n"; > + outs() << "*** All input ok\n"; > > // All input files read successfully! > return false; > @@ -149,14 +146,6 @@ > /// variables are set up from command line arguments. > /// > bool BugDriver::run(std::string &ErrMsg) { > - // The first thing to do is determine if we're running as a child. If we are, > - // then what to do is very narrow. This form of invocation is only called > - // from the runPasses method to actually run those passes in a child process. > - if (run_as_child) { > - // Execute the passes > - return runPassesAsChild(PassesToRun); > - } > - > if (run_find_bugs) { > // Rearrange the passes and apply them to the program. Repeat this process > // until the user kills the program or we find a bug. > > Modified: llvm/trunk/tools/bugpoint/BugDriver.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.h?rev=110333&r1=110332&r2=110333&view=diff > ============================================================================== > --- llvm/trunk/tools/bugpoint/BugDriver.h (original) > +++ llvm/trunk/tools/bugpoint/BugDriver.h Thu Aug 5 10:25:38 2010 > @@ -51,7 +51,6 @@ > AbstractInterpreter *Interpreter; // How to run the program > AbstractInterpreter *SafeInterpreter; // To generate reference output, etc. > GCC *gcc; > - bool run_as_child; > bool run_find_bugs; > unsigned Timeout; > unsigned MemoryLimit; > @@ -62,7 +61,7 @@ > friend class ReduceMisCodegenFunctions; > > public: > - BugDriver(const char *toolname, bool as_child, bool find_bugs, > + BugDriver(const char *toolname, bool find_bugs, > unsigned timeout, unsigned memlimit, bool use_valgrind, > LLVMContext& ctxt); > ~BugDriver(); > @@ -290,9 +289,6 @@ > return runPasses(M, PassesToRun, Filename, DeleteOutput); > } > > - /// runAsChild - The actual "runPasses" guts that runs in a child process. > - int runPassesAsChild(const std::vector &PassesToRun); > - > /// initializeExecutionEnvironment - This method is used to set up the > /// environment for executing LLVM programs. > /// > > Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=110333&r1=110332&r2=110333&view=diff > ============================================================================== > --- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original) > +++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Thu Aug 5 10:25:38 2010 > @@ -27,6 +27,7 @@ > #include "llvm/Target/TargetData.h" > #include "llvm/Support/FileUtilities.h" > #include "llvm/Support/CommandLine.h" > +#include "llvm/Support/Debug.h" > #include "llvm/Support/raw_ostream.h" > #include "llvm/System/Path.h" > #include "llvm/System/Program.h" > @@ -85,37 +86,6 @@ > outs() << getPassesString(PassesToRun) << "\n"; > } > > -int BugDriver::runPassesAsChild(const std::vector &Passes) { > - std::string ErrInfo; > - raw_fd_ostream OutFile(ChildOutput.c_str(), ErrInfo, > - raw_fd_ostream::F_Binary); > - if (!ErrInfo.empty()) { > - errs() << "Error opening bitcode file: " << ChildOutput << "\n"; > - return 1; > - } > - > - PassManager PM; > - // Make sure that the appropriate target data is always used... > - PM.add(new TargetData(Program)); > - > - for (unsigned i = 0, e = Passes.size(); i != e; ++i) { > - if (Passes[i]->getNormalCtor()) > - PM.add(Passes[i]->getNormalCtor()()); > - else > - errs() << "Cannot create pass yet: " << Passes[i]->getPassName() << "\n"; > - } > - // Check that the module is well formed on completion of optimization > - PM.add(createVerifierPass()); > - > - // Write bitcode out to disk as the last step... > - PM.add(createBitcodeWriterPass(OutFile)); > - > - // Run all queued passes. > - PM.run(*Program); > - > - return 0; > -} > - > cl::opt SilencePasses("silence-passes", cl::desc("Suppress output of running passes (both stdout and stderr)")); > > /// runPasses - Run the specified passes on Program, outputting a bitcode file > @@ -164,17 +134,25 @@ > > // setup the child process' arguments > SmallVector Args; > - sys::Path tool = sys::Program::FindProgramByName(ToolName); > + std::string Opt; > + llvm::StringRef TN(ToolName); > + if (TN.find('/') == llvm::StringRef::npos) { > + Opt = ToolName; > + } else { > + std::pair P = TN.rsplit('/'); > + Opt = P.first.str() + "/" + "opt"; > + } > + > + sys::Path tool = sys::Program::FindProgramByName(Opt); > if (UseValgrind) { > Args.push_back("valgrind"); > Args.push_back("--error-exitcode=1"); > Args.push_back("-q"); > Args.push_back(tool.c_str()); > } else > - Args.push_back(ToolName); > + Args.push_back(Opt.c_str()); > > - Args.push_back("-as-child"); > - Args.push_back("-child-output"); > + Args.push_back("-o"); > Args.push_back(OutputFilename.c_str()); > std::vector pass_args; > for (unsigned i = 0, e = PluginLoader::getNumPlugins(); i != e; ++i) { > @@ -192,6 +170,12 @@ > Args.push_back(*ExtraArgs); > Args.push_back(0); > > + DEBUG(errs() << "\nAbout to run:\t"; > + for (unsigned i = 0, e = Args.size()-1; i != e; ++i) > + errs() << " " << Args[i]; > + errs() << "\n"; > + ); > + > sys::Path prog; > if (UseValgrind) > prog = sys::Program::FindProgramByName("valgrind"); > > Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=110333&r1=110332&r2=110333&view=diff > ============================================================================== > --- llvm/trunk/tools/bugpoint/bugpoint.cpp (original) > +++ llvm/trunk/tools/bugpoint/bugpoint.cpp Thu Aug 5 10:25:38 2010 > @@ -29,13 +29,6 @@ > #include "llvm/LinkAllVMCore.h" > using namespace llvm; > > -// AsChild - Specifies that this invocation of bugpoint is being generated > -// from a parent process. It is not intended to be used by users so the > -// option is hidden. > -static cl::opt > -AsChild("as-child", cl::desc("Run bugpoint as child process"), > - cl::ReallyHidden); > - > static cl::opt > FindBugs("find-bugs", cl::desc("Run many different optimization sequences " > "on program to find bugs"), cl::init(false)); > @@ -123,7 +116,7 @@ > MemoryLimit = 100; > } > > - BugDriver D(argv[0], AsChild, FindBugs, TimeoutValue, MemoryLimit, > + BugDriver D(argv[0], FindBugs, TimeoutValue, MemoryLimit, > UseValgrind, Context); > if (D.addSources(InputFilenames)) return 1; > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From espindola at google.com Thu Aug 5 11:40:13 2010 From: espindola at google.com (Rafael Espindola) Date: Thu, 5 Aug 2010 12:40:13 -0400 Subject: [llvm-commits] [llvm] r110333 - in /llvm/trunk/tools/bugpoint: BugDriver.cpp BugDriver.h OptimizerDriver.cpp bugpoint.cpp In-Reply-To: <2BD86A28-D6D6-49EC-945A-BA3428636A00@apple.com> References: <20100805152538.50CAA2A6C12C@llvm.org> <2BD86A28-D6D6-49EC-945A-BA3428636A00@apple.com> Message-ID: On 5 August 2010 12:27, Bob Wilson wrote: > This broke a bunch of buildbots. ?I've reverted it for now. Thanks, was just about to do the same. Cheers, -- Rafael ?vila de Esp?ndola From gohman at apple.com Thu Aug 5 12:04:16 2010 From: gohman at apple.com (Dan Gohman) Date: Thu, 05 Aug 2010 17:04:16 -0000 Subject: [llvm-commits] [llvm] r110343 - in /llvm/trunk/test: CodeGen/X86/ Transforms/LoopStrengthReduce/ Message-ID: <20100805170416.2F9AA2A6C12C@llvm.org> Author: djg Date: Thu Aug 5 12:04:15 2010 New Revision: 110343 URL: http://llvm.org/viewvc/llvm-project?rev=110343&view=rev Log: Move x86-specific tests out of test/Transforms/LoopStrengthReduce and into test/CodeGen/X86, so that they aren't run when the x86 target is not enabled. Fix uglygep.ll to not be x86-specific. Added: llvm/trunk/test/CodeGen/X86/2008-08-06-CmpStride.ll - copied unchanged from r110294, llvm/trunk/test/Transforms/LoopStrengthReduce/2008-08-06-CmpStride.ll llvm/trunk/test/CodeGen/X86/2009-02-09-ivs-different-sizes.ll - copied unchanged from r110294, llvm/trunk/test/Transforms/LoopStrengthReduce/2009-02-09-ivs-different-sizes.ll llvm/trunk/test/CodeGen/X86/change-compare-stride-trickiness-0.ll - copied unchanged from r110294, llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-0.ll llvm/trunk/test/CodeGen/X86/change-compare-stride-trickiness-1.ll - copied unchanged from r110294, llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-1.ll llvm/trunk/test/CodeGen/X86/change-compare-stride-trickiness-2.ll - copied unchanged from r110294, llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-2.ll llvm/trunk/test/CodeGen/X86/insert-positions.ll - copied unchanged from r110294, llvm/trunk/test/Transforms/LoopStrengthReduce/insert-positions.ll Removed: llvm/trunk/test/Transforms/LoopStrengthReduce/2008-08-06-CmpStride.ll llvm/trunk/test/Transforms/LoopStrengthReduce/2009-02-09-ivs-different-sizes.ll llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-0.ll llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-1.ll llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-2.ll llvm/trunk/test/Transforms/LoopStrengthReduce/insert-positions.ll Modified: llvm/trunk/test/Transforms/LoopStrengthReduce/uglygep.ll Removed: llvm/trunk/test/Transforms/LoopStrengthReduce/2008-08-06-CmpStride.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/2008-08-06-CmpStride.ll?rev=110342&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopStrengthReduce/2008-08-06-CmpStride.ll (original) +++ llvm/trunk/test/Transforms/LoopStrengthReduce/2008-08-06-CmpStride.ll (removed) @@ -1,23 +0,0 @@ -; RUN: llc -march=x86-64 < %s -o - | grep {cmpl \\$\[1\], %} - - at .str = internal constant [4 x i8] c"%d\0A\00" - -declare i32 @printf(i8* noalias , ...) nounwind - -define i32 @main() nounwind { -entry: - br label %forbody - -forbody: - %i.0 = phi i32 [ 0, %entry ], [ %inc, %forbody ] ; [#uses=3] - %sub14 = sub i32 1027, %i.0 ; [#uses=1] - %mul15 = mul i32 %sub14, 10 ; [#uses=1] - %add166 = or i32 %mul15, 1 ; [#uses=1] * - call i32 (i8*, ...)* @printf( i8* noalias getelementptr ([4 x i8]* @.str, i32 0, i32 0), i32 %add166 ) nounwind - %inc = add i32 %i.0, 1 ; [#uses=3] - %cmp = icmp ne i32 %inc, 1027 ; [#uses=1] - br i1 %cmp, label %forbody, label %afterfor - -afterfor: ; preds = %forcond - ret i32 0 -} Removed: llvm/trunk/test/Transforms/LoopStrengthReduce/2009-02-09-ivs-different-sizes.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/2009-02-09-ivs-different-sizes.ll?rev=110342&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopStrengthReduce/2009-02-09-ivs-different-sizes.ll (original) +++ llvm/trunk/test/Transforms/LoopStrengthReduce/2009-02-09-ivs-different-sizes.ll (removed) @@ -1,33 +0,0 @@ -; RUN: llc < %s -; This used to crash. -; ModuleID = 'bugpoint-reduced-simplified.bc' -target datalayout ="e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" -target triple = "x86_64-unknown-linux-gnu" - -define void @parse_number(i8* nocapture %p) nounwind { -entry: - %shift.0 = select i1 false, i32 4, i32 2 ; [#uses=1] - br label %bb47 - -bb47: ; preds = %bb47, %entry - br i1 false, label %bb54, label %bb47 - -bb54: ; preds = %bb47 - br i1 false, label %bb56, label %bb66 - -bb56: ; preds = %bb62, %bb54 - %p_addr.0.pn.rec = phi i64 [ %p_addr.6.rec, %bb62 ], [ 0, %bb54 ] ; [#uses=2] - %ch.6.in.in = phi i8* [ %p_addr.6, %bb62 ], [ null, %bb54 ] ; [#uses=0] - %indvar202 = trunc i64 %p_addr.0.pn.rec to i32 ; [#uses=1] - %frac_bits.0 = mul i32 %indvar202, %shift.0 ; [#uses=1] - %p_addr.6.rec = add i64 %p_addr.0.pn.rec, 1 ; [#uses=2] - %p_addr.6 = getelementptr i8* null, i64 %p_addr.6.rec ; [#uses=1] - br i1 false, label %bb66, label %bb62 - -bb62: ; preds = %bb56 - br label %bb56 - -bb66: ; preds = %bb56, %bb54 - %frac_bits.1 = phi i32 [ 0, %bb54 ], [ %frac_bits.0, %bb56 ] ; [#uses=0] - unreachable -} Removed: llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-0.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-0.ll?rev=110342&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-0.ll (original) +++ llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-0.ll (removed) @@ -1,29 +0,0 @@ -; RUN: llc < %s -o - | FileCheck %s -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" -target triple = "x86_64-apple-darwin9" - -; The comparison happens before the relevant use, but it can still be rewritten -; to compare with zero. - -; CHECK: foo: -; CHECK: align -; CHECK: incl %eax -; CHECK-NEXT: decl %ecx -; CHECK-NEXT: jne - -define void @foo() nounwind { -entry: - br label %loop - -loop: - %indvar = phi i32 [ 0, %entry ], [ %i.2.0.us1534, %loop ] ; [#uses=1] - %i.2.0.us1534 = add i32 %indvar, 1 ; [#uses=3] - %tmp611.us1535 = icmp eq i32 %i.2.0.us1534, 4 ; [#uses=2] - %tmp623.us1538 = select i1 %tmp611.us1535, i32 6, i32 0 ; [#uses=0] - %tmp628.us1540 = shl i32 %i.2.0.us1534, 1 ; [#uses=1] - %tmp645646647.us1547 = sext i32 %tmp628.us1540 to i64 ; [#uses=0] - br i1 %tmp611.us1535, label %exit, label %loop - -exit: - ret void -} Removed: llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-1.ll?rev=110342&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-1.ll (original) +++ llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-1.ll (removed) @@ -1,28 +0,0 @@ -; RUN: llc %s -o - --x86-asm-syntax=att | grep {cmp. \$10} -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" -target triple = "x86_64-apple-darwin9" - -; The comparison happens after the relevant use, so the stride can easily -; be changed. The comparison can be done in a narrower mode than the -; induction variable. -; TODO: By making the first store post-increment as well, the loop setup -; could be made simpler. - -define void @foo() nounwind { -entry: - br label %loop - -loop: - %indvar = phi i32 [ 0, %entry ], [ %i.2.0.us1534, %loop ] ; [#uses=1] - %i.2.0.us1534 = add i32 %indvar, 1 ; [#uses=3] - %tmp628.us1540 = shl i32 %i.2.0.us1534, 1 ; [#uses=1] - %tmp645646647.us1547 = sext i32 %tmp628.us1540 to i64 ; [#uses=1] - store i64 %tmp645646647.us1547, i64* null - %tmp611.us1535 = icmp eq i32 %i.2.0.us1534, 4 ; [#uses=2] - %tmp623.us1538 = select i1 %tmp611.us1535, i32 6, i32 0 ; [#uses=1] - store i32 %tmp623.us1538, i32* null - br i1 %tmp611.us1535, label %exit, label %loop - -exit: - ret void -} Removed: llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-2.ll?rev=110342&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-2.ll (original) +++ llvm/trunk/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-2.ll (removed) @@ -1,58 +0,0 @@ -; RUN: llc < %s -; PR4222 - -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "x86_64-pc-linux-gnu" -module asm ".ident\09\22$FreeBSD: head/sys/amd64/amd64/minidump_machdep.c 184499 2008-10-31 10:11:35Z kib $\22" - %struct.dumperinfo = type <{ i32 (i8*, i8*, i64, i64, i64)*, i8*, i32, i32, i64, i64 }> - -define void @minidumpsys(%struct.dumperinfo* %di) nounwind { -entry: - br label %if.end - -if.end: ; preds = %if.end52, %entry - br label %for.cond.i.preheader - -for.cond.i.preheader: ; preds = %if.end52, %if.end - %indvar688 = phi i64 [ 0, %if.end ], [ %indvar.next689, %if.end52 ] ; [#uses=3] - %tmp690 = shl i64 %indvar688, 12 ; [#uses=1] - %pa.0642 = add i64 %tmp690, 0 ; [#uses=1] - %indvar688703 = trunc i64 %indvar688 to i32 ; [#uses=1] - %tmp692693 = add i32 %indvar688703, 1 ; [#uses=1] - %phitmp = sext i32 %tmp692693 to i64 ; [#uses=1] - br i1 false, label %if.end52, label %land.lhs.true.i - -land.lhs.true.i: ; preds = %for.cond.i.preheader - %shr2.i = lshr i64 %pa.0642, 18 ; [#uses=0] - unreachable - -if.end52: ; preds = %for.cond.i.preheader - %phitmp654 = icmp ult i64 %phitmp, 512 ; [#uses=1] - %indvar.next689 = add i64 %indvar688, 1 ; [#uses=1] - br i1 %phitmp654, label %for.cond.i.preheader, label %if.end -} - -define void @promote(%struct.dumperinfo* %di) nounwind { -entry: - br label %if.end - -if.end: ; preds = %if.end52, %entry - br label %for.cond.i.preheader - -for.cond.i.preheader: ; preds = %if.end52, %if.end - %indvar688 = phi i32 [ 0, %if.end ], [ %indvar.next689, %if.end52 ] ; [#uses=3] - %tmp690 = shl i32 %indvar688, 12 ; [#uses=1] - %pa.0642 = add i32 %tmp690, 0 ; [#uses=1] - %tmp692693 = add i32 %indvar688, 1 ; [#uses=1] - %phitmp = sext i32 %tmp692693 to i64 ; [#uses=1] - br i1 false, label %if.end52, label %land.lhs.true.i - -land.lhs.true.i: ; preds = %for.cond.i.preheader - %shr2.i = lshr i32 %pa.0642, 18 ; [#uses=0] - unreachable - -if.end52: ; preds = %for.cond.i.preheader - %phitmp654 = icmp ult i64 %phitmp, 512 ; [#uses=1] - %indvar.next689 = add i32 %indvar688, 1 ; [#uses=1] - br i1 %phitmp654, label %for.cond.i.preheader, label %if.end -} Removed: llvm/trunk/test/Transforms/LoopStrengthReduce/insert-positions.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/insert-positions.ll?rev=110342&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopStrengthReduce/insert-positions.ll (original) +++ llvm/trunk/test/Transforms/LoopStrengthReduce/insert-positions.ll (removed) @@ -1,69 +0,0 @@ -; RUN: llc < %s -march=x86-64 >/dev/null - -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" - -define void @test0() nounwind { -if.end90.i.i: - br label %while.body.i.i221.i - -while.body.i.i221.i: ; preds = %while.cond.backedge.i.i.i, %if.end90.i.i - br i1 undef, label %if.then.i.i224.i, label %while.cond.backedge.i.i.i - -while.cond.backedge.i.i.i: ; preds = %for.end.i.i.i, %while.body.i.i221.i - br label %while.body.i.i221.i - -if.then.i.i224.i: ; preds = %while.body.i.i221.i - switch i32 undef, label %for.cond.i.i226.i [ - i32 92, label %sw.bb.i.i225.i - i32 34, label %sw.bb.i.i225.i - i32 110, label %sw.bb21.i.i.i - ] - -sw.bb.i.i225.i: ; preds = %if.then.i.i224.i, %if.then.i.i224.i - unreachable - -sw.bb21.i.i.i: ; preds = %if.then.i.i224.i - unreachable - -for.cond.i.i226.i: ; preds = %for.body.i.i.i, %if.then.i.i224.i - %0 = phi i64 [ %tmp154.i.i.i, %for.body.i.i.i ], [ 0, %if.then.i.i224.i ] ; [#uses=2] - %tmp154.i.i.i = add i64 %0, 1 ; [#uses=2] - %i.0.i.i.i = trunc i64 %0 to i32 ; [#uses=1] - br i1 undef, label %land.rhs.i.i.i, label %for.end.i.i.i - -land.rhs.i.i.i: ; preds = %for.cond.i.i226.i - br i1 undef, label %for.body.i.i.i, label %for.end.i.i.i - -for.body.i.i.i: ; preds = %land.rhs.i.i.i - br label %for.cond.i.i226.i - -for.end.i.i.i: ; preds = %land.rhs.i.i.i, %for.cond.i.i226.i - %idx.ext.i.i.i = sext i32 %i.0.i.i.i to i64 ; [#uses=1] - %sub.ptr72.sum.i.i.i = xor i64 %idx.ext.i.i.i, -1 ; [#uses=1] - %pos.addr.1.sum155.i.i.i = add i64 %tmp154.i.i.i, %sub.ptr72.sum.i.i.i ; [#uses=1] - %arrayidx76.i.i.i = getelementptr inbounds i8* undef, i64 %pos.addr.1.sum155.i.i.i ; [#uses=0] - br label %while.cond.backedge.i.i.i -} - -define void @test1() nounwind { -entry: - %t = shl i32 undef, undef ; [#uses=1] - %t9 = sub nsw i32 0, %t ; [#uses=1] - br label %outer - -outer: ; preds = %bb18, %bb - %i12 = phi i32 [ %t21, %bb18 ], [ 0, %entry ] ; [#uses=2] - %i13 = phi i32 [ %t20, %bb18 ], [ 0, %entry ] ; [#uses=2] - br label %inner - -inner: ; preds = %bb16, %bb11 - %t17 = phi i32 [ %i13, %outer ], [ undef, %inner ] ; [#uses=1] - store i32 %t17, i32* undef - br i1 undef, label %bb18, label %inner - -bb18: ; preds = %bb16 - %t19 = add i32 %i13, %t9 ; [#uses=1] - %t20 = add i32 %t19, %i12 ; [#uses=1] - %t21 = add i32 %i12, 1 ; [#uses=1] - br label %outer -} Modified: llvm/trunk/test/Transforms/LoopStrengthReduce/uglygep.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/uglygep.ll?rev=110343&r1=110342&r2=110343&view=diff ============================================================================== --- llvm/trunk/test/Transforms/LoopStrengthReduce/uglygep.ll (original) +++ llvm/trunk/test/Transforms/LoopStrengthReduce/uglygep.ll Thu Aug 5 12:04:15 2010 @@ -4,7 +4,6 @@ ; should be able to form pretty GEPs. target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" -target triple = "x86_64-unknown-linux-gnu" define void @Z4() nounwind { bb: From espindola at google.com Thu Aug 5 12:28:45 2010 From: espindola at google.com (Rafael Espindola) Date: Thu, 5 Aug 2010 13:28:45 -0400 Subject: [llvm-commits] [llvm] r110333 - in /llvm/trunk/tools/bugpoint: BugDriver.cpp BugDriver.h OptimizerDriver.cpp bugpoint.cpp In-Reply-To: References: <20100805152538.50CAA2A6C12C@llvm.org> <2BD86A28-D6D6-49EC-945A-BA3428636A00@apple.com> Message-ID: > Thanks, was just about to do the same. So the problem are the bugpoint test passes. They are not available in opt. Since opt already have some bupoint only features, I think that just moving them there is the correct solution. The attached patch does that. Another option is to build a plugin and have bugpoint pass the plugin to opt. Let me know if you prefer that. Cheers, -- Rafael ?vila de Esp?ndola -------------- next part -------------- A non-text attachment was scrubbed... Name: move.patch Type: text/x-patch Size: 7216 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100805/0dd83371/attachment.bin From criswell at uiuc.edu Thu Aug 5 12:33:39 2010 From: criswell at uiuc.edu (John Criswell) Date: Thu, 05 Aug 2010 17:33:39 -0000 Subject: [llvm-commits] [poolalloc] r110346 - /poolalloc/trunk/lib/DSA/Local.cpp Message-ID: <20100805173339.F2A9E2A6C12C@llvm.org> Author: criswell Date: Thu Aug 5 12:33:39 2010 New Revision: 110346 URL: http://llvm.org/viewvc/llvm-project?rev=110346&view=rev Log: Added an assertion to make sure that DSNodes are large enough when merging in constant initializers. Fixed small indentation issue. Modified: poolalloc/trunk/lib/DSA/Local.cpp Modified: poolalloc/trunk/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=110346&r1=110345&r2=110346&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Local.cpp (original) +++ poolalloc/trunk/lib/DSA/Local.cpp Thu Aug 5 12:33:39 2010 @@ -615,7 +615,7 @@ #endif // Add in the offset calculated... - Value.setOffset(Value.getOffset()+Offset); + Value.setOffset(Value.getOffset()+Offset); // Check the offset DSNode *N = Value.getNode(); @@ -1059,6 +1059,7 @@ // will point into a different offset into that DSNode. // DSNodeHandle NewNH (NHN, offset); + assert ((NewNH.getOffset() == offset) && "Need to resize DSNode!\n"); // // Recursively merge in this element of the constant struture into the From espindola at google.com Thu Aug 5 12:38:09 2010 From: espindola at google.com (Rafael Espindola) Date: Thu, 5 Aug 2010 13:38:09 -0400 Subject: [llvm-commits] [llvm] r110333 - in /llvm/trunk/tools/bugpoint: BugDriver.cpp BugDriver.h OptimizerDriver.cpp bugpoint.cpp In-Reply-To: References: <20100805152538.50CAA2A6C12C@llvm.org> <2BD86A28-D6D6-49EC-945A-BA3428636A00@apple.com> Message-ID: And the revised patch to use opt is attached. It goes on top of the move.patch and passes all tests. Cheers, -- Rafael ?vila de Esp?ndola -------------- next part -------------- A non-text attachment was scrubbed... Name: bugpoint.patch Type: text/x-patch Size: 8105 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100805/862edfcb/attachment.bin From resistor at mac.com Thu Aug 5 12:45:33 2010 From: resistor at mac.com (Owen Anderson) Date: Thu, 05 Aug 2010 17:45:33 -0000 Subject: [llvm-commits] [test-suite] r110348 - /test-suite/trunk/MultiSource/Applications/Makefile Message-ID: <20100805174533.DA59D2A6C12C@llvm.org> Author: resistor Date: Thu Aug 5 12:45:33 2010 New Revision: 110348 URL: http://llvm.org/viewvc/llvm-project?rev=110348&view=rev Log: Re-enable OpenSSL. It should be working on 32-bit platforms now. Modified: test-suite/trunk/MultiSource/Applications/Makefile Modified: test-suite/trunk/MultiSource/Applications/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/Makefile?rev=110348&r1=110347&r2=110348&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Applications/Makefile (original) +++ test-suite/trunk/MultiSource/Applications/Makefile Thu Aug 5 12:45:33 2010 @@ -5,7 +5,7 @@ include $(LEVEL)/Makefile.config PARALLEL_DIRS = Burg aha sgefa siod d spiff treecc SPASS \ - oggenc JM viterbi SIBsim4 ClamAV sqlite3 lemon + oggenc JM viterbi SIBsim4 ClamAV sqlite3 lemon OpenSSL ifndef DISABLE_CXX PARALLEL_DIRS += lambda-0.1.3 hbd hexxagon minisat endif From stoklund at 2pi.dk Thu Aug 5 13:12:19 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Thu, 05 Aug 2010 18:12:19 -0000 Subject: [llvm-commits] [llvm] r110355 - /llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp Message-ID: <20100805181219.A692F2A6C12C@llvm.org> Author: stoklund Date: Thu Aug 5 13:12:19 2010 New Revision: 110355 URL: http://llvm.org/viewvc/llvm-project?rev=110355&view=rev Log: Avoid using a live std::multimap iterator while editing the map. It looks like we sometimes compare singular iterators, reported by ENABLE_EXPENSIVE_CHECKS. This fixes PR7825. Modified: llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp Modified: llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp?rev=110355&r1=110354&r2=110355&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp (original) +++ llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp Thu Aug 5 13:12:19 2010 @@ -1914,7 +1914,6 @@ if (InsertSpills(MII)) NextMII = llvm::next(MII); - VirtRegMap::MI2VirtMapTy::const_iterator I, End; bool Erased = false; bool BackTracked = false; MachineInstr &MI = *MII; @@ -2248,15 +2247,22 @@ // If we have folded references to memory operands, make sure we clear all // physical registers that may contain the value of the spilled virtual // register + + // Copy the folded virts to a small vector, we may change MI2VirtMap. + SmallVector, 4> FoldedVirts; + // C++0x FTW! + for (std::pair FVRange = + VRM->getFoldedVirts(&MI); + FVRange.first != FVRange.second; ++FVRange.first) + FoldedVirts.push_back(FVRange.first->second); + SmallSet FoldedSS; - for (tie(I, End) = VRM->getFoldedVirts(&MI); I != End; ) { - unsigned VirtReg = I->second.first; - VirtRegMap::ModRef MR = I->second.second; + for (unsigned FVI = 0, FVE = FoldedVirts.size(); FVI != FVE; ++FVI) { + unsigned VirtReg = FoldedVirts[FVI].first; + VirtRegMap::ModRef MR = FoldedVirts[FVI].second; DEBUG(dbgs() << "Folded vreg: " << VirtReg << " MR: " << MR); - // MI2VirtMap be can updated which invalidate the iterator. - // Increment the iterator first. - ++I; int SS = VRM->getStackSlot(VirtReg); if (SS == VirtRegMap::NO_STACK_SLOT) continue; From daniel at zuster.org Thu Aug 5 13:15:37 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Thu, 05 Aug 2010 18:15:37 -0000 Subject: [llvm-commits] [test-suite] r110356 - /test-suite/trunk/SingleSource/Regression/C++/EH/Makefile Message-ID: <20100805181537.B8A792A6C12C@llvm.org> Author: ddunbar Date: Thu Aug 5 13:15:37 2010 New Revision: 110356 URL: http://llvm.org/viewvc/llvm-project?rev=110356&view=rev Log: XFAIL ConditionalExpr when using TEST=simple with Clang -- it is really only testing for copy elision, which we don't implement yet. Modified: test-suite/trunk/SingleSource/Regression/C++/EH/Makefile Modified: test-suite/trunk/SingleSource/Regression/C++/EH/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Regression/C%2B%2B/EH/Makefile?rev=110356&r1=110355&r2=110356&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Regression/C++/EH/Makefile (original) +++ test-suite/trunk/SingleSource/Regression/C++/EH/Makefile Thu Aug 5 13:15:37 2010 @@ -1,6 +1,10 @@ LEVEL = ../../../.. REQUIRES_EH_SUPPORT = 1 +ifdef CC_UNDER_TEST_IS_CLANG +EXEC_XFAILS = ConditionalExpr +endif + CFLAGS += -std=c99 LDFLAGS += -lstdc++ include $(LEVEL)/SingleSource/Makefile.singlesrc From bob.wilson at apple.com Thu Aug 5 13:23:44 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Thu, 05 Aug 2010 18:23:44 -0000 Subject: [llvm-commits] [llvm] r110358 - in /llvm/trunk: lib/Target/ARM/ARMInstrInfo.td test/MC/Disassembler/arm-tests.txt Message-ID: <20100805182344.2F9E42A6C12C@llvm.org> Author: bwilson Date: Thu Aug 5 13:23:43 2010 New Revision: 110358 URL: http://llvm.org/viewvc/llvm-project?rev=110358&view=rev Log: Add an ARM RSBrr instruction for disassembly only. Partial fix for PR7792. Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td llvm/trunk/test/MC/Disassembler/arm-tests.txt Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=110358&r1=110357&r2=110358&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Thu Aug 5 13:23:43 2010 @@ -1629,13 +1629,21 @@ defm SBCS : AI1_adde_sube_s_irs<0b0110, "sbcs", BinOpFrag<(sube_live_carry node:$LHS, node:$RHS) >>; -// These don't define reg/reg forms, because they are handled above. def RSBri : AsI1<0b0011, (outs GPR:$dst), (ins GPR:$a, so_imm:$b), DPFrm, IIC_iALUi, "rsb", "\t$dst, $a, $b", [(set GPR:$dst, (sub so_imm:$b, GPR:$a))]> { let Inst{25} = 1; } +// The reg/reg form is only defined for the disassembler; for codegen it is +// equivalent to SUBrr. +def RSBrr : AsI1<0b0011, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm, + IIC_iALUr, "rsb", "\t$dst, $a, $b", + [/* For disassembly only; pattern left blank */]> { + let Inst{25} = 0; + let Inst{11-4} = 0b00000000; +} + def RSBrs : AsI1<0b0011, (outs GPR:$dst), (ins GPR:$a, so_reg:$b), DPSoRegFrm, IIC_iALUsr, "rsb", "\t$dst, $a, $b", [(set GPR:$dst, (sub so_reg:$b, GPR:$a))]> { Modified: llvm/trunk/test/MC/Disassembler/arm-tests.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/arm-tests.txt?rev=110358&r1=110357&r2=110358&view=diff ============================================================================== --- llvm/trunk/test/MC/Disassembler/arm-tests.txt (original) +++ llvm/trunk/test/MC/Disassembler/arm-tests.txt Thu Aug 5 13:23:43 2010 @@ -61,6 +61,10 @@ # CHECK: rfedb r0! 0x00 0x0a 0x30 0xf9 +# CHECK-NOT: rsbeq r0, r2, r0, lsl #0 +# CHECK: rsbeq r0, r2, r0 +0x00 0x00 0x62 0x00 + # CHECK: sbcs r0, pc, #1 0x01 0x00 0xdf 0xe2 From echristo at apple.com Thu Aug 5 13:34:30 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 05 Aug 2010 18:34:30 -0000 Subject: [llvm-commits] [llvm] r110359 - /llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Message-ID: <20100805183430.C40C32A6C12C@llvm.org> Author: echristo Date: Thu Aug 5 13:34:30 2010 New Revision: 110359 URL: http://llvm.org/viewvc/llvm-project?rev=110359&view=rev Log: Handle the pseudo in MCInstLower. Modified: llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Modified: llvm/trunk/lib/Target/X86/X86MCInstLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCInstLower.cpp?rev=110359&r1=110358&r2=110359&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86MCInstLower.cpp (original) +++ llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Thu Aug 5 13:34:30 2010 @@ -515,6 +515,12 @@ } return; + // Emit nothing here but a comment if we can. + case X86::Int_MemBarrier: + if (OutStreamer.hasRawTextSupport()) + OutStreamer.EmitRawText(StringRef("\t#MEMBARRIER")); + return; + case X86::TAILJMPr: case X86::TAILJMPd: case X86::TAILJMPd64: From echristo at apple.com Thu Aug 5 13:36:20 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 05 Aug 2010 18:36:20 -0000 Subject: [llvm-commits] [llvm] r110360 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td Message-ID: <20100805183621.10CEB2A6C12C@llvm.org> Author: echristo Date: Thu Aug 5 13:36:20 2010 New Revision: 110360 URL: http://llvm.org/viewvc/llvm-project?rev=110360&view=rev Log: Be a little bit more specific about target for the memory barrier instructions. Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=110360&r1=110359&r2=110360&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Thu Aug 5 13:36:20 2010 @@ -1624,7 +1624,8 @@ def Int_MemBarrierNoSSE64 : RI<0x09, MRM1r, (outs), (ins GR64:$zero), "lock\n\t" "or{q}\t{$zero, (%rsp)|(%rsp), $zero}", - [(X86MemBarrierNoSSE GR64:$zero)]>, LOCK; + [(X86MemBarrierNoSSE GR64:$zero)]>, + Requires<[In64BitMode]>, LOCK; let Defs = [RAX, EFLAGS], Uses = [RAX] in { def LCMPXCHG64 : RI<0xB1, MRMDestMem, (outs), (ins i64mem:$ptr, GR64:$swap), Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=110360&r1=110359&r2=110360&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Thu Aug 5 13:36:20 2010 @@ -3938,7 +3938,8 @@ def Int_MemBarrierNoSSE : I<0x09, MRM1r, (outs), (ins GR32:$zero), "lock\n\t" "or{l}\t{$zero, (%esp)|(%esp), $zero}", - [(X86MemBarrierNoSSE GR32:$zero)]>, LOCK; + [(X86MemBarrierNoSSE GR32:$zero)]>, + Requires<[In32BitMode]>, LOCK; } // Atomic swap. These are just normal xchg instructions. But since a memory From espindola at google.com Thu Aug 5 13:45:53 2010 From: espindola at google.com (Rafael Espindola) Date: Thu, 5 Aug 2010 14:45:53 -0400 Subject: [llvm-commits] [llvm] r110333 - in /llvm/trunk/tools/bugpoint: BugDriver.cpp BugDriver.h OptimizerDriver.cpp bugpoint.cpp In-Reply-To: References: <20100805152538.50CAA2A6C12C@llvm.org> <2BD86A28-D6D6-49EC-945A-BA3428636A00@apple.com> Message-ID: And for context the next patch I have in the series converts most of bugpoint to handle just pass names. Cheers, -- Rafael ?vila de Esp?ndola -------------- next part -------------- A non-text attachment was scrubbed... Name: string.patch Type: text/x-patch Size: 12745 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100805/017b42e1/attachment.bin From bob.wilson at apple.com Thu Aug 5 13:59:36 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Thu, 05 Aug 2010 18:59:36 -0000 Subject: [llvm-commits] [llvm] r110361 - in /llvm/trunk: lib/Target/ARM/ARMInstrInfo.td test/MC/Disassembler/arm-tests.txt Message-ID: <20100805185936.655212A6C12C@llvm.org> Author: bwilson Date: Thu Aug 5 13:59:36 2010 New Revision: 110361 URL: http://llvm.org/viewvc/llvm-project?rev=110361&view=rev Log: Add an ARM RSCrr instruction for disassembly only. Partial fix for PR7792. Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td llvm/trunk/test/MC/Disassembler/arm-tests.txt Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=110361&r1=110360&r2=110361&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Thu Aug 5 13:59:36 2010 @@ -1673,6 +1673,14 @@ Requires<[IsARM]> { let Inst{25} = 1; } +// The reg/reg form is only defined for the disassembler; for codegen it is +// equivalent to SUBrr. +def RSCrr : AsI1<0b0111, (outs GPR:$dst), (ins GPR:$a, GPR:$b), + DPFrm, IIC_iALUr, "rsc", "\t$dst, $a, $b", + [/* For disassembly only; pattern left blank */]> { + let Inst{25} = 0; + let Inst{11-4} = 0b00000000; +} def RSCrs : AsI1<0b0111, (outs GPR:$dst), (ins GPR:$a, so_reg:$b), DPSoRegFrm, IIC_iALUsr, "rsc", "\t$dst, $a, $b", [(set GPR:$dst, (sube_dead_carry so_reg:$b, GPR:$a))]>, Modified: llvm/trunk/test/MC/Disassembler/arm-tests.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/arm-tests.txt?rev=110361&r1=110360&r2=110361&view=diff ============================================================================== --- llvm/trunk/test/MC/Disassembler/arm-tests.txt (original) +++ llvm/trunk/test/MC/Disassembler/arm-tests.txt Thu Aug 5 13:59:36 2010 @@ -65,6 +65,10 @@ # CHECK: rsbeq r0, r2, r0 0x00 0x00 0x62 0x00 +# CHECK-NOT: rsceqs r0, r0, r1, lsl #0 +# CHECK: rsceqs r0, r0, r1 +0x01 0x00 0xf0 0x00 + # CHECK: sbcs r0, pc, #1 0x01 0x00 0xdf 0xe2 From stoklund at 2pi.dk Thu Aug 5 13:59:59 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Thu, 05 Aug 2010 18:59:59 -0000 Subject: [llvm-commits] [llvm] r110362 - in /llvm/trunk: include/llvm/CodeGen/MachineFunction.h include/llvm/CodeGen/Passes.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/MachineVerifier.cpp Message-ID: <20100805185959.57E582A6C12C@llvm.org> Author: stoklund Date: Thu Aug 5 13:59:59 2010 New Revision: 110362 URL: http://llvm.org/viewvc/llvm-project?rev=110362&view=rev Log: Remove double-def checking from MachineVerifier, so a register does not have to be killed before being redefined. These checks are usually disabled, and usually fail when enabled. We de facto allow live registers to be redefined without a kill, the corresponding assertions in RegScavenger were removed long ago. Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h llvm/trunk/include/llvm/CodeGen/Passes.h llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp llvm/trunk/lib/CodeGen/MachineVerifier.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=110362&r1=110361&r2=110362&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Thu Aug 5 13:59:59 2010 @@ -266,7 +266,7 @@ /// verify - Run the current MachineFunction through the machine code /// verifier, useful for debugger use. - void verify(Pass *p=NULL, bool allowDoubleDefs=false) const; + void verify(Pass *p=NULL) const; // Provide accessors for the MachineBasicBlock list... typedef BasicBlockListType::iterator iterator; Modified: llvm/trunk/include/llvm/CodeGen/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=110362&r1=110361&r2=110362&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) +++ llvm/trunk/include/llvm/CodeGen/Passes.h Thu Aug 5 13:59:59 2010 @@ -188,10 +188,7 @@ /// createMachineVerifierPass - This pass verifies cenerated machine code /// instructions for correctness. - /// - /// @param allowDoubleDefs ignore double definitions of - /// registers. Useful before LiveVariables has run. - FunctionPass *createMachineVerifierPass(bool allowDoubleDefs); + FunctionPass *createMachineVerifierPass(); /// createDwarfEHPass - This pass mulches exception handling code into a form /// adapted to code generation. Required if using dwarf exception handling. Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=110362&r1=110361&r2=110362&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Thu Aug 5 13:59:59 2010 @@ -236,13 +236,12 @@ } static void printAndVerify(PassManagerBase &PM, - const char *Banner, - bool allowDoubleDefs = false) { + const char *Banner) { if (PrintMachineCode) PM.add(createMachineFunctionPrinterPass(dbgs(), Banner)); if (VerifyMachineCode) - PM.add(createMachineVerifierPass(allowDoubleDefs)); + PM.add(createMachineVerifierPass()); } /// addCommonCodeGenPasses - Add standard LLVM codegen passes used for both @@ -339,8 +338,7 @@ return true; // Print the instruction selected machine code... - printAndVerify(PM, "After Instruction Selection", - /* allowDoubleDefs= */ true); + printAndVerify(PM, "After Instruction Selection"); // Optimize PHIs before DCE: removing dead PHI cycles may make more // instructions dead. @@ -353,8 +351,7 @@ // used by tail calls, where the tail calls reuse the incoming stack // arguments directly (see t11 in test/CodeGen/X86/sibcall.ll). PM.add(createDeadMachineInstructionElimPass()); - printAndVerify(PM, "After codegen DCE pass", - /* allowDoubleDefs= */ true); + printAndVerify(PM, "After codegen DCE pass"); PM.add(createOptimizeExtsPass()); if (!DisableMachineLICM) @@ -362,21 +359,18 @@ PM.add(createMachineCSEPass()); if (!DisableMachineSink) PM.add(createMachineSinkingPass()); - printAndVerify(PM, "After Machine LICM, CSE and Sinking passes", - /* allowDoubleDefs= */ true); + printAndVerify(PM, "After Machine LICM, CSE and Sinking passes"); } // Pre-ra tail duplication. if (OptLevel != CodeGenOpt::None && !DisableEarlyTailDup) { PM.add(createTailDuplicatePass(true)); - printAndVerify(PM, "After Pre-RegAlloc TailDuplicate", - /* allowDoubleDefs= */ true); + printAndVerify(PM, "After Pre-RegAlloc TailDuplicate"); } // Run pre-ra passes. if (addPreRegAlloc(PM, OptLevel)) - printAndVerify(PM, "After PreRegAlloc passes", - /* allowDoubleDefs= */ true); + printAndVerify(PM, "After PreRegAlloc passes"); // Perform register allocation. PM.add(createRegisterAllocator(OptLevel)); Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=110362&r1=110361&r2=110362&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Thu Aug 5 13:59:59 2010 @@ -44,19 +44,14 @@ namespace { struct MachineVerifier { - MachineVerifier(Pass *pass, bool allowDoubleDefs) : + MachineVerifier(Pass *pass) : PASS(pass), - allowVirtDoubleDefs(allowDoubleDefs), - allowPhysDoubleDefs(true), OutFileName(getenv("LLVM_VERIFY_MACHINEINSTRS")) {} bool runOnMachineFunction(MachineFunction &MF); Pass *const PASS; - const bool allowVirtDoubleDefs; - const bool allowPhysDoubleDefs; - const char *const OutFileName; raw_ostream *OS; const MachineFunction *MF; @@ -91,10 +86,6 @@ // defined. Map value is the user. RegMap vregsLiveIn; - // Vregs that must be dead in because they are defined without being - // killed first. Map value is the defining instruction. - RegMap vregsDeadIn; - // Regs killed in MBB. They may be defined again, and will then be in both // regsKilled and regsLiveOut. RegSet regsKilled; @@ -199,11 +190,9 @@ struct MachineVerifierPass : public MachineFunctionPass { static char ID; // Pass ID, replacement for typeid - bool AllowDoubleDefs; - explicit MachineVerifierPass(bool allowDoubleDefs = false) - : MachineFunctionPass(&ID), - AllowDoubleDefs(allowDoubleDefs) {} + MachineVerifierPass() + : MachineFunctionPass(&ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -211,7 +200,7 @@ } bool runOnMachineFunction(MachineFunction &MF) { - MF.verify(this, AllowDoubleDefs); + MF.verify(this); return false; } }; @@ -223,13 +212,12 @@ MachineVer("machineverifier", "Verify generated machine code"); static const PassInfo *const MachineVerifyID = &MachineVer; -FunctionPass *llvm::createMachineVerifierPass(bool allowPhysDoubleDefs) { - return new MachineVerifierPass(allowPhysDoubleDefs); +FunctionPass *llvm::createMachineVerifierPass() { + return new MachineVerifierPass(); } -void MachineFunction::verify(Pass *p, bool allowDoubleDefs) const { - MachineVerifier(p, allowDoubleDefs) - .runOnMachineFunction(const_cast(*this)); +void MachineFunction::verify(Pass *p) const { + MachineVerifier(p).runOnMachineFunction(const_cast(*this)); } bool MachineVerifier::runOnMachineFunction(MachineFunction &MF) { @@ -670,40 +658,9 @@ void MachineVerifier::visitMachineInstrAfter(const MachineInstr *MI) { BBInfo &MInfo = MBBInfoMap[MI->getParent()]; set_union(MInfo.regsKilled, regsKilled); - set_subtract(regsLive, regsKilled); - regsKilled.clear(); - - // Verify that both and operands refer to dead registers. - RegVector defs(regsDefined); - defs.append(regsDead.begin(), regsDead.end()); - - for (RegVector::const_iterator I = defs.begin(), E = defs.end(); - I != E; ++I) { - if (regsLive.count(*I)) { - if (TargetRegisterInfo::isPhysicalRegister(*I)) { - if (!allowPhysDoubleDefs && !isReserved(*I) && - !regsLiveInButUnused.count(*I)) { - report("Redefining a live physical register", MI); - *OS << "Register " << TRI->getName(*I) - << " was defined but already live.\n"; - } - } else { - if (!allowVirtDoubleDefs) { - report("Redefining a live virtual register", MI); - *OS << "Virtual register %reg" << *I - << " was defined but already live.\n"; - } - } - } else if (TargetRegisterInfo::isVirtualRegister(*I) && - !MInfo.regsKilled.count(*I)) { - // Virtual register defined without being killed first must be dead on - // entry. - MInfo.vregsDeadIn.insert(std::make_pair(*I, MI)); - } - } - - set_subtract(regsLive, regsDead); regsDead.clear(); - set_union(regsLive, regsDefined); regsDefined.clear(); + set_subtract(regsLive, regsKilled); regsKilled.clear(); + set_subtract(regsLive, regsDead); regsDead.clear(); + set_union(regsLive, regsDefined); regsDefined.clear(); } void @@ -828,28 +785,6 @@ continue; checkPHIOps(MFI); - - // Verify dead-in virtual registers. - if (!allowVirtDoubleDefs) { - for (MachineBasicBlock::const_pred_iterator PrI = MFI->pred_begin(), - PrE = MFI->pred_end(); PrI != PrE; ++PrI) { - BBInfo &PrInfo = MBBInfoMap[*PrI]; - if (!PrInfo.reachable) - continue; - - for (RegMap::iterator I = MInfo.vregsDeadIn.begin(), - E = MInfo.vregsDeadIn.end(); I != E; ++I) { - // DeadIn register must be in neither regsLiveOut or vregsPassed of - // any predecessor. - if (PrInfo.isLiveOut(I->first)) { - report("Live-in virtual register redefined", I->second); - *OS << "Register %reg" << I->first - << " was live-out from predecessor MBB #" - << (*PrI)->getNumber() << ".\n"; - } - } - } - } } // Now check LiveVariables info if available From bob.wilson at apple.com Thu Aug 5 14:00:21 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Thu, 05 Aug 2010 19:00:21 -0000 Subject: [llvm-commits] [llvm] r110363 - /llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Message-ID: <20100805190021.691422A6C12C@llvm.org> Author: bwilson Date: Thu Aug 5 14:00:21 2010 New Revision: 110363 URL: http://llvm.org/viewvc/llvm-project?rev=110363&view=rev Log: Fix indentation. Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=110363&r1=110362&r2=110363&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Thu Aug 5 14:00:21 2010 @@ -1630,23 +1630,23 @@ BinOpFrag<(sube_live_carry node:$LHS, node:$RHS) >>; def RSBri : AsI1<0b0011, (outs GPR:$dst), (ins GPR:$a, so_imm:$b), DPFrm, - IIC_iALUi, "rsb", "\t$dst, $a, $b", - [(set GPR:$dst, (sub so_imm:$b, GPR:$a))]> { + IIC_iALUi, "rsb", "\t$dst, $a, $b", + [(set GPR:$dst, (sub so_imm:$b, GPR:$a))]> { let Inst{25} = 1; } // The reg/reg form is only defined for the disassembler; for codegen it is // equivalent to SUBrr. def RSBrr : AsI1<0b0011, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm, - IIC_iALUr, "rsb", "\t$dst, $a, $b", - [/* For disassembly only; pattern left blank */]> { + IIC_iALUr, "rsb", "\t$dst, $a, $b", + [/* For disassembly only; pattern left blank */]> { let Inst{25} = 0; let Inst{11-4} = 0b00000000; } def RSBrs : AsI1<0b0011, (outs GPR:$dst), (ins GPR:$a, so_reg:$b), DPSoRegFrm, - IIC_iALUsr, "rsb", "\t$dst, $a, $b", - [(set GPR:$dst, (sub so_reg:$b, GPR:$a))]> { + IIC_iALUsr, "rsb", "\t$dst, $a, $b", + [(set GPR:$dst, (sub so_reg:$b, GPR:$a))]> { let Inst{25} = 0; } From criswell at uiuc.edu Thu Aug 5 14:08:45 2010 From: criswell at uiuc.edu (John Criswell) Date: Thu, 05 Aug 2010 19:08:45 -0000 Subject: [llvm-commits] [poolalloc] r110364 - in /poolalloc/trunk: include/assistDS/ include/assistDS/IndCloner.h lib/AssistDS/IndCloner.cpp Message-ID: <20100805190845.C48AB2A6C12C@llvm.org> Author: criswell Date: Thu Aug 5 14:08:45 2010 New Revision: 110364 URL: http://llvm.org/viewvc/llvm-project?rev=110364&view=rev Log: Added a header file for the IndCloner pass so that tools other than opt may use it. Added comments. Refactored code slightly to (hopefully) make the transform more efficient. Enhanced code to consider an invoke instruction a direct call. Added: poolalloc/trunk/include/assistDS/ poolalloc/trunk/include/assistDS/IndCloner.h Modified: poolalloc/trunk/lib/AssistDS/IndCloner.cpp Added: poolalloc/trunk/include/assistDS/IndCloner.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/IndCloner.h?rev=110364&view=auto ============================================================================== --- poolalloc/trunk/include/assistDS/IndCloner.h (added) +++ poolalloc/trunk/include/assistDS/IndCloner.h Thu Aug 5 14:08:45 2010 @@ -0,0 +1,34 @@ +//===-- IndCloner.h - Clone Indirectly Called Functions -------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This code defines a pass which clones functions which could potentially be +// used in indirect function calls. +// +//===----------------------------------------------------------------------===// + +#include "llvm/Instructions.h" +#include "llvm/Module.h" +#include "llvm/Pass.h" + +namespace llvm { + // + // Class: IndClone + // + // Description: + // Implement an LLVM pass that clones functions which could be used for + // indirect function calls. + // + class IndClone : public ModulePass { + public: + static char ID; + IndClone() : ModulePass(&ID) {} + virtual bool runOnModule(Module& M); + }; +} + Modified: poolalloc/trunk/lib/AssistDS/IndCloner.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/IndCloner.cpp?rev=110364&r1=110363&r2=110364&view=diff ============================================================================== --- poolalloc/trunk/lib/AssistDS/IndCloner.cpp (original) +++ poolalloc/trunk/lib/AssistDS/IndCloner.cpp Thu Aug 5 14:08:45 2010 @@ -1,4 +1,4 @@ -//===-- IndClonder.cpp - Clone Indirect Called Functions ------------------===// +//===-- IndCloner.cpp - Clone Indirectly Called Functions -----------------===// // // The LLVM Compiler Infrastructure // @@ -6,56 +6,131 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// +// This pass clones functions which can be called indirectly and then updates +// direct calls to call the clone. +// +//===----------------------------------------------------------------------===// #define DEBUG_TYPE "indclone" -#include "llvm/Instructions.h" -#include "llvm/Module.h" -#include "llvm/Pass.h" +#include "assistDS/IndCloner.h" + #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/ADT/Statistic.h" -#include + +#include using namespace llvm; -STATISTIC(numCloned, "Number of Functions Cloned"); +// Pass ID variable +char IndClone::ID = 0; + +// Register the Indirect Function Cloner Pass +static RegisterPass +X("indclone", "Indirect call cloning"); + +// Pass statistics +STATISTIC(numCloned, "Number of Functions Cloned"); STATISTIC(numReplaced, "Number of Calls Replaced"); -namespace { - class IndClone : public ModulePass { - public: - static char ID; - IndClone() : ModulePass(&ID) {} - bool runOnModule(Module& M) { - std::set toClone; - for (Module::iterator I = M.begin(); I != M.end(); ++I) - if (!I->isDeclaration() && !I->mayBeOverridden()) - for(Value::use_iterator ui = I->use_begin(), ue = I->use_end(); - ui != ue; ++ui) - if (!isa(ui)) { - toClone.insert(I); - } - numCloned += toClone.size(); - for (std::set::iterator I = toClone.begin(), - E = toClone.end(); I != E; ++I) { - Function* DirectF = CloneFunction(*I); - DirectF->setName((*I)->getName() + "_DIRECT"); - DirectF->setLinkage(GlobalValue::InternalLinkage); - (*I)->getParent()->getFunctionList().push_back(DirectF); - for(Value::use_iterator ui = (*I)->use_begin(), ue = (*I)->use_end(); - ui != ue; ++ui) - if (CallInst* CI = dyn_cast(ui)) - if (CI->getOperand(0) == *I) { - ++numReplaced; - CI->setOperand(0, DirectF); - } +// +// Method: runOnModule() +// +// Description: +// Entry point for this LLVM pass. Search for functions which could be called +// indirectly and create clones for them which are only called by direct +// calls. +// +// Inputs: +// M - A reference to the LLVM module to transform. +// +// Outputs: +// M - The transformed LLVM module. +// +// Return value: +// true - The module was modified. +// false - The module was not modified. +// +bool +IndClone::runOnModule(Module& M) { + // Set of functions to clone + std::vector toClone; + + // + // Check all of the functions in the module. If the function could be called + // by an indirect function call, add it to our worklist of functions to + // clone. + // + for (Module::iterator I = M.begin(); I != M.end(); ++I) { + // + // Only clone functions which are defined and cannot be replaced by another + // function by the linker. + // + if (!I->isDeclaration() && !I->mayBeOverridden()) { + for (Value::use_iterator ui = I->use_begin(), ue = I->use_end(); + ui != ue; ++ui) { + // + // If this function is used for anything other than a direct function + // call, then we want to clone it. + // + if (!isa(ui) && !isa(ui)) { + toClone.push_back(I); + break; + } + } + } + } + + // + // Update the statistics on the number of functions we'll be cloning. + // + numCloned += toClone.size(); + + // + // Go through the worklist and clone each function. After cloning a + // function, change all direct calls to use the clone instead of using the + // original function. + // + for (unsigned index = 0; index < toClone.size(); ++index) { + // + // Clone the function and give it a name indicating that it is a clone to + // be used for direct function calls. + // + Function * Original = toClone[index]; + Function* DirectF = CloneFunction(Original); + DirectF->setName(Original->getName() + "_DIRECT"); + + // + // Make the clone internal; external code can use the original function. + // + DirectF->setLinkage(GlobalValue::InternalLinkage); + + // + // Link the cloned function into the set of functions belonging to the + // module. + // + Original->getParent()->getFunctionList().push_back(DirectF); + + // + // Find all uses of the function that use it as a direct call. Change + // them to use the clone. + // + for (Value::use_iterator ui = Original->use_begin(), + ue = Original->use_end(); + ui != ue; ++ui) { + if (CallInst* CI = dyn_cast(ui)) { + if (CI->getOperand(0) == Original) { + ++numReplaced; + CI->setOperand(0, DirectF); + } } - - return true; } - }; + } + + // + // Assume that we've cloned at least one function. + // + return true; } -char IndClone::ID = 0; -static RegisterPass -X("indclone", "Indirect call cloning"); From grosbach at apple.com Thu Aug 5 14:27:37 2010 From: grosbach at apple.com (Jim Grosbach) Date: Thu, 05 Aug 2010 19:27:37 -0000 Subject: [llvm-commits] [llvm] r110366 - in /llvm/trunk/lib/Target/ARM: ARMBaseRegisterInfo.cpp ARMBaseRegisterInfo.h Message-ID: <20100805192737.977462A6C12C@llvm.org> Author: grosbach Date: Thu Aug 5 14:27:37 2010 New Revision: 110366 URL: http://llvm.org/viewvc/llvm-project?rev=110366&view=rev Log: For local variables in functions with a frame pointer, use FP as a base register for local access when it's closer to the stack slot being refererenced than the stack pointer. Make sure to take into account any argument frame SP adjustments that are in affect at the time. rdar://8256090 Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=110366&r1=110365&r2=110366&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Thu Aug 5 14:27:37 2010 @@ -980,48 +980,70 @@ return ARM::SP; } +// Provide a base+offset reference to an FI slot for debug info. It's the +// same as what we use for resolving the code-gen references for now. +// FIXME: This can go wrong when references are SP-relative and simple call +// frames aren't used. int ARMBaseRegisterInfo::getFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg) const { + return ResolveFrameIndexReference(MF, FI, FrameReg, 0); +} + +int +ARMBaseRegisterInfo::ResolveFrameIndexReference(const MachineFunction &MF, + int FI, + unsigned &FrameReg, + int SPAdj) const { const MachineFrameInfo *MFI = MF.getFrameInfo(); const ARMFunctionInfo *AFI = MF.getInfo(); int Offset = MFI->getObjectOffset(FI) + MFI->getStackSize(); + int FPOffset = Offset - AFI->getFramePtrSpillOffset(); bool isFixed = MFI->isFixedObjectIndex(FI); FrameReg = ARM::SP; + Offset += SPAdj; if (AFI->isGPRCalleeSavedArea1Frame(FI)) - Offset -= AFI->getGPRCalleeSavedArea1Offset(); + return Offset - AFI->getGPRCalleeSavedArea1Offset(); else if (AFI->isGPRCalleeSavedArea2Frame(FI)) - Offset -= AFI->getGPRCalleeSavedArea2Offset(); + return Offset - AFI->getGPRCalleeSavedArea2Offset(); else if (AFI->isDPRCalleeSavedAreaFrame(FI)) - Offset -= AFI->getDPRCalleeSavedAreaOffset(); - else if (needsStackRealignment(MF)) { - // When dynamically realigning the stack, use the frame pointer for - // parameters, and the stack pointer for locals. + return Offset - AFI->getDPRCalleeSavedAreaOffset(); + + // When dynamically realigning the stack, use the frame pointer for + // parameters, and the stack pointer for locals. + if (needsStackRealignment(MF)) { assert (hasFP(MF) && "dynamic stack realignment without a FP!"); if (isFixed) { FrameReg = getFrameRegister(MF); - Offset -= AFI->getFramePtrSpillOffset(); + Offset = FPOffset; } - } else if (hasFP(MF) && AFI->hasStackFrame()) { + return Offset; + } + + // If there is a frame pointer, use it when we can. + if (hasFP(MF) && AFI->hasStackFrame()) { + // Use frame pointer to reference fixed objects. Use it for locals if + // there are VLAs (and thus the SP isn't reliable as a base). if (isFixed || MFI->hasVarSizedObjects()) { - // Use frame pointer to reference fixed objects unless this is a - // frameless function. FrameReg = getFrameRegister(MF); - Offset -= AFI->getFramePtrSpillOffset(); + Offset = FPOffset; } else if (AFI->isThumb2Function()) { - // In Thumb2 mode, the negative offset is very limited. - int FPOffset = Offset - AFI->getFramePtrSpillOffset(); + // In Thumb2 mode, the negative offset is very limited. Try to avoid + // out of range references. if (FPOffset >= -255 && FPOffset < 0) { FrameReg = getFrameRegister(MF); Offset = FPOffset; } + } else if (Offset > (FPOffset < 0 ? -FPOffset : FPOffset)) { + // Otherwise, use SP or FP, whichever is closer to the stack slot. + FrameReg = getFrameRegister(MF); + Offset = FPOffset; } } return Offset; } - int ARMBaseRegisterInfo::getFrameIndexOffset(const MachineFunction &MF, int FI) const { @@ -1357,10 +1379,7 @@ int FrameIndex = MI.getOperand(i).getIndex(); unsigned FrameReg; - int Offset = getFrameIndexReference(MF, FrameIndex, FrameReg); - if (FrameReg != ARM::SP) - SPAdj = 0; - Offset += SPAdj; + int Offset = ResolveFrameIndexReference(MF, FrameIndex, FrameReg, SPAdj); // Special handling of dbg_value instructions. if (MI.isDebugValue()) { Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h?rev=110366&r1=110365&r2=110366&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h Thu Aug 5 14:27:37 2010 @@ -116,6 +116,8 @@ unsigned getFrameRegister(const MachineFunction &MF) const; int getFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg) const; + int ResolveFrameIndexReference(const MachineFunction &MF, int FI, + unsigned &FrameReg, int SPAdj) const; int getFrameIndexOffset(const MachineFunction &MF, int FI) const; // Exception handling queries. From criswell at uiuc.edu Thu Aug 5 14:42:08 2010 From: criswell at uiuc.edu (John Criswell) Date: Thu, 05 Aug 2010 19:42:08 -0000 Subject: [llvm-commits] [poolalloc] r110368 - /poolalloc/trunk/lib/AssistDS/IndCloner.cpp Message-ID: <20100805194208.230922A6C12C@llvm.org> Author: criswell Date: Thu Aug 5 14:42:07 2010 New Revision: 110368 URL: http://llvm.org/viewvc/llvm-project?rev=110368&view=rev Log: When a call or invoke instruction is found in a function's def-use chain, ensure that the function isn't passed as an argument in the call. That would make it usable as an indirect function call. Modified: poolalloc/trunk/lib/AssistDS/IndCloner.cpp Modified: poolalloc/trunk/lib/AssistDS/IndCloner.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/IndCloner.cpp?rev=110368&r1=110367&r2=110368&view=diff ============================================================================== --- poolalloc/trunk/lib/AssistDS/IndCloner.cpp (original) +++ poolalloc/trunk/lib/AssistDS/IndCloner.cpp Thu Aug 5 14:42:07 2010 @@ -63,6 +63,9 @@ // clone. // for (Module::iterator I = M.begin(); I != M.end(); ++I) { + // Flag whether the function should be cloned + bool pleaseCloneTheFunction = false; + // // Only clone functions which are defined and cannot be replaced by another // function by the linker. @@ -70,11 +73,32 @@ if (!I->isDeclaration() && !I->mayBeOverridden()) { for (Value::use_iterator ui = I->use_begin(), ue = I->use_end(); ui != ue; ++ui) { + if (!isa(ui) && !isa(ui)) { + // + // If this function is used for anything other than a direct function + // call, then we want to clone it. + // + pleaseCloneTheFunction = true; + } else { + // + // This is a call instruction, but hold up ranger! We need to make + // sure that the function isn't passed as an argument to *another* + // function. That would make the function usable in an indirect + // function call. + // + for (unsigned index = 1; index < ui->getNumOperands(); ++index) { + if (ui->getOperand(index)->stripPointerCasts() == I) { + pleaseCloneTheFunction = true; + break; + } + } + } + // - // If this function is used for anything other than a direct function - // call, then we want to clone it. + // If we've discovered that the function could be used by an indirect + // call site, schedule it for cloning. // - if (!isa(ui) && !isa(ui)) { + if (pleaseCloneTheFunction) { toClone.push_back(I); break; } @@ -84,8 +108,12 @@ // // Update the statistics on the number of functions we'll be cloning. + // We only update the statistic if we want to clone one or more functions; + // due to the magic of how statistics work, avoiding assignment prevents it + // from needlessly showing up. // - numCloned += toClone.size(); + if (toClone.size()) + numCloned += toClone.size(); // // Go through the worklist and clone each function. After cloning a From echristo at apple.com Thu Aug 5 14:54:59 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 05 Aug 2010 19:54:59 -0000 Subject: [llvm-commits] [llvm] r110369 - /llvm/trunk/lib/Target/X86/X86Instr64bit.td Message-ID: <20100805195459.DA7DC2A6C12C@llvm.org> Author: echristo Date: Thu Aug 5 14:54:59 2010 New Revision: 110369 URL: http://llvm.org/viewvc/llvm-project?rev=110369&view=rev Log: Set hasSideEffects on the 64-bit no-sse memory barrier. Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=110369&r1=110368&r2=110369&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Thu Aug 5 14:54:59 2010 @@ -1620,7 +1620,7 @@ //===----------------------------------------------------------------------===// // TODO: Get this to fold the constant into the instruction. -let Defs = [ESP] in +let hasSideEffects = 1, Defs = [ESP] in def Int_MemBarrierNoSSE64 : RI<0x09, MRM1r, (outs), (ins GR64:$zero), "lock\n\t" "or{q}\t{$zero, (%rsp)|(%rsp), $zero}", From echristo at apple.com Thu Aug 5 15:04:36 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 05 Aug 2010 20:04:36 -0000 Subject: [llvm-commits] [llvm] r110371 - /llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Message-ID: <20100805200437.085722A6C12C@llvm.org> Author: echristo Date: Thu Aug 5 15:04:36 2010 New Revision: 110371 URL: http://llvm.org/viewvc/llvm-project?rev=110371&view=rev Log: Handle the memory barrier pseudo that goes to nothing for the JIT. Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=110371&r1=110370&r2=110371&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Thu Aug 5 15:04:36 2010 @@ -705,6 +705,12 @@ llvm_unreachable("psuedo instructions should be removed before code" " emission"); break; + // Do nothing for Int_MemBarrier - it's just a comment. Add a debug + // to make it slightly easier to see. + case X86::Int_MemBarrier: + DEBUG(dbgs() << "#MEMBARRIER\n"); + break; + case TargetOpcode::INLINEASM: // We allow inline assembler nodes with empty bodies - they can // implicitly define registers, which is ok for JIT. @@ -716,7 +722,7 @@ case TargetOpcode::EH_LABEL: MCE.emitLabel(MI.getOperand(0).getMCSymbol()); break; - + case TargetOpcode::IMPLICIT_DEF: case TargetOpcode::KILL: break; From dpatel at apple.com Thu Aug 5 15:25:37 2010 From: dpatel at apple.com (Devang Patel) Date: Thu, 05 Aug 2010 20:25:37 -0000 Subject: [llvm-commits] [llvm] r110372 - in /llvm/trunk/test: CodeGen/X86/2010-01-18-DbgValue.ll CodeGen/X86/2010-02-01-DbgValueCrash.ll CodeGen/X86/2010-05-25-DotDebugLoc.ll CodeGen/X86/2010-05-28-Crash.ll CodeGen/X86/2010-06-01-DeadArg-DbgInfo.ll DebugInfo/2010-01-18-DbgValue.ll DebugInfo/2010-02-01-DbgValueCrash.ll DebugInfo/2010-05-25-DotDebugLoc.ll DebugInfo/2010-05-28-Crash.ll DebugInfo/2010-06-01-DeadArg-DbgInfo.ll Message-ID: <20100805202537.4F54C2A6C12C@llvm.org> Author: dpatel Date: Thu Aug 5 15:25:37 2010 New Revision: 110372 URL: http://llvm.org/viewvc/llvm-project?rev=110372&view=rev Log: Move x86 specific tests into test/CodeGen/X86. Added: llvm/trunk/test/CodeGen/X86/2010-01-18-DbgValue.ll - copied, changed from r110288, llvm/trunk/test/DebugInfo/2010-01-18-DbgValue.ll llvm/trunk/test/CodeGen/X86/2010-02-01-DbgValueCrash.ll - copied, changed from r110288, llvm/trunk/test/DebugInfo/2010-02-01-DbgValueCrash.ll llvm/trunk/test/CodeGen/X86/2010-05-25-DotDebugLoc.ll - copied, changed from r110288, llvm/trunk/test/DebugInfo/2010-05-25-DotDebugLoc.ll llvm/trunk/test/CodeGen/X86/2010-05-28-Crash.ll - copied unchanged from r110288, llvm/trunk/test/DebugInfo/2010-05-28-Crash.ll llvm/trunk/test/CodeGen/X86/2010-06-01-DeadArg-DbgInfo.ll - copied unchanged from r110288, llvm/trunk/test/DebugInfo/2010-06-01-DeadArg-DbgInfo.ll Removed: llvm/trunk/test/DebugInfo/2010-01-18-DbgValue.ll llvm/trunk/test/DebugInfo/2010-02-01-DbgValueCrash.ll llvm/trunk/test/DebugInfo/2010-05-25-DotDebugLoc.ll llvm/trunk/test/DebugInfo/2010-05-28-Crash.ll llvm/trunk/test/DebugInfo/2010-06-01-DeadArg-DbgInfo.ll Copied: llvm/trunk/test/CodeGen/X86/2010-01-18-DbgValue.ll (from r110288, llvm/trunk/test/DebugInfo/2010-01-18-DbgValue.ll) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-01-18-DbgValue.ll?p2=llvm/trunk/test/CodeGen/X86/2010-01-18-DbgValue.ll&p1=llvm/trunk/test/DebugInfo/2010-01-18-DbgValue.ll&r1=110288&r2=110372&rev=110372&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2010-01-18-DbgValue.ll (original) +++ llvm/trunk/test/CodeGen/X86/2010-01-18-DbgValue.ll Thu Aug 5 15:25:37 2010 @@ -1,7 +1,4 @@ ; RUN: llc -O0 < %s | FileCheck %s -; ModuleID = 'try.c' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32" -target triple = "i386-apple-darwin9.8" ; Currently, dbg.declare generates a DEBUG_VALUE comment. Eventually it will ; generate DWARF and this test will need to be modified or removed. Copied: llvm/trunk/test/CodeGen/X86/2010-02-01-DbgValueCrash.ll (from r110288, llvm/trunk/test/DebugInfo/2010-02-01-DbgValueCrash.ll) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-02-01-DbgValueCrash.ll?p2=llvm/trunk/test/CodeGen/X86/2010-02-01-DbgValueCrash.ll&p1=llvm/trunk/test/DebugInfo/2010-02-01-DbgValueCrash.ll&r1=110288&r2=110372&rev=110372&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2010-02-01-DbgValueCrash.ll (original) +++ llvm/trunk/test/CodeGen/X86/2010-02-01-DbgValueCrash.ll Thu Aug 5 15:25:37 2010 @@ -1,6 +1,5 @@ ; RUN: llc -O1 < %s ; ModuleID = 'pr6157.bc' -target triple = "x86_64-unknown-linux-gnu" ; formerly crashed in SelectionDAGBuilder %tart.reflect.ComplexType = type { double, double } Copied: llvm/trunk/test/CodeGen/X86/2010-05-25-DotDebugLoc.ll (from r110288, llvm/trunk/test/DebugInfo/2010-05-25-DotDebugLoc.ll) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-05-25-DotDebugLoc.ll?p2=llvm/trunk/test/CodeGen/X86/2010-05-25-DotDebugLoc.ll&p1=llvm/trunk/test/DebugInfo/2010-05-25-DotDebugLoc.ll&r1=110288&r2=110372&rev=110372&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/2010-05-25-DotDebugLoc.ll (original) +++ llvm/trunk/test/CodeGen/X86/2010-05-25-DotDebugLoc.ll Thu Aug 5 15:25:37 2010 @@ -1,4 +1,4 @@ -; RUN: llc -O2 < %s -mtriple=x86_64-apple-darwin | grep debug_loc12 +; RUN: llc -O2 < %s | grep debug_loc12 ; Test to check .debug_loc support. This test case emits 13 debug_loc entries. %0 = type { double } Removed: llvm/trunk/test/DebugInfo/2010-01-18-DbgValue.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2010-01-18-DbgValue.ll?rev=110371&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2010-01-18-DbgValue.ll (original) +++ llvm/trunk/test/DebugInfo/2010-01-18-DbgValue.ll (removed) @@ -1,51 +0,0 @@ -; RUN: llc -O0 < %s | FileCheck %s -; ModuleID = 'try.c' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32" -target triple = "i386-apple-darwin9.8" -; Currently, dbg.declare generates a DEBUG_VALUE comment. Eventually it will -; generate DWARF and this test will need to be modified or removed. - - -%struct.Pt = type { double, double } -%struct.Rect = type { %struct.Pt, %struct.Pt } - -define double @foo(%struct.Rect* byval %my_r0) nounwind ssp { -entry: -;CHECK: DEBUG_VALUE - %retval = alloca double ; [#uses=2] - %0 = alloca double ; [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - call void @llvm.dbg.declare(metadata !{%struct.Rect* %my_r0}, metadata !0), !dbg !15 - %1 = getelementptr inbounds %struct.Rect* %my_r0, i32 0, i32 0, !dbg !16 ; <%struct.Pt*> [#uses=1] - %2 = getelementptr inbounds %struct.Pt* %1, i32 0, i32 0, !dbg !16 ; [#uses=1] - %3 = load double* %2, align 8, !dbg !16 ; [#uses=1] - store double %3, double* %0, align 8, !dbg !16 - %4 = load double* %0, align 8, !dbg !16 ; [#uses=1] - store double %4, double* %retval, align 8, !dbg !16 - br label %return, !dbg !16 - -return: ; preds = %entry - %retval1 = load double* %retval, !dbg !16 ; [#uses=1] - ret double %retval1, !dbg !16 -} - -declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone - -!0 = metadata !{i32 524545, metadata !1, metadata !"my_r0", metadata !2, i32 11, metadata !7} ; [ DW_TAG_arg_variable ] -!1 = metadata !{i32 524334, i32 0, metadata !2, metadata !"foo", metadata !"foo", metadata !"foo", metadata !2, i32 11, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i1 false} ; [ DW_TAG_subprogram ] -!2 = metadata !{i32 524329, metadata !"b2.c", metadata !"/tmp/", metadata !3} ; [ DW_TAG_file_type ] -!3 = metadata !{i32 524305, i32 0, i32 1, metadata !"b2.c", metadata !"/tmp/", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ] -!4 = metadata !{i32 524309, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !5, i32 0, null} ; [ DW_TAG_subroutine_type ] -!5 = metadata !{metadata !6, metadata !7} -!6 = metadata !{i32 524324, metadata !2, metadata !"double", metadata !2, i32 0, i64 64, i64 64, i64 0, i32 0, i32 4} ; [ DW_TAG_base_type ] -!7 = metadata !{i32 524307, metadata !2, metadata !"Rect", metadata !2, i32 6, i64 256, i64 64, i64 0, i32 0, null, metadata !8, i32 0, null} ; [ DW_TAG_structure_type ] -!8 = metadata !{metadata !9, metadata !14} -!9 = metadata !{i32 524301, metadata !7, metadata !"P1", metadata !2, i32 7, i64 128, i64 64, i64 0, i32 0, metadata !10} ; [ DW_TAG_member ] -!10 = metadata !{i32 524307, metadata !2, metadata !"Pt", metadata !2, i32 1, i64 128, i64 64, i64 0, i32 0, null, metadata !11, i32 0, null} ; [ DW_TAG_structure_type ] -!11 = metadata !{metadata !12, metadata !13} -!12 = metadata !{i32 524301, metadata !10, metadata !"x", metadata !2, i32 2, i64 64, i64 64, i64 0, i32 0, metadata !6} ; [ DW_TAG_member ] -!13 = metadata !{i32 524301, metadata !10, metadata !"y", metadata !2, i32 3, i64 64, i64 64, i64 64, i32 0, metadata !6} ; [ DW_TAG_member ] -!14 = metadata !{i32 524301, metadata !7, metadata !"P2", metadata !2, i32 8, i64 128, i64 64, i64 128, i32 0, metadata !10} ; [ DW_TAG_member ] -!15 = metadata !{i32 11, i32 0, metadata !1, null} -!16 = metadata !{i32 12, i32 0, metadata !17, null} -!17 = metadata !{i32 524299, metadata !1, i32 11, i32 0} ; [ DW_TAG_lexical_block ] Removed: llvm/trunk/test/DebugInfo/2010-02-01-DbgValueCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2010-02-01-DbgValueCrash.ll?rev=110371&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2010-02-01-DbgValueCrash.ll (original) +++ llvm/trunk/test/DebugInfo/2010-02-01-DbgValueCrash.ll (removed) @@ -1,34 +0,0 @@ -; RUN: llc -O1 < %s -; ModuleID = 'pr6157.bc' -target triple = "x86_64-unknown-linux-gnu" -; formerly crashed in SelectionDAGBuilder - -%tart.reflect.ComplexType = type { double, double } - - at .type.SwitchStmtTest = constant %tart.reflect.ComplexType { double 3.0, double 2.0 } - -define i32 @"main(tart.core.String[])->int32"(i32 %args) { -entry: - tail call void @llvm.dbg.value(metadata !14, i64 0, metadata !8) - tail call void @"tart.reflect.ComplexType.create->tart.core.Object"(%tart.reflect.ComplexType* @.type.SwitchStmtTest) ; <%tart.core.Object*> [#uses=2] - ret i32 3 -} - -declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone -declare void @"tart.reflect.ComplexType.create->tart.core.Object"(%tart.reflect.ComplexType*) nounwind readnone - -!0 = metadata !{i32 458769, i32 0, i32 1, metadata !"sm.c", metadata !"/Volumes/MacOS9/tests/", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ] -!1 = metadata !{i32 458790, metadata !0, metadata !"", metadata !0, i32 0, i64 192, i64 64, i64 0, i32 0, metadata !2} ; [ DW_TAG_const_type ] -!2 = metadata !{i32 458771, metadata !0, metadata !"C", metadata !0, i32 1, i64 192, i64 64, i64 0, i32 0, null, metadata !3, i32 0, null} ; [ DW_TAG_structure_type ] -!3 = metadata !{metadata !4, metadata !6, metadata !7} -!4 = metadata !{i32 458765, metadata !2, metadata !"x", metadata !0, i32 1, i64 64, i64 64, i64 0, i32 0, metadata !5} ; [ DW_TAG_member ] -!5 = metadata !{i32 458788, metadata !0, metadata !"double", metadata !0, i32 0, i64 64, i64 64, i64 0, i32 0, i32 4} ; [ DW_TAG_base_type ] -!6 = metadata !{i32 458765, metadata !2, metadata !"y", metadata !0, i32 1, i64 64, i64 64, i64 64, i32 0, metadata !5} ; [ DW_TAG_member ] -!7 = metadata !{i32 458765, metadata !2, metadata !"z", metadata !0, i32 1, i64 64, i64 64, i64 128, i32 0, metadata !5} ; [ DW_TAG_member ] -!8 = metadata !{i32 459008, metadata !9, metadata !"t", metadata !0, i32 5, metadata !2} ; [ DW_TAG_auto_variable ] -!9 = metadata !{i32 458763, metadata !10} ; [ DW_TAG_lexical_block ] -!10 = metadata !{i32 458798, i32 0, metadata !0, metadata !"foo", metadata !"foo", metadata !"foo", metadata !0, i32 4, metadata !11, i1 false, i1 true, i32 0, i32 0, null} ; [ DW_TAG_subprogram ] -!11 = metadata !{i32 458773, metadata !0, metadata !"", metadata !0, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !12, i32 0, null} ; [ DW_TAG_subroutine_type ] -!12 = metadata !{metadata !13} -!13 = metadata !{i32 458788, metadata !0, metadata !"int", metadata !0, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] -!14 = metadata !{%tart.reflect.ComplexType* @.type.SwitchStmtTest} Removed: llvm/trunk/test/DebugInfo/2010-05-25-DotDebugLoc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2010-05-25-DotDebugLoc.ll?rev=110371&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2010-05-25-DotDebugLoc.ll (original) +++ llvm/trunk/test/DebugInfo/2010-05-25-DotDebugLoc.ll (removed) @@ -1,239 +0,0 @@ -; RUN: llc -O2 < %s -mtriple=x86_64-apple-darwin | grep debug_loc12 -; Test to check .debug_loc support. This test case emits 13 debug_loc entries. - -%0 = type { double } - -define hidden %0 @__divsc3(float %a, float %b, float %c, float %d) nounwind readnone { -entry: - tail call void @llvm.dbg.value(metadata !{float %a}, i64 0, metadata !0) - tail call void @llvm.dbg.value(metadata !{float %b}, i64 0, metadata !11) - tail call void @llvm.dbg.value(metadata !{float %c}, i64 0, metadata !12) - tail call void @llvm.dbg.value(metadata !{float %d}, i64 0, metadata !13) - %0 = tail call float @fabsf(float %c) nounwind readnone, !dbg !19 ; [#uses=1] - %1 = tail call float @fabsf(float %d) nounwind readnone, !dbg !19 ; [#uses=1] - %2 = fcmp olt float %0, %1, !dbg !19 ; [#uses=1] - br i1 %2, label %bb, label %bb1, !dbg !19 - -bb: ; preds = %entry - %3 = fdiv float %c, %d, !dbg !20 ; [#uses=3] - tail call void @llvm.dbg.value(metadata !{float %3}, i64 0, metadata !16), !dbg !20 - %4 = fmul float %3, %c, !dbg !21 ; [#uses=1] - %5 = fadd float %4, %d, !dbg !21 ; [#uses=2] - tail call void @llvm.dbg.value(metadata !{float %5}, i64 0, metadata !14), !dbg !21 - %6 = fmul float %3, %a, !dbg !22 ; [#uses=1] - %7 = fadd float %6, %b, !dbg !22 ; [#uses=1] - %8 = fdiv float %7, %5, !dbg !22 ; [#uses=1] - tail call void @llvm.dbg.value(metadata !{float %8}, i64 0, metadata !17), !dbg !22 - %9 = fmul float %3, %b, !dbg !23 ; [#uses=1] - %10 = fsub float %9, %a, !dbg !23 ; [#uses=1] - %11 = fdiv float %10, %5, !dbg !23 ; [#uses=1] - tail call void @llvm.dbg.value(metadata !{float %11}, i64 0, metadata !18), !dbg !23 - br label %bb2, !dbg !23 - -bb1: ; preds = %entry - %12 = fdiv float %d, %c, !dbg !24 ; [#uses=3] - tail call void @llvm.dbg.value(metadata !{float %12}, i64 0, metadata !16), !dbg !24 - %13 = fmul float %12, %d, !dbg !25 ; [#uses=1] - %14 = fadd float %13, %c, !dbg !25 ; [#uses=2] - tail call void @llvm.dbg.value(metadata !{float %14}, i64 0, metadata !14), !dbg !25 - %15 = fmul float %12, %b, !dbg !26 ; [#uses=1] - %16 = fadd float %15, %a, !dbg !26 ; [#uses=1] - %17 = fdiv float %16, %14, !dbg !26 ; [#uses=1] - tail call void @llvm.dbg.value(metadata !{float %17}, i64 0, metadata !17), !dbg !26 - %18 = fmul float %12, %a, !dbg !27 ; [#uses=1] - %19 = fsub float %b, %18, !dbg !27 ; [#uses=1] - %20 = fdiv float %19, %14, !dbg !27 ; [#uses=1] - tail call void @llvm.dbg.value(metadata !{float %20}, i64 0, metadata !18), !dbg !27 - br label %bb2, !dbg !27 - -bb2: ; preds = %bb1, %bb - %y.0 = phi float [ %11, %bb ], [ %20, %bb1 ] ; [#uses=5] - %x.0 = phi float [ %8, %bb ], [ %17, %bb1 ] ; [#uses=5] - %21 = fcmp uno float %x.0, 0.000000e+00, !dbg !28 ; [#uses=1] - %22 = fcmp uno float %y.0, 0.000000e+00, !dbg !28 ; [#uses=1] - %or.cond = and i1 %21, %22 ; [#uses=1] - br i1 %or.cond, label %bb4, label %bb46, !dbg !28 - -bb4: ; preds = %bb2 - %23 = fcmp une float %c, 0.000000e+00, !dbg !29 ; [#uses=1] - %24 = fcmp une float %d, 0.000000e+00, !dbg !29 ; [#uses=1] - %or.cond93 = or i1 %23, %24 ; [#uses=1] - br i1 %or.cond93, label %bb9, label %bb6, !dbg !29 - -bb6: ; preds = %bb4 - %25 = fcmp uno float %a, 0.000000e+00, !dbg !29 ; [#uses=1] - %26 = fcmp uno float %b, 0.000000e+00, !dbg !29 ; [#uses=1] - %or.cond94 = and i1 %25, %26 ; [#uses=1] - br i1 %or.cond94, label %bb9, label %bb8, !dbg !29 - -bb8: ; preds = %bb6 - %27 = tail call float @copysignf(float 0x7FF0000000000000, float %c) nounwind readnone, !dbg !30 ; [#uses=2] - %28 = fmul float %27, %a, !dbg !30 ; [#uses=1] - tail call void @llvm.dbg.value(metadata !{float %28}, i64 0, metadata !17), !dbg !30 - %29 = fmul float %27, %b, !dbg !31 ; [#uses=1] - tail call void @llvm.dbg.value(metadata !{float %29}, i64 0, metadata !18), !dbg !31 - br label %bb46, !dbg !31 - -bb9: ; preds = %bb6, %bb4 - %30 = fcmp ord float %a, 0.000000e+00 ; [#uses=1] - %31 = fsub float %a, %a, !dbg !32 ; [#uses=3] - %32 = fcmp uno float %31, 0.000000e+00 ; [#uses=1] - %33 = and i1 %30, %32, !dbg !32 ; [#uses=2] - br i1 %33, label %bb14, label %bb11, !dbg !32 - -bb11: ; preds = %bb9 - %34 = fcmp ord float %b, 0.000000e+00 ; [#uses=1] - %35 = fsub float %b, %b, !dbg !32 ; [#uses=1] - %36 = fcmp uno float %35, 0.000000e+00 ; [#uses=1] - %37 = and i1 %34, %36, !dbg !32 ; [#uses=1] - br i1 %37, label %bb14, label %bb27, !dbg !32 - -bb14: ; preds = %bb11, %bb9 - %38 = fsub float %c, %c, !dbg !32 ; [#uses=1] - %39 = fcmp ord float %38, 0.000000e+00 ; [#uses=1] - br i1 %39, label %bb15, label %bb27, !dbg !32 - -bb15: ; preds = %bb14 - %40 = fsub float %d, %d, !dbg !32 ; [#uses=1] - %41 = fcmp ord float %40, 0.000000e+00 ; [#uses=1] - br i1 %41, label %bb16, label %bb27, !dbg !32 - -bb16: ; preds = %bb15 - %iftmp.0.0 = select i1 %33, float 1.000000e+00, float 0.000000e+00 ; [#uses=1] - %42 = tail call float @copysignf(float %iftmp.0.0, float %a) nounwind readnone, !dbg !33 ; [#uses=2] - tail call void @llvm.dbg.value(metadata !{float %42}, i64 0, metadata !0), !dbg !33 - %43 = fcmp ord float %b, 0.000000e+00 ; [#uses=1] - %44 = fsub float %b, %b, !dbg !34 ; [#uses=1] - %45 = fcmp uno float %44, 0.000000e+00 ; [#uses=1] - %46 = and i1 %43, %45, !dbg !34 ; [#uses=1] - %iftmp.1.0 = select i1 %46, float 1.000000e+00, float 0.000000e+00 ; [#uses=1] - %47 = tail call float @copysignf(float %iftmp.1.0, float %b) nounwind readnone, !dbg !34 ; [#uses=2] - tail call void @llvm.dbg.value(metadata !{float %47}, i64 0, metadata !11), !dbg !34 - %48 = fmul float %42, %c, !dbg !35 ; [#uses=1] - %49 = fmul float %47, %d, !dbg !35 ; [#uses=1] - %50 = fadd float %48, %49, !dbg !35 ; [#uses=1] - %51 = fmul float %50, 0x7FF0000000000000, !dbg !35 ; [#uses=1] - tail call void @llvm.dbg.value(metadata !{float %51}, i64 0, metadata !17), !dbg !35 - %52 = fmul float %47, %c, !dbg !36 ; [#uses=1] - %53 = fmul float %42, %d, !dbg !36 ; [#uses=1] - %54 = fsub float %52, %53, !dbg !36 ; [#uses=1] - %55 = fmul float %54, 0x7FF0000000000000, !dbg !36 ; [#uses=1] - tail call void @llvm.dbg.value(metadata !{float %55}, i64 0, metadata !18), !dbg !36 - br label %bb46, !dbg !36 - -bb27: ; preds = %bb15, %bb14, %bb11 - %56 = fcmp ord float %c, 0.000000e+00 ; [#uses=1] - %57 = fsub float %c, %c, !dbg !37 ; [#uses=1] - %58 = fcmp uno float %57, 0.000000e+00 ; [#uses=1] - %59 = and i1 %56, %58, !dbg !37 ; [#uses=2] - br i1 %59, label %bb33, label %bb30, !dbg !37 - -bb30: ; preds = %bb27 - %60 = fcmp ord float %d, 0.000000e+00 ; [#uses=1] - %61 = fsub float %d, %d, !dbg !37 ; [#uses=1] - %62 = fcmp uno float %61, 0.000000e+00 ; [#uses=1] - %63 = and i1 %60, %62, !dbg !37 ; [#uses=1] - %64 = fcmp ord float %31, 0.000000e+00 ; [#uses=1] - %or.cond95 = and i1 %63, %64 ; [#uses=1] - br i1 %or.cond95, label %bb34, label %bb46, !dbg !37 - -bb33: ; preds = %bb27 - %.old = fcmp ord float %31, 0.000000e+00 ; [#uses=1] - br i1 %.old, label %bb34, label %bb46, !dbg !37 - -bb34: ; preds = %bb33, %bb30 - %65 = fsub float %b, %b, !dbg !37 ; [#uses=1] - %66 = fcmp ord float %65, 0.000000e+00 ; [#uses=1] - br i1 %66, label %bb35, label %bb46, !dbg !37 - -bb35: ; preds = %bb34 - %iftmp.2.0 = select i1 %59, float 1.000000e+00, float 0.000000e+00 ; [#uses=1] - %67 = tail call float @copysignf(float %iftmp.2.0, float %c) nounwind readnone, !dbg !38 ; [#uses=2] - tail call void @llvm.dbg.value(metadata !{float %67}, i64 0, metadata !12), !dbg !38 - %68 = fcmp ord float %d, 0.000000e+00 ; [#uses=1] - %69 = fsub float %d, %d, !dbg !39 ; [#uses=1] - %70 = fcmp uno float %69, 0.000000e+00 ; [#uses=1] - %71 = and i1 %68, %70, !dbg !39 ; [#uses=1] - %iftmp.3.0 = select i1 %71, float 1.000000e+00, float 0.000000e+00 ; [#uses=1] - %72 = tail call float @copysignf(float %iftmp.3.0, float %d) nounwind readnone, !dbg !39 ; [#uses=2] - tail call void @llvm.dbg.value(metadata !{float %72}, i64 0, metadata !13), !dbg !39 - %73 = fmul float %67, %a, !dbg !40 ; [#uses=1] - %74 = fmul float %72, %b, !dbg !40 ; [#uses=1] - %75 = fadd float %73, %74, !dbg !40 ; [#uses=1] - %76 = fmul float %75, 0.000000e+00, !dbg !40 ; [#uses=1] - tail call void @llvm.dbg.value(metadata !{float %76}, i64 0, metadata !17), !dbg !40 - %77 = fmul float %67, %b, !dbg !41 ; [#uses=1] - %78 = fmul float %72, %a, !dbg !41 ; [#uses=1] - %79 = fsub float %77, %78, !dbg !41 ; [#uses=1] - %80 = fmul float %79, 0.000000e+00, !dbg !41 ; [#uses=1] - tail call void @llvm.dbg.value(metadata !{float %80}, i64 0, metadata !18), !dbg !41 - br label %bb46, !dbg !41 - -bb46: ; preds = %bb35, %bb34, %bb33, %bb30, %bb16, %bb8, %bb2 - %y.1 = phi float [ %80, %bb35 ], [ %y.0, %bb34 ], [ %y.0, %bb33 ], [ %y.0, %bb30 ], [ %55, %bb16 ], [ %29, %bb8 ], [ %y.0, %bb2 ] ; [#uses=2] - %x.1 = phi float [ %76, %bb35 ], [ %x.0, %bb34 ], [ %x.0, %bb33 ], [ %x.0, %bb30 ], [ %51, %bb16 ], [ %28, %bb8 ], [ %x.0, %bb2 ] ; [#uses=1] - %81 = fmul float %y.1, 0.000000e+00, !dbg !42 ; [#uses=1] - %82 = fadd float %y.1, 0.000000e+00, !dbg !42 ; [#uses=1] - %tmpr = fadd float %x.1, %81, !dbg !42 ; [#uses=1] - %tmp89 = bitcast float %tmpr to i32 ; [#uses=1] - %tmp90 = zext i32 %tmp89 to i64 ; [#uses=1] - %tmp85 = bitcast float %82 to i32 ; [#uses=1] - %tmp86 = zext i32 %tmp85 to i64 ; [#uses=1] - %tmp87 = shl i64 %tmp86, 32 ; [#uses=1] - %ins = or i64 %tmp90, %tmp87 ; [#uses=1] - %tmp84 = bitcast i64 %ins to double ; [#uses=1] - %mrv75 = insertvalue %0 undef, double %tmp84, 0, !dbg !42 ; <%0> [#uses=1] - ret %0 %mrv75, !dbg !42 -} - -declare float @fabsf(float) - -declare float @copysignf(float, float) nounwind readnone - -declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone - -!llvm.dbg.lv = !{!0, !11, !12, !13, !14, !16, !17, !18} - -!0 = metadata !{i32 524545, metadata !1, metadata !"a", metadata !2, i32 1921, metadata !9} ; [ DW_TAG_arg_variable ] -!1 = metadata !{i32 524334, i32 0, metadata !2, metadata !"__divsc3", metadata !"__divsc3", metadata !"__divsc3", metadata !2, i32 1922, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 true} ; [ DW_TAG_subprogram ] -!2 = metadata !{i32 524329, metadata !"libgcc2.c", metadata !"/Users/yash/clean/LG.D/gcc/../../llvmgcc/gcc", metadata !3} ; [ DW_TAG_file_type ] -!3 = metadata !{i32 524305, i32 0, i32 1, metadata !"libgcc2.c", metadata !"/Users/yash/clean/LG.D/gcc/../../llvmgcc/gcc", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 true, i1 true, metadata !"", i32 0} ; [ DW_TAG_compile_unit ] -!4 = metadata !{i32 524309, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !5, i32 0, null} ; [ DW_TAG_subroutine_type ] -!5 = metadata !{metadata !6, metadata !9, metadata !9, metadata !9, metadata !9} -!6 = metadata !{i32 524310, metadata !7, metadata !"SCtype", metadata !7, i32 170, i64 0, i64 0, i64 0, i32 0, metadata !8} ; [ DW_TAG_typedef ] -!7 = metadata !{i32 524329, metadata !"libgcc2.h", metadata !"/Users/yash/clean/LG.D/gcc/../../llvmgcc/gcc", metadata !3} ; [ DW_TAG_file_type ] -!8 = metadata !{i32 524324, metadata !2, metadata !"complex float", metadata !2, i32 0, i64 64, i64 32, i64 0, i32 0, i32 3} ; [ DW_TAG_base_type ] -!9 = metadata !{i32 524310, metadata !7, metadata !"SFtype", metadata !7, i32 167, i64 0, i64 0, i64 0, i32 0, metadata !10} ; [ DW_TAG_typedef ] -!10 = metadata !{i32 524324, metadata !2, metadata !"float", metadata !2, i32 0, i64 32, i64 32, i64 0, i32 0, i32 4} ; [ DW_TAG_base_type ] -!11 = metadata !{i32 524545, metadata !1, metadata !"b", metadata !2, i32 1921, metadata !9} ; [ DW_TAG_arg_variable ] -!12 = metadata !{i32 524545, metadata !1, metadata !"c", metadata !2, i32 1921, metadata !9} ; [ DW_TAG_arg_variable ] -!13 = metadata !{i32 524545, metadata !1, metadata !"d", metadata !2, i32 1921, metadata !9} ; [ DW_TAG_arg_variable ] -!14 = metadata !{i32 524544, metadata !15, metadata !"denom", metadata !2, i32 1923, metadata !9} ; [ DW_TAG_auto_variable ] -!15 = metadata !{i32 524299, metadata !1, i32 1922, i32 0} ; [ DW_TAG_lexical_block ] -!16 = metadata !{i32 524544, metadata !15, metadata !"ratio", metadata !2, i32 1923, metadata !9} ; [ DW_TAG_auto_variable ] -!17 = metadata !{i32 524544, metadata !15, metadata !"x", metadata !2, i32 1923, metadata !9} ; [ DW_TAG_auto_variable ] -!18 = metadata !{i32 524544, metadata !15, metadata !"y", metadata !2, i32 1923, metadata !9} ; [ DW_TAG_auto_variable ] -!19 = metadata !{i32 1929, i32 0, metadata !15, null} -!20 = metadata !{i32 1931, i32 0, metadata !15, null} -!21 = metadata !{i32 1932, i32 0, metadata !15, null} -!22 = metadata !{i32 1933, i32 0, metadata !15, null} -!23 = metadata !{i32 1934, i32 0, metadata !15, null} -!24 = metadata !{i32 1938, i32 0, metadata !15, null} -!25 = metadata !{i32 1939, i32 0, metadata !15, null} -!26 = metadata !{i32 1940, i32 0, metadata !15, null} -!27 = metadata !{i32 1941, i32 0, metadata !15, null} -!28 = metadata !{i32 1946, i32 0, metadata !15, null} -!29 = metadata !{i32 1948, i32 0, metadata !15, null} -!30 = metadata !{i32 1950, i32 0, metadata !15, null} -!31 = metadata !{i32 1951, i32 0, metadata !15, null} -!32 = metadata !{i32 1953, i32 0, metadata !15, null} -!33 = metadata !{i32 1955, i32 0, metadata !15, null} -!34 = metadata !{i32 1956, i32 0, metadata !15, null} -!35 = metadata !{i32 1957, i32 0, metadata !15, null} -!36 = metadata !{i32 1958, i32 0, metadata !15, null} -!37 = metadata !{i32 1960, i32 0, metadata !15, null} -!38 = metadata !{i32 1962, i32 0, metadata !15, null} -!39 = metadata !{i32 1963, i32 0, metadata !15, null} -!40 = metadata !{i32 1964, i32 0, metadata !15, null} -!41 = metadata !{i32 1965, i32 0, metadata !15, null} -!42 = metadata !{i32 1969, i32 0, metadata !15, null} Removed: llvm/trunk/test/DebugInfo/2010-05-28-Crash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2010-05-28-Crash.ll?rev=110371&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2010-05-28-Crash.ll (original) +++ llvm/trunk/test/DebugInfo/2010-05-28-Crash.ll (removed) @@ -1,44 +0,0 @@ -; RUN: llc -mtriple=x86_64-apple-darwin < %s | FileCheck %s -; Test to check separate label for inlined function argument. - -define i32 @foo(i32 %y) nounwind optsize ssp { -entry: - tail call void @llvm.dbg.value(metadata !{i32 %y}, i64 0, metadata !0) - %0 = tail call i32 (...)* @zoo(i32 %y) nounwind, !dbg !9 ; [#uses=1] - ret i32 %0, !dbg !9 -} - -declare i32 @zoo(...) - -declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone - -define i32 @bar(i32 %x) nounwind optsize ssp { -entry: - tail call void @llvm.dbg.value(metadata !{i32 %x}, i64 0, metadata !7) - tail call void @llvm.dbg.value(metadata !11, i64 0, metadata !0) nounwind - %0 = tail call i32 (...)* @zoo(i32 1) nounwind, !dbg !12 ; [#uses=1] - %1 = add nsw i32 %0, %x, !dbg !13 ; [#uses=1] - ret i32 %1, !dbg !13 -} - -!llvm.dbg.lv = !{!0, !7} - -!0 = metadata !{i32 524545, metadata !1, metadata !"y", metadata !2, i32 2, metadata !6} ; [ DW_TAG_arg_variable ] -!1 = metadata !{i32 524334, i32 0, metadata !2, metadata !"foo", metadata !"foo", metadata !"foo", metadata !2, i32 2, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 true} ; [ DW_TAG_subprogram ] -!2 = metadata !{i32 524329, metadata !"f.c", metadata !"/tmp", metadata !3} ; [ DW_TAG_file_type ] -!3 = metadata !{i32 524305, i32 0, i32 1, metadata !"f.c", metadata !"/tmp", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 true, i1 true, metadata !"", i32 0} ; [ DW_TAG_compile_unit ] -!4 = metadata !{i32 524309, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !5, i32 0, null} ; [ DW_TAG_subroutine_type ] -!5 = metadata !{metadata !6, metadata !6} -!6 = metadata !{i32 524324, metadata !2, metadata !"int", metadata !2, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] -!7 = metadata !{i32 524545, metadata !8, metadata !"x", metadata !2, i32 6, metadata !6} ; [ DW_TAG_arg_variable ] -!8 = metadata !{i32 524334, i32 0, metadata !2, metadata !"bar", metadata !"bar", metadata !"bar", metadata !2, i32 6, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 true} ; [ DW_TAG_subprogram ] -!9 = metadata !{i32 3, i32 0, metadata !10, null} -!10 = metadata !{i32 524299, metadata !1, i32 2, i32 0} ; [ DW_TAG_lexical_block ] -!11 = metadata !{i32 1} -!12 = metadata !{i32 3, i32 0, metadata !10, metadata !13} -!13 = metadata !{i32 7, i32 0, metadata !14, null} -!14 = metadata !{i32 524299, metadata !8, i32 6, i32 0} ; [ DW_TAG_lexical_block ] - -;CHECK: DEBUG_VALUE: bar:x <- EBX+0 -;CHECK-NEXT:Ltmp -;CHECK-NEXT: DEBUG_VALUE: foo:y <- 1+0 Removed: llvm/trunk/test/DebugInfo/2010-06-01-DeadArg-DbgInfo.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2010-06-01-DeadArg-DbgInfo.ll?rev=110371&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2010-06-01-DeadArg-DbgInfo.ll (original) +++ llvm/trunk/test/DebugInfo/2010-06-01-DeadArg-DbgInfo.ll (removed) @@ -1,53 +0,0 @@ -; RUN: llc -O2 < %s | FileCheck %s -; Test to check that unused argument 'this' is not undefined in debug info. - -target triple = "x86_64-apple-darwin10.2" -%struct.foo = type { i32 } - - at llvm.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.foo*, i32)* @_ZN3foo3bazEi to i8*)], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] - -define i32 @_ZN3foo3bazEi(%struct.foo* nocapture %this, i32 %x) nounwind readnone optsize noinline ssp align 2 { -;CHECK: DEBUG_VALUE: baz:this <- RDI+0 -entry: - tail call void @llvm.dbg.value(metadata !{%struct.foo* %this}, i64 0, metadata !15) - tail call void @llvm.dbg.value(metadata !{i32 %x}, i64 0, metadata !16) - %0 = mul nsw i32 %x, 7, !dbg !29 ; [#uses=1] - %1 = add nsw i32 %0, 1, !dbg !29 ; [#uses=1] - ret i32 %1, !dbg !29 -} - -declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone - -!llvm.dbg.lv = !{!0, !14, !15, !16, !17, !24, !25, !28} - -!0 = metadata !{i32 524545, metadata !1, metadata !"this", metadata !3, i32 11, metadata !12} ; [ DW_TAG_arg_variable ] -!1 = metadata !{i32 524334, i32 0, metadata !2, metadata !"bar", metadata !"bar", metadata !"_ZN3foo3barEi", metadata !3, i32 11, metadata !9, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 true} ; [ DW_TAG_subprogram ] -!2 = metadata !{i32 524307, metadata !3, metadata !"foo", metadata !3, i32 3, i64 32, i64 32, i64 0, i32 0, null, metadata !5, i32 0, null} ; [ DW_TAG_structure_type ] -!3 = metadata !{i32 524329, metadata !"foo.cp", metadata !"/tmp/", metadata !4} ; [ DW_TAG_file_type ] -!4 = metadata !{i32 524305, i32 0, i32 4, metadata !"foo.cp", metadata !"/tmp/", metadata !"4.2.1 LLVM build", i1 true, i1 true, metadata !"", i32 0} ; [ DW_TAG_compile_unit ] -!5 = metadata !{metadata !6, metadata !1, metadata !8} -!6 = metadata !{i32 524301, metadata !2, metadata !"y", metadata !3, i32 8, i64 32, i64 32, i64 0, i32 0, metadata !7} ; [ DW_TAG_member ] -!7 = metadata !{i32 524324, metadata !3, metadata !"int", metadata !3, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] -!8 = metadata !{i32 524334, i32 0, metadata !2, metadata !"baz", metadata !"baz", metadata !"_ZN3foo3bazEi", metadata !3, i32 15, metadata !9, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 true} ; [ DW_TAG_subprogram ] -!9 = metadata !{i32 524309, metadata !3, metadata !"", metadata !3, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !10, i32 0, null} ; [ DW_TAG_subroutine_type ] -!10 = metadata !{metadata !7, metadata !11, metadata !7} -!11 = metadata !{i32 524303, metadata !3, metadata !"", metadata !3, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !2} ; [ DW_TAG_pointer_type ] -!12 = metadata !{i32 524326, metadata !3, metadata !"", metadata !3, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !13} ; [ DW_TAG_const_type ] -!13 = metadata !{i32 524303, metadata !3, metadata !"", metadata !3, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !2} ; [ DW_TAG_pointer_type ] -!14 = metadata !{i32 524545, metadata !1, metadata !"x", metadata !3, i32 11, metadata !7} ; [ DW_TAG_arg_variable ] -!15 = metadata !{i32 524545, metadata !8, metadata !"this", metadata !3, i32 15, metadata !12} ; [ DW_TAG_arg_variable ] -!16 = metadata !{i32 524545, metadata !8, metadata !"x", metadata !3, i32 15, metadata !7} ; [ DW_TAG_arg_variable ] -!17 = metadata !{i32 524545, metadata !18, metadata !"argc", metadata !3, i32 19, metadata !7} ; [ DW_TAG_arg_variable ] -!18 = metadata !{i32 524334, i32 0, metadata !3, metadata !"main", metadata !"main", metadata !"main", metadata !3, i32 19, metadata !19, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 true} ; [ DW_TAG_subprogram ] -!19 = metadata !{i32 524309, metadata !3, metadata !"", metadata !3, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !20, i32 0, null} ; [ DW_TAG_subroutine_type ] -!20 = metadata !{metadata !7, metadata !7, metadata !21} -!21 = metadata !{i32 524303, metadata !3, metadata !"", metadata !3, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !22} ; [ DW_TAG_pointer_type ] -!22 = metadata !{i32 524303, metadata !3, metadata !"", metadata !3, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !23} ; [ DW_TAG_pointer_type ] -!23 = metadata !{i32 524324, metadata !3, metadata !"char", metadata !3, i32 0, i64 8, i64 8, i64 0, i32 0, i32 6} ; [ DW_TAG_base_type ] -!24 = metadata !{i32 524545, metadata !18, metadata !"argv", metadata !3, i32 19, metadata !21} ; [ DW_TAG_arg_variable ] -!25 = metadata !{i32 524544, metadata !26, metadata !"a", metadata !3, i32 20, metadata !2} ; [ DW_TAG_auto_variable ] -!26 = metadata !{i32 524299, metadata !27, i32 19, i32 0} ; [ DW_TAG_lexical_block ] -!27 = metadata !{i32 524299, metadata !18, i32 19, i32 0} ; [ DW_TAG_lexical_block ] -!28 = metadata !{i32 524544, metadata !26, metadata !"b", metadata !3, i32 21, metadata !7} ; [ DW_TAG_auto_variable ] -!29 = metadata !{i32 16, i32 0, metadata !30, null} -!30 = metadata !{i32 524299, metadata !8, i32 15, i32 0} ; [ DW_TAG_lexical_block ] From echristo at apple.com Thu Aug 5 15:38:39 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 05 Aug 2010 20:38:39 -0000 Subject: [llvm-commits] [llvm] r110373 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <20100805203839.827442A6C12C@llvm.org> Author: echristo Date: Thu Aug 5 15:38:39 2010 New Revision: 110373 URL: http://llvm.org/viewvc/llvm-project?rev=110373&view=rev Log: Document results of PR7762. Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=110373&r1=110372&r2=110373&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Thu Aug 5 15:38:39 2010 @@ -554,6 +554,9 @@ However, A Modern GCC Build for x86/x86-64 has been made available from the third party AuroraUX Project that has been meticulously tested for bootstrapping LLVM & Clang.
  • +
  • There have been reports of Solaris and/or OpenSolaris build failures due +to an incompatibility in the nm program as well. The nm from binutils does seem +to work.
  • From isanbard at gmail.com Thu Aug 5 15:45:04 2010 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 05 Aug 2010 20:45:04 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r110375 - /llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin Message-ID: <20100805204504.556142A6C12C@llvm.org> Author: void Date: Thu Aug 5 15:45:04 2010 New Revision: 110375 URL: http://llvm.org/viewvc/llvm-project?rev=110375&view=rev Log: 10.5 instead of 10.6 for PPC platforms which don't have 10.6. Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin?rev=110375&r1=110374&r2=110375&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin (original) +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/t-darwin Thu Aug 5 15:45:04 2010 @@ -27,7 +27,7 @@ # APPLE LOCAL 5901604 6499452 # LLVM LOCAL begin 8260893 -MULTILIB_EXTRA_OPTS = isysroot/Developer/SDKs/MacOSX10.6.sdk mmacosx-version-min=10.6 +MULTILIB_EXTRA_OPTS = isysroot/Developer/SDKs/MacOSX10.5.sdk mmacosx-version-min=10.5 # LLVM LOCAL end # Export the _xlq* symbols from darwin-ldouble.c. From dimitry at andric.com Thu Aug 5 15:47:12 2010 From: dimitry at andric.com (Dimitry Andric) Date: Thu, 05 Aug 2010 22:47:12 +0200 Subject: [llvm-commits] [PATCH] Don't cast Win32 FILETIME structs to int64 Message-ID: <4C5B2350.2000503@andric.com> Subject: Don't cast Win32 FILETIME structs to int64 According to the Microsoft documentation here: http://msdn.microsoft.com/en-us/library/ms724284%28VS.85%29.aspx this cast used in lib/System/Win32/Path.inc: __int64 ft = *reinterpret_cast<__int64*>(&fi.ftLastWriteTime); should not be done. The documentation says: "Do not cast a pointer to a FILETIME structure to either a ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows." When compiling with MinGW gcc 4.5.0, you also get some strict-aliasing warnings about those casts: In file included from lib/System/Path.cpp:262:0: lib/System/Win32/Path.inc: In member function 'const llvm::sys::FileStatus* llvm::sys::PathWithStatus::getFileStatus(bool, std::string*) const': lib/System/Win32/Path.inc:403:65: warning: dereferencing type-punned pointer will break strict-aliasing rules lib/System/Win32/Path.inc: In member function 'bool llvm::sys::Path::setStatusInfoOnDisk(const llvm::sys::FileStatus&, std::string*) const': lib/System/Win32/Path.inc:781:14: warning: dereferencing type-punned pointer will break strict-aliasing rules Attached is a fix that uses the recommended ULARGE_INTEGER structure, and fixes the strict-aliasing warnings as a side-effect. Please review. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: fix-filetime-aliasing.diff Url: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100805/6f81d013/attachment.pl From resistor at mac.com Thu Aug 5 15:51:10 2010 From: resistor at mac.com (Owen Anderson) Date: Thu, 05 Aug 2010 20:51:10 -0000 Subject: [llvm-commits] [llvm] r110376 - /llvm/trunk/include/llvm/Support/ConstantRange.h Message-ID: <20100805205110.9DA872A6C12C@llvm.org> Author: resistor Date: Thu Aug 5 15:51:10 2010 New Revision: 110376 URL: http://llvm.org/viewvc/llvm-project?rev=110376&view=rev Log: Give ConstantRange an operator= Modified: llvm/trunk/include/llvm/Support/ConstantRange.h Modified: llvm/trunk/include/llvm/Support/ConstantRange.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ConstantRange.h?rev=110376&r1=110375&r2=110376&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/ConstantRange.h (original) +++ llvm/trunk/include/llvm/Support/ConstantRange.h Thu Aug 5 15:51:10 2010 @@ -139,6 +139,12 @@ /// APInt getSignedMin() const; + /// operator= - Copy one ConstantRange over another. + void operator=(const ConstantRange &CR) { + Lower = CR.Lower; + Upper = CR.Upper; + } + /// operator== - Return true if this range is equal to another range. /// bool operator==(const ConstantRange &CR) const { From ggreif at gmail.com Thu Aug 5 16:25:50 2010 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 05 Aug 2010 21:25:50 -0000 Subject: [llvm-commits] [llvm] r110380 - in /llvm/trunk: include/llvm/Instructions.h include/llvm/Support/CallSite.h lib/VMCore/Instructions.cpp Message-ID: <20100805212550.124EC2A6C12C@llvm.org> Author: ggreif Date: Thu Aug 5 16:25:49 2010 New Revision: 110380 URL: http://llvm.org/viewvc/llvm-project?rev=110380&view=rev Log: remove the private hack from CallInst, it was not supposed to hit the branch anyway as a positive consequence the CallSite::getCallee() methods now can be rewritten to be a bit more efficient Modified: llvm/trunk/include/llvm/Instructions.h llvm/trunk/include/llvm/Support/CallSite.h llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=110380&r1=110379&r2=110380&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Thu Aug 5 16:25:49 2010 @@ -941,28 +941,8 @@ unsigned(isTC)); } - /// @deprecated these "define hacks" will go away soon - /// @brief coerce out-of-tree code to abandon the low-level interfaces - /// @detail see below comments and update your code to high-level interfaces - /// - getOperand(0) ---> getCalledValue(), or possibly getCalledFunction - /// - setOperand(0, V) ---> setCalledFunction(V) - /// - /// in LLVM v2.8-only code - /// - getOperand(N+1) ---> getArgOperand(N) - /// - setOperand(N+1, V) ---> setArgOperand(N, V) - /// - getNumOperands() ---> getNumArgOperands()+1 // note the "+1"! - /// - /// in backward compatible code please consult llvm/Support/CallSite.h, - /// you should create a callsite using the CallInst pointer and call its - /// methods - /// -# define public private -# define protected private /// Provide fast operand accessors DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); -# undef public -# undef protected -public: /// getNumArgOperands - Return the number of call arguments. /// Modified: llvm/trunk/include/llvm/Support/CallSite.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CallSite.h?rev=110380&r1=110379&r2=110380&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/CallSite.h (original) +++ llvm/trunk/include/llvm/Support/CallSite.h Thu Aug 5 16:25:49 2010 @@ -261,13 +261,10 @@ } IterTy getCallee() const { - // FIXME: this is slow, since we do not have the fast versions - // of the op_*() functions here. See CallSite::getCallee. - // - if (isCall()) - return getInstruction()->op_end() - 1; // Skip Callee - else - return getInstruction()->op_end() - 3; // Skip BB, BB, Callee + if (isCall()) // Skip Callee + return cast(getInstruction())->op_end() - 1; + else // Skip BB, BB, Callee + return cast(getInstruction())->op_end() - 3; } }; Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=110380&r1=110379&r2=110380&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Thu Aug 5 16:25:49 2010 @@ -33,7 +33,7 @@ User::op_iterator CallSite::getCallee() const { Instruction *II(getInstruction()); return isCall() - ? cast(II)->op_end() - 1 // Skip Callee + ? cast(II)->op_end() - 1 // Skip Callee : cast(II)->op_end() - 3; // Skip BB, BB, Callee } From geek4civic at gmail.com Thu Aug 5 16:53:14 2010 From: geek4civic at gmail.com (NAKAMURA Takumi) Date: Fri, 6 Aug 2010 06:53:14 +0900 Subject: [llvm-commits] Patch Proposal: tweak *.d on mingw-msys build environment In-Reply-To: <8AB39C99-F624-4EE6-BB1F-305D9260404D@apple.com> References: <8AB39C99-F624-4EE6-BB1F-305D9260404D@apple.com> Message-ID: Anton told me, on the IRC, it is supposed msys-make should accept both schemes. My patch might cause another sideeffect, and I have to let autoconf detect that incompatibility. Thanks....Takumi 2010/8/2 Eric Christopher : > > On Jul 28, 2010, at 9:35 AM, NAKAMURA Takumi wrote: > >> This patch substitutes DOSish driveletter(c:/xxx/) scheme to >> msys-compatible(/c/xxx/) one >> when build host is MingW. >> >> I am using the msysgit (msys+mingw+git) package as development environment. >> C:/msysgit/mingw/bin/g++.exe (TDM-1 mingw32) 4.4.0 >> C:/msysgit/mingw/bin/make.exe GNU Make 3.81 >> >> msys-make igonores dependency rules emitted by mingw-g++ with -MMD, >> ... without any warnings. >> >> And I have confirmed this might not have any side effects on >> fedora12-ppc and cygwin. >> > > > Anton: Can you give this a run on your system? I think you use mingw yes? > > > > > -eric > From gohman at apple.com Thu Aug 5 17:02:16 2010 From: gohman at apple.com (Dan Gohman) Date: Thu, 5 Aug 2010 15:02:16 -0700 Subject: [llvm-commits] [llvm] r110376 - /llvm/trunk/include/llvm/Support/ConstantRange.h In-Reply-To: <20100805205110.9DA872A6C12C@llvm.org> References: <20100805205110.9DA872A6C12C@llvm.org> Message-ID: <21612717-39FF-460F-8B7A-001E5BB9EAA8@apple.com> On Aug 5, 2010, at 1:51 PM, Owen Anderson wrote: > > Give ConstantRange an operator= What was wrong with the implicit operator= it already had? Dan From gohman at apple.com Thu Aug 5 17:09:15 2010 From: gohman at apple.com (Dan Gohman) Date: Thu, 05 Aug 2010 22:09:15 -0000 Subject: [llvm-commits] [llvm] r110382 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp lib/Analysis/MemoryDependenceAnalysis.cpp test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Message-ID: <20100805220915.C1C152A6C12C@llvm.org> Author: djg Date: Thu Aug 5 17:09:15 2010 New Revision: 110382 URL: http://llvm.org/viewvc/llvm-project?rev=110382&view=rev Log: Fix memdep's code for reasoning about dependences between two calls. A Ref response from getModRefInfo is not useful here. Instead, check for identical calls only in the NoModRef case. Reapply r110270, and strengthen it to compensate for the memdep changes. When both calls are readonly, there is no dependence between them. Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110382&r1=110381&r2=110382&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Thu Aug 5 17:09:15 2010 @@ -425,8 +425,13 @@ ModRefBehavior CS2B = AliasAnalysis::getModRefBehavior(CS2); if (CS2B == DoesNotAccessMemory) return NoModRef; - // If they both only read from memory, just return ref. + // If they both only read from memory, there is no dependence. if (CS1B == OnlyReadsMemory && CS2B == OnlyReadsMemory) + return NoModRef; + + // If CS1 only reads memory, the only dependence on CS2 can be + // from CS1 reading memory written by CS2. + if (CS1B == OnlyReadsMemory) return Ref; // Otherwise, fall back to NoAA (mod+ref). Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=110382&r1=110381&r2=110382&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Thu Aug 5 17:09:15 2010 @@ -126,26 +126,15 @@ // If these two calls do not interfere, look past it. switch (AA->getModRefInfo(CS, InstCS)) { case AliasAnalysis::NoModRef: - // If the two calls don't interact (e.g. InstCS is readnone) keep - // scanning. + // If the two calls are the same, return InstCS as a Def, so that + // CS can be found redundant and eliminated. + if (isReadOnlyCall && InstCS.onlyReadsMemory() && + CS.getInstruction()->isIdenticalToWhenDefined(Inst)) + return MemDepResult::getDef(Inst); + + // Otherwise if the two calls don't interact (e.g. InstCS is readnone) + // keep scanning. continue; - case AliasAnalysis::Ref: - // If the two calls read the same memory locations and CS is a readonly - // function, then we have two cases: 1) the calls may not interfere with - // each other at all. 2) the calls may produce the same value. In case - // #1 we want to ignore the values, in case #2, we want to return Inst - // as a Def dependence. This allows us to CSE in cases like: - // X = strlen(P); - // memchr(...); - // Y = strlen(P); // Y = X - if (isReadOnlyCall) { - if (CS.getCalledFunction() != 0 && - CS.getCalledFunction() == InstCS.getCalledFunction()) - return MemDepResult::getDef(Inst); - // Ignore unrelated read/read call dependences. - continue; - } - // FALL THROUGH default: return MemDepResult::getClobber(Inst); } Modified: llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll?rev=110382&r1=110381&r2=110382&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Thu Aug 5 17:09:15 2010 @@ -1,5 +1,4 @@ ; RUN: opt < %s -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s -; XFAIL: * ; CHECK: Just Ref: call void @ro() <-> call void @f0() From resistor at mac.com Thu Aug 5 17:10:46 2010 From: resistor at mac.com (Owen Anderson) Date: Thu, 05 Aug 2010 22:10:46 -0000 Subject: [llvm-commits] [llvm] r110383 - /llvm/trunk/lib/Analysis/LazyValueInfo.cpp Message-ID: <20100805221046.4E5422A6C12C@llvm.org> Author: resistor Date: Thu Aug 5 17:10:46 2010 New Revision: 110383 URL: http://llvm.org/viewvc/llvm-project?rev=110383&view=rev Log: Split the tag and value members of LVILatticeVal in preparation for expanding the lattice to something that won't fit in two bits. Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyValueInfo.cpp?rev=110383&r1=110382&r2=110383&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LazyValueInfo.cpp (original) +++ llvm/trunk/lib/Analysis/LazyValueInfo.cpp Thu Aug 5 17:10:46 2010 @@ -24,7 +24,6 @@ #include "llvm/Support/ValueHandle.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseSet.h" -#include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/STLExtras.h" using namespace llvm; @@ -65,10 +64,11 @@ /// Val: This stores the current lattice value along with the Constant* for /// the constant if this is a 'constant' or 'notconstant' value. - PointerIntPair Val; + LatticeValueTy Tag; + Constant *Val; public: - LVILatticeVal() : Val(0, undefined) {} + LVILatticeVal() : Tag(undefined), Val(0) {} static LVILatticeVal get(Constant *C) { LVILatticeVal Res; @@ -81,26 +81,26 @@ return Res; } - bool isUndefined() const { return Val.getInt() == undefined; } - bool isConstant() const { return Val.getInt() == constant; } - bool isNotConstant() const { return Val.getInt() == notconstant; } - bool isOverdefined() const { return Val.getInt() == overdefined; } + bool isUndefined() const { return Tag == undefined; } + bool isConstant() const { return Tag == constant; } + bool isNotConstant() const { return Tag == notconstant; } + bool isOverdefined() const { return Tag == overdefined; } Constant *getConstant() const { assert(isConstant() && "Cannot get the constant of a non-constant!"); - return Val.getPointer(); + return Val; } Constant *getNotConstant() const { assert(isNotConstant() && "Cannot get the constant of a non-notconstant!"); - return Val.getPointer(); + return Val; } /// markOverdefined - Return true if this is a change in status. bool markOverdefined() { if (isOverdefined()) return false; - Val.setInt(overdefined); + Tag = overdefined; return true; } @@ -112,9 +112,9 @@ } assert(isUndefined()); - Val.setInt(constant); + Tag = constant; assert(V && "Marking constant with NULL"); - Val.setPointer(V); + Val = V; return true; } @@ -130,9 +130,9 @@ else assert(isUndefined()); - Val.setInt(notconstant); + Tag = notconstant; assert(V && "Marking constant with NULL"); - Val.setPointer(V); + Val = V; return true; } From resistor at mac.com Thu Aug 5 17:11:32 2010 From: resistor at mac.com (Owen Anderson) Date: Thu, 05 Aug 2010 22:11:32 -0000 Subject: [llvm-commits] [llvm] r110384 - /llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Message-ID: <20100805221132.2400E2A6C12C@llvm.org> Author: resistor Date: Thu Aug 5 17:11:31 2010 New Revision: 110384 URL: http://llvm.org/viewvc/llvm-project?rev=110384&view=rev Log: Give JumpThreading+LVI a long-form cl::opt so that it's easier to toggle the default. Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=110384&r1=110383&r2=110384&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Thu Aug 5 17:11:31 2010 @@ -45,7 +45,10 @@ // Turn on use of LazyValueInfo. static cl::opt -EnableLVI("enable-jump-threading-lvi", cl::ReallyHidden); +EnableLVI("enable-jump-threading-lvi", + cl::desc("Use LVI for jump threading"), + cl::init(false), + cl::ReallyHidden); From espindola at google.com Thu Aug 5 17:12:27 2010 From: espindola at google.com (Rafael Espindola) Date: Thu, 5 Aug 2010 18:12:27 -0400 Subject: [llvm-commits] [patch][arm] Fix eabi calling convention when a 64 bit value shadows r3 Message-ID: Without this patch the included testcase would fail because the ARM backend would think that r3 had to be saved because it could have been used for vaarg. This would then cause the stack offsets to be invalid. OK? Cheers, -- Rafael ?vila de Esp?ndola -------------- next part -------------- A non-text attachment was scrubbed... Name: shadow.patch Type: text/x-patch Size: 3948 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100805/82b1ab02/attachment.bin From echristo at apple.com Thu Aug 5 17:28:22 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 05 Aug 2010 22:28:22 -0000 Subject: [llvm-commits] [llvm] r110385 - /llvm/trunk/include/llvm/Target/TargetSelect.h Message-ID: <20100805222822.B334A2A6C12C@llvm.org> Author: echristo Date: Thu Aug 5 17:28:22 2010 New Revision: 110385 URL: http://llvm.org/viewvc/llvm-project?rev=110385&view=rev Log: Remove unnecessary include. Modified: llvm/trunk/include/llvm/Target/TargetSelect.h Modified: llvm/trunk/include/llvm/Target/TargetSelect.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetSelect.h?rev=110385&r1=110384&r2=110385&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetSelect.h (original) +++ llvm/trunk/include/llvm/Target/TargetSelect.h Thu Aug 5 17:28:22 2010 @@ -16,8 +16,6 @@ #ifndef LLVM_TARGET_TARGETSELECT_H #define LLVM_TARGET_TARGETSELECT_H -#include "llvm/Config/config.h" - extern "C" { // Declare all of the target-initialization functions that are available. #define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##TargetInfo(); From stoklund at 2pi.dk Thu Aug 5 17:32:22 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Thu, 05 Aug 2010 22:32:22 -0000 Subject: [llvm-commits] [llvm] r110386 - /llvm/trunk/lib/CodeGen/MachineVerifier.cpp Message-ID: <20100805223222.160A72A6C12C@llvm.org> Author: stoklund Date: Thu Aug 5 17:32:21 2010 New Revision: 110386 URL: http://llvm.org/viewvc/llvm-project?rev=110386&view=rev Log: Add basic verification of LiveIntervals. We verify that the LiveInterval is live at uses and defs, and that all instructions have a SlotIndex. Stuff we don't check yet: - Is the LiveInterval minimal? - Do all defs correspond to instructions or phis? - Do all defs dominate all their live ranges? - Are all live ranges continually reachable from their def? Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=110386&r1=110385&r2=110386&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Thu Aug 5 17:32:21 2010 @@ -24,6 +24,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Function.h" +#include "llvm/CodeGen/LiveIntervalAnalysis.h" #include "llvm/CodeGen/LiveVariables.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineFrameInfo.h" @@ -166,6 +167,7 @@ // Analysis information if available LiveVariables *LiveVars; + LiveIntervals *LiveInts; void visitMachineFunctionBefore(); void visitMachineBasicBlockBefore(const MachineBasicBlock *MBB); @@ -245,8 +247,10 @@ if (PASS) { LiveVars = PASS->getAnalysisIfAvailable(); + LiveInts = PASS->getAnalysisIfAvailable(); } else { LiveVars = NULL; + LiveInts = NULL; } visitMachineFunctionBefore(); @@ -500,6 +504,20 @@ if ((*I)->isStore() && !TI.mayStore()) report("Missing mayStore flag", MI); } + + // Debug values must not have a slot index. + // Other instructions must have one. + if (LiveInts) { + bool mapped = !LiveInts->isNotInMIMap(MI); + if (MI->isDebugValue()) { + if (mapped) + report("Debug instruction has a slot index", MI); + } else { + if (!mapped) + report("Missing slot index", MI); + } + } + } void @@ -570,6 +588,21 @@ } } + // Check LiveInts liveness and kill. + if (LiveInts && !LiveInts->isNotInMIMap(MI)) { + SlotIndex UseIdx = LiveInts->getInstructionIndex(MI).getUseIndex(); + if (LiveInts->hasInterval(Reg)) { + const LiveInterval &LI = LiveInts->getInterval(Reg); + if (!LI.liveAt(UseIdx)) { + report("No live range at use", MO, MONum); + *OS << UseIdx << " is not live in " << LI << '\n'; + } + // TODO: Verify isKill == LI.killedAt. + } else if (TargetRegisterInfo::isVirtualRegister(Reg)) { + report("Virtual register has no Live interval", MO, MONum); + } + } + // Use of a dead register. if (!regsLive.count(Reg)) { if (TargetRegisterInfo::isPhysicalRegister(Reg)) { @@ -595,6 +628,32 @@ addRegWithSubRegs(regsDead, Reg); else addRegWithSubRegs(regsDefined, Reg); + + // Check LiveInts for a live range. + if (LiveInts && !LiveInts->isNotInMIMap(MI)) { + SlotIndex DefIdx = LiveInts->getInstructionIndex(MI).getDefIndex(); + if (LiveInts->hasInterval(Reg)) { + const LiveInterval &LI = LiveInts->getInterval(Reg); + if (const LiveRange *LR = LI.getLiveRangeContaining(DefIdx)) { + assert(LR->valno && "NULL valno is not allowed"); + if (LR->valno->def != DefIdx) { + report("Inconsistent valno->def", MO, MONum); + *OS << "Valno " << LR->valno->id << " is not defined at " + << DefIdx << " in " << LI << '\n'; + } + if (LR->start != DefIdx) { + report("Live range doesn't start at def", MO, MONum); + LR->print(*OS); + *OS << " should start at " << DefIdx << " in " << LI << '\n'; + } + } else { + report("No live range at def", MO, MONum); + *OS << DefIdx << " is not live in " << LI << '\n'; + } + } else if (TargetRegisterInfo::isVirtualRegister(Reg)) { + report("Virtual register has no Live interval", MO, MONum); + } + } } // Check register classes. From echristo at apple.com Thu Aug 5 17:48:32 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 05 Aug 2010 22:48:32 -0000 Subject: [llvm-commits] [llvm] r110387 - /llvm/trunk/include/llvm/Target/TargetSelect.h Message-ID: <20100805224832.A10612A6C12C@llvm.org> Author: echristo Date: Thu Aug 5 17:48:32 2010 New Revision: 110387 URL: http://llvm.org/viewvc/llvm-project?rev=110387&view=rev Log: Revert my last commit, apparently it's a runtime issue. Modified: llvm/trunk/include/llvm/Target/TargetSelect.h Modified: llvm/trunk/include/llvm/Target/TargetSelect.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetSelect.h?rev=110387&r1=110386&r2=110387&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetSelect.h (original) +++ llvm/trunk/include/llvm/Target/TargetSelect.h Thu Aug 5 17:48:32 2010 @@ -16,6 +16,8 @@ #ifndef LLVM_TARGET_TARGETSELECT_H #define LLVM_TARGET_TARGETSELECT_H +#include "llvm/Config/config.h" + extern "C" { // Declare all of the target-initialization functions that are available. #define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##TargetInfo(); From resistor at mac.com Thu Aug 5 17:59:19 2010 From: resistor at mac.com (Owen Anderson) Date: Thu, 05 Aug 2010 22:59:19 -0000 Subject: [llvm-commits] [llvm] r110388 - /llvm/trunk/lib/Analysis/LazyValueInfo.cpp Message-ID: <20100805225919.6217C2A6C12C@llvm.org> Author: resistor Date: Thu Aug 5 17:59:19 2010 New Revision: 110388 URL: http://llvm.org/viewvc/llvm-project?rev=110388&view=rev Log: Add the beginnings of infrastructure for range tracking. Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyValueInfo.cpp?rev=110388&r1=110387&r2=110388&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LazyValueInfo.cpp (original) +++ llvm/trunk/lib/Analysis/LazyValueInfo.cpp Thu Aug 5 17:59:19 2010 @@ -19,6 +19,7 @@ #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/ConstantRange.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/ValueHandle.h" @@ -51,12 +52,15 @@ enum LatticeValueTy { /// undefined - This LLVM Value has no known value yet. undefined, + /// constant - This LLVM Value has a specific constant value. constant, - /// notconstant - This LLVM value is known to not have the specified value. notconstant, + /// constantrange + constantrange, + /// overdefined - This instruction is not known to be constant, and we know /// it has a value. overdefined @@ -66,9 +70,10 @@ /// the constant if this is a 'constant' or 'notconstant' value. LatticeValueTy Tag; Constant *Val; + ConstantRange Range; public: - LVILatticeVal() : Tag(undefined), Val(0) {} + LVILatticeVal() : Tag(undefined), Val(0), Range(1, true) {} static LVILatticeVal get(Constant *C) { LVILatticeVal Res; @@ -81,10 +86,11 @@ return Res; } - bool isUndefined() const { return Tag == undefined; } - bool isConstant() const { return Tag == constant; } - bool isNotConstant() const { return Tag == notconstant; } - bool isOverdefined() const { return Tag == overdefined; } + bool isUndefined() const { return Tag == undefined; } + bool isConstant() const { return Tag == constant; } + bool isNotConstant() const { return Tag == notconstant; } + bool isConstantRange() const { return Tag == constantrange; } + bool isOverdefined() const { return Tag == overdefined; } Constant *getConstant() const { assert(isConstant() && "Cannot get the constant of a non-constant!"); @@ -96,6 +102,12 @@ return Val; } + ConstantRange getConstantRange() const { + assert(isConstantRange() && + "Cannot get the constant-range of a non-constant-range!"); + return Range; + } + /// markOverdefined - Return true if this is a change in status. bool markOverdefined() { if (isOverdefined()) @@ -136,6 +148,32 @@ return true; } + /// markConstantRange - Return true if this is a change in status. + bool markConstantRange(const ConstantRange NewR) { + if (isConstantRange()) { + if (NewR.isEmptySet()) + return markOverdefined(); + + assert(Range.contains(NewR) && + "Marking constant range with non-subset range!"); + bool changed = Range == NewR; + Range = NewR; + return changed; + } + + assert(isUndefined()); + if (NewR.isEmptySet()) + return markOverdefined(); + else if (NewR.isFullSet()) { + Tag = undefined; + return true; + } + + Tag = constantrange; + Range = NewR; + return true; + } + /// mergeIn - Merge the specified lattice value into this one, updating this /// one and returning true if anything changed. bool mergeIn(const LVILatticeVal &RHS) { @@ -162,7 +200,23 @@ return markNotConstant(RHS.getNotConstant()); } + if (RHS.isConstantRange()) { + if (isConstantRange()) { + ConstantRange NewR = Range.intersectWith(RHS.getConstantRange()); + if (NewR.isEmptySet()) + return markOverdefined(); + else + return markConstantRange(NewR); + } + + assert(isUndefined() && "Unexpected lattice"); + return markConstantRange(RHS.getConstantRange()); + } + // RHS must be a constant, we must be undef, constant, or notconstant. + assert(!isConstantRange() && + "Constant and ConstantRange cannot be merged."); + if (isUndefined()) return markConstant(RHS.getConstant()); From gohman at apple.com Thu Aug 5 18:23:32 2010 From: gohman at apple.com (Dan Gohman) Date: Thu, 05 Aug 2010 23:23:32 -0000 Subject: [llvm-commits] [llvm] r110391 - /llvm/trunk/lib/Analysis/AliasAnalysis.cpp Message-ID: <20100805232332.2826F2A6C12C@llvm.org> Author: djg Date: Thu Aug 5 18:23:32 2010 New Revision: 110391 URL: http://llvm.org/viewvc/llvm-project?rev=110391&view=rev Log: Yes, we can do better, but this is not the place for it. Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=110391&r1=110390&r2=110391&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Thu Aug 5 18:23:32 2010 @@ -66,7 +66,6 @@ AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo(ImmutableCallSite CS1, ImmutableCallSite CS2) { - // FIXME: we can do better. assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!"); return AA->getModRefInfo(CS1, CS2); } From gohman at apple.com Thu Aug 5 18:34:51 2010 From: gohman at apple.com (Dan Gohman) Date: Thu, 05 Aug 2010 23:34:51 -0000 Subject: [llvm-commits] [llvm] r110393 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Message-ID: <20100805233451.146302A6C12C@llvm.org> Author: djg Date: Thu Aug 5 18:34:50 2010 New Revision: 110393 URL: http://llvm.org/viewvc/llvm-project?rev=110393&view=rev Log: Implement AccessesArguments checking in the two-callsite form of BasicAA::getModRefInfo. This allows BasicAA to say that two memset calls to non-aliasing memory locations don't interfere. Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110393&r1=110392&r2=110393&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Thu Aug 5 18:34:50 2010 @@ -429,13 +429,43 @@ if (CS1B == OnlyReadsMemory && CS2B == OnlyReadsMemory) return NoModRef; + AliasAnalysis::ModRefResult Mask = ModRef; + // If CS1 only reads memory, the only dependence on CS2 can be // from CS1 reading memory written by CS2. if (CS1B == OnlyReadsMemory) - return Ref; + Mask = ModRefResult(Mask & Ref); + // If CS2 only access memory through arguments, accumulate the mod/ref + // information from CS1's references to the memory referenced by + // CS2's arguments. + if (CS2B == AccessesArguments) { + AliasAnalysis::ModRefResult R = NoModRef; + for (ImmutableCallSite::arg_iterator + I = CS2.arg_begin(), E = CS2.arg_end(); I != E; ++I) { + R = ModRefResult((R | getModRefInfo(CS1, *I, UnknownSize)) & Mask); + if (R == Mask) + break; + } + return R; + } + + // If CS1 only accesses memory through arguments, check if CS2 references + // any of the memory referenced by CS1's arguments. If not, return NoModRef. + if (CS1B == AccessesArguments) { + AliasAnalysis::ModRefResult R = NoModRef; + for (ImmutableCallSite::arg_iterator + I = CS1.arg_begin(), E = CS1.arg_end(); I != E; ++I) + if (getModRefInfo(CS2, *I, UnknownSize) != NoModRef) { + R = Mask; + break; + } + if (R == NoModRef) + return R; + } + // Otherwise, fall back to NoAA (mod+ref). - return NoAA::getModRefInfo(CS1, CS2); + return ModRefResult(NoAA::getModRefInfo(CS1, CS2) & Mask); } /// GetIndexDifference - Dest and Src are the variable indices from two Modified: llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll?rev=110393&r1=110392&r2=110393&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll Thu Aug 5 18:34:50 2010 @@ -1,12 +1,26 @@ ; RUN: opt < %s -aa-eval -print-all-alias-modref-info -disable-output |& FileCheck %s + ; CHECK: Just Ref: call void @ro() <-> call void @f0() declare void @f0() declare void @ro() readonly -define void @test() { +define void @test0() { call void @f0() call void @ro() ret void } + +; CHECK: NoModRef: call void @llvm.memset.p0i8.i64(i8* @A, i8 0, i64 1, i32 1, i1 false) <-> call void @llvm.memset.p0i8.i64(i8* @B, i8 0, i64 1, i32 1, i1 false) +; CHECK: NoModRef: call void @llvm.memset.p0i8.i64(i8* @B, i8 0, i64 1, i32 1, i1 false) <-> call void @llvm.memset.p0i8.i64(i8* @A, i8 0, i64 1, i32 1, i1 false) + +declare void @llvm.memset.i64(i8*, i8, i64, i32) + + at A = external global i8 + at B = external global i8 +define void @test1() { + call void @llvm.memset.i64(i8* @A, i8 0, i64 1, i32 1) + call void @llvm.memset.i64(i8* @B, i8 0, i64 1, i32 1) + ret void +} From bruno.cardoso at gmail.com Thu Aug 5 18:35:52 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Thu, 05 Aug 2010 23:35:52 -0000 Subject: [llvm-commits] [llvm] r110394 - in /llvm/trunk/lib/Target/X86: X86CallingConv.td X86ISelLowering.cpp Message-ID: <20100805233552.29A292A6C12C@llvm.org> Author: bruno Date: Thu Aug 5 18:35:51 2010 New Revision: 110394 URL: http://llvm.org/viewvc/llvm-project?rev=110394&view=rev Log: Support very basic (doesn't include ABI support in the front-end, varags, ...) 256-bit argument passing and return for AVX Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallingConv.td?rev=110394&r1=110393&r2=110394&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CallingConv.td (original) +++ llvm/trunk/lib/Target/X86/X86CallingConv.td Thu Aug 5 18:35:51 2010 @@ -33,13 +33,19 @@ CCIfType<[i16], CCAssignToReg<[AX, DX]>>, CCIfType<[i32], CCAssignToReg<[EAX, EDX]>>, CCIfType<[i64], CCAssignToReg<[RAX, RDX]>>, - - // Vector types are returned in XMM0 and XMM1, when they fit. XMMM2 and XMM3 + + // Vector types are returned in XMM0 and XMM1, when they fit. XMM2 and XMM3 // can only be used by ABI non-compliant code. If the target doesn't have XMM // registers, it won't have vector types. CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToReg<[XMM0,XMM1,XMM2,XMM3]>>, + // 256-bit vectors are returned in YMM0 and XMM1, when they fit. YMM2 and YMM3 + // can only be used by ABI non-compliant code. This vector type is only + // supported while using the AVX target feature. + CCIfType<[v32i8, v16i16, v8i32, v4i64, v8f32, v4f64], + CCIfSubtarget<"hasAVX()", CCAssignToReg<[YMM0,YMM1,YMM2,YMM3]>>>, + // MMX vector types are always returned in MM0. If the target doesn't have // MM0, it doesn't support these vector types. CCIfType<[v8i8, v4i16, v2i32, v1i64], CCAssignToReg<[MM0]>>, @@ -164,11 +170,16 @@ CCIfType<[f32, f64, v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCIfSubtarget<"hasSSE1()", CCAssignToReg<[XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7]>>>, - + + // The first 8 256-bit vector arguments are passed in YMM registers. + CCIfType<[v32i8, v16i16, v8i32, v4i64, v8f32, v4f64], + CCIfSubtarget<"hasAVX()", + CCAssignToReg<[YMM0, YMM1, YMM2, YMM3, YMM4, YMM5, YMM6, YMM7]>>>, + // Integer/FP values get stored in stack slots that are 8 bytes in size and // 8-byte aligned if there are no more registers to hold them. CCIfType<[i32, i64, f32, f64], CCAssignToStack<8, 8>>, - + // Long doubles get stack slots whose size and alignment depends on the // subtarget. CCIfType<[f80], CCAssignToStack<0, 0>>, @@ -176,6 +187,10 @@ // Vectors get 16-byte stack slots that are 16-byte aligned. CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToStack<16, 16>>, + // 256-bit vectors get 32-byte stack slots that are 32-byte aligned. + CCIfType<[v32i8, v16i16, v8i32, v4i64, v8f32, v4f64], + CCAssignToStack<32, 32>>, + // __m64 vectors get 8-byte stack slots that are 8-byte aligned. CCIfType<[v8i8, v4i16, v2i32, v1i64], CCAssignToStack<8, 8>> ]>; @@ -271,9 +286,18 @@ CCIfNotVarArg>>, + // The first 4 AVX 256-bit vector arguments are passed in YMM registers. + CCIfNotVarArg>>>, + // Other SSE vectors get 16-byte stack slots that are 16-byte aligned. CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64], CCAssignToStack<16, 16>>, + // 256-bit AVX vectors get 32-byte stack slots that are 32-byte aligned. + CCIfType<[v32i8, v16i16, v8i32, v4i64, v8f32, v4f64], + CCAssignToStack<32, 32>>, + // __m64 vectors get 8-byte stack slots that are 4-byte aligned. They are // passed in the parameter area. CCIfType<[v8i8, v4i16, v2i32, v1i64], CCAssignToStack<8, 4>>]>; Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=110394&r1=110393&r2=110394&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Aug 5 18:35:51 2010 @@ -1633,6 +1633,8 @@ RC = X86::FR32RegisterClass; else if (RegVT == MVT::f64) RC = X86::FR64RegisterClass; + else if (RegVT.isVector() && RegVT.getSizeInBits() == 256) + RC = X86::VR256RegisterClass; else if (RegVT.isVector() && RegVT.getSizeInBits() == 128) RC = X86::VR128RegisterClass; else if (RegVT.isVector() && RegVT.getSizeInBits() == 64) From gohman at apple.com Thu Aug 5 18:36:21 2010 From: gohman at apple.com (Dan Gohman) Date: Thu, 05 Aug 2010 23:36:21 -0000 Subject: [llvm-commits] [llvm] r110395 - in /llvm/trunk: include/llvm/Intrinsics.td include/llvm/IntrinsicsARM.td include/llvm/IntrinsicsPowerPC.td include/llvm/IntrinsicsX86.td lib/Target/MBlaze/MBlazeIntrinsics.td utils/TableGen/CodeGenDAGPatterns.cpp utils/TableGen/CodeGenIntrinsics.h utils/TableGen/CodeGenTarget.cpp utils/TableGen/IntrinsicEmitter.cpp Message-ID: <20100805233621.B72EA2A6C12D@llvm.org> Author: djg Date: Thu Aug 5 18:36:21 2010 New Revision: 110395 URL: http://llvm.org/viewvc/llvm-project?rev=110395&view=rev Log: Remove IntrWriteMem, as it's the default. Rename IntrWriteArgMem to IntrReadWriteArgMem, as it's for reading as well as writing. Modified: llvm/trunk/include/llvm/Intrinsics.td llvm/trunk/include/llvm/IntrinsicsARM.td llvm/trunk/include/llvm/IntrinsicsPowerPC.td llvm/trunk/include/llvm/IntrinsicsX86.td llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsics.td llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp llvm/trunk/utils/TableGen/CodeGenIntrinsics.h llvm/trunk/utils/TableGen/CodeGenTarget.cpp llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp Modified: llvm/trunk/include/llvm/Intrinsics.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=110395&r1=110394&r2=110395&view=diff ============================================================================== --- llvm/trunk/include/llvm/Intrinsics.td (original) +++ llvm/trunk/include/llvm/Intrinsics.td Thu Aug 5 18:36:21 2010 @@ -19,10 +19,11 @@ class IntrinsicProperty; -// Intr*Mem - Memory properties. An intrinsic is allowed to have exactly one of +// Intr*Mem - Memory properties. An intrinsic is allowed to have at most one of // these properties set. They are listed from the most aggressive (best to use // if correct) to the least aggressive. If no property is set, the worst case -// is assumed (IntrWriteMem). +// is assumed (it may read and write any memory it can get access to and it may +// have other side effects). // IntrNoMem - The intrinsic does not access memory or have any other side // effects. It may be CSE'd deleted if dead, etc. @@ -37,15 +38,11 @@ // deleted if dead. def IntrReadMem : IntrinsicProperty; -// IntrWriteArgMem - This intrinsic reads and writes only from memory that one -// of its arguments points to, but may access an unspecified amount. The reads -// and writes may be volatile, but except for this it has no other side effects. -def IntrWriteArgMem : IntrinsicProperty; - -// IntrWriteMem - This intrinsic may read or modify unspecified memory or has -// other side effects. It cannot be modified by the optimizer. This is the -// default if the intrinsic has no other Intr*Mem property. -def IntrWriteMem : IntrinsicProperty; +// IntrReadWriteArgMem - This intrinsic reads and writes only from memory that +// one of its arguments points to, but may access an unspecified amount. The +// reads and writes may be volatile, but except for this it has no other side +// effects. +def IntrReadWriteArgMem : IntrinsicProperty; // Commutative - This intrinsic is commutative: X op Y == Y op X. def Commutative : IntrinsicProperty; @@ -190,7 +187,7 @@ [IntrReadArgMem]>; def int_gcwrite : Intrinsic<[], [llvm_ptr_ty, llvm_ptr_ty, llvm_ptrptr_ty], - [IntrWriteArgMem, NoCapture<1>, NoCapture<2>]>; + [IntrReadWriteArgMem, NoCapture<1>, NoCapture<2>]>; //===--------------------- Code Generator Intrinsics ----------------------===// // @@ -204,21 +201,19 @@ def int_stackrestore : Intrinsic<[], [llvm_ptr_ty]>, GCCBuiltin<"__builtin_stack_restore">; -// IntrWriteArgMem is more pessimistic than strictly necessary for prefetch, +// IntrReadWriteArgMem is more pessimistic than strictly necessary for prefetch, // however it does conveniently prevent the prefetch from being reordered // with respect to nearby accesses to the same memory. def int_prefetch : Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], - [IntrWriteArgMem, NoCapture<0>]>; + [IntrReadWriteArgMem, NoCapture<0>]>; def int_pcmarker : Intrinsic<[], [llvm_i32_ty]>; def int_readcyclecounter : Intrinsic<[llvm_i64_ty]>; // Stack Protector Intrinsic - The stackprotector intrinsic writes the stack // guard to the correct place on the stack frame. -def int_stackprotector : Intrinsic<[], - [llvm_ptr_ty, llvm_ptrptr_ty], - [IntrWriteMem]>; +def int_stackprotector : Intrinsic<[], [llvm_ptr_ty, llvm_ptrptr_ty], []>; //===------------------- Standard C Library Intrinsics --------------------===// // @@ -226,15 +221,15 @@ def int_memcpy : Intrinsic<[], [llvm_anyptr_ty, llvm_anyptr_ty, llvm_anyint_ty, llvm_i32_ty, llvm_i1_ty], - [IntrWriteArgMem, NoCapture<0>, NoCapture<1>]>; + [IntrReadWriteArgMem, NoCapture<0>, NoCapture<1>]>; def int_memmove : Intrinsic<[], [llvm_anyptr_ty, llvm_anyptr_ty, llvm_anyint_ty, llvm_i32_ty, llvm_i1_ty], - [IntrWriteArgMem, NoCapture<0>, NoCapture<1>]>; + [IntrReadWriteArgMem, NoCapture<0>, NoCapture<1>]>; def int_memset : Intrinsic<[], [llvm_anyptr_ty, llvm_i8_ty, llvm_anyint_ty, llvm_i32_ty, llvm_i1_ty], - [IntrWriteArgMem, NoCapture<0>]>; + [IntrReadWriteArgMem, NoCapture<0>]>; // These functions do not actually read memory, but they are sensitive to the // rounding mode. This needs to be modelled separately; in the meantime @@ -331,7 +326,7 @@ // def int_init_trampoline : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty, llvm_ptr_ty, llvm_ptr_ty], - [IntrWriteArgMem]>, + [IntrReadWriteArgMem]>, GCCBuiltin<"__builtin_init_trampoline">; //===------------------------ Overflow Intrinsics -------------------------===// @@ -369,79 +364,79 @@ def int_atomic_cmp_swap : Intrinsic<[llvm_anyint_ty], [LLVMAnyPointerType>, LLVMMatchType<0>, LLVMMatchType<0>], - [IntrWriteArgMem, NoCapture<0>]>, + [IntrReadWriteArgMem, NoCapture<0>]>, GCCBuiltin<"__sync_val_compare_and_swap">; def int_atomic_load_add : Intrinsic<[llvm_anyint_ty], [LLVMAnyPointerType>, LLVMMatchType<0>], - [IntrWriteArgMem, NoCapture<0>]>, + [IntrReadWriteArgMem, NoCapture<0>]>, GCCBuiltin<"__sync_fetch_and_add">; def int_atomic_swap : Intrinsic<[llvm_anyint_ty], [LLVMAnyPointerType>, LLVMMatchType<0>], - [IntrWriteArgMem, NoCapture<0>]>, + [IntrReadWriteArgMem, NoCapture<0>]>, GCCBuiltin<"__sync_lock_test_and_set">; def int_atomic_load_sub : Intrinsic<[llvm_anyint_ty], [LLVMAnyPointerType>, LLVMMatchType<0>], - [IntrWriteArgMem, NoCapture<0>]>, + [IntrReadWriteArgMem, NoCapture<0>]>, GCCBuiltin<"__sync_fetch_and_sub">; def int_atomic_load_and : Intrinsic<[llvm_anyint_ty], [LLVMAnyPointerType>, LLVMMatchType<0>], - [IntrWriteArgMem, NoCapture<0>]>, + [IntrReadWriteArgMem, NoCapture<0>]>, GCCBuiltin<"__sync_fetch_and_and">; def int_atomic_load_or : Intrinsic<[llvm_anyint_ty], [LLVMAnyPointerType>, LLVMMatchType<0>], - [IntrWriteArgMem, NoCapture<0>]>, + [IntrReadWriteArgMem, NoCapture<0>]>, GCCBuiltin<"__sync_fetch_and_or">; def int_atomic_load_xor : Intrinsic<[llvm_anyint_ty], [LLVMAnyPointerType>, LLVMMatchType<0>], - [IntrWriteArgMem, NoCapture<0>]>, + [IntrReadWriteArgMem, NoCapture<0>]>, GCCBuiltin<"__sync_fetch_and_xor">; def int_atomic_load_nand : Intrinsic<[llvm_anyint_ty], [LLVMAnyPointerType>, LLVMMatchType<0>], - [IntrWriteArgMem, NoCapture<0>]>, + [IntrReadWriteArgMem, NoCapture<0>]>, GCCBuiltin<"__sync_fetch_and_nand">; def int_atomic_load_min : Intrinsic<[llvm_anyint_ty], [LLVMAnyPointerType>, LLVMMatchType<0>], - [IntrWriteArgMem, NoCapture<0>]>, + [IntrReadWriteArgMem, NoCapture<0>]>, GCCBuiltin<"__sync_fetch_and_min">; def int_atomic_load_max : Intrinsic<[llvm_anyint_ty], [LLVMAnyPointerType>, LLVMMatchType<0>], - [IntrWriteArgMem, NoCapture<0>]>, + [IntrReadWriteArgMem, NoCapture<0>]>, GCCBuiltin<"__sync_fetch_and_max">; def int_atomic_load_umin : Intrinsic<[llvm_anyint_ty], [LLVMAnyPointerType>, LLVMMatchType<0>], - [IntrWriteArgMem, NoCapture<0>]>, + [IntrReadWriteArgMem, NoCapture<0>]>, GCCBuiltin<"__sync_fetch_and_umin">; def int_atomic_load_umax : Intrinsic<[llvm_anyint_ty], [LLVMAnyPointerType>, LLVMMatchType<0>], - [IntrWriteArgMem, NoCapture<0>]>, + [IntrReadWriteArgMem, NoCapture<0>]>, GCCBuiltin<"__sync_fetch_and_umax">; //===------------------------- Memory Use Markers -------------------------===// // def int_lifetime_start : Intrinsic<[], [llvm_i64_ty, llvm_ptr_ty], - [IntrWriteArgMem, NoCapture<1>]>; + [IntrReadWriteArgMem, NoCapture<1>]>; def int_lifetime_end : Intrinsic<[], [llvm_i64_ty, llvm_ptr_ty], - [IntrWriteArgMem, NoCapture<1>]>; + [IntrReadWriteArgMem, NoCapture<1>]>; def int_invariant_start : Intrinsic<[llvm_descriptor_ty], [llvm_i64_ty, llvm_ptr_ty], [IntrReadArgMem, NoCapture<1>]>; def int_invariant_end : Intrinsic<[], [llvm_descriptor_ty, llvm_i64_ty, llvm_ptr_ty], - [IntrWriteArgMem, NoCapture<2>]>; + [IntrReadWriteArgMem, NoCapture<2>]>; //===-------------------------- Other Intrinsics --------------------------===// // Modified: llvm/trunk/include/llvm/IntrinsicsARM.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsARM.td?rev=110395&r1=110394&r2=110395&view=diff ============================================================================== --- llvm/trunk/include/llvm/IntrinsicsARM.td (original) +++ llvm/trunk/include/llvm/IntrinsicsARM.td Thu Aug 5 18:36:21 2010 @@ -42,7 +42,7 @@ def int_arm_get_fpscr : GCCBuiltin<"__builtin_arm_get_fpscr">, Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>; def int_arm_set_fpscr : GCCBuiltin<"__builtin_arm_set_fpscr">, - Intrinsic<[], [llvm_i32_ty], [IntrWriteMem]>; + Intrinsic<[], [llvm_i32_ty], []>; def int_arm_vcvtr : Intrinsic<[llvm_float_ty], [llvm_anyfloat_ty], [IntrNoMem]>; def int_arm_vcvtru : Intrinsic<[llvm_float_ty], [llvm_anyfloat_ty], @@ -375,31 +375,31 @@ // Interleaving vector stores from N-element structures. def int_arm_neon_vst1 : Intrinsic<[], [llvm_ptr_ty, llvm_anyvector_ty], - [IntrWriteArgMem]>; + [IntrReadWriteArgMem]>; def int_arm_neon_vst2 : Intrinsic<[], [llvm_ptr_ty, llvm_anyvector_ty, - LLVMMatchType<0>], [IntrWriteArgMem]>; + LLVMMatchType<0>], [IntrReadWriteArgMem]>; def int_arm_neon_vst3 : Intrinsic<[], [llvm_ptr_ty, llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>], - [IntrWriteArgMem]>; + [IntrReadWriteArgMem]>; def int_arm_neon_vst4 : Intrinsic<[], [llvm_ptr_ty, llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, - LLVMMatchType<0>], [IntrWriteArgMem]>; + LLVMMatchType<0>], [IntrReadWriteArgMem]>; // Vector store N-element structure from one lane. def int_arm_neon_vst2lane : Intrinsic<[], [llvm_ptr_ty, llvm_anyvector_ty, LLVMMatchType<0>, llvm_i32_ty], - [IntrWriteArgMem]>; + [IntrReadWriteArgMem]>; def int_arm_neon_vst3lane : Intrinsic<[], [llvm_ptr_ty, llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, - llvm_i32_ty], [IntrWriteArgMem]>; + llvm_i32_ty], [IntrReadWriteArgMem]>; def int_arm_neon_vst4lane : Intrinsic<[], [llvm_ptr_ty, llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>, llvm_i32_ty], - [IntrWriteArgMem]>; + [IntrReadWriteArgMem]>; } Modified: llvm/trunk/include/llvm/IntrinsicsPowerPC.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsPowerPC.td?rev=110395&r1=110394&r2=110395&view=diff ============================================================================== --- llvm/trunk/include/llvm/IntrinsicsPowerPC.td (original) +++ llvm/trunk/include/llvm/IntrinsicsPowerPC.td Thu Aug 5 18:36:21 2010 @@ -18,17 +18,17 @@ // Non-altivec intrinsics. let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.". // dcba/dcbf/dcbi/dcbst/dcbt/dcbz/dcbzl(PPC970) instructions. - def int_ppc_dcba : Intrinsic<[], [llvm_ptr_ty], [IntrWriteMem]>; - def int_ppc_dcbf : Intrinsic<[], [llvm_ptr_ty], [IntrWriteMem]>; - def int_ppc_dcbi : Intrinsic<[], [llvm_ptr_ty], [IntrWriteMem]>; - def int_ppc_dcbst : Intrinsic<[], [llvm_ptr_ty], [IntrWriteMem]>; - def int_ppc_dcbt : Intrinsic<[], [llvm_ptr_ty], [IntrWriteMem]>; - def int_ppc_dcbtst: Intrinsic<[], [llvm_ptr_ty], [IntrWriteMem]>; - def int_ppc_dcbz : Intrinsic<[], [llvm_ptr_ty], [IntrWriteMem]>; - def int_ppc_dcbzl : Intrinsic<[], [llvm_ptr_ty], [IntrWriteMem]>; + def int_ppc_dcba : Intrinsic<[], [llvm_ptr_ty], []>; + def int_ppc_dcbf : Intrinsic<[], [llvm_ptr_ty], []>; + def int_ppc_dcbi : Intrinsic<[], [llvm_ptr_ty], []>; + def int_ppc_dcbst : Intrinsic<[], [llvm_ptr_ty], []>; + def int_ppc_dcbt : Intrinsic<[], [llvm_ptr_ty], []>; + def int_ppc_dcbtst: Intrinsic<[], [llvm_ptr_ty], []>; + def int_ppc_dcbz : Intrinsic<[], [llvm_ptr_ty], []>; + def int_ppc_dcbzl : Intrinsic<[], [llvm_ptr_ty], []>; // sync instruction - def int_ppc_sync : Intrinsic<[], [], [IntrWriteMem]>; + def int_ppc_sync : Intrinsic<[], [], []>; } @@ -86,31 +86,31 @@ let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.". // Data Stream Control. def int_ppc_altivec_dss : GCCBuiltin<"__builtin_altivec_dss">, - Intrinsic<[], [llvm_i32_ty], [IntrWriteMem]>; + Intrinsic<[], [llvm_i32_ty], []>; def int_ppc_altivec_dssall : GCCBuiltin<"__builtin_altivec_dssall">, - Intrinsic<[], [], [IntrWriteMem]>; + Intrinsic<[], [], []>; def int_ppc_altivec_dst : GCCBuiltin<"__builtin_altivec_dst">, Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], - [IntrWriteMem]>; + []>; def int_ppc_altivec_dstt : GCCBuiltin<"__builtin_altivec_dstt">, Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], - [IntrWriteMem]>; + []>; def int_ppc_altivec_dstst : GCCBuiltin<"__builtin_altivec_dstst">, Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], - [IntrWriteMem]>; + []>; def int_ppc_altivec_dststt : GCCBuiltin<"__builtin_altivec_dststt">, Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty], - [IntrWriteMem]>; + []>; // VSCR access. def int_ppc_altivec_mfvscr : GCCBuiltin<"__builtin_altivec_mfvscr">, Intrinsic<[llvm_v8i16_ty], [], [IntrReadMem]>; def int_ppc_altivec_mtvscr : GCCBuiltin<"__builtin_altivec_mtvscr">, - Intrinsic<[], [llvm_v4i32_ty], [IntrWriteMem]>; + Intrinsic<[], [llvm_v4i32_ty], []>; // Loads. These don't map directly to GCC builtins because they represent the @@ -129,20 +129,15 @@ // Stores. These don't map directly to GCC builtins because they represent the // source address with a single pointer. def int_ppc_altivec_stvx : - Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], - [IntrWriteMem]>; + Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], []>; def int_ppc_altivec_stvxl : - Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], - [IntrWriteMem]>; + Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], []>; def int_ppc_altivec_stvebx : - Intrinsic<[], [llvm_v16i8_ty, llvm_ptr_ty], - [IntrWriteMem]>; + Intrinsic<[], [llvm_v16i8_ty, llvm_ptr_ty], []>; def int_ppc_altivec_stvehx : - Intrinsic<[], [llvm_v8i16_ty, llvm_ptr_ty], - [IntrWriteMem]>; + Intrinsic<[], [llvm_v8i16_ty, llvm_ptr_ty], []>; def int_ppc_altivec_stvewx : - Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], - [IntrWriteMem]>; + Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], []>; // Comparisons setting a vector. def int_ppc_altivec_vcmpbfp : GCCBuiltin<"__builtin_altivec_vcmpbfp">, Modified: llvm/trunk/include/llvm/IntrinsicsX86.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=110395&r1=110394&r2=110395&view=diff ============================================================================== --- llvm/trunk/include/llvm/IntrinsicsX86.td (original) +++ llvm/trunk/include/llvm/IntrinsicsX86.td Thu Aug 5 18:36:21 2010 @@ -143,24 +143,24 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_sse_storeu_ps : GCCBuiltin<"__builtin_ia32_storeups">, Intrinsic<[], [llvm_ptr_ty, - llvm_v4f32_ty], [IntrWriteMem]>; + llvm_v4f32_ty], []>; } // Cacheability support ops let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_sse_movnt_ps : GCCBuiltin<"__builtin_ia32_movntps">, Intrinsic<[], [llvm_ptr_ty, - llvm_v4f32_ty], [IntrWriteMem]>; + llvm_v4f32_ty], []>; def int_x86_sse_sfence : GCCBuiltin<"__builtin_ia32_sfence">, - Intrinsic<[], [], [IntrWriteMem]>; + Intrinsic<[], [], []>; } // Control register. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_sse_stmxcsr : - Intrinsic<[], [llvm_ptr_ty], [IntrWriteMem]>; + Intrinsic<[], [llvm_ptr_ty], []>; def int_x86_sse_ldmxcsr : - Intrinsic<[], [llvm_ptr_ty], [IntrWriteMem]>; + Intrinsic<[], [llvm_ptr_ty], []>; } // Misc. @@ -459,26 +459,26 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_sse2_storeu_pd : GCCBuiltin<"__builtin_ia32_storeupd">, Intrinsic<[], [llvm_ptr_ty, - llvm_v2f64_ty], [IntrWriteMem]>; + llvm_v2f64_ty], []>; def int_x86_sse2_storeu_dq : GCCBuiltin<"__builtin_ia32_storedqu">, Intrinsic<[], [llvm_ptr_ty, - llvm_v16i8_ty], [IntrWriteMem]>; + llvm_v16i8_ty], []>; def int_x86_sse2_storel_dq : GCCBuiltin<"__builtin_ia32_storelv4si">, Intrinsic<[], [llvm_ptr_ty, - llvm_v4i32_ty], [IntrWriteMem]>; + llvm_v4i32_ty], []>; } // Cacheability support ops let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_sse2_movnt_dq : GCCBuiltin<"__builtin_ia32_movntdq">, Intrinsic<[], [llvm_ptr_ty, - llvm_v2i64_ty], [IntrWriteMem]>; + llvm_v2i64_ty], []>; def int_x86_sse2_movnt_pd : GCCBuiltin<"__builtin_ia32_movntpd">, Intrinsic<[], [llvm_ptr_ty, - llvm_v2f64_ty], [IntrWriteMem]>; + llvm_v2f64_ty], []>; def int_x86_sse2_movnt_i : GCCBuiltin<"__builtin_ia32_movnti">, Intrinsic<[], [llvm_ptr_ty, - llvm_i32_ty], [IntrWriteMem]>; + llvm_i32_ty], []>; } // Misc. @@ -498,13 +498,13 @@ Intrinsic<[llvm_i32_ty], [llvm_v16i8_ty], [IntrNoMem]>; def int_x86_sse2_maskmov_dqu : GCCBuiltin<"__builtin_ia32_maskmovdqu">, Intrinsic<[], [llvm_v16i8_ty, - llvm_v16i8_ty, llvm_ptr_ty], [IntrWriteMem]>; + llvm_v16i8_ty, llvm_ptr_ty], []>; def int_x86_sse2_clflush : GCCBuiltin<"__builtin_ia32_clflush">, - Intrinsic<[], [llvm_ptr_ty], [IntrWriteMem]>; + Intrinsic<[], [llvm_ptr_ty], []>; def int_x86_sse2_lfence : GCCBuiltin<"__builtin_ia32_lfence">, - Intrinsic<[], [], [IntrWriteMem]>; + Intrinsic<[], [], []>; def int_x86_sse2_mfence : GCCBuiltin<"__builtin_ia32_mfence">, - Intrinsic<[], [], [IntrWriteMem]>; + Intrinsic<[], [], []>; } //===----------------------------------------------------------------------===// @@ -546,10 +546,10 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_sse3_monitor : GCCBuiltin<"__builtin_ia32_monitor">, Intrinsic<[], [llvm_ptr_ty, - llvm_i32_ty, llvm_i32_ty], [IntrWriteMem]>; + llvm_i32_ty, llvm_i32_ty], []>; def int_x86_sse3_mwait : GCCBuiltin<"__builtin_ia32_mwait">, Intrinsic<[], [llvm_i32_ty, - llvm_i32_ty], [IntrWriteMem]>; + llvm_i32_ty], []>; } //===----------------------------------------------------------------------===// @@ -1363,21 +1363,21 @@ // SIMD store ops let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_avx_storeu_pd_256 : GCCBuiltin<"__builtin_ia32_storeupd256">, - Intrinsic<[], [llvm_ptr_ty, llvm_v4f64_ty], [IntrWriteMem]>; + Intrinsic<[], [llvm_ptr_ty, llvm_v4f64_ty], []>; def int_x86_avx_storeu_ps_256 : GCCBuiltin<"__builtin_ia32_storeups256">, - Intrinsic<[], [llvm_ptr_ty, llvm_v8f32_ty], [IntrWriteMem]>; + Intrinsic<[], [llvm_ptr_ty, llvm_v8f32_ty], []>; def int_x86_avx_storeu_dq_256 : GCCBuiltin<"__builtin_ia32_storedqu256">, - Intrinsic<[], [llvm_ptr_ty, llvm_v32i8_ty], [IntrWriteMem]>; + Intrinsic<[], [llvm_ptr_ty, llvm_v32i8_ty], []>; } // Cacheability support ops let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_avx_movnt_dq_256 : GCCBuiltin<"__builtin_ia32_movntdq256">, - Intrinsic<[], [llvm_ptr_ty, llvm_v4i64_ty], [IntrWriteMem]>; + Intrinsic<[], [llvm_ptr_ty, llvm_v4i64_ty], []>; def int_x86_avx_movnt_pd_256 : GCCBuiltin<"__builtin_ia32_movntpd256">, - Intrinsic<[], [llvm_ptr_ty, llvm_v4f64_ty], [IntrWriteMem]>; + Intrinsic<[], [llvm_ptr_ty, llvm_v4f64_ty], []>; def int_x86_avx_movnt_ps_256 : GCCBuiltin<"__builtin_ia32_movntps256">, - Intrinsic<[], [llvm_ptr_ty, llvm_v8f32_ty], [IntrWriteMem]>; + Intrinsic<[], [llvm_ptr_ty, llvm_v8f32_ty], []>; } // Conditional load ops @@ -1396,18 +1396,18 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_avx_maskstore_pd : GCCBuiltin<"__builtin_ia32_maskstorepd">, Intrinsic<[], [llvm_ptr_ty, - llvm_v2f64_ty, llvm_v2f64_ty], [IntrWriteMem]>; + llvm_v2f64_ty, llvm_v2f64_ty], []>; def int_x86_avx_maskstore_ps : GCCBuiltin<"__builtin_ia32_maskstoreps">, Intrinsic<[], [llvm_ptr_ty, - llvm_v4f32_ty, llvm_v4f32_ty], [IntrWriteMem]>; + llvm_v4f32_ty, llvm_v4f32_ty], []>; def int_x86_avx_maskstore_pd_256 : GCCBuiltin<"__builtin_ia32_maskstorepd256">, Intrinsic<[], [llvm_ptr_ty, - llvm_v4f64_ty, llvm_v4f64_ty], [IntrWriteMem]>; + llvm_v4f64_ty, llvm_v4f64_ty], []>; def int_x86_avx_maskstore_ps_256 : GCCBuiltin<"__builtin_ia32_maskstoreps256">, Intrinsic<[], [llvm_ptr_ty, - llvm_v8f32_ty, llvm_v8f32_ty], [IntrWriteMem]>; + llvm_v8f32_ty, llvm_v8f32_ty], []>; } //===----------------------------------------------------------------------===// @@ -1416,9 +1416,9 @@ // Empty MMX state op. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_mmx_emms : GCCBuiltin<"__builtin_ia32_emms">, - Intrinsic<[], [], [IntrWriteMem]>; + Intrinsic<[], [], []>; def int_x86_mmx_femms : GCCBuiltin<"__builtin_ia32_femms">, - Intrinsic<[], [], [IntrWriteMem]>; + Intrinsic<[], [], []>; } // Integer arithmetic ops. @@ -1594,14 +1594,11 @@ // Misc. let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_mmx_maskmovq : GCCBuiltin<"__builtin_ia32_maskmovq">, - Intrinsic<[], - [llvm_v8i8_ty, llvm_v8i8_ty, llvm_ptr_ty], - [IntrWriteMem]>; + Intrinsic<[], [llvm_v8i8_ty, llvm_v8i8_ty, llvm_ptr_ty], []>; def int_x86_mmx_pmovmskb : GCCBuiltin<"__builtin_ia32_pmovmskb">, Intrinsic<[llvm_i32_ty], [llvm_v8i8_ty], [IntrNoMem]>; def int_x86_mmx_movnt_dq : GCCBuiltin<"__builtin_ia32_movntq">, - Intrinsic<[], [llvm_ptr_ty, - llvm_v1i64_ty], [IntrWriteMem]>; + Intrinsic<[], [llvm_ptr_ty, llvm_v1i64_ty], []>; } Modified: llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsics.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsics.td?rev=110395&r1=110394&r2=110395&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsics.td (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeIntrinsics.td Thu Aug 5 18:36:21 2010 @@ -17,17 +17,11 @@ // MBlaze intrinsic classes. let TargetPrefix = "mblaze", isTarget = 1 in { - class MBFSL_Get_Intrinsic : Intrinsic<[llvm_i32_ty], - [llvm_i32_ty], - [IntrWriteMem]>; - - class MBFSL_Put_Intrinsic : Intrinsic<[], - [llvm_i32_ty, llvm_i32_ty], - [IntrWriteMem]>; - - class MBFSL_PutT_Intrinsic : Intrinsic<[], - [llvm_i32_ty], - [IntrWriteMem]>; + class MBFSL_Get_Intrinsic : Intrinsic<[llvm_i32_ty], [llvm_i32_ty], []>; + + class MBFSL_Put_Intrinsic : Intrinsic<[], [llvm_i32_ty, llvm_i32_ty], []>; + + class MBFSL_PutT_Intrinsic : Intrinsic<[], [llvm_i32_ty], []>; } //===----------------------------------------------------------------------===// Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp?rev=110395&r1=110394&r2=110395&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp (original) +++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp Thu Aug 5 18:36:21 2010 @@ -2197,10 +2197,10 @@ if (IntInfo->ModRef >= CodeGenIntrinsic::ReadArgMem) mayLoad = true;// These may load memory. - if (IntInfo->ModRef >= CodeGenIntrinsic::WriteArgMem) + if (IntInfo->ModRef >= CodeGenIntrinsic::ReadWriteArgMem) mayStore = true;// Intrinsics that can write to memory are 'mayStore'. - if (IntInfo->ModRef >= CodeGenIntrinsic::WriteMem) + if (IntInfo->ModRef >= CodeGenIntrinsic::ReadWriteMem) // WriteMem intrinsics can have other strange effects. HasSideEffects = true; } Modified: llvm/trunk/utils/TableGen/CodeGenIntrinsics.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenIntrinsics.h?rev=110395&r1=110394&r2=110395&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenIntrinsics.h (original) +++ llvm/trunk/utils/TableGen/CodeGenIntrinsics.h Thu Aug 5 18:36:21 2010 @@ -60,7 +60,7 @@ // Memory mod/ref behavior of this intrinsic. enum { - NoMem, ReadArgMem, ReadMem, WriteArgMem, WriteMem + NoMem, ReadArgMem, ReadMem, ReadWriteArgMem, ReadWriteMem } ModRef; /// This is set to true if the intrinsic is overloaded by its argument Modified: llvm/trunk/utils/TableGen/CodeGenTarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.cpp?rev=110395&r1=110394&r2=110395&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenTarget.cpp (original) +++ llvm/trunk/utils/TableGen/CodeGenTarget.cpp Thu Aug 5 18:36:21 2010 @@ -434,7 +434,7 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) { TheDef = R; std::string DefName = R->getName(); - ModRef = WriteMem; + ModRef = ReadWriteMem; isOverloaded = false; isCommutative = false; @@ -555,10 +555,8 @@ ModRef = ReadArgMem; else if (Property->getName() == "IntrReadMem") ModRef = ReadMem; - else if (Property->getName() == "IntrWriteArgMem") - ModRef = WriteArgMem; - else if (Property->getName() == "IntrWriteMem") - ModRef = WriteMem; + else if (Property->getName() == "IntrReadWriteArgMem") + ModRef = ReadWriteArgMem; else if (Property->getName() == "Commutative") isCommutative = true; else if (Property->isSubClassOf("NoCapture")) { Modified: llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp?rev=110395&r1=110394&r2=110395&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp Thu Aug 5 18:36:21 2010 @@ -545,7 +545,7 @@ OS << "switch (iid) {\n"; OS << "default:\n return UnknownModRefBehavior;\n"; for (unsigned i = 0, e = Ints.size(); i != e; ++i) { - if (Ints[i].ModRef == CodeGenIntrinsic::WriteMem) + if (Ints[i].ModRef == CodeGenIntrinsic::ReadWriteMem) continue; OS << "case " << TargetPrefix << "Intrinsic::" << Ints[i].EnumName << ":\n"; @@ -559,7 +559,7 @@ case CodeGenIntrinsic::ReadMem: OS << " return OnlyReadsMemory;\n"; break; - case CodeGenIntrinsic::WriteArgMem: + case CodeGenIntrinsic::ReadWriteArgMem: OS << " return AccessesArguments;\n"; break; } From resistor at mac.com Thu Aug 5 18:42:05 2010 From: resistor at mac.com (Owen Anderson) Date: Thu, 05 Aug 2010 23:42:05 -0000 Subject: [llvm-commits] [llvm] r110396 - in /llvm/trunk: include/llvm/ include/llvm/Analysis/ include/llvm/CodeGen/ include/llvm/Target/ include/llvm/Transforms/ include/llvm/Transforms/IPO/ include/llvm/Transforms/Utils/ lib/Analysis/ lib/Analysis/IPA/ lib/Bitcode/Writer/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/CBackend/ lib/Target/CppBackend/ lib/Target/MBlaze/ lib/Target/MSIL/ lib/Target/MSP430/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PIC16... Message-ID: <20100805234207.C19CA2A6C12C@llvm.org> Author: resistor Date: Thu Aug 5 18:42:04 2010 New Revision: 110396 URL: http://llvm.org/viewvc/llvm-project?rev=110396&view=rev Log: Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. Modified: llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h llvm/trunk/include/llvm/Analysis/Dominators.h llvm/trunk/include/llvm/Analysis/FindUsedTypes.h llvm/trunk/include/llvm/Analysis/IntervalPartition.h llvm/trunk/include/llvm/Analysis/LazyValueInfo.h llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h llvm/trunk/include/llvm/Analysis/LoopInfo.h llvm/trunk/include/llvm/Analysis/LoopPass.h llvm/trunk/include/llvm/Analysis/Passes.h llvm/trunk/include/llvm/Analysis/PostDominators.h llvm/trunk/include/llvm/CallGraphSCCPass.h llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h llvm/trunk/include/llvm/CodeGen/LiveVariables.h llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h llvm/trunk/include/llvm/CodeGen/Passes.h llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h llvm/trunk/include/llvm/CodeGen/SlotIndexes.h llvm/trunk/include/llvm/Pass.h llvm/trunk/include/llvm/PassAnalysisSupport.h llvm/trunk/include/llvm/PassManagers.h llvm/trunk/include/llvm/PassRegistry.h llvm/trunk/include/llvm/PassSupport.h llvm/trunk/include/llvm/Target/TargetData.h llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h llvm/trunk/include/llvm/Transforms/Scalar.h llvm/trunk/include/llvm/Transforms/Utils/SSI.h llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp llvm/trunk/lib/Analysis/AliasDebugger.cpp llvm/trunk/lib/Analysis/AliasSetTracker.cpp llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/CFGPrinter.cpp llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp llvm/trunk/lib/Analysis/DomPrinter.cpp llvm/trunk/lib/Analysis/IPA/CallGraph.cpp llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp llvm/trunk/lib/Analysis/IVUsers.cpp llvm/trunk/lib/Analysis/InstCount.cpp llvm/trunk/lib/Analysis/IntervalPartition.cpp llvm/trunk/lib/Analysis/Lint.cpp llvm/trunk/lib/Analysis/LiveValues.cpp llvm/trunk/lib/Analysis/LoopPass.cpp llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp llvm/trunk/lib/Analysis/PointerTracking.cpp llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp llvm/trunk/lib/Analysis/ProfileInfo.cpp llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp llvm/trunk/lib/Analysis/RegionInfo.cpp llvm/trunk/lib/Analysis/RegionPrinter.cpp llvm/trunk/lib/Analysis/ScalarEvolution.cpp llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/BranchFolding.cpp llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp llvm/trunk/lib/CodeGen/ELFWriter.cpp llvm/trunk/lib/CodeGen/GCMetadata.cpp llvm/trunk/lib/CodeGen/GCStrategy.cpp llvm/trunk/lib/CodeGen/IfConversion.cpp llvm/trunk/lib/CodeGen/LowerSubregs.cpp llvm/trunk/lib/CodeGen/MachineCSE.cpp llvm/trunk/lib/CodeGen/MachineDominators.cpp llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp llvm/trunk/lib/CodeGen/MachineLICM.cpp llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp llvm/trunk/lib/CodeGen/MachineSink.cpp llvm/trunk/lib/CodeGen/MachineVerifier.cpp llvm/trunk/lib/CodeGen/OptimizeExts.cpp llvm/trunk/lib/CodeGen/OptimizePHIs.cpp llvm/trunk/lib/CodeGen/PHIElimination.cpp llvm/trunk/lib/CodeGen/PHIElimination.h llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp llvm/trunk/lib/CodeGen/PrologEpilogInserter.h llvm/trunk/lib/CodeGen/RegAllocFast.cpp llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp llvm/trunk/lib/CodeGen/RenderMachineFunction.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp llvm/trunk/lib/CodeGen/Splitter.h llvm/trunk/lib/CodeGen/StackProtector.cpp llvm/trunk/lib/CodeGen/StackSlotColoring.cpp llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp llvm/trunk/lib/CodeGen/TailDuplication.cpp llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp llvm/trunk/lib/CodeGen/VirtRegMap.h llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp llvm/trunk/lib/Target/CBackend/CBackend.cpp llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp llvm/trunk/lib/Target/MSIL/MSILWriter.h llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp llvm/trunk/lib/Target/Sparc/FPMover.cpp llvm/trunk/lib/Target/TargetData.cpp llvm/trunk/lib/Target/X86/SSEDomainFix.cpp llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp llvm/trunk/lib/Transforms/Hello/Hello.cpp llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp llvm/trunk/lib/Transforms/IPO/Inliner.cpp llvm/trunk/lib/Transforms/IPO/Internalize.cpp llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp llvm/trunk/lib/Transforms/IPO/PruneEH.cpp llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp llvm/trunk/lib/Transforms/InstCombine/InstCombine.h llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp llvm/trunk/lib/Transforms/Scalar/ABCD.cpp llvm/trunk/lib/Transforms/Scalar/ADCE.cpp llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp llvm/trunk/lib/Transforms/Scalar/DCE.cpp llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp llvm/trunk/lib/Transforms/Scalar/GVN.cpp llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp llvm/trunk/lib/Transforms/Scalar/LICM.cpp llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp llvm/trunk/lib/Transforms/Scalar/SCCP.cpp llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp llvm/trunk/lib/Transforms/Scalar/Sink.cpp llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp llvm/trunk/lib/Transforms/Utils/LCSSA.cpp llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp llvm/trunk/lib/Transforms/Utils/SSI.cpp llvm/trunk/lib/VMCore/Pass.cpp llvm/trunk/lib/VMCore/PassManager.cpp llvm/trunk/lib/VMCore/PassRegistry.cpp llvm/trunk/lib/VMCore/PrintModulePass.cpp llvm/trunk/lib/VMCore/Verifier.cpp llvm/trunk/tools/bugpoint/ExtractFunction.cpp llvm/trunk/tools/bugpoint/TestPasses.cpp llvm/trunk/tools/bugpoint/bugpoint.cpp llvm/trunk/tools/llvm-prof/llvm-prof.cpp llvm/trunk/tools/opt/AnalysisWrappers.cpp llvm/trunk/tools/opt/GraphPrinters.cpp llvm/trunk/tools/opt/PrintSCC.cpp llvm/trunk/tools/opt/opt.cpp llvm/trunk/unittests/VMCore/PassManagerTest.cpp Modified: llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h (original) +++ llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h Thu Aug 5 18:42:04 2010 @@ -22,7 +22,7 @@ struct DOTGraphTraitsViewer : public FunctionPass { std::string Name; - DOTGraphTraitsViewer(std::string GraphName, const void *ID) : FunctionPass(ID) { + DOTGraphTraitsViewer(std::string GraphName, char &ID) : FunctionPass(ID) { Name = GraphName; } @@ -48,7 +48,7 @@ std::string Name; - DOTGraphTraitsPrinter(std::string GraphName, const void *ID) + DOTGraphTraitsPrinter(std::string GraphName, char &ID) : FunctionPass(ID) { Name = GraphName; } Modified: llvm/trunk/include/llvm/Analysis/Dominators.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/Dominators.h (original) +++ llvm/trunk/include/llvm/Analysis/Dominators.h Thu Aug 5 18:42:04 2010 @@ -702,7 +702,7 @@ static char ID; // Pass ID, replacement for typeid DominatorTreeBase* DT; - DominatorTree() : FunctionPass(&ID) { + DominatorTree() : FunctionPass(ID) { DT = new DominatorTreeBase(false); } @@ -890,7 +890,7 @@ const bool IsPostDominators; public: - DominanceFrontierBase(void *ID, bool isPostDom) + DominanceFrontierBase(char &ID, bool isPostDom) : FunctionPass(ID), IsPostDominators(isPostDom) {} /// getRoots - Return the root blocks of the current CFG. This may include @@ -1009,7 +1009,7 @@ public: static char ID; // Pass ID, replacement for typeid DominanceFrontier() : - DominanceFrontierBase(&ID, false) {} + DominanceFrontierBase(ID, false) {} BasicBlock *getRoot() const { assert(Roots.size() == 1 && "Should always have entry node!"); Modified: llvm/trunk/include/llvm/Analysis/FindUsedTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/FindUsedTypes.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/FindUsedTypes.h (original) +++ llvm/trunk/include/llvm/Analysis/FindUsedTypes.h Thu Aug 5 18:42:04 2010 @@ -26,7 +26,7 @@ std::set UsedTypes; public: static char ID; // Pass identification, replacement for typeid - FindUsedTypes() : ModulePass(&ID) {} + FindUsedTypes() : ModulePass(ID) {} /// getTypes - After the pass has been run, return the set containing all of /// the types used in the module. Modified: llvm/trunk/include/llvm/Analysis/IntervalPartition.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/IntervalPartition.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/IntervalPartition.h (original) +++ llvm/trunk/include/llvm/Analysis/IntervalPartition.h Thu Aug 5 18:42:04 2010 @@ -48,7 +48,7 @@ public: static char ID; // Pass identification, replacement for typeid - IntervalPartition() : FunctionPass(&ID), RootInterval(0) {} + IntervalPartition() : FunctionPass(ID), RootInterval(0) {} // run - Calculate the interval partition for this function virtual bool runOnFunction(Function &F); Modified: llvm/trunk/include/llvm/Analysis/LazyValueInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LazyValueInfo.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LazyValueInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LazyValueInfo.h Thu Aug 5 18:42:04 2010 @@ -31,7 +31,7 @@ void operator=(const LazyValueInfo&); // DO NOT IMPLEMENT. public: static char ID; - LazyValueInfo() : FunctionPass(&ID), PImpl(0) {} + LazyValueInfo() : FunctionPass(ID), PImpl(0) {} ~LazyValueInfo() { assert(PImpl == 0 && "releaseMemory not called"); } /// Tristate - This is used to return true/false/dunno results. Modified: llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h Thu Aug 5 18:42:04 2010 @@ -28,9 +28,9 @@ LibCallInfo *LCI; explicit LibCallAliasAnalysis(LibCallInfo *LC = 0) - : FunctionPass(&ID), LCI(LC) { + : FunctionPass(ID), LCI(LC) { } - explicit LibCallAliasAnalysis(const void *ID, LibCallInfo *LC) + explicit LibCallAliasAnalysis(char &ID, LibCallInfo *LC) : FunctionPass(ID), LCI(LC) { } ~LibCallAliasAnalysis(); @@ -55,8 +55,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(const void *PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h Thu Aug 5 18:42:04 2010 @@ -91,7 +91,7 @@ public: static char ID; // Class identification, replacement for typeinfo - LoopDependenceAnalysis() : LoopPass(&ID) {} + LoopDependenceAnalysis() : LoopPass(ID) {} /// isDependencePair - Check whether two values can possibly give rise to /// a data dependence: that is the case if both are instructions accessing Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Thu Aug 5 18:42:04 2010 @@ -940,7 +940,7 @@ public: static char ID; // Pass identification, replacement for typeid - LoopInfo() : FunctionPass(&ID) {} + LoopInfo() : FunctionPass(ID) {} LoopInfoBase& getBase() { return LI; } Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopPass.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopPass.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopPass.h Thu Aug 5 18:42:04 2010 @@ -28,8 +28,7 @@ class LoopPass : public Pass { public: - explicit LoopPass(intptr_t pid) : Pass(PT_Loop, pid) {} - explicit LoopPass(void *pid) : Pass(PT_Loop, pid) {} + explicit LoopPass(char &pid) : Pass(PT_Loop, pid) {} /// getPrinterPass - Get a pass to print the function corresponding /// to a Loop. Modified: llvm/trunk/include/llvm/Analysis/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Passes.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/Passes.h (original) +++ llvm/trunk/include/llvm/Analysis/Passes.h Thu Aug 5 18:42:04 2010 @@ -92,7 +92,7 @@ // file. // ModulePass *createProfileLoaderPass(); - extern const PassInfo *ProfileLoaderPassID; + extern char &ProfileLoaderPassID; //===--------------------------------------------------------------------===// // @@ -106,7 +106,7 @@ // instead of loading it from a previous run. // FunctionPass *createProfileEstimatorPass(); - extern const PassInfo *ProfileEstimatorPassID; + extern char &ProfileEstimatorPassID; //===--------------------------------------------------------------------===// // Modified: llvm/trunk/include/llvm/Analysis/PostDominators.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/PostDominators.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/PostDominators.h (original) +++ llvm/trunk/include/llvm/Analysis/PostDominators.h Thu Aug 5 18:42:04 2010 @@ -25,7 +25,7 @@ static char ID; // Pass identification, replacement for typeid DominatorTreeBase* DT; - PostDominatorTree() : FunctionPass(&ID) { + PostDominatorTree() : FunctionPass(ID) { DT = new DominatorTreeBase(true); } @@ -106,7 +106,7 @@ struct PostDominanceFrontier : public DominanceFrontierBase { static char ID; PostDominanceFrontier() - : DominanceFrontierBase(&ID, true) {} + : DominanceFrontierBase(ID, true) {} virtual bool runOnFunction(Function &) { Frontiers.clear(); Modified: llvm/trunk/include/llvm/CallGraphSCCPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CallGraphSCCPass.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/CallGraphSCCPass.h (original) +++ llvm/trunk/include/llvm/CallGraphSCCPass.h Thu Aug 5 18:42:04 2010 @@ -33,8 +33,7 @@ class CallGraphSCCPass : public Pass { public: - explicit CallGraphSCCPass(intptr_t pid) : Pass(PT_CallGraphSCC, pid) {} - explicit CallGraphSCCPass(void *pid) : Pass(PT_CallGraphSCC, pid) {} + explicit CallGraphSCCPass(char &pid) : Pass(PT_CallGraphSCC, pid) {} /// createPrinterPass - Get a pass that prints the Module /// corresponding to a CallGraph. Modified: llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h (original) +++ llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h Thu Aug 5 18:42:04 2010 @@ -23,7 +23,7 @@ public: static char ID; - CalculateSpillWeights() : MachineFunctionPass(&ID) {} + CalculateSpillWeights() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Thu Aug 5 18:42:04 2010 @@ -68,7 +68,7 @@ public: static char ID; // Pass identification, replacement for typeid - LiveIntervals() : MachineFunctionPass(&ID) {} + LiveIntervals() : MachineFunctionPass(ID) {} // Calculate the spill weight to assign to a single instruction. static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth); Modified: llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h Thu Aug 5 18:42:04 2010 @@ -39,7 +39,7 @@ public: static char ID; // Pass identification, replacement for typeid - LiveStacks() : MachineFunctionPass(&ID) {} + LiveStacks() : MachineFunctionPass(ID) {} typedef SS2IntervalMap::iterator iterator; typedef SS2IntervalMap::const_iterator const_iterator; Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveVariables.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveVariables.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveVariables.h Thu Aug 5 18:42:04 2010 @@ -46,7 +46,7 @@ class LiveVariables : public MachineFunctionPass { public: static char ID; // Pass identification, replacement for typeid - LiveVariables() : MachineFunctionPass(&ID) {} + LiveVariables() : MachineFunctionPass(ID) {} /// VarInfo - This represents the regions where a virtual register is live in /// the program. We represent this with three different pieces of Modified: llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h Thu Aug 5 18:42:04 2010 @@ -31,8 +31,7 @@ /// override runOnMachineFunction. class MachineFunctionPass : public FunctionPass { protected: - explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {} - explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {} + explicit MachineFunctionPass(char &ID) : FunctionPass(ID) {} /// runOnMachineFunction - This method must be overloaded to perform the /// desired machine code transformation or analysis. Modified: llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h Thu Aug 5 18:42:04 2010 @@ -67,7 +67,7 @@ public: static char ID; // Pass identification, replacement for typeid - MachineLoopInfo() : MachineFunctionPass(&ID) {} + MachineLoopInfo() : MachineFunctionPass(ID) {} LoopInfoBase& getBase() { return LI; } Modified: llvm/trunk/include/llvm/CodeGen/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) +++ llvm/trunk/include/llvm/CodeGen/Passes.h Thu Aug 5 18:42:04 2010 @@ -43,18 +43,18 @@ /// MachineLoopInfo pass - This pass is a loop analysis pass. /// - extern const PassInfo *const MachineLoopInfoID; + extern char &MachineLoopInfoID; /// MachineDominators pass - This pass is a machine dominators analysis pass. /// - extern const PassInfo *const MachineDominatorsID; + extern char &MachineDominatorsID; /// PHIElimination pass - This pass eliminates machine instruction PHI nodes /// by inserting copy instructions. This destroys SSA information, but is the /// desired input for some register allocators. This pass is "required" by /// these register allocator like this: AU.addRequiredID(PHIEliminationID); /// - extern const PassInfo *const PHIEliminationID; + extern char &PHIEliminationID; /// StrongPHIElimination pass - This pass eliminates machine instruction PHI /// nodes by inserting copy instructions. This destroys SSA information, but @@ -62,23 +62,23 @@ /// "required" by these register allocator like this: /// AU.addRequiredID(PHIEliminationID); /// This pass is still in development - extern const PassInfo *const StrongPHIEliminationID; + extern char &StrongPHIEliminationID; - extern const PassInfo *const PreAllocSplittingID; + extern char &PreAllocSplittingID; /// SimpleRegisterCoalescing pass. Aggressively coalesces every register /// copy it can. /// - extern const PassInfo *const SimpleRegisterCoalescingID; + extern char &SimpleRegisterCoalescingID; /// TwoAddressInstruction pass - This pass reduces two-address instructions to /// use two operands. This destroys SSA information but it is desired by /// register allocators. - extern const PassInfo *const TwoAddressInstructionPassID; + extern char &TwoAddressInstructionPassID; /// UnreachableMachineBlockElimination pass - This pass removes unreachable /// machine basic blocks. - extern const PassInfo *const UnreachableMachineBlockElimID; + extern char &UnreachableMachineBlockElimID; /// DeadMachineInstructionElim pass - This pass removes dead machine /// instructions. Modified: llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h (original) +++ llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h Thu Aug 5 18:42:04 2010 @@ -31,7 +31,7 @@ public: static char ID; - ProcessImplicitDefs() : MachineFunctionPass(&ID) {} + ProcessImplicitDefs() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/include/llvm/CodeGen/SlotIndexes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SlotIndexes.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SlotIndexes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SlotIndexes.h Thu Aug 5 18:42:04 2010 @@ -475,7 +475,7 @@ public: static char ID; - SlotIndexes() : MachineFunctionPass(&ID), indexListHead(0) {} + SlotIndexes() : MachineFunctionPass(ID), indexListHead(0) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; virtual void releaseMemory(); Modified: llvm/trunk/include/llvm/Pass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Pass.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Pass.h (original) +++ llvm/trunk/include/llvm/Pass.h Thu Aug 5 18:42:04 2010 @@ -50,7 +50,7 @@ class StringRef; // AnalysisID - Use the PassInfo to identify a pass... -typedef const PassInfo* AnalysisID; +typedef const void* AnalysisID; /// Different types of internal pass managers. External pass managers /// (PassManager and FunctionPassManager) are not represented here. @@ -82,14 +82,13 @@ /// class Pass { AnalysisResolver *Resolver; // Used to resolve analysis - intptr_t PassID; + const void *PassID; PassKind Kind; void operator=(const Pass&); // DO NOT IMPLEMENT Pass(const Pass &); // DO NOT IMPLEMENT public: - explicit Pass(PassKind K, intptr_t pid); - explicit Pass(PassKind K, const void *pid); + explicit Pass(PassKind K, char &pid); virtual ~Pass(); @@ -101,10 +100,10 @@ /// virtual const char *getPassName() const; - /// getPassInfo - Return the PassInfo data structure that corresponds to this - /// pass... If the pass has not been registered, this will return null. - /// - const PassInfo *getPassInfo() const; + /// getPassID - Return the PassID number that corresponds to this pass. + virtual AnalysisID getPassID() const { + return PassID; + } /// print - Print out the internal state of the pass. This is called by /// Analyze to print out the contents of an analysis. Otherwise it is not @@ -159,7 +158,7 @@ /// an analysis interface through multiple inheritance. If needed, it should /// override this to adjust the this pointer as needed for the specified pass /// info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *); + virtual void *getAdjustedAnalysisPointer(AnalysisID ID); virtual ImmutablePass *getAsImmutablePass(); virtual PMDataManager *getAsPMDataManager(); @@ -170,14 +169,9 @@ // dumpPassStructure - Implement the -debug-passes=PassStructure option virtual void dumpPassStructure(unsigned Offset = 0); - template - static const PassInfo *getClassPassInfo() { - return lookupPassInfo(intptr_t(&AnalysisClass::ID)); - } - // lookupPassInfo - Return the pass info object for the specified pass class, // or null if it is not known. - static const PassInfo *lookupPassInfo(intptr_t TI); + static const PassInfo *lookupPassInfo(const void *TI); // lookupPassInfo - Return the pass info object for the pass with the given // argument string, or null if it is not known. @@ -200,7 +194,7 @@ /// don't have the class name available (use getAnalysisIfAvailable if you /// do), but it can tell you if you need to preserve the pass at least. /// - bool mustPreserveAnalysisID(const PassInfo *AnalysisID) const; + bool mustPreserveAnalysisID(char &AID) const; /// getAnalysis() - This function is used by subclasses to get /// to the analysis information that they claim to use by overriding the @@ -213,10 +207,10 @@ AnalysisType &getAnalysis(Function &F); // Defined in PassAnalysisSupport.h template - AnalysisType &getAnalysisID(const PassInfo *PI) const; + AnalysisType &getAnalysisID(AnalysisID PI) const; template - AnalysisType &getAnalysisID(const PassInfo *PI, Function &F); + AnalysisType &getAnalysisID(AnalysisID PI, Function &F); }; @@ -240,8 +234,7 @@ /// Return what kind of Pass Manager can manage this pass. virtual PassManagerType getPotentialPassManagerType() const; - explicit ModulePass(intptr_t pid) : Pass(PT_Module, pid) {} - explicit ModulePass(const void *pid) : Pass(PT_Module, pid) {} + explicit ModulePass(char &pid) : Pass(PT_Module, pid) {} // Force out-of-line virtual method. virtual ~ModulePass(); }; @@ -268,8 +261,7 @@ /// bool runOnModule(Module &) { return false; } - explicit ImmutablePass(intptr_t pid) : ModulePass(pid) {} - explicit ImmutablePass(const void *pid) + explicit ImmutablePass(char &pid) : ModulePass(pid) {} // Force out-of-line virtual method. @@ -287,8 +279,7 @@ /// class FunctionPass : public Pass { public: - explicit FunctionPass(intptr_t pid) : Pass(PT_Function, pid) {} - explicit FunctionPass(const void *pid) : Pass(PT_Function, pid) {} + explicit FunctionPass(char &pid) : Pass(PT_Function, pid) {} /// createPrinterPass - Get a function printer pass. Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const; @@ -340,8 +331,7 @@ /// class BasicBlockPass : public Pass { public: - explicit BasicBlockPass(intptr_t pid) : Pass(PT_BasicBlock, pid) {} - explicit BasicBlockPass(const void *pid) : Pass(PT_BasicBlock, pid) {} + explicit BasicBlockPass(char &pid) : Pass(PT_BasicBlock, pid) {} /// createPrinterPass - Get a function printer pass. Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const; Modified: llvm/trunk/include/llvm/PassAnalysisSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassAnalysisSupport.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassAnalysisSupport.h (original) +++ llvm/trunk/include/llvm/PassAnalysisSupport.h Thu Aug 5 18:42:04 2010 @@ -49,34 +49,37 @@ // addRequired - Add the specified ID to the required set of the usage info // for a pass. // - AnalysisUsage &addRequiredID(AnalysisID ID); + AnalysisUsage &addRequiredID(const void *ID); + AnalysisUsage &addRequiredID(char &ID); template AnalysisUsage &addRequired() { - return addRequiredID(Pass::getClassPassInfo()); + return addRequiredID(PassClass::ID); } - AnalysisUsage &addRequiredTransitiveID(AnalysisID ID); + AnalysisUsage &addRequiredTransitiveID(char &ID); template AnalysisUsage &addRequiredTransitive() { - AnalysisID ID = Pass::getClassPassInfo(); - return addRequiredTransitiveID(ID); + return addRequiredTransitiveID(PassClass::ID); } // addPreserved - Add the specified ID to the set of analyses preserved by // this pass // - AnalysisUsage &addPreservedID(AnalysisID ID) { + AnalysisUsage &addPreservedID(const void *ID) { Preserved.push_back(ID); return *this; } + AnalysisUsage &addPreservedID(char &ID) { + Preserved.push_back(&ID); + return *this; + } // addPreserved - Add the specified Pass class to the set of analyses // preserved by this pass. // template AnalysisUsage &addPreserved() { - assert(Pass::getClassPassInfo() && "Pass class not registered!"); - Preserved.push_back(Pass::getClassPassInfo()); + Preserved.push_back(&PassClass::ID); return *this; } @@ -85,12 +88,7 @@ // This can be useful when a pass is trivially preserved, but may not be // linked in. Be careful about spelling! // - AnalysisUsage &addPreserved(StringRef Arg) { - const PassInfo *PI = Pass::lookupPassInfo(Arg); - // If the pass exists, preserve it. Otherwise silently do nothing. - if (PI) Preserved.push_back(PI); - return *this; - } + AnalysisUsage &addPreserved(StringRef Arg); // setPreservesAll - Set by analyses that do not transform their input at all void setPreservesAll() { PreservesAll = true; } @@ -130,7 +128,7 @@ inline PMDataManager &getPMDataManager() { return PM; } // Find pass that is implementing PI. - Pass *findImplPass(const PassInfo *PI) { + Pass *findImplPass(AnalysisID PI) { Pass *ResultPass = 0; for (unsigned i = 0; i < AnalysisImpls.size() ; ++i) { if (AnalysisImpls[i].first == PI) { @@ -142,10 +140,10 @@ } // Find pass that is implementing PI. Initialize pass for Function F. - Pass *findImplPass(Pass *P, const PassInfo *PI, Function &F); + Pass *findImplPass(Pass *P, AnalysisID PI, Function &F); - void addAnalysisImplsPair(const PassInfo *PI, Pass *P) { - std::pair pir = std::make_pair(PI,P); + void addAnalysisImplsPair(AnalysisID PI, Pass *P) { + std::pair pir = std::make_pair(PI,P); AnalysisImpls.push_back(pir); } @@ -160,7 +158,7 @@ // AnalysisImpls - This keeps track of which passes implements the interfaces // that are required by the current pass (to implement getAnalysis()). - std::vector > AnalysisImpls; + std::vector > AnalysisImpls; private: // PassManager that is used to resolve analysis info @@ -179,8 +177,7 @@ AnalysisType *Pass::getAnalysisIfAvailable() const { assert(Resolver && "Pass not resident in a PassManager object!"); - const PassInfo *PI = getClassPassInfo(); - if (PI == 0) return 0; + const void *PI = &AnalysisType::ID; Pass *ResultPass = Resolver->getAnalysisIfAvailable(PI, true); if (ResultPass == 0) return 0; @@ -199,11 +196,11 @@ template AnalysisType &Pass::getAnalysis() const { assert(Resolver && "Pass has not been inserted into a PassManager object!"); - return getAnalysisID(getClassPassInfo()); + return getAnalysisID(&AnalysisType::ID); } template -AnalysisType &Pass::getAnalysisID(const PassInfo *PI) const { +AnalysisType &Pass::getAnalysisID(AnalysisID PI) const { assert(PI && "getAnalysis for unregistered pass!"); assert(Resolver&&"Pass has not been inserted into a PassManager object!"); // PI *must* appear in AnalysisImpls. Because the number of passes used @@ -229,11 +226,11 @@ AnalysisType &Pass::getAnalysis(Function &F) { assert(Resolver &&"Pass has not been inserted into a PassManager object!"); - return getAnalysisID(getClassPassInfo(), F); + return getAnalysisID(&AnalysisType::ID, F); } template -AnalysisType &Pass::getAnalysisID(const PassInfo *PI, Function &F) { +AnalysisType &Pass::getAnalysisID(AnalysisID PI, Function &F) { assert(PI && "getAnalysis for unregistered pass!"); assert(Resolver && "Pass has not been inserted into a PassManager object!"); // PI *must* appear in AnalysisImpls. Because the number of passes used Modified: llvm/trunk/include/llvm/PassManagers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassManagers.h (original) +++ llvm/trunk/include/llvm/PassManagers.h Thu Aug 5 18:42:04 2010 @@ -302,7 +302,7 @@ /// through getAnalysis interface. virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass); - virtual Pass *getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F); + virtual Pass *getOnTheFlyPass(Pass *P, AnalysisID PI, Function &F); /// Initialize available analysis information. void initializeAnalysisInfo() { @@ -414,7 +414,7 @@ public: static char ID; explicit FPPassManager(int Depth) - : ModulePass(&ID), PMDataManager(Depth) { } + : ModulePass(ID), PMDataManager(Depth) { } /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. Modified: llvm/trunk/include/llvm/PassRegistry.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassRegistry.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassRegistry.h (original) +++ llvm/trunk/include/llvm/PassRegistry.h Thu Aug 5 18:42:04 2010 @@ -34,7 +34,7 @@ mutable sys::SmartMutex Lock; /// PassInfoMap - Keep track of the PassInfo object for each registered pass. - typedef std::map MapType; + typedef std::map MapType; MapType PassInfoMap; typedef StringMap StringMapType; @@ -51,14 +51,14 @@ public: static PassRegistry *getPassRegistry(); - const PassInfo *getPassInfo(intptr_t TI) const; + const PassInfo *getPassInfo(const void *TI) const; const PassInfo *getPassInfo(StringRef Arg) const; void registerPass(const PassInfo &PI); void unregisterPass(const PassInfo &PI); /// Analysis Group Mechanisms. - void registerAnalysisGroup(intptr_t InterfaceID, intptr_t PassID, + void registerAnalysisGroup(const void *InterfaceID, const void *PassID, PassInfo& Registeree, bool isDefault); void enumerateWith(PassRegistrationListener *L); Modified: llvm/trunk/include/llvm/PassSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassSupport.h (original) +++ llvm/trunk/include/llvm/PassSupport.h Thu Aug 5 18:42:04 2010 @@ -41,7 +41,7 @@ private: const char *const PassName; // Nice name for Pass const char *const PassArgument; // Command Line argument to run this pass - const intptr_t PassID; + const void *PassID; const bool IsCFGOnlyPass; // Pass only looks at the CFG. const bool IsAnalysis; // True if an analysis pass. const bool IsAnalysisGroup; // True if an analysis group. @@ -52,7 +52,7 @@ public: /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. - PassInfo(const char *name, const char *arg, intptr_t pi, + PassInfo(const char *name, const char *arg, const void *pi, NormalCtor_t normal = 0, bool isCFGOnly = false, bool is_analysis = false) : PassName(name), PassArgument(arg), PassID(pi), @@ -63,7 +63,7 @@ /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. This version is for use by analysis groups; it /// does not auto-register the pass. - PassInfo(const char *name, intptr_t pi) + PassInfo(const char *name, const void *pi) : PassName(name), PassArgument(""), PassID(pi), IsCFGOnlyPass(false), IsAnalysis(false), IsAnalysisGroup(true), NormalCtor(0) { @@ -81,11 +81,11 @@ /// getTypeInfo - Return the id object for the pass... /// TODO : Rename - intptr_t getTypeInfo() const { return PassID; } + const void *getTypeInfo() const { return PassID; } /// Return true if this PassID implements the specified ID pointer. - bool isPassID(void *IDPtr) const { - return PassID == (intptr_t)IDPtr; + bool isPassID(const void *IDPtr) const { + return PassID == IDPtr; } /// isAnalysisGroup - Return true if this is an analysis group, not a normal @@ -161,7 +161,7 @@ // Register Pass using default constructor... RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false, bool is_analysis = false) - : PassInfo(Name, PassArg, intptr_t(&passName::ID), + : PassInfo(Name, PassArg, &passName::ID, PassInfo::NormalCtor_t(callDefaultCtor), CFGOnly, is_analysis) { @@ -191,8 +191,8 @@ class RegisterAGBase : public PassInfo { protected: RegisterAGBase(const char *Name, - intptr_t InterfaceID, - intptr_t PassID = 0, + const void *InterfaceID, + const void *PassID = 0, bool isDefault = false); }; @@ -200,12 +200,12 @@ struct RegisterAnalysisGroup : public RegisterAGBase { explicit RegisterAnalysisGroup(PassInfo &RPB) : RegisterAGBase(RPB.getPassName(), - intptr_t(&Interface::ID), RPB.getTypeInfo(), + &Interface::ID, RPB.getTypeInfo(), Default) { } explicit RegisterAnalysisGroup(const char *Name) - : RegisterAGBase(Name, intptr_t(&Interface::ID)) { + : RegisterAGBase(Name, &Interface::ID) { } }; Modified: llvm/trunk/include/llvm/Target/TargetData.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetData.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetData.h (original) +++ llvm/trunk/include/llvm/Target/TargetData.h Thu Aug 5 18:42:04 2010 @@ -110,7 +110,7 @@ /// Constructs a TargetData from a specification string. See init(). explicit TargetData(StringRef TargetDescription) - : ImmutablePass(&ID) { + : ImmutablePass(ID) { init(TargetDescription); } @@ -118,7 +118,7 @@ explicit TargetData(const Module *M); TargetData(const TargetData &TD) : - ImmutablePass(&ID), + ImmutablePass(ID), LittleEndian(TD.isLittleEndian()), PointerMemSize(TD.PointerMemSize), PointerABIAlign(TD.PointerABIAlign), Modified: llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h (original) +++ llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h Thu Aug 5 18:42:04 2010 @@ -30,8 +30,8 @@ /// perform the inlining operations that do not depend on the policy. /// struct Inliner : public CallGraphSCCPass { - explicit Inliner(void *ID); - explicit Inliner(void *ID, int Threshold); + explicit Inliner(char &ID); + explicit Inliner(char &ID, int Threshold); /// getAnalysisUsage - For this class, we declare that we require and preserve /// the call graph. If the derived class implements this method, it should Modified: llvm/trunk/include/llvm/Transforms/Scalar.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Scalar.h (original) +++ llvm/trunk/include/llvm/Transforms/Scalar.h Thu Aug 5 18:42:04 2010 @@ -149,7 +149,7 @@ // ret i32 %Y // FunctionPass *createPromoteMemoryToRegisterPass(); -extern const PassInfo *const PromoteMemoryToRegisterID; +extern char &PromoteMemoryToRegisterID; //===----------------------------------------------------------------------===// // @@ -158,7 +158,7 @@ // hacking easier. // FunctionPass *createDemoteRegisterToMemoryPass(); -extern const PassInfo *const DemoteRegisterToMemoryID; +extern char &DemoteRegisterToMemoryID; //===----------------------------------------------------------------------===// // @@ -202,7 +202,7 @@ // (set, immediate dominators, tree, and frontier) information. // FunctionPass *createBreakCriticalEdgesPass(); -extern const PassInfo *const BreakCriticalEdgesID; +extern char &BreakCriticalEdgesID; //===----------------------------------------------------------------------===// // @@ -213,7 +213,7 @@ // AU.addRequiredID(LoopSimplifyID); // Pass *createLoopSimplifyPass(); -extern const PassInfo *const LoopSimplifyID; +extern char &LoopSimplifyID; //===----------------------------------------------------------------------===// // @@ -228,7 +228,7 @@ // chained binary branch instructions. // FunctionPass *createLowerSwitchPass(); -extern const PassInfo *const LowerSwitchID; +extern char &LowerSwitchID; //===----------------------------------------------------------------------===// // @@ -243,7 +243,7 @@ FunctionPass *createLowerInvokePass(const TargetLowering *TLI = 0); FunctionPass *createLowerInvokePass(const TargetLowering *TLI, bool useExpensiveEHSupport); -extern const PassInfo *const LowerInvokePassID; +extern char &LowerInvokePassID; //===----------------------------------------------------------------------===// // @@ -258,7 +258,7 @@ // optimizations. // Pass *createLCSSAPass(); -extern const PassInfo *const LCSSAID; +extern char &LCSSAID; //===----------------------------------------------------------------------===// // @@ -304,7 +304,7 @@ // InstructionNamer - Give any unnamed non-void instructions "tmp" names. // FunctionPass *createInstructionNamerPass(); -extern const PassInfo *const InstructionNamerID; +extern char &InstructionNamerID; //===----------------------------------------------------------------------===// // Modified: llvm/trunk/include/llvm/Transforms/Utils/SSI.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/SSI.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/SSI.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/SSI.h Thu Aug 5 18:42:04 2010 @@ -39,7 +39,7 @@ public: static char ID; // Pass identification, replacement for typeid. SSI() : - FunctionPass(&ID) { + FunctionPass(ID) { } void getAnalysisUsage(AnalysisUsage &AU) const; Modified: llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h Thu Aug 5 18:42:04 2010 @@ -26,7 +26,7 @@ BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock; public: static char ID; // Pass identification, replacement for typeid - UnifyFunctionExitNodes() : FunctionPass(&ID), + UnifyFunctionExitNodes() : FunctionPass(ID), ReturnBlock(0), UnwindBlock(0) {} // We can preserve non-critical-edgeness when we unify function exit nodes Modified: llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp Thu Aug 5 18:42:04 2010 @@ -34,7 +34,7 @@ Module *M; public: static char ID; // Class identification, replacement for typeinfo - AliasAnalysisCounter() : ModulePass(&ID) { + AliasAnalysisCounter() : ModulePass(ID) { No = May = Must = 0; NoMR = JustRef = JustMod = MR = 0; } @@ -87,8 +87,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Thu Aug 5 18:42:04 2010 @@ -50,7 +50,7 @@ public: static char ID; // Pass identification, replacement for typeid - AAEval() : FunctionPass(&ID) {} + AAEval() : FunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Analysis/AliasDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasDebugger.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasDebugger.cpp (original) +++ llvm/trunk/lib/Analysis/AliasDebugger.cpp Thu Aug 5 18:42:04 2010 @@ -39,7 +39,7 @@ public: static char ID; // Class identification, replacement for typeinfo - AliasDebugger() : ModulePass(&ID) {} + AliasDebugger() : ModulePass(ID) {} bool runOnModule(Module &M) { InitializeAliasAnalysis(this); // set up super class @@ -83,8 +83,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original) +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Thu Aug 5 18:42:04 2010 @@ -579,7 +579,7 @@ AliasSetTracker *Tracker; public: static char ID; // Pass identification, replacement for typeid - AliasSetPrinter() : FunctionPass(&ID) {} + AliasSetPrinter() : FunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Thu Aug 5 18:42:04 2010 @@ -137,8 +137,8 @@ /// struct NoAA : public ImmutablePass, public AliasAnalysis { static char ID; // Class identification, replacement for typeinfo - NoAA() : ImmutablePass(&ID) {} - explicit NoAA(void *PID) : ImmutablePass(PID) { } + NoAA() : ImmutablePass(ID) {} + explicit NoAA(char &PID) : ImmutablePass(PID) { } virtual void getAnalysisUsage(AnalysisUsage &AU) const { } @@ -169,8 +169,8 @@ /// an analysis interface through multiple inheritance. If needed, it should /// override this to adjust the this pointer as needed for the specified pass /// info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } @@ -215,7 +215,7 @@ /// derives from the NoAA class. struct BasicAliasAnalysis : public NoAA { static char ID; // Class identification, replacement for typeinfo - BasicAliasAnalysis() : NoAA(&ID) {} + BasicAliasAnalysis() : NoAA(ID) {} AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size) { @@ -240,8 +240,8 @@ /// an analysis interface through multiple inheritance. If needed, it should /// override this to adjust the this pointer as needed for the specified pass /// info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/CFGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFGPrinter.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/CFGPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/CFGPrinter.cpp Thu Aug 5 18:42:04 2010 @@ -25,7 +25,7 @@ namespace { struct CFGViewer : public FunctionPass { static char ID; // Pass identifcation, replacement for typeid - CFGViewer() : FunctionPass(&ID) {} + CFGViewer() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { F.viewCFG(); @@ -46,7 +46,7 @@ namespace { struct CFGOnlyViewer : public FunctionPass { static char ID; // Pass identifcation, replacement for typeid - CFGOnlyViewer() : FunctionPass(&ID) {} + CFGOnlyViewer() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { F.viewCFGOnly(); @@ -68,8 +68,8 @@ namespace { struct CFGPrinter : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGPrinter() : FunctionPass(&ID) {} - explicit CFGPrinter(void *pid) : FunctionPass(pid) {} + CFGPrinter() : FunctionPass(ID) {} + explicit CFGPrinter(char &pid) : FunctionPass(pid) {} virtual bool runOnFunction(Function &F) { std::string Filename = "cfg." + F.getNameStr() + ".dot"; @@ -101,8 +101,8 @@ namespace { struct CFGOnlyPrinter : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGOnlyPrinter() : FunctionPass(&ID) {} - explicit CFGOnlyPrinter(void *pid) : FunctionPass(pid) {} + CFGOnlyPrinter() : FunctionPass(ID) {} + explicit CFGOnlyPrinter(char &pid) : FunctionPass(pid) {} virtual bool runOnFunction(Function &F) { std::string Filename = "cfg." + F.getNameStr() + ".dot"; errs() << "Writing '" << Filename << "'..."; Modified: llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp Thu Aug 5 18:42:04 2010 @@ -40,7 +40,7 @@ void printVariableDeclaration(const Value *V); public: static char ID; // Pass identification - PrintDbgInfo() : FunctionPass(&ID), Out(outs()) {} + PrintDbgInfo() : FunctionPass(ID), Out(outs()) {} virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/lib/Analysis/DomPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DomPrinter.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DomPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/DomPrinter.cpp Thu Aug 5 18:42:04 2010 @@ -86,27 +86,27 @@ struct DomViewer : public DOTGraphTraitsViewer { static char ID; - DomViewer() : DOTGraphTraitsViewer("dom", &ID){} + DomViewer() : DOTGraphTraitsViewer("dom", ID){} }; struct DomOnlyViewer : public DOTGraphTraitsViewer { static char ID; - DomOnlyViewer() : DOTGraphTraitsViewer("domonly", &ID){} + DomOnlyViewer() : DOTGraphTraitsViewer("domonly", ID){} }; struct PostDomViewer : public DOTGraphTraitsViewer { static char ID; PostDomViewer() : - DOTGraphTraitsViewer("postdom", &ID){} + DOTGraphTraitsViewer("postdom", ID){} }; struct PostDomOnlyViewer : public DOTGraphTraitsViewer { static char ID; PostDomOnlyViewer() : - DOTGraphTraitsViewer("postdomonly", &ID){} + DOTGraphTraitsViewer("postdomonly", ID){} }; } // end anonymous namespace @@ -133,27 +133,27 @@ struct DomPrinter : public DOTGraphTraitsPrinter { static char ID; - DomPrinter() : DOTGraphTraitsPrinter("dom", &ID) {} + DomPrinter() : DOTGraphTraitsPrinter("dom", ID) {} }; struct DomOnlyPrinter : public DOTGraphTraitsPrinter { static char ID; - DomOnlyPrinter() : DOTGraphTraitsPrinter("domonly", &ID) {} + DomOnlyPrinter() : DOTGraphTraitsPrinter("domonly", ID) {} }; struct PostDomPrinter : public DOTGraphTraitsPrinter { static char ID; PostDomPrinter() : - DOTGraphTraitsPrinter("postdom", &ID) {} + DOTGraphTraitsPrinter("postdom", ID) {} }; struct PostDomOnlyPrinter : public DOTGraphTraitsPrinter { static char ID; PostDomOnlyPrinter() : - DOTGraphTraitsPrinter("postdomonly", &ID) {} + DOTGraphTraitsPrinter("postdomonly", ID) {} }; } // end anonymous namespace Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Thu Aug 5 18:42:04 2010 @@ -42,7 +42,7 @@ public: static char ID; // Class identification, replacement for typeinfo - BasicCallGraph() : ModulePass(&ID), Root(0), + BasicCallGraph() : ModulePass(ID), Root(0), ExternalCallingNode(0), CallsExternalNode(0) {} // runOnModule - Compute the call graph for the specified module. @@ -86,8 +86,8 @@ /// an analysis interface through multiple inheritance. If needed, it should /// override this to adjust the this pointer as needed for the specified pass /// info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&CallGraph::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &CallGraph::ID) return (CallGraph*)this; return this; } Modified: llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp Thu Aug 5 18:42:04 2010 @@ -45,7 +45,7 @@ public: static char ID; explicit CGPassManager(int Depth) - : ModulePass(&ID), PMDataManager(Depth) { } + : ModulePass(ID), PMDataManager(Depth) { } /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. @@ -582,9 +582,9 @@ public: static char ID; - PrintCallGraphPass() : CallGraphSCCPass(&ID), Out(dbgs()) {} + PrintCallGraphPass() : CallGraphSCCPass(ID), Out(dbgs()) {} PrintCallGraphPass(const std::string &B, raw_ostream &o) - : CallGraphSCCPass(&ID), Banner(B), Out(o) {} + : CallGraphSCCPass(ID), Banner(B), Out(o) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp Thu Aug 5 18:42:04 2010 @@ -88,7 +88,7 @@ public: static char ID; - GlobalsModRef() : ModulePass(&ID) {} + GlobalsModRef() : ModulePass(ID) {} bool runOnModule(Module &M) { InitializeAliasAnalysis(this); // set up super class @@ -150,8 +150,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/IVUsers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IVUsers.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IVUsers.cpp (original) +++ llvm/trunk/lib/Analysis/IVUsers.cpp Thu Aug 5 18:42:04 2010 @@ -140,7 +140,7 @@ } IVUsers::IVUsers() - : LoopPass(&ID) { + : LoopPass(ID) { } void IVUsers::getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/lib/Analysis/InstCount.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstCount.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/InstCount.cpp (original) +++ llvm/trunk/lib/Analysis/InstCount.cpp Thu Aug 5 18:42:04 2010 @@ -51,7 +51,7 @@ } public: static char ID; // Pass identification, replacement for typeid - InstCount() : FunctionPass(&ID) {} + InstCount() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Analysis/IntervalPartition.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IntervalPartition.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IntervalPartition.cpp (original) +++ llvm/trunk/lib/Analysis/IntervalPartition.cpp Thu Aug 5 18:42:04 2010 @@ -91,7 +91,7 @@ // distinguish it from a copy constructor. Always pass in false for now. // IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) - : FunctionPass(&ID) { + : FunctionPass(ID) { assert(IP.getRootInterval() && "Cannot operate on empty IntervalPartitions!"); // Pass false to intervals_begin because we take ownership of it's memory Modified: llvm/trunk/lib/Analysis/Lint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Lint.cpp (original) +++ llvm/trunk/lib/Analysis/Lint.cpp Thu Aug 5 18:42:04 2010 @@ -108,7 +108,7 @@ raw_string_ostream MessagesStr; static char ID; // Pass identification, replacement for typeid - Lint() : FunctionPass(&ID), MessagesStr(Messages) {} + Lint() : FunctionPass(ID), MessagesStr(Messages) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Analysis/LiveValues.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LiveValues.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LiveValues.cpp (original) +++ llvm/trunk/lib/Analysis/LiveValues.cpp Thu Aug 5 18:42:04 2010 @@ -25,7 +25,7 @@ INITIALIZE_PASS(LiveValues, "live-values", "Value Liveness Analysis", false, true); -LiveValues::LiveValues() : FunctionPass(&ID) {} +LiveValues::LiveValues() : FunctionPass(ID) {} void LiveValues::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Analysis/LoopPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopPass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LoopPass.cpp (original) +++ llvm/trunk/lib/Analysis/LoopPass.cpp Thu Aug 5 18:42:04 2010 @@ -30,9 +30,9 @@ public: static char ID; - PrintLoopPass() : LoopPass(&ID), Out(dbgs()) {} + PrintLoopPass() : LoopPass(ID), Out(dbgs()) {} PrintLoopPass(const std::string &B, raw_ostream &o) - : LoopPass(&ID), Banner(B), Out(o) {} + : LoopPass(ID), Banner(B), Out(o) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -59,7 +59,7 @@ char LPPassManager::ID = 0; LPPassManager::LPPassManager(int Depth) - : FunctionPass(&ID), PMDataManager(Depth) { + : FunctionPass(ID), PMDataManager(Depth) { skipThisLoop = false; redoThisLoop = false; LI = NULL; Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Thu Aug 5 18:42:04 2010 @@ -50,7 +50,7 @@ "Memory Dependence Analysis", false, true); MemoryDependenceAnalysis::MemoryDependenceAnalysis() -: FunctionPass(&ID), PredCache(0) { +: FunctionPass(ID), PredCache(0) { } MemoryDependenceAnalysis::~MemoryDependenceAnalysis() { } Modified: llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp Thu Aug 5 18:42:04 2010 @@ -30,7 +30,7 @@ DebugInfoFinder Finder; public: static char ID; // Pass identification, replacement for typeid - ModuleDebugInfoPrinter() : ModulePass(&ID) {} + ModuleDebugInfoPrinter() : ModulePass(ID) {} virtual bool runOnModule(Module &M); Modified: llvm/trunk/lib/Analysis/PointerTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/PointerTracking.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/PointerTracking.cpp (original) +++ llvm/trunk/lib/Analysis/PointerTracking.cpp Thu Aug 5 18:42:04 2010 @@ -28,7 +28,7 @@ using namespace llvm; char PointerTracking::ID = 0; -PointerTracking::PointerTracking() : FunctionPass(&ID) {} +PointerTracking::PointerTracking() : FunctionPass(ID) {} bool PointerTracking::runOnFunction(Function &F) { predCache.clear(); Modified: llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp Thu Aug 5 18:42:04 2010 @@ -39,7 +39,7 @@ public: static char ID; // Class identification, replacement for typeinfo explicit ProfileEstimatorPass(const double execcount = 0) - : FunctionPass(&ID), ExecCount(execcount) { + : FunctionPass(ID), ExecCount(execcount) { if (execcount == 0) ExecCount = LoopWeight; } @@ -59,8 +59,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&ProfileInfo::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &ProfileInfo::ID) return (ProfileInfo*)this; return this; } @@ -78,7 +78,7 @@ static RegisterAnalysisGroup Y(X); namespace llvm { - const PassInfo *ProfileEstimatorPassID = &X; + char &ProfileEstimatorPassID = ProfileEstimatorPass::ID; FunctionPass *createProfileEstimatorPass() { return new ProfileEstimatorPass(); Modified: llvm/trunk/lib/Analysis/ProfileInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfo.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileInfo.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileInfo.cpp Thu Aug 5 18:42:04 2010 @@ -1076,14 +1076,14 @@ namespace { struct NoProfileInfo : public ImmutablePass, public ProfileInfo { static char ID; // Class identification, replacement for typeinfo - NoProfileInfo() : ImmutablePass(&ID) {} + NoProfileInfo() : ImmutablePass(ID) {} /// getAdjustedAnalysisPointer - This method is used when a pass implements /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&ProfileInfo::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &ProfileInfo::ID) return (ProfileInfo*)this; return this; } Modified: llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp Thu Aug 5 18:42:04 2010 @@ -45,7 +45,7 @@ public: static char ID; // Class identification, replacement for typeinfo explicit LoaderPass(const std::string &filename = "") - : ModulePass(&ID), Filename(filename) { + : ModulePass(ID), Filename(filename) { if (filename.empty()) Filename = ProfileInfoFilename; } @@ -67,8 +67,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&ProfileInfo::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &ProfileInfo::ID) return (ProfileInfo*)this; return this; } @@ -84,7 +84,7 @@ static RegisterAnalysisGroup Y(X); -const PassInfo *llvm::ProfileLoaderPassID = &X; +char &llvm::ProfileLoaderPassID = LoaderPass::ID; ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); } Modified: llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp Thu Aug 5 18:42:04 2010 @@ -59,10 +59,10 @@ public: static char ID; // Class identification, replacement for typeinfo - explicit ProfileVerifierPassT () : FunctionPass(&ID) { + explicit ProfileVerifierPassT () : FunctionPass(ID) { DisableAssertions = ProfileVerifierDisableAssertions; } - explicit ProfileVerifierPassT (bool da) : FunctionPass(&ID), + explicit ProfileVerifierPassT (bool da) : FunctionPass(ID), DisableAssertions(da) { } Modified: llvm/trunk/lib/Analysis/RegionInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionInfo.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/RegionInfo.cpp (original) +++ llvm/trunk/lib/Analysis/RegionInfo.cpp Thu Aug 5 18:42:04 2010 @@ -589,7 +589,7 @@ TopLevelRegion = 0; } -RegionInfo::RegionInfo() : FunctionPass(&ID) { +RegionInfo::RegionInfo() : FunctionPass(ID) { TopLevelRegion = 0; } Modified: llvm/trunk/lib/Analysis/RegionPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionPrinter.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/RegionPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/RegionPrinter.cpp Thu Aug 5 18:42:04 2010 @@ -121,7 +121,7 @@ struct RegionViewer : public DOTGraphTraitsViewer { static char ID; - RegionViewer() : DOTGraphTraitsViewer("reg", &ID){} + RegionViewer() : DOTGraphTraitsViewer("reg", ID){} }; char RegionViewer::ID = 0; @@ -131,7 +131,7 @@ struct RegionOnlyViewer : public DOTGraphTraitsViewer { static char ID; - RegionOnlyViewer() : DOTGraphTraitsViewer("regonly", &ID){} + RegionOnlyViewer() : DOTGraphTraitsViewer("regonly", ID){} }; char RegionOnlyViewer::ID = 0; @@ -143,7 +143,7 @@ : public DOTGraphTraitsPrinter { static char ID; RegionPrinter() : - DOTGraphTraitsPrinter("reg", &ID) {} + DOTGraphTraitsPrinter("reg", ID) {} }; } //end anonymous namespace @@ -157,7 +157,7 @@ : public DOTGraphTraitsPrinter { static char ID; RegionOnlyPrinter() : - DOTGraphTraitsPrinter("reg", &ID) {} + DOTGraphTraitsPrinter("reg", ID) {} }; } Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Thu Aug 5 18:42:04 2010 @@ -5742,7 +5742,7 @@ //===----------------------------------------------------------------------===// ScalarEvolution::ScalarEvolution() - : FunctionPass(&ID), FirstUnknown(0) { + : FunctionPass(ID), FirstUnknown(0) { } bool ScalarEvolution::runOnFunction(Function &F) { Modified: llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp Thu Aug 5 18:42:04 2010 @@ -34,14 +34,14 @@ public: static char ID; // Class identification, replacement for typeinfo - ScalarEvolutionAliasAnalysis() : FunctionPass(&ID), SE(0) {} + ScalarEvolutionAliasAnalysis() : FunctionPass(ID), SE(0) {} /// getAdjustedAnalysisPointer - This method is used when a pass implements /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Thu Aug 5 18:42:04 2010 @@ -82,14 +82,14 @@ public AliasAnalysis { public: static char ID; // Class identification, replacement for typeinfo - TypeBasedAliasAnalysis() : ImmutablePass(&ID) {} + TypeBasedAliasAnalysis() : ImmutablePass(ID) {} /// getAdjustedAnalysisPointer - This method is used when a pass implements /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(const void *PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp Thu Aug 5 18:42:04 2010 @@ -21,7 +21,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit WriteBitcodePass(raw_ostream &o) - : ModulePass(&ID), OS(o) {} + : ModulePass(ID), OS(o) {} const char *getPassName() const { return "Bitcode Writer"; } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Aug 5 18:42:04 2010 @@ -91,7 +91,7 @@ AsmPrinter::AsmPrinter(TargetMachine &tm, MCStreamer &Streamer) - : MachineFunctionPass(&ID), + : MachineFunctionPass(ID), TM(tm), MAI(tm.getMCAsmInfo()), OutContext(Streamer.getContext()), OutStreamer(Streamer), Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original) +++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Thu Aug 5 18:42:04 2010 @@ -65,7 +65,7 @@ public: static char ID; explicit BranchFolderPass(bool defaultEnableTailMerge) - : MachineFunctionPass(&ID), BranchFolder(defaultEnableTailMerge) {} + : MachineFunctionPass(ID), BranchFolder(defaultEnableTailMerge) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Control Flow Optimizer"; } Modified: llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp (original) +++ llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp Thu Aug 5 18:42:04 2010 @@ -36,7 +36,7 @@ public: static char ID; - CodePlacementOpt() : MachineFunctionPass(&ID) {} + CodePlacementOpt() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { Modified: llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp (original) +++ llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp Thu Aug 5 18:42:04 2010 @@ -36,7 +36,7 @@ public: static char ID; // Pass identification, replacement for typeid - DeadMachineInstructionElim() : MachineFunctionPass(&ID) {} + DeadMachineInstructionElim() : MachineFunctionPass(ID) {} private: bool isDead(const MachineInstr *MI) const; Modified: llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp (original) +++ llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp Thu Aug 5 18:42:04 2010 @@ -160,7 +160,7 @@ public: static char ID; // Pass identification, replacement for typeid. DwarfEHPrepare(const TargetMachine *tm, bool fast) : - FunctionPass(&ID), TM(tm), TLI(TM->getTargetLowering()), + FunctionPass(ID), TM(tm), TLI(TM->getTargetLowering()), CompileFast(fast), ExceptionValueIntrinsic(0), SelectorIntrinsic(0), URoR(0), EHCatchAllValue(0), RewindFunction(0) {} Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Thu Aug 5 18:42:04 2010 @@ -63,7 +63,7 @@ //===----------------------------------------------------------------------===// ELFWriter::ELFWriter(raw_ostream &o, TargetMachine &tm) - : MachineFunctionPass(&ID), O(o), TM(tm), + : MachineFunctionPass(ID), O(o), TM(tm), OutContext(*new MCContext(*TM.getMCAsmInfo())), TLOF(TM.getTargetLowering()->getObjFileLowering()), is64Bit(TM.getTargetData()->getPointerSizeInBits() == 64), Modified: llvm/trunk/lib/CodeGen/GCMetadata.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCMetadata.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/GCMetadata.cpp (original) +++ llvm/trunk/lib/CodeGen/GCMetadata.cpp Thu Aug 5 18:42:04 2010 @@ -30,8 +30,8 @@ raw_ostream &OS; public: - Printer() : FunctionPass(&ID), OS(errs()) {} - explicit Printer(raw_ostream &OS) : FunctionPass(&ID), OS(OS) {} + Printer() : FunctionPass(ID), OS(errs()) {} + explicit Printer(raw_ostream &OS) : FunctionPass(ID), OS(OS) {} const char *getPassName() const; @@ -70,7 +70,7 @@ char GCModuleInfo::ID = 0; GCModuleInfo::GCModuleInfo() - : ImmutablePass(&ID) {} + : ImmutablePass(ID) {} GCModuleInfo::~GCModuleInfo() { clear(); @@ -189,7 +189,7 @@ return new Deleter(); } -Deleter::Deleter() : FunctionPass(&ID) {} +Deleter::Deleter() : FunctionPass(ID) {} const char *Deleter::getPassName() const { return "Delete Garbage Collector Information"; Modified: llvm/trunk/lib/CodeGen/GCStrategy.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCStrategy.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/GCStrategy.cpp (original) +++ llvm/trunk/lib/CodeGen/GCStrategy.cpp Thu Aug 5 18:42:04 2010 @@ -130,7 +130,7 @@ char LowerIntrinsics::ID = 0; LowerIntrinsics::LowerIntrinsics() - : FunctionPass(&ID) {} + : FunctionPass(ID) {} const char *LowerIntrinsics::getPassName() const { return "Lower Garbage Collection Instructions"; @@ -318,7 +318,7 @@ char MachineCodeAnalysis::ID = 0; MachineCodeAnalysis::MachineCodeAnalysis() - : MachineFunctionPass(&ID) {} + : MachineFunctionPass(ID) {} const char *MachineCodeAnalysis::getPassName() const { return "Analyze Machine Code For Garbage Collection"; Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IfConversion.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/IfConversion.cpp (original) +++ llvm/trunk/lib/CodeGen/IfConversion.cpp Thu Aug 5 18:42:04 2010 @@ -154,7 +154,7 @@ int FnNum; public: static char ID; - IfConverter() : MachineFunctionPass(&ID), FnNum(-1) {} + IfConverter() : MachineFunctionPass(ID), FnNum(-1) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "If Converter"; } Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original) +++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Thu Aug 5 18:42:04 2010 @@ -36,7 +36,7 @@ public: static char ID; // Pass identification, replacement for typeid - LowerSubregsInstructionPass() : MachineFunctionPass(&ID) {} + LowerSubregsInstructionPass() : MachineFunctionPass(ID) {} const char *getPassName() const { return "Subregister lowering instruction pass"; Modified: llvm/trunk/lib/CodeGen/MachineCSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCSE.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineCSE.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineCSE.cpp Thu Aug 5 18:42:04 2010 @@ -41,7 +41,7 @@ MachineRegisterInfo *MRI; public: static char ID; // Pass identification - MachineCSE() : MachineFunctionPass(&ID), LookAheadLimit(5), CurrVN(0) {} + MachineCSE() : MachineFunctionPass(ID), LookAheadLimit(5), CurrVN(0) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/MachineDominators.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineDominators.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineDominators.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineDominators.cpp Thu Aug 5 18:42:04 2010 @@ -27,7 +27,7 @@ static RegisterPass E("machinedomtree", "MachineDominator Tree Construction", true); -const PassInfo *const llvm::MachineDominatorsID = &E; +char &llvm::MachineDominatorsID = MachineDominatorTree::ID; void MachineDominatorTree::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -41,7 +41,7 @@ } MachineDominatorTree::MachineDominatorTree() - : MachineFunctionPass(&ID) { + : MachineFunctionPass(ID) { DT = new DominatorTreeBase(false); } Modified: llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp Thu Aug 5 18:42:04 2010 @@ -20,14 +20,14 @@ // a default constructor. static PassInfo X("Machine Function Analysis", "machine-function-analysis", - intptr_t(&MachineFunctionAnalysis::ID), 0, + &MachineFunctionAnalysis::ID, 0, /*CFGOnly=*/false, /*is_analysis=*/true); char MachineFunctionAnalysis::ID = 0; MachineFunctionAnalysis::MachineFunctionAnalysis(const TargetMachine &tm, CodeGenOpt::Level OL) : - FunctionPass(&ID), TM(tm), OptLevel(OL), MF(0) { + FunctionPass(ID), TM(tm), OptLevel(OL), MF(0) { } MachineFunctionAnalysis::~MachineFunctionAnalysis() { Modified: llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp Thu Aug 5 18:42:04 2010 @@ -29,7 +29,7 @@ const std::string Banner; MachineFunctionPrinterPass(raw_ostream &os, const std::string &banner) - : MachineFunctionPass(&ID), OS(os), Banner(banner) {} + : MachineFunctionPass(ID), OS(os), Banner(banner) {} const char *getPassName() const { return "MachineFunction Printer"; } Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Thu Aug 5 18:42:04 2010 @@ -74,10 +74,10 @@ public: static char ID; // Pass identification, replacement for typeid MachineLICM() : - MachineFunctionPass(&ID), PreRegAlloc(true) {} + MachineFunctionPass(ID), PreRegAlloc(true) {} explicit MachineLICM(bool PreRA) : - MachineFunctionPass(&ID), PreRegAlloc(PreRA) {} + MachineFunctionPass(ID), PreRegAlloc(PreRA) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp Thu Aug 5 18:42:04 2010 @@ -33,7 +33,7 @@ static RegisterPass X("machine-loops", "Machine Natural Loop Construction", true); -const PassInfo *const llvm::MachineLoopInfoID = &X; +char &llvm::MachineLoopInfoID = MachineLoopInfo::ID; bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) { releaseMemory(); Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Thu Aug 5 18:42:04 2010 @@ -254,7 +254,7 @@ //===----------------------------------------------------------------------===// MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI) -: ImmutablePass(&ID), Context(MAI), +: ImmutablePass(ID), Context(MAI), ObjFileMMI(0), CurCallSite(0), CallsEHReturn(0), CallsUnwindInit(0), DbgInfoAvailable(false){ // Always emit some info, by default "no personality" info. @@ -264,7 +264,7 @@ } MachineModuleInfo::MachineModuleInfo() -: ImmutablePass(&ID), Context(*(MCAsmInfo*)0) { +: ImmutablePass(ID), Context(*(MCAsmInfo*)0) { assert(0 && "This MachineModuleInfo constructor should never be called, MMI " "should always be explicitly constructed by LLVMTargetMachine"); abort(); Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineSink.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineSink.cpp Thu Aug 5 18:42:04 2010 @@ -44,7 +44,7 @@ public: static char ID; // Pass identification - MachineSinking() : MachineFunctionPass(&ID) {} + MachineSinking() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Thu Aug 5 18:42:04 2010 @@ -194,7 +194,7 @@ static char ID; // Pass ID, replacement for typeid MachineVerifierPass() - : MachineFunctionPass(&ID) {} + : MachineFunctionPass(ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/CodeGen/OptimizeExts.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizeExts.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/OptimizeExts.cpp (original) +++ llvm/trunk/lib/CodeGen/OptimizeExts.cpp Thu Aug 5 18:42:04 2010 @@ -43,7 +43,7 @@ public: static char ID; // Pass identification - OptimizeExts() : MachineFunctionPass(&ID) {} + OptimizeExts() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/OptimizePHIs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizePHIs.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/OptimizePHIs.cpp (original) +++ llvm/trunk/lib/CodeGen/OptimizePHIs.cpp Thu Aug 5 18:42:04 2010 @@ -33,7 +33,7 @@ public: static char ID; // Pass identification - OptimizePHIs() : MachineFunctionPass(&ID) {} + OptimizePHIs() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Thu Aug 5 18:42:04 2010 @@ -40,7 +40,7 @@ static RegisterPass X("phi-node-elimination", "Eliminate PHI nodes for register allocation"); -const PassInfo *const llvm::PHIEliminationID = &X; +char &llvm::PHIEliminationID = PHIElimination::ID; void llvm::PHIElimination::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); Modified: llvm/trunk/lib/CodeGen/PHIElimination.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.h (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.h Thu Aug 5 18:42:04 2010 @@ -25,7 +25,7 @@ public: static char ID; // Pass identification, replacement for typeid - PHIElimination() : MachineFunctionPass(&ID) {} + PHIElimination() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original) +++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Thu Aug 5 18:42:04 2010 @@ -85,7 +85,7 @@ public: static char ID; PostRAScheduler(CodeGenOpt::Level ol) : - MachineFunctionPass(&ID), OptLevel(ol) {} + MachineFunctionPass(ID), OptLevel(ol) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); Modified: llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp (original) +++ llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp Thu Aug 5 18:42:04 2010 @@ -92,7 +92,7 @@ public: static char ID; PreAllocSplitting() - : MachineFunctionPass(&ID) {} + : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); @@ -206,7 +206,7 @@ static RegisterPass X("pre-alloc-splitting", "Pre-Register Allocation Live Interval Splitting"); -const PassInfo *const llvm::PreAllocSplittingID = &X; +char &llvm::PreAllocSplittingID = PreAllocSplitting::ID; /// findSpillPoint - Find a gap as far away from the given MI that's suitable /// for spilling the current live interval. The index must be before any Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.h (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.h Thu Aug 5 18:42:04 2010 @@ -36,7 +36,7 @@ class PEI : public MachineFunctionPass { public: static char ID; - PEI() : MachineFunctionPass(&ID) {} + PEI() : MachineFunctionPass(ID) {} const char *getPassName() const { return "Prolog/Epilog Insertion & Frame Finalization"; Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Thu Aug 5 18:42:04 2010 @@ -47,7 +47,7 @@ class RAFast : public MachineFunctionPass { public: static char ID; - RAFast() : MachineFunctionPass(&ID), StackSlotForVirtReg(-1), + RAFast() : MachineFunctionPass(ID), StackSlotForVirtReg(-1), isBulkSpilling(false) {} private: const TargetMachine *TM; Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Thu Aug 5 18:42:04 2010 @@ -90,7 +90,7 @@ struct RALinScan : public MachineFunctionPass { static char ID; - RALinScan() : MachineFunctionPass(&ID) { + RALinScan() : MachineFunctionPass(ID) { // Initialize the queue to record recently-used registers. if (NumRecentlyUsedRegs > 0) RecentRegs.resize(NumRecentlyUsedRegs, 0); Modified: llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp Thu Aug 5 18:42:04 2010 @@ -84,7 +84,7 @@ static char ID; /// Construct a PBQP register allocator. - PBQPRegAlloc() : MachineFunctionPass(&ID) {} + PBQPRegAlloc() : MachineFunctionPass(ID) {} /// Return the pass name. virtual const char* getPassName() const { Modified: llvm/trunk/lib/CodeGen/RenderMachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RenderMachineFunction.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RenderMachineFunction.h (original) +++ llvm/trunk/lib/CodeGen/RenderMachineFunction.h Thu Aug 5 18:42:04 2010 @@ -198,7 +198,7 @@ public: static char ID; - RenderMachineFunction() : MachineFunctionPass(&ID) {} + RenderMachineFunction() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Aug 5 18:42:04 2010 @@ -171,7 +171,7 @@ //===----------------------------------------------------------------------===// SelectionDAGISel::SelectionDAGISel(const TargetMachine &tm, CodeGenOpt::Level OL) : - MachineFunctionPass(&ID), TM(tm), TLI(*tm.getTargetLowering()), + MachineFunctionPass(ID), TM(tm), TLI(*tm.getTargetLowering()), FuncInfo(new FunctionLoweringInfo(TLI)), CurDAG(new SelectionDAG(tm)), SDB(new SelectionDAGBuilder(*CurDAG, *FuncInfo, OL)), Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Thu Aug 5 18:42:04 2010 @@ -65,7 +65,7 @@ // Declare that we implement the RegisterCoalescer interface static RegisterAnalysisGroup V(X); -const PassInfo *const llvm::SimpleRegisterCoalescingID = &X; +char &llvm::SimpleRegisterCoalescingID = SimpleRegisterCoalescing::ID; void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h Thu Aug 5 18:42:04 2010 @@ -64,7 +64,7 @@ public: static char ID; // Pass identifcation, replacement for typeid - SimpleRegisterCoalescing() : MachineFunctionPass(&ID) {} + SimpleRegisterCoalescing() : MachineFunctionPass(ID) {} struct InstrSlots { enum { Modified: llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp (original) +++ llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp Thu Aug 5 18:42:04 2010 @@ -58,7 +58,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit SjLjEHPass(const TargetLowering *tli = NULL) - : FunctionPass(&ID), TLI(tli) { } + : FunctionPass(ID), TLI(tli) { } bool doInitialization(Module &M); bool runOnFunction(Function &F); Modified: llvm/trunk/lib/CodeGen/Splitter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Splitter.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/Splitter.h (original) +++ llvm/trunk/lib/CodeGen/Splitter.h Thu Aug 5 18:42:04 2010 @@ -36,7 +36,7 @@ public: static char ID; - LoopSplitter() : MachineFunctionPass(&ID) {} + LoopSplitter() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackProtector.cpp (original) +++ llvm/trunk/lib/CodeGen/StackProtector.cpp Thu Aug 5 18:42:04 2010 @@ -62,9 +62,9 @@ bool RequiresStackProtector() const; public: static char ID; // Pass identification, replacement for typeid. - StackProtector() : FunctionPass(&ID), TLI(0) {} + StackProtector() : FunctionPass(ID), TLI(0) {} StackProtector(const TargetLowering *tli) - : FunctionPass(&ID), TLI(tli) {} + : FunctionPass(ID), TLI(tli) {} virtual bool runOnFunction(Function &Fn); }; Modified: llvm/trunk/lib/CodeGen/StackSlotColoring.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackSlotColoring.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackSlotColoring.cpp (original) +++ llvm/trunk/lib/CodeGen/StackSlotColoring.cpp Thu Aug 5 18:42:04 2010 @@ -95,9 +95,9 @@ public: static char ID; // Pass identification StackSlotColoring() : - MachineFunctionPass(&ID), ColorWithRegs(false), NextColor(-1) {} + MachineFunctionPass(ID), ColorWithRegs(false), NextColor(-1) {} StackSlotColoring(bool RegColor) : - MachineFunctionPass(&ID), ColorWithRegs(RegColor), NextColor(-1) {} + MachineFunctionPass(ID), ColorWithRegs(RegColor), NextColor(-1) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Thu Aug 5 18:42:04 2010 @@ -39,7 +39,7 @@ namespace { struct StrongPHIElimination : public MachineFunctionPass { static char ID; // Pass identification, replacement for typeid - StrongPHIElimination() : MachineFunctionPass(&ID) {} + StrongPHIElimination() : MachineFunctionPass(ID) {} // Waiting stores, for each MBB, the set of copies that need to // be inserted into that MBB @@ -154,7 +154,7 @@ X("strong-phi-node-elimination", "Eliminate PHI nodes for register allocation, intelligently"); -const PassInfo *const llvm::StrongPHIEliminationID = &X; +char &llvm::StrongPHIEliminationID = StrongPHIElimination::ID; /// computeDFS - Computes the DFS-in and DFS-out numbers of the dominator tree /// of the given MachineFunction. These numbers are then used in other parts Modified: llvm/trunk/lib/CodeGen/TailDuplication.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TailDuplication.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TailDuplication.cpp (original) +++ llvm/trunk/lib/CodeGen/TailDuplication.cpp Thu Aug 5 18:42:04 2010 @@ -69,7 +69,7 @@ public: static char ID; explicit TailDuplicatePass(bool PreRA) : - MachineFunctionPass(&ID), PreRegAlloc(PreRA) {} + MachineFunctionPass(ID), PreRegAlloc(PreRA) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Tail Duplication"; } Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Thu Aug 5 18:42:04 2010 @@ -138,7 +138,7 @@ public: static char ID; // Pass identification, replacement for typeid - TwoAddressInstructionPass() : MachineFunctionPass(&ID) {} + TwoAddressInstructionPass() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); @@ -162,7 +162,7 @@ static RegisterPass X("twoaddressinstruction", "Two-Address instruction pass"); -const PassInfo *const llvm::TwoAddressInstructionPassID = &X; +char &llvm::TwoAddressInstructionPassID = TwoAddressInstructionPass::ID; /// Sink3AddrInstruction - A two-address instruction has been converted to a /// three-address instruction to avoid clobbering a register. Try to sink it Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp (original) +++ llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Thu Aug 5 18:42:04 2010 @@ -43,7 +43,7 @@ virtual bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - UnreachableBlockElim() : FunctionPass(&ID) {} + UnreachableBlockElim() : FunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); @@ -100,7 +100,7 @@ MachineModuleInfo *MMI; public: static char ID; // Pass identification, replacement for typeid - UnreachableMachineBlockElim() : MachineFunctionPass(&ID) {} + UnreachableMachineBlockElim() : MachineFunctionPass(ID) {} }; } char UnreachableMachineBlockElim::ID = 0; @@ -109,7 +109,7 @@ Y("unreachable-mbb-elimination", "Remove unreachable machine basic blocks"); -const PassInfo *const llvm::UnreachableMachineBlockElimID = &Y; +char &llvm::UnreachableMachineBlockElimID = UnreachableMachineBlockElim::ID; void UnreachableMachineBlockElim::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); Modified: llvm/trunk/lib/CodeGen/VirtRegMap.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/VirtRegMap.h (original) +++ llvm/trunk/lib/CodeGen/VirtRegMap.h Thu Aug 5 18:42:04 2010 @@ -139,7 +139,7 @@ public: static char ID; - VirtRegMap() : MachineFunctionPass(&ID), Virt2PhysMap(NO_PHYS_REG), + VirtRegMap() : MachineFunctionPass(ID), Virt2PhysMap(NO_PHYS_REG), Virt2StackSlotMap(NO_STACK_SLOT), Virt2ReMatIdMap(NO_STACK_SLOT), Virt2SplitMap(0), Virt2SplitKillMap(SlotIndex()), ReMatMap(NULL), Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Thu Aug 5 18:42:04 2010 @@ -65,7 +65,7 @@ static char ID; public: ARMCodeEmitter(TargetMachine &tm, JITCodeEmitter &mce) - : MachineFunctionPass(&ID), JTI(0), + : MachineFunctionPass(ID), JTI(0), II((const ARMInstrInfo *)tm.getInstrInfo()), TD(tm.getTargetData()), TM(tm), MCE(mce), MCPEs(0), MJTEs(0), Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Thu Aug 5 18:42:04 2010 @@ -173,7 +173,7 @@ bool isThumb2; public: static char ID; - ARMConstantIslands() : MachineFunctionPass(&ID) {} + ARMConstantIslands() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp Thu Aug 5 18:42:04 2010 @@ -26,7 +26,7 @@ class ARMExpandPseudo : public MachineFunctionPass { public: static char ID; - ARMExpandPseudo() : MachineFunctionPass(&ID) {} + ARMExpandPseudo() : MachineFunctionPass(ID) {} const TargetInstrInfo *TII; const TargetRegisterInfo *TRI; Modified: llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp Thu Aug 5 18:42:04 2010 @@ -78,7 +78,7 @@ public: static char ID; // Pass identification, replacement for typeid. explicit ARMGlobalMerge(const TargetLowering *tli) - : FunctionPass(&ID), TLI(tli) {} + : FunctionPass(ID), TLI(tli) {} virtual bool doInitialization(Module &M); virtual bool runOnFunction(Function& F); Modified: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Thu Aug 5 18:42:04 2010 @@ -57,7 +57,7 @@ namespace { struct ARMLoadStoreOpt : public MachineFunctionPass { static char ID; - ARMLoadStoreOpt() : MachineFunctionPass(&ID) {} + ARMLoadStoreOpt() : MachineFunctionPass(ID) {} const TargetInstrInfo *TII; const TargetRegisterInfo *TRI; @@ -1268,7 +1268,7 @@ namespace { struct ARMPreAllocLoadStoreOpt : public MachineFunctionPass{ static char ID; - ARMPreAllocLoadStoreOpt() : MachineFunctionPass(&ID) {} + ARMPreAllocLoadStoreOpt() : MachineFunctionPass(ID) {} const TargetData *TD; const TargetInstrInfo *TII; Modified: llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp (original) +++ llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp Thu Aug 5 18:42:04 2010 @@ -24,7 +24,7 @@ namespace { struct NEONMoveFixPass : public MachineFunctionPass { static char ID; - NEONMoveFixPass() : MachineFunctionPass(&ID) {} + NEONMoveFixPass() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); Modified: llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp Thu Aug 5 18:42:04 2010 @@ -23,7 +23,7 @@ public: static char ID; - NEONPreAllocPass() : MachineFunctionPass(&ID) {} + NEONPreAllocPass() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp Thu Aug 5 18:42:04 2010 @@ -27,7 +27,7 @@ public: static char ID; - Thumb2ITBlockPass() : MachineFunctionPass(&ID) {} + Thumb2ITBlockPass() : MachineFunctionPass(ID) {} const Thumb2InstrInfo *TII; const TargetRegisterInfo *TRI; Modified: llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp Thu Aug 5 18:42:04 2010 @@ -173,7 +173,7 @@ char Thumb2SizeReduce::ID = 0; } -Thumb2SizeReduce::Thumb2SizeReduce() : MachineFunctionPass(&ID) { +Thumb2SizeReduce::Thumb2SizeReduce() : MachineFunctionPass(ID) { for (unsigned i = 0, e = array_lengthof(ReduceTable); i != e; ++i) { unsigned FromOpc = ReduceTable[i].WideOpc; if (!ReduceOpcodeMap.insert(std::make_pair(FromOpc, i)).second) Modified: llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp Thu Aug 5 18:42:04 2010 @@ -22,7 +22,7 @@ namespace { struct AlphaBSel : public MachineFunctionPass { static char ID; - AlphaBSel() : MachineFunctionPass(&ID) {} + AlphaBSel() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); Modified: llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp Thu Aug 5 18:42:04 2010 @@ -34,7 +34,7 @@ public: static char ID; - AlphaCodeEmitter(JITCodeEmitter &mce) : MachineFunctionPass(&ID), + AlphaCodeEmitter(JITCodeEmitter &mce) : MachineFunctionPass(ID), MCE(mce) {} /// getBinaryCodeForInstr - This function, generated by the Modified: llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp Thu Aug 5 18:42:04 2010 @@ -39,7 +39,7 @@ static char ID; AlphaLLRPPass(AlphaTargetMachine &tm) - : MachineFunctionPass(&ID), TM(tm) { } + : MachineFunctionPass(ID), TM(tm) { } virtual const char *getPassName() const { return "Alpha NOP inserter"; Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Thu Aug 5 18:42:04 2010 @@ -73,7 +73,7 @@ public: static char ID; CBackendNameAllUsedStructsAndMergeFunctions() - : ModulePass(&ID) {} + : ModulePass(ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); } @@ -110,7 +110,7 @@ public: static char ID; explicit CWriter(formatted_raw_ostream &o) - : FunctionPass(&ID), Out(o), IL(0), Mang(0), LI(0), + : FunctionPass(ID), Out(o), IL(0), Mang(0), LI(0), TheModule(0), TAsm(0), TCtx(0), TD(0), OpaqueCounter(0), NextAnonValueNumber(0) { FPCounter = 0; Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Thu Aug 5 18:42:04 2010 @@ -104,7 +104,7 @@ public: static char ID; explicit CppWriter(formatted_raw_ostream &o) : - ModulePass(&ID), Out(o), uniqueNum(0), is_inline(false), indent_level(0){} + ModulePass(ID), Out(o), uniqueNum(0), is_inline(false), indent_level(0){} virtual const char *getPassName() const { return "C++ backend"; } Modified: llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp Thu Aug 5 18:42:04 2010 @@ -32,7 +32,7 @@ static char ID; Filler(TargetMachine &tm) - : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { } + : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { } virtual const char *getPassName() const { return "MBlaze Delay Slot Filler"; Modified: llvm/trunk/lib/Target/MSIL/MSILWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/MSILWriter.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSIL/MSILWriter.h (original) +++ llvm/trunk/lib/Target/MSIL/MSILWriter.h Thu Aug 5 18:42:04 2010 @@ -40,7 +40,7 @@ static char ID; MSILModule(const std::set*& _UsedTypes, const TargetData*& _TD) - : ModulePass(&ID), UsedTypes(_UsedTypes), TD(_TD) {} + : ModulePass(ID), UsedTypes(_UsedTypes), TD(_TD) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); @@ -86,7 +86,7 @@ DenseMap AnonValueNumbers; unsigned NextAnonValueNumber; - MSILWriter(formatted_raw_ostream &o) : FunctionPass(&ID), Out(o), + MSILWriter(formatted_raw_ostream &o) : FunctionPass(ID), Out(o), NextAnonValueNumber(0) { UniqID = 0; } Modified: llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp (original) +++ llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp Thu Aug 5 18:42:04 2010 @@ -30,7 +30,7 @@ namespace { struct MSP430BSel : public MachineFunctionPass { static char ID; - MSP430BSel() : MachineFunctionPass(&ID) {} + MSP430BSel() : MachineFunctionPass(ID) {} /// BlockSizes - The sizes of the basic blocks in the function. std::vector BlockSizes; Modified: llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp Thu Aug 5 18:42:04 2010 @@ -32,7 +32,7 @@ static char ID; Filler(TargetMachine &tm) - : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { } + : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { } virtual const char *getPassName() const { return "Mips Delay Slot Filler"; Modified: llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp Thu Aug 5 18:42:04 2010 @@ -38,7 +38,7 @@ namespace { struct MemSelOpt : public MachineFunctionPass { static char ID; - MemSelOpt() : MachineFunctionPass(&ID) {} + MemSelOpt() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreservedID(MachineLoopInfoID); Modified: llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h Thu Aug 5 18:42:04 2010 @@ -35,7 +35,7 @@ class PIC16Cloner : public ModulePass { public: static char ID; // Class identification - PIC16Cloner() : ModulePass(&ID) {} + PIC16Cloner() : ModulePass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h Thu Aug 5 18:42:04 2010 @@ -39,7 +39,7 @@ unsigned IndirectCallColor; public: static char ID; // Class identification - PIC16Overlay() : ModulePass(&ID) { + PIC16Overlay() : ModulePass(ID) { OverlayStr = "Overlay="; InterruptDepth = PIC16OVERLAY::StartInterruptColor; IndirectCallColor = PIC16OVERLAY::StartIndirectCallColor; Modified: llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp Thu Aug 5 18:42:04 2010 @@ -31,7 +31,7 @@ namespace { struct PPCBSel : public MachineFunctionPass { static char ID; - PPCBSel() : MachineFunctionPass(&ID) {} + PPCBSel() : MachineFunctionPass(ID) {} /// BlockSizes - The sizes of the basic blocks in the function. std::vector BlockSizes; Modified: llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp Thu Aug 5 18:42:04 2010 @@ -45,7 +45,7 @@ public: PPCCodeEmitter(TargetMachine &tm, JITCodeEmitter &mce) - : MachineFunctionPass(&ID), TM(tm), MCE(mce) {} + : MachineFunctionPass(ID), TM(tm), MCE(mce) {} /// getBinaryCodeForInstr - This function, generated by the /// CodeEmitterGenerator using TableGen, produces the binary encoding for Modified: llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp (original) +++ llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp Thu Aug 5 18:42:04 2010 @@ -32,7 +32,7 @@ static char ID; Filler(TargetMachine &tm) - : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { } + : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { } virtual const char *getPassName() const { return "SPARC Delay Slot Filler"; Modified: llvm/trunk/lib/Target/Sparc/FPMover.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/FPMover.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/FPMover.cpp (original) +++ llvm/trunk/lib/Target/Sparc/FPMover.cpp Thu Aug 5 18:42:04 2010 @@ -36,7 +36,7 @@ static char ID; explicit FPMover(TargetMachine &tm) - : MachineFunctionPass(&ID), TM(tm) { } + : MachineFunctionPass(ID), TM(tm) { } virtual const char *getPassName() const { return "Sparc Double-FP Move Fixer"; Modified: llvm/trunk/lib/Target/TargetData.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetData.cpp (original) +++ llvm/trunk/lib/Target/TargetData.cpp Thu Aug 5 18:42:04 2010 @@ -226,13 +226,13 @@ /// /// @note This has to exist, because this is a pass, but it should never be /// used. -TargetData::TargetData() : ImmutablePass(&ID) { +TargetData::TargetData() : ImmutablePass(ID) { report_fatal_error("Bad TargetData ctor used. " "Tool did not specify a TargetData to use?"); } TargetData::TargetData(const Module *M) - : ImmutablePass(&ID) { + : ImmutablePass(ID) { init(M->getDataLayout()); } Modified: llvm/trunk/lib/Target/X86/SSEDomainFix.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/SSEDomainFix.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/SSEDomainFix.cpp (original) +++ llvm/trunk/lib/Target/X86/SSEDomainFix.cpp Thu Aug 5 18:42:04 2010 @@ -115,7 +115,7 @@ unsigned Distance; public: - SSEDomainFixPass() : MachineFunctionPass(&ID) {} + SSEDomainFixPass() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Thu Aug 5 18:42:04 2010 @@ -53,12 +53,12 @@ public: static char ID; explicit Emitter(X86TargetMachine &tm, CodeEmitter &mce) - : MachineFunctionPass(&ID), II(0), TD(0), TM(tm), + : MachineFunctionPass(ID), II(0), TD(0), TM(tm), MCE(mce), PICBaseOffset(0), Is64BitMode(false), IsPIC(TM.getRelocationModel() == Reloc::PIC_) {} Emitter(X86TargetMachine &tm, CodeEmitter &mce, const X86InstrInfo &ii, const TargetData &td, bool is64) - : MachineFunctionPass(&ID), II(&ii), TD(&td), TM(tm), + : MachineFunctionPass(ID), II(&ii), TD(&td), TM(tm), MCE(mce), PICBaseOffset(0), Is64BitMode(is64), IsPIC(TM.getRelocationModel() == Reloc::PIC_) {} Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Thu Aug 5 18:42:04 2010 @@ -50,7 +50,7 @@ namespace { struct FPS : public MachineFunctionPass { static char ID; - FPS() : MachineFunctionPass(&ID) { + FPS() : MachineFunctionPass(ID) { // This is really only to keep valgrind quiet. // The logic in isLive() is too much for it. memset(Stack, 0, sizeof(Stack)); Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Thu Aug 5 18:42:04 2010 @@ -3029,7 +3029,7 @@ /// global base register for x86-32. struct CGBR : public MachineFunctionPass { static char ID; - CGBR() : MachineFunctionPass(&ID) {} + CGBR() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF) { const X86TargetMachine *TM = Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Thu Aug 5 18:42:04 2010 @@ -1524,7 +1524,7 @@ namespace { struct MSAH : public MachineFunctionPass { static char ID; - MSAH() : MachineFunctionPass(&ID) {} + MSAH() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF) { const X86TargetMachine *TM = Modified: llvm/trunk/lib/Transforms/Hello/Hello.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Hello/Hello.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Hello/Hello.cpp (original) +++ llvm/trunk/lib/Transforms/Hello/Hello.cpp Thu Aug 5 18:42:04 2010 @@ -25,7 +25,7 @@ // Hello - The first implementation, without getAnalysisUsage. struct Hello : public FunctionPass { static char ID; // Pass identification, replacement for typeid - Hello() : FunctionPass(&ID) {} + Hello() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { ++HelloCounter; @@ -43,7 +43,7 @@ // Hello2 - The second implementation with getAnalysisUsage implemented. struct Hello2 : public FunctionPass { static char ID; // Pass identification, replacement for typeid - Hello2() : FunctionPass(&ID) {} + Hello2() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { ++HelloCounter; Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Thu Aug 5 18:42:04 2010 @@ -67,7 +67,7 @@ virtual bool runOnSCC(CallGraphSCC &SCC); static char ID; // Pass identification, replacement for typeid explicit ArgPromotion(unsigned maxElements = 3) - : CallGraphSCCPass(&ID), maxElements(maxElements) {} + : CallGraphSCCPass(ID), maxElements(maxElements) {} /// A vector used to hold the indices of a single GEP instruction typedef std::vector IndicesVector; Modified: llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp Thu Aug 5 18:42:04 2010 @@ -31,7 +31,7 @@ namespace { struct ConstantMerge : public ModulePass { static char ID; // Pass identification, replacement for typeid - ConstantMerge() : ModulePass(&ID) {} + ConstantMerge() : ModulePass(ID) {} // run - For this pass, process all of the globals in the module, // eliminating duplicate constants. Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Thu Aug 5 18:42:04 2010 @@ -122,11 +122,11 @@ protected: // DAH uses this to specify a different ID. - explicit DAE(void *ID) : ModulePass(ID) {} + explicit DAE(char &ID) : ModulePass(ID) {} public: static char ID; // Pass identification, replacement for typeid - DAE() : ModulePass(&ID) {} + DAE() : ModulePass(ID) {} bool runOnModule(Module &M); @@ -159,7 +159,7 @@ /// by bugpoint. struct DAH : public DAE { static char ID; - DAH() : DAE(&ID) {} + DAH() : DAE(ID) {} virtual bool ShouldHackArguments() const { return true; } }; Modified: llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp Thu Aug 5 18:42:04 2010 @@ -26,7 +26,7 @@ namespace { struct DTE : public ModulePass { static char ID; // Pass identification, replacement for typeid - DTE() : ModulePass(&ID) {} + DTE() : ModulePass(ID) {} // doPassInitialization - For this pass, it removes global symbol table // entries for primitive types. These are never used for linking in GCC and Modified: llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp Thu Aug 5 18:42:04 2010 @@ -35,7 +35,7 @@ /// explicit GVExtractorPass(std::vector& GVs, bool deleteS = true, bool relinkCallees = false) - : ModulePass(&ID), Named(GVs), deleteStuff(deleteS), + : ModulePass(ID), Named(GVs), deleteStuff(deleteS), reLink(relinkCallees) {} bool runOnModule(Module &M) { Modified: llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp Thu Aug 5 18:42:04 2010 @@ -41,7 +41,7 @@ namespace { struct FunctionAttrs : public CallGraphSCCPass { static char ID; // Pass identification, replacement for typeid - FunctionAttrs() : CallGraphSCCPass(&ID) {} + FunctionAttrs() : CallGraphSCCPass(ID) {} // runOnSCC - Analyze the SCC, performing the transformation if possible. bool runOnSCC(CallGraphSCC &SCC); Modified: llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp Thu Aug 5 18:42:04 2010 @@ -31,7 +31,7 @@ namespace { struct GlobalDCE : public ModulePass { static char ID; // Pass identification, replacement for typeid - GlobalDCE() : ModulePass(&ID) {} + GlobalDCE() : ModulePass(ID) {} // run - Do the GlobalDCE pass on the specified module, optionally updating // the specified callgraph to reflect the changes. Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Thu Aug 5 18:42:04 2010 @@ -59,7 +59,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { } static char ID; // Pass identification, replacement for typeid - GlobalOpt() : ModulePass(&ID) {} + GlobalOpt() : ModulePass(ID) {} bool runOnModule(Module &M); Modified: llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp Thu Aug 5 18:42:04 2010 @@ -35,7 +35,7 @@ /// struct IPCP : public ModulePass { static char ID; // Pass identification, replacement for typeid - IPCP() : ModulePass(&ID) {} + IPCP() : ModulePass(ID) {} bool runOnModule(Module &M); private: Modified: llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp Thu Aug 5 18:42:04 2010 @@ -36,7 +36,7 @@ InlineCostAnalyzer CA; public: // Use extremely low threshold. - AlwaysInliner() : Inliner(&ID, -2000000000) {} + AlwaysInliner() : Inliner(ID, -2000000000) {} static char ID; // Pass identification, replacement for typeid InlineCost getInlineCost(CallSite CS) { return CA.getInlineCost(CS, NeverInline); Modified: llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp Thu Aug 5 18:42:04 2010 @@ -33,8 +33,8 @@ SmallPtrSet NeverInline; InlineCostAnalyzer CA; public: - SimpleInliner() : Inliner(&ID) {} - SimpleInliner(int Threshold) : Inliner(&ID, Threshold) {} + SimpleInliner() : Inliner(ID) {} + SimpleInliner(int Threshold) : Inliner(ID, Threshold) {} static char ID; // Pass identification, replacement for typeid InlineCost getInlineCost(CallSite CS) { return CA.getInlineCost(CS, NeverInline); Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Thu Aug 5 18:42:04 2010 @@ -48,10 +48,10 @@ // Threshold to use when optsize is specified (and there is no -inline-limit). const int OptSizeThreshold = 75; -Inliner::Inliner(void *ID) +Inliner::Inliner(char &ID) : CallGraphSCCPass(ID), InlineThreshold(InlineLimit) {} -Inliner::Inliner(void *ID, int Threshold) +Inliner::Inliner(char &ID, int Threshold) : CallGraphSCCPass(ID), InlineThreshold(Threshold) {} /// getAnalysisUsage - For this class, we declare that we require and preserve Modified: llvm/trunk/lib/Transforms/IPO/Internalize.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Internalize.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Internalize.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Internalize.cpp Thu Aug 5 18:42:04 2010 @@ -67,7 +67,7 @@ "Internalize Global Symbols", false, false); InternalizePass::InternalizePass(bool AllButMain) - : ModulePass(&ID), AllButMain(AllButMain){ + : ModulePass(ID), AllButMain(AllButMain){ if (!APIFile.empty()) // If a filename is specified, use it. LoadFile(APIFile.c_str()); if (!APIList.empty()) // If a list is specified, use it as well. @@ -75,7 +75,7 @@ } InternalizePass::InternalizePass(const std::vector&exportList) - : ModulePass(&ID), AllButMain(false){ + : ModulePass(ID), AllButMain(false){ for(std::vector::const_iterator itr = exportList.begin(); itr != exportList.end(); itr++) { ExternalNames.insert(*itr); Modified: llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp Thu Aug 5 18:42:04 2010 @@ -37,7 +37,7 @@ unsigned NumLoops; explicit LoopExtractor(unsigned numLoops = ~0) - : LoopPass(&ID), NumLoops(numLoops) {} + : LoopPass(ID), NumLoops(numLoops) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -147,7 +147,7 @@ std::vector > BlocksToNotExtractByName; public: static char ID; // Pass identification, replacement for typeid - BlockExtractorPass() : ModulePass(&ID) { + BlockExtractorPass() : ModulePass(ID) { if (!BlockFile.empty()) LoadFile(BlockFile.c_str()); } Modified: llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp Thu Aug 5 18:42:04 2010 @@ -109,7 +109,7 @@ bool IsTransformableFunction(StringRef Name); public: static char ID; // Pass identification, replacement for typeid - LowerSetJmp() : ModulePass(&ID) {} + LowerSetJmp() : ModulePass(ID) {} void visitCallInst(CallInst& CI); void visitInvokeInst(InvokeInst& II); Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Thu Aug 5 18:42:04 2010 @@ -88,7 +88,7 @@ /// struct MergeFunctions : public ModulePass { static char ID; // Pass identification, replacement for typeid - MergeFunctions() : ModulePass(&ID) {} + MergeFunctions() : ModulePass(ID) {} bool runOnModule(Module &M); }; Modified: llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp Thu Aug 5 18:42:04 2010 @@ -30,7 +30,7 @@ struct PartialInliner : public ModulePass { virtual void getAnalysisUsage(AnalysisUsage &AU) const { } static char ID; // Pass identification, replacement for typeid - PartialInliner() : ModulePass(&ID) {} + PartialInliner() : ModulePass(ID) {} bool runOnModule(Module& M); Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Thu Aug 5 18:42:04 2010 @@ -50,7 +50,7 @@ int scanDistribution(Function&, int, std::map&); public : static char ID; // Pass identification, replacement for typeid - PartSpec() : ModulePass(&ID) {} + PartSpec() : ModulePass(ID) {} bool runOnModule(Module &M); }; } Modified: llvm/trunk/lib/Transforms/IPO/PruneEH.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PruneEH.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PruneEH.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PruneEH.cpp Thu Aug 5 18:42:04 2010 @@ -37,7 +37,7 @@ namespace { struct PruneEH : public CallGraphSCCPass { static char ID; // Pass identification, replacement for typeid - PruneEH() : CallGraphSCCPass(&ID) {} + PruneEH() : CallGraphSCCPass(ID) {} // runOnSCC - Analyze the SCC, performing the transformation if possible. bool runOnSCC(CallGraphSCC &SCC); Modified: llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp Thu Aug 5 18:42:04 2010 @@ -29,7 +29,7 @@ class StripDeadPrototypesPass : public ModulePass { public: static char ID; // Pass identification, replacement for typeid - StripDeadPrototypesPass() : ModulePass(&ID) { } + StripDeadPrototypesPass() : ModulePass(ID) { } virtual bool runOnModule(Module &M); }; Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Thu Aug 5 18:42:04 2010 @@ -39,7 +39,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripSymbols(bool ODI = false) - : ModulePass(&ID), OnlyDebugInfo(ODI) {} + : ModulePass(ID), OnlyDebugInfo(ODI) {} virtual bool runOnModule(Module &M); @@ -52,7 +52,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripNonDebugSymbols() - : ModulePass(&ID) {} + : ModulePass(ID) {} virtual bool runOnModule(Module &M); @@ -65,7 +65,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripDebugDeclare() - : ModulePass(&ID) {} + : ModulePass(ID) {} virtual bool runOnModule(Module &M); @@ -78,7 +78,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripDeadDebugInfo() - : ModulePass(&ID) {} + : ModulePass(ID) {} virtual bool runOnModule(Module &M); Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Thu Aug 5 18:42:04 2010 @@ -50,7 +50,7 @@ virtual bool runOnSCC(CallGraphSCC &SCC); static char ID; // Pass identification, replacement for typeid - SRETPromotion() : CallGraphSCCPass(&ID) {} + SRETPromotion() : CallGraphSCCPass(ID) {} private: CallGraphNode *PromoteReturn(CallGraphNode *CGN); Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombine.h?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/InstCombine/InstCombine.h (original) +++ llvm/trunk/lib/Transforms/InstCombine/InstCombine.h Thu Aug 5 18:42:04 2010 @@ -81,7 +81,7 @@ BuilderTy *Builder; static char ID; // Pass identification, replacement for typeid - InstCombiner() : FunctionPass(&ID), TD(0), Builder(0) {} + InstCombiner() : FunctionPass(ID), TD(0), Builder(0) {} public: virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp Thu Aug 5 18:42:04 2010 @@ -34,7 +34,7 @@ bool runOnModule(Module &M); public: static char ID; // Pass identification, replacement for typeid - EdgeProfiler() : ModulePass(&ID) {} + EdgeProfiler() : ModulePass(ID) {} virtual const char *getPassName() const { return "Edge Profiler"; Modified: llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp Thu Aug 5 18:42:04 2010 @@ -36,7 +36,7 @@ bool runOnModule(Module &M); public: static char ID; // Pass identification, replacement for typeid - OptimalEdgeProfiler() : ModulePass(&ID) {} + OptimalEdgeProfiler() : ModulePass(ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(ProfileEstimatorPassID); Modified: llvm/trunk/lib/Transforms/Scalar/ABCD.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ABCD.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ABCD.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ABCD.cpp Thu Aug 5 18:42:04 2010 @@ -49,7 +49,7 @@ class ABCD : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid. - ABCD() : FunctionPass(&ID) {} + ABCD() : FunctionPass(ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Transforms/Scalar/ADCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ADCE.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ADCE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ADCE.cpp Thu Aug 5 18:42:04 2010 @@ -33,7 +33,7 @@ namespace { struct ADCE : public FunctionPass { static char ID; // Pass identification, replacement for typeid - ADCE() : FunctionPass(&ID) {} + ADCE() : FunctionPass(ID) {} virtual bool runOnFunction(Function& F); Modified: llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp Thu Aug 5 18:42:04 2010 @@ -41,7 +41,7 @@ namespace { struct BlockPlacement : public FunctionPass { static char ID; // Pass identification, replacement for typeid - BlockPlacement() : FunctionPass(&ID) {} + BlockPlacement() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Thu Aug 5 18:42:04 2010 @@ -54,7 +54,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit CodeGenPrepare(const TargetLowering *tli = 0) - : FunctionPass(&ID), TLI(tli) {} + : FunctionPass(ID), TLI(tli) {} bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp Thu Aug 5 18:42:04 2010 @@ -34,7 +34,7 @@ namespace { struct ConstantPropagation : public FunctionPass { static char ID; // Pass identification, replacement for typeid - ConstantPropagation() : FunctionPass(&ID) {} + ConstantPropagation() : FunctionPass(ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/DCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DCE.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DCE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DCE.cpp Thu Aug 5 18:42:04 2010 @@ -35,7 +35,7 @@ // struct DeadInstElimination : public BasicBlockPass { static char ID; // Pass identification, replacement for typeid - DeadInstElimination() : BasicBlockPass(&ID) {} + DeadInstElimination() : BasicBlockPass(ID) {} virtual bool runOnBasicBlock(BasicBlock &BB) { bool Changed = false; for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); ) { @@ -70,7 +70,7 @@ // struct DCE : public FunctionPass { static char ID; // Pass identification, replacement for typeid - DCE() : FunctionPass(&ID) {} + DCE() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Thu Aug 5 18:42:04 2010 @@ -40,7 +40,7 @@ TargetData *TD; static char ID; // Pass identification, replacement for typeid - DSE() : FunctionPass(&ID) {} + DSE() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { bool Changed = false; Modified: llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp Thu Aug 5 18:42:04 2010 @@ -27,7 +27,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const; public: static char ID; // Pass identification, replacement for typeid - explicit GEPSplitter() : FunctionPass(&ID) {} + explicit GEPSplitter() : FunctionPass(ID) {} }; } Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Thu Aug 5 18:42:04 2010 @@ -665,7 +665,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit GVN(bool noloads = false) - : FunctionPass(&ID), NoLoads(noloads), MD(0) { } + : FunctionPass(ID), NoLoads(noloads), MD(0) { } private: bool NoLoads; Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Thu Aug 5 18:42:04 2010 @@ -77,7 +77,7 @@ public: static char ID; // Pass identification, replacement for typeid - IndVarSimplify() : LoopPass(&ID) {} + IndVarSimplify() : LoopPass(ID) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM); Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Thu Aug 5 18:42:04 2010 @@ -79,7 +79,7 @@ #endif public: static char ID; // Pass identification - JumpThreading() : FunctionPass(&ID) {} + JumpThreading() : FunctionPass(ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Thu Aug 5 18:42:04 2010 @@ -66,7 +66,7 @@ namespace { struct LICM : public LoopPass { static char ID; // Pass identification, replacement for typeid - LICM() : LoopPass(&ID) {} + LICM() : LoopPass(ID) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM); Modified: llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp Thu Aug 5 18:42:04 2010 @@ -28,7 +28,7 @@ class LoopDeletion : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopDeletion() : LoopPass(&ID) {} + LoopDeletion() : LoopPass(ID) {} // Possibly eliminate loop L if it is dead. bool runOnLoop(Loop* L, LPPassManager& LPM); Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Thu Aug 5 18:42:04 2010 @@ -74,7 +74,7 @@ class LoopIndexSplit : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopIndexSplit() : LoopPass(&ID) {} + LoopIndexSplit() : LoopPass(ID) {} // Index split Loop L. Return true if loop is split. bool runOnLoop(Loop *L, LPPassManager &LPM); Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Thu Aug 5 18:42:04 2010 @@ -35,7 +35,7 @@ class LoopRotate : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopRotate() : LoopPass(&ID) {} + LoopRotate() : LoopPass(ID) {} // Rotate Loop L as many times as possible. Return true if // loop is rotated at least once. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Thu Aug 5 18:42:04 2010 @@ -3751,7 +3751,7 @@ } LoopStrengthReduce::LoopStrengthReduce(const TargetLowering *tli) - : LoopPass(&ID), TLI(tli) {} + : LoopPass(ID), TLI(tli) {} void LoopStrengthReduce::getAnalysisUsage(AnalysisUsage &AU) const { // We split critical edges, so we change the CFG. However, we do update Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp Thu Aug 5 18:42:04 2010 @@ -43,7 +43,7 @@ class LoopUnroll : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopUnroll() : LoopPass(&ID) {} + LoopUnroll() : LoopPass(ID) {} /// A magic value for use with the Threshold parameter to indicate /// that the loop unroll should be performed regardless of how much Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Thu Aug 5 18:42:04 2010 @@ -92,7 +92,7 @@ public: static char ID; // Pass ID, replacement for typeid explicit LoopUnswitch(bool Os = false) : - LoopPass(&ID), OptimizeForSize(Os), redoLoop(false), + LoopPass(ID), OptimizeForSize(Os), redoLoop(false), currentLoop(NULL), DF(NULL), DT(NULL), loopHeader(NULL), loopPreheader(NULL) {} Modified: llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp Thu Aug 5 18:42:04 2010 @@ -138,7 +138,7 @@ struct LowerAtomic : public BasicBlockPass { static char ID; - LowerAtomic() : BasicBlockPass(&ID) {} + LowerAtomic() : BasicBlockPass(ID) {} bool runOnBasicBlock(BasicBlock &BB) { bool Changed = false; for (BasicBlock::iterator DI = BB.begin(), DE = BB.end(); DI != DE; ) { Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Thu Aug 5 18:42:04 2010 @@ -304,7 +304,7 @@ bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - MemCpyOpt() : FunctionPass(&ID) {} + MemCpyOpt() : FunctionPass(ID) {} private: // This transformation requires dominator postdominator info Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Thu Aug 5 18:42:04 2010 @@ -77,7 +77,7 @@ bool MadeChange; public: static char ID; // Pass identification, replacement for typeid - Reassociate() : FunctionPass(&ID) {} + Reassociate() : FunctionPass(ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp Thu Aug 5 18:42:04 2010 @@ -36,7 +36,7 @@ namespace { struct RegToMem : public FunctionPass { static char ID; // Pass identification, replacement for typeid - RegToMem() : FunctionPass(&ID) {} + RegToMem() : FunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(BreakCriticalEdgesID); @@ -124,7 +124,7 @@ // createDemoteRegisterToMemory - Provide an entry point to create this pass. // -const PassInfo *const llvm::DemoteRegisterToMemoryID = &X; +char &llvm::DemoteRegisterToMemoryID = RegToMem::ID; FunctionPass *llvm::createDemoteRegisterToMemoryPass() { return new RegToMem(); } Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Thu Aug 5 18:42:04 2010 @@ -1586,7 +1586,7 @@ /// struct SCCP : public FunctionPass { static char ID; // Pass identification, replacement for typeid - SCCP() : FunctionPass(&ID) {} + SCCP() : FunctionPass(ID) {} // runOnFunction - Run the Sparse Conditional Constant Propagation // algorithm, and return true if the function was modified. @@ -1702,7 +1702,7 @@ /// struct IPSCCP : public ModulePass { static char ID; - IPSCCP() : ModulePass(&ID) {} + IPSCCP() : ModulePass(ID) {} bool runOnModule(Module &M); }; } // end anonymous namespace Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Thu Aug 5 18:42:04 2010 @@ -51,7 +51,7 @@ namespace { struct SROA : public FunctionPass { static char ID; // Pass identification, replacement for typeid - explicit SROA(signed T = -1) : FunctionPass(&ID) { + explicit SROA(signed T = -1) : FunctionPass(ID) { if (T == -1) SRThreshold = 128; else Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp Thu Aug 5 18:42:04 2010 @@ -42,7 +42,7 @@ namespace { struct CFGSimplifyPass : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGSimplifyPass() : FunctionPass(&ID) {} + CFGSimplifyPass() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); }; Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp Thu Aug 5 18:42:04 2010 @@ -32,7 +32,7 @@ const TargetData *TD; public: static char ID; // Pass identification - SimplifyHalfPowrLibCalls() : FunctionPass(&ID) {} + SimplifyHalfPowrLibCalls() : FunctionPass(ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Thu Aug 5 18:42:04 2010 @@ -1237,7 +1237,7 @@ bool Modified; // This is only used by doInitialization. public: static char ID; // Pass identification - SimplifyLibCalls() : FunctionPass(&ID), StrCpy(false), StrCpyChk(true) {} + SimplifyLibCalls() : FunctionPass(ID), StrCpy(false), StrCpyChk(true) {} void InitOptimizations(); bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/Sink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Sink.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Sink.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Sink.cpp Thu Aug 5 18:42:04 2010 @@ -35,7 +35,7 @@ public: static char ID; // Pass identification - Sinking() : FunctionPass(&ID) {} + Sinking() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp Thu Aug 5 18:42:04 2010 @@ -49,7 +49,7 @@ bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - TailDup() : FunctionPass(&ID) {} + TailDup() : FunctionPass(ID) {} private: inline bool shouldEliminateUnconditionalBranch(TerminatorInst *, unsigned); Modified: llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp Thu Aug 5 18:42:04 2010 @@ -72,7 +72,7 @@ namespace { struct TailCallElim : public FunctionPass { static char ID; // Pass identification, replacement for typeid - TailCallElim() : FunctionPass(&ID) {} + TailCallElim() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Thu Aug 5 18:42:04 2010 @@ -36,7 +36,7 @@ namespace { struct BreakCriticalEdges : public FunctionPass { static char ID; // Pass identification, replacement for typeid - BreakCriticalEdges() : FunctionPass(&ID) {} + BreakCriticalEdges() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); @@ -57,7 +57,7 @@ X("break-crit-edges", "Break critical edges in CFG"); // Publically exposed interface to pass... -const PassInfo *const llvm::BreakCriticalEdgesID = &X; +char &llvm::BreakCriticalEdgesID = BreakCriticalEdges::ID; FunctionPass *llvm::createBreakCriticalEdgesPass() { return new BreakCriticalEdges(); } Modified: llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp Thu Aug 5 18:42:04 2010 @@ -23,7 +23,7 @@ namespace { struct InstNamer : public FunctionPass { static char ID; // Pass identification, replacement for typeid - InstNamer() : FunctionPass(&ID) {} + InstNamer() : FunctionPass(ID) {} void getAnalysisUsage(AnalysisUsage &Info) const { Info.setPreservesAll(); @@ -53,7 +53,7 @@ } -const PassInfo *const llvm::InstructionNamerID = &X; +char &llvm::InstructionNamerID = InstNamer::ID; //===----------------------------------------------------------------------===// // // InstructionNamer - Give any unnamed non-void instructions "tmp" names. Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LCSSA.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Thu Aug 5 18:42:04 2010 @@ -47,7 +47,7 @@ namespace { struct LCSSA : public LoopPass { static char ID; // Pass identification, replacement for typeid - LCSSA() : LoopPass(&ID) {} + LCSSA() : LoopPass(ID) {} // Cached analysis information for the current function. DominatorTree *DT; @@ -93,7 +93,7 @@ static RegisterPass X("lcssa", "Loop-Closed SSA Form Pass"); Pass *llvm::createLCSSAPass() { return new LCSSA(); } -const PassInfo *const llvm::LCSSAID = &X; +char &llvm::LCSSAID = LCSSA::ID; /// BlockDominatesAnExit - Return true if the specified block dominates at least Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Thu Aug 5 18:42:04 2010 @@ -65,7 +65,7 @@ namespace { struct LoopSimplify : public LoopPass { static char ID; // Pass identification, replacement for typeid - LoopSimplify() : LoopPass(&ID) {} + LoopSimplify() : LoopPass(ID) {} // AA - If we have an alias analysis object to update, this is it, otherwise // this is null. @@ -110,7 +110,7 @@ X("loopsimplify", "Canonicalize natural loops", true); // Publically exposed interface to pass... -const PassInfo *const llvm::LoopSimplifyID = &X; +char &llvm::LoopSimplifyID = LoopSimplify::ID; Pass *llvm::createLoopSimplifyPass() { return new LoopSimplify(); } /// runOnLoop - Run down all loops in the CFG (recursively, but we could do Modified: llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp Thu Aug 5 18:42:04 2010 @@ -78,7 +78,7 @@ static char ID; // Pass identification, replacement for typeid explicit LowerInvoke(const TargetLowering *tli = NULL, bool useExpensiveEHSupport = ExpensiveEHSupport) - : FunctionPass(&ID), useExpensiveEHSupport(useExpensiveEHSupport), + : FunctionPass(ID), useExpensiveEHSupport(useExpensiveEHSupport), TLI(tli) { } bool doInitialization(Module &M); bool runOnFunction(Function &F); @@ -103,7 +103,7 @@ static RegisterPass X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); -const PassInfo *const llvm::LowerInvokePassID = &X; +char &llvm::LowerInvokePassID = LowerInvoke::ID; // Public Interface To the LowerInvoke pass. FunctionPass *llvm::createLowerInvokePass(const TargetLowering *TLI) { Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Thu Aug 5 18:42:04 2010 @@ -34,7 +34,7 @@ class LowerSwitch : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid - LowerSwitch() : FunctionPass(&ID) {} + LowerSwitch() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); @@ -85,7 +85,7 @@ X("lowerswitch", "Lower SwitchInst's to branches"); // Publically exposed interface to pass... -const PassInfo *const llvm::LowerSwitchID = &X; +char &llvm::LowerSwitchID = LowerSwitch::ID; // createLowerSwitchPass - Interface to this file... FunctionPass *llvm::createLowerSwitchPass() { return new LowerSwitch(); Modified: llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp Thu Aug 5 18:42:04 2010 @@ -27,7 +27,7 @@ namespace { struct PromotePass : public FunctionPass { static char ID; // Pass identification, replacement for typeid - PromotePass() : FunctionPass(&ID) {} + PromotePass() : FunctionPass(ID) {} // runOnFunction - To run this pass, first we calculate the alloca // instructions that are safe for promotion, then we promote each one. @@ -82,7 +82,7 @@ } // Publically exposed interface to pass... -const PassInfo *const llvm::PromoteMemoryToRegisterID = &X; +char &llvm::PromoteMemoryToRegisterID = PromotePass::ID; // createPromoteMemoryToRegister - Provide an entry point to create this pass. // FunctionPass *llvm::createPromoteMemoryToRegisterPass() { Modified: llvm/trunk/lib/Transforms/Utils/SSI.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SSI.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/SSI.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/SSI.cpp Thu Aug 5 18:42:04 2010 @@ -399,7 +399,7 @@ namespace { struct SSIEverything : public FunctionPass { static char ID; // Pass identification, replacement for typeid - SSIEverything() : FunctionPass(&ID) {} + SSIEverything() : FunctionPass(ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/VMCore/Pass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Pass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Pass.cpp (original) +++ llvm/trunk/lib/VMCore/Pass.cpp Thu Aug 5 18:42:04 2010 @@ -36,14 +36,7 @@ // Pass Implementation // -Pass::Pass(PassKind K, intptr_t pid) : Resolver(0), PassID(pid), Kind(K) { - assert(pid && "pid cannot be 0"); -} - -Pass::Pass(PassKind K, const void *pid) - : Resolver(0), PassID((intptr_t)pid), Kind(K) { - assert(pid && "pid cannot be 0"); -} +Pass::Pass(PassKind K, char &pid) : Resolver(0), PassID(&pid), Kind(K) { } // Force out-of-line virtual method. Pass::~Pass() { @@ -62,8 +55,8 @@ return PMT_ModulePassManager; } -bool Pass::mustPreserveAnalysisID(const PassInfo *AnalysisID) const { - return Resolver->getAnalysisIfAvailable(AnalysisID, true) != 0; +bool Pass::mustPreserveAnalysisID(char &AID) const { + return Resolver->getAnalysisIfAvailable(&AID, true) != 0; } // dumpPassStructure - Implement the -debug-passes=Structure option @@ -76,7 +69,9 @@ /// Registration templates, but can be overloaded directly. /// const char *Pass::getPassName() const { - if (const PassInfo *PI = getPassInfo()) + AnalysisID AID = getPassID(); + const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(AID); + if (PI) return PI->getPassName(); return "Unnamed pass: implement Pass::getPassName()"; } @@ -102,7 +97,7 @@ // By default, don't do anything. } -void *Pass::getAdjustedAnalysisPointer(const PassInfo *) { +void *Pass::getAdjustedAnalysisPointer(AnalysisID AID) { return this; } @@ -234,13 +229,7 @@ return PMT_BasicBlockPassManager; } -// getPassInfo - Return the PassInfo data structure that corresponds to this -// pass... -const PassInfo *Pass::getPassInfo() const { - return lookupPassInfo(PassID); -} - -const PassInfo *Pass::lookupPassInfo(intptr_t TI) { +const PassInfo *Pass::lookupPassInfo(const void *TI) { return PassRegistry::getPassRegistry()->getPassInfo(TI); } @@ -262,8 +251,8 @@ // RegisterAGBase implementation // -RegisterAGBase::RegisterAGBase(const char *Name, intptr_t InterfaceID, - intptr_t PassID, bool isDefault) +RegisterAGBase::RegisterAGBase(const char *Name, const void *InterfaceID, + const void *PassID, bool isDefault) : PassInfo(Name, InterfaceID) { PassRegistry::getPassRegistry()->registerAnalysisGroup(InterfaceID, PassID, *this, isDefault); @@ -306,7 +295,7 @@ void passEnumerate(const PassInfo *P) { if (P->isCFGOnlyPass()) - CFGOnlyList.push_back(P); + CFGOnlyList.push_back(P->getTypeInfo()); } }; } @@ -326,15 +315,25 @@ GetCFGOnlyPasses(Preserved).enumeratePasses(); } -AnalysisUsage &AnalysisUsage::addRequiredID(AnalysisID ID) { - assert(ID && "Pass class not registered!"); - Required.push_back(ID); +AnalysisUsage &AnalysisUsage::addPreserved(StringRef Arg) { + const PassInfo *PI = Pass::lookupPassInfo(Arg); + // If the pass exists, preserve it. Otherwise silently do nothing. + if (PI) Preserved.push_back(PI->getTypeInfo()); return *this; } -AnalysisUsage &AnalysisUsage::addRequiredTransitiveID(AnalysisID ID) { - assert(ID && "Pass class not registered!"); +AnalysisUsage &AnalysisUsage::addRequiredID(const void *ID) { Required.push_back(ID); - RequiredTransitive.push_back(ID); + return *this; +} + +AnalysisUsage &AnalysisUsage::addRequiredID(char &ID) { + Required.push_back(&ID); + return *this; +} + +AnalysisUsage &AnalysisUsage::addRequiredTransitiveID(char &ID) { + Required.push_back(&ID); + RequiredTransitive.push_back(&ID); return *this; } Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Thu Aug 5 18:42:04 2010 @@ -84,13 +84,15 @@ static bool ShouldPrintBeforeOrAfterPass(Pass *P, PassOptionList &PassesToPrint) { - for (unsigned i = 0, ie = PassesToPrint.size(); i < ie; ++i) { - const llvm::PassInfo *PassInf = PassesToPrint[i]; - if (PassInf && P->getPassInfo()) - if (PassInf->getPassArgument() == - P->getPassInfo()->getPassArgument()) { - return true; - } + if (const llvm::PassInfo *PI = + PassRegistry::getPassRegistry()->getPassInfo(P->getPassID())) { + for (unsigned i = 0, ie = PassesToPrint.size(); i < ie; ++i) { + const llvm::PassInfo *PassInf = PassesToPrint[i]; + if (PassInf) + if (PassInf->getPassArgument() == PI->getPassArgument()) { + return true; + } + } } return false; } @@ -163,7 +165,7 @@ public: static char ID; explicit BBPassManager(int Depth) - : PMDataManager(Depth), FunctionPass(&ID) {} + : PMDataManager(Depth), FunctionPass(ID) {} /// Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the function, and if so, return true. @@ -224,7 +226,7 @@ public: static char ID; explicit FunctionPassManagerImpl(int Depth) : - Pass(PT_PassManager, &ID), PMDataManager(Depth), + Pass(PT_PassManager, ID), PMDataManager(Depth), PMTopLevelManager(TLM_Function), wasRun(false) { } /// add - Add a pass to the queue of passes to run. This passes ownership of @@ -298,7 +300,7 @@ public: static char ID; explicit MPPassManager(int Depth) : - Pass(PT_PassManager, &ID), PMDataManager(Depth) { } + Pass(PT_PassManager, ID), PMDataManager(Depth) { } // Delete on the fly managers. virtual ~MPPassManager() { @@ -332,7 +334,7 @@ /// Return function pass corresponding to PassInfo PI, that is /// required by module pass MP. Instantiate analysis pass, by using /// its runOnFunction() for function F. - virtual Pass* getOnTheFlyPass(Pass *MP, const PassInfo *PI, Function &F); + virtual Pass* getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F); virtual const char *getPassName() const { return "Module Pass Manager"; @@ -383,7 +385,7 @@ public: static char ID; explicit PassManagerImpl(int Depth) : - Pass(PT_PassManager, &ID), PMDataManager(Depth), + Pass(PT_PassManager, ID), PMDataManager(Depth), PMTopLevelManager(TLM_Pass) { } /// add - Add a pass to the queue of passes to run. This passes ownership of @@ -568,8 +570,9 @@ // If P is an analysis pass and it is available then do not // generate the analysis again. Stale analysis info should not be // available at this point. - if (P->getPassInfo() && - P->getPassInfo()->isAnalysis() && findAnalysisPass(P->getPassInfo())) { + const PassInfo *PI = + PassRegistry::getPassRegistry()->getPassInfo(P->getPassID()); + if (PI && PI->isAnalysis() && findAnalysisPass(P->getPassID())) { delete P; return; } @@ -586,7 +589,8 @@ Pass *AnalysisPass = findAnalysisPass(*I); if (!AnalysisPass) { - AnalysisPass = (*I)->createPass(); + const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(*I); + AnalysisPass = PI->createPass(); if (P->getPotentialPassManagerType () == AnalysisPass->getPotentialPassManagerType()) // Schedule analysis pass that is managed by the same pass manager. @@ -632,16 +636,21 @@ for (SmallVector::iterator I = ImmutablePasses.begin(), E = ImmutablePasses.end(); P == NULL && I != E; ++I) { - const PassInfo *PI = (*I)->getPassInfo(); + AnalysisID PI = (*I)->getPassID(); if (PI == AID) P = *I; // If Pass not found then check the interfaces implemented by Immutable Pass if (!P) { + const PassInfo *PassInf = + PassRegistry::getPassRegistry()->getPassInfo(PI); const std::vector &ImmPI = - PI->getInterfacesImplemented(); - if (std::find(ImmPI.begin(), ImmPI.end(), AID) != ImmPI.end()) - P = *I; + PassInf->getInterfacesImplemented(); + for (std::vector::const_iterator II = ImmPI.begin(), + EE = ImmPI.end(); II != EE; ++II) { + if ((*II)->getTypeInfo() == AID) + P = *I; + } } } @@ -724,16 +733,19 @@ /// Augement AvailableAnalysis by adding analysis made available by pass P. void PMDataManager::recordAvailableAnalysis(Pass *P) { - const PassInfo *PI = P->getPassInfo(); - if (PI == 0) return; + AnalysisID PI = P->getPassID(); AvailableAnalysis[PI] = P; + + assert(AvailableAnalysis.size()); //This pass is the current implementation of all of the interfaces it //implements as well. - const std::vector &II = PI->getInterfacesImplemented(); + const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(PI); + if (PInf == 0) return; + const std::vector &II = PInf->getInterfacesImplemented(); for (unsigned i = 0, e = II.size(); i != e; ++i) - AvailableAnalysis[II[i]] = P; + AvailableAnalysis[II[i]->getTypeInfo()] = P; } // Return true if P preserves high level analysis used by other @@ -749,7 +761,7 @@ Pass *P1 = *I; if (P1->getAsImmutablePass() == 0 && std::find(PreservedSet.begin(), PreservedSet.end(), - P1->getPassInfo()) == + P1->getPassID()) == PreservedSet.end()) return false; } @@ -799,7 +811,7 @@ AvailableAnalysis.erase(Info); } } - + // Check inherited analysis also. If P is not preserving analysis // provided by parent manager then remove it here. for (unsigned Index = 0; Index < PMT_Last; ++Index) { @@ -861,16 +873,17 @@ P->releaseMemory(); } - if (const PassInfo *PI = P->getPassInfo()) { + AnalysisID PI = P->getPassID(); + if (const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(PI)) { // Remove the pass itself (if it is not already removed). AvailableAnalysis.erase(PI); // Remove all interfaces this pass implements, for which it is also // listed as the available implementation. - const std::vector &II = PI->getInterfacesImplemented(); + const std::vector &II = PInf->getInterfacesImplemented(); for (unsigned i = 0, e = II.size(); i != e; ++i) { std::map::iterator Pos = - AvailableAnalysis.find(II[i]); + AvailableAnalysis.find(II[i]->getTypeInfo()); if (Pos != AvailableAnalysis.end() && Pos->second == P) AvailableAnalysis.erase(Pos); } @@ -941,7 +954,8 @@ for (SmallVector::iterator I = ReqAnalysisNotAvailable.begin(), E = ReqAnalysisNotAvailable.end() ;I != E; ++I) { - Pass *AnalysisPass = (*I)->createPass(); + const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(*I); + Pass *AnalysisPass = PI->createPass(); this->addLowerLevelRequiredPass(P, AnalysisPass); } @@ -1044,7 +1058,8 @@ if (PMDataManager *PMD = (*I)->getAsPMDataManager()) PMD->dumpPassArguments(); else - if (const PassInfo *PI = (*I)->getPassInfo()) + if (const PassInfo *PI = + PassRegistry::getPassRegistry()->getPassInfo((*I)->getPassID())) if (!PI->isAnalysisGroup()) dbgs() << " -" << PI->getPassArgument(); } @@ -1116,7 +1131,8 @@ dbgs() << (void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:"; for (unsigned i = 0; i != Set.size(); ++i) { if (i) dbgs() << ','; - dbgs() << ' ' << Set[i]->getPassName(); + const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(Set[i]); + dbgs() << ' ' << PInf->getPassName(); } dbgs() << '\n'; } @@ -1147,7 +1163,7 @@ llvm_unreachable("Unable to schedule pass"); } -Pass *PMDataManager::getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F) { +Pass *PMDataManager::getOnTheFlyPass(Pass *P, AnalysisID PI, Function &F) { assert(0 && "Unable to find on the fly pass"); return NULL; } @@ -1166,7 +1182,7 @@ return PM.findAnalysisPass(ID, dir); } -Pass *AnalysisResolver::findImplPass(Pass *P, const PassInfo *AnalysisPI, +Pass *AnalysisResolver::findImplPass(Pass *P, AnalysisID AnalysisPI, Function &F) { return PM.getOnTheFlyPass(P, AnalysisPI, F); } @@ -1561,7 +1577,7 @@ /// Return function pass corresponding to PassInfo PI, that is /// required by module pass MP. Instantiate analysis pass, by using /// its runOnFunction() for function F. -Pass* MPPassManager::getOnTheFlyPass(Pass *MP, const PassInfo *PI, Function &F){ +Pass* MPPassManager::getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F){ FunctionPassManagerImpl *FPP = OnTheFlyManagers[MP]; assert(FPP && "Unable to find on the fly pass"); Modified: llvm/trunk/lib/VMCore/PassRegistry.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassRegistry.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassRegistry.cpp (original) +++ llvm/trunk/lib/VMCore/PassRegistry.cpp Thu Aug 5 18:42:04 2010 @@ -60,7 +60,7 @@ } -const PassInfo *PassRegistry::getPassInfo(intptr_t TI) const { +const PassInfo *PassRegistry::getPassInfo(const void *TI) const { sys::SmartScopedLock Guard(Lock); MapType::const_iterator I = PassInfoMap.find(TI); return I != PassInfoMap.end() ? I->second : 0; @@ -108,8 +108,8 @@ /// Analysis Group Mechanisms. -void PassRegistry::registerAnalysisGroup(intptr_t InterfaceID, - intptr_t PassID, +void PassRegistry::registerAnalysisGroup(const void *InterfaceID, + const void *PassID, PassInfo& Registeree, bool isDefault) { PassInfo *InterfaceInfo = const_cast(getPassInfo(InterfaceID)); Modified: llvm/trunk/lib/VMCore/PrintModulePass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PrintModulePass.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PrintModulePass.cpp (original) +++ llvm/trunk/lib/VMCore/PrintModulePass.cpp Thu Aug 5 18:42:04 2010 @@ -28,10 +28,10 @@ bool DeleteStream; // Delete the ostream in our dtor? public: static char ID; - PrintModulePass() : ModulePass(&ID), Out(&dbgs()), + PrintModulePass() : ModulePass(ID), Out(&dbgs()), DeleteStream(false) {} PrintModulePass(const std::string &B, raw_ostream *o, bool DS) - : ModulePass(&ID), Banner(B), Out(o), DeleteStream(DS) {} + : ModulePass(ID), Banner(B), Out(o), DeleteStream(DS) {} ~PrintModulePass() { if (DeleteStream) delete Out; @@ -53,10 +53,10 @@ bool DeleteStream; // Delete the ostream in our dtor? public: static char ID; - PrintFunctionPass() : FunctionPass(&ID), Banner(""), Out(&dbgs()), + PrintFunctionPass() : FunctionPass(ID), Banner(""), Out(&dbgs()), DeleteStream(false) {} PrintFunctionPass(const std::string &B, raw_ostream *o, bool DS) - : FunctionPass(&ID), Banner(B), Out(o), DeleteStream(DS) {} + : FunctionPass(ID), Banner(B), Out(o), DeleteStream(DS) {} inline ~PrintFunctionPass() { if (DeleteStream) delete Out; Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Thu Aug 5 18:42:04 2010 @@ -72,7 +72,7 @@ struct PreVerifier : public FunctionPass { static char ID; // Pass ID, replacement for typeid - PreVerifier() : FunctionPass(&ID) { } + PreVerifier() : FunctionPass(ID) { } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -104,7 +104,7 @@ char PreVerifier::ID = 0; static RegisterPass PreVer("preverify", "Preliminary module verification"); -static const PassInfo *const PreVerifyID = &PreVer; +char &PreVerifyID = PreVerifier::ID; namespace { class TypeSet : public AbstractTypeUser { @@ -182,20 +182,20 @@ SmallPtrSet MDNodes; Verifier() - : FunctionPass(&ID), + : FunctionPass(ID), Broken(false), RealPass(true), action(AbortProcessAction), Mod(0), Context(0), DT(0), MessagesStr(Messages) {} explicit Verifier(VerifierFailureAction ctn) - : FunctionPass(&ID), + : FunctionPass(ID), Broken(false), RealPass(true), action(ctn), Mod(0), Context(0), DT(0), MessagesStr(Messages) {} explicit Verifier(bool AB) - : FunctionPass(&ID), + : FunctionPass(ID), Broken(false), RealPass(true), action( AB ? AbortProcessAction : PrintMessageAction), Mod(0), Context(0), DT(0), MessagesStr(Messages) {} explicit Verifier(DominatorTree &dt) - : FunctionPass(&ID), + : FunctionPass(ID), Broken(false), RealPass(false), action(PrintMessageAction), Mod(0), Context(0), DT(&dt), MessagesStr(Messages) {} Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original) +++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Thu Aug 5 18:42:04 2010 @@ -100,7 +100,8 @@ } static const PassInfo *getPI(Pass *P) { - const PassInfo *PI = P->getPassInfo(); + const void *ID = P->getPassID(); + const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID); delete P; return PI; } Modified: llvm/trunk/tools/bugpoint/TestPasses.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/TestPasses.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/TestPasses.cpp (original) +++ llvm/trunk/tools/bugpoint/TestPasses.cpp Thu Aug 5 18:42:04 2010 @@ -27,7 +27,7 @@ class CrashOnCalls : public BasicBlockPass { public: static char ID; // Pass ID, replacement for typeid - CrashOnCalls() : BasicBlockPass(&ID) {} + CrashOnCalls() : BasicBlockPass(ID) {} private: virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -54,7 +54,7 @@ class DeleteCalls : public BasicBlockPass { public: static char ID; // Pass ID, replacement for typeid - DeleteCalls() : BasicBlockPass(&ID) {} + DeleteCalls() : BasicBlockPass(ID) {} private: bool runOnBasicBlock(BasicBlock &BB) { for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/bugpoint.cpp (original) +++ llvm/trunk/tools/bugpoint/bugpoint.cpp Thu Aug 5 18:42:04 2010 @@ -90,7 +90,8 @@ AddToDriver(BugDriver &_D) : D(_D) {} virtual void add(Pass *P) { - const PassInfo *PI = P->getPassInfo(); + const void *ID = P->getPassID(); + const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID); D.addPasses(&PI, &PI + 1); } }; Modified: llvm/trunk/tools/llvm-prof/llvm-prof.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-prof/llvm-prof.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/tools/llvm-prof/llvm-prof.cpp (original) +++ llvm/trunk/tools/llvm-prof/llvm-prof.cpp Thu Aug 5 18:42:04 2010 @@ -128,7 +128,7 @@ public: static char ID; // Class identification, replacement for typeinfo. explicit ProfileInfoPrinterPass(ProfileInfoLoader &_PIL) - : ModulePass(&ID), PIL(_PIL) {} + : ModulePass(ID), PIL(_PIL) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/tools/opt/AnalysisWrappers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/AnalysisWrappers.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/tools/opt/AnalysisWrappers.cpp (original) +++ llvm/trunk/tools/opt/AnalysisWrappers.cpp Thu Aug 5 18:42:04 2010 @@ -31,7 +31,7 @@ /// or handle in alias analyses. struct ExternalFunctionsPassedConstants : public ModulePass { static char ID; // Pass ID, replacement for typeid - ExternalFunctionsPassedConstants() : ModulePass(&ID) {} + ExternalFunctionsPassedConstants() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { if (!I->isDeclaration()) continue; @@ -74,7 +74,7 @@ struct CallGraphPrinter : public ModulePass { static char ID; // Pass ID, replacement for typeid - CallGraphPrinter() : ModulePass(&ID) {} + CallGraphPrinter() : ModulePass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/tools/opt/GraphPrinters.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/GraphPrinters.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/tools/opt/GraphPrinters.cpp (original) +++ llvm/trunk/tools/opt/GraphPrinters.cpp Thu Aug 5 18:42:04 2010 @@ -65,7 +65,7 @@ namespace { struct CallGraphPrinter : public ModulePass { static char ID; // Pass ID, replacement for typeid - CallGraphPrinter() : ModulePass(&ID) {} + CallGraphPrinter() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { WriteGraphToFile(llvm::errs(), "callgraph", &getAnalysis()); @@ -93,7 +93,7 @@ class DomInfoPrinter : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid - DomInfoPrinter() : FunctionPass(&ID) {} + DomInfoPrinter() : FunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/tools/opt/PrintSCC.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/PrintSCC.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/tools/opt/PrintSCC.cpp (original) +++ llvm/trunk/tools/opt/PrintSCC.cpp Thu Aug 5 18:42:04 2010 @@ -36,7 +36,7 @@ namespace { struct CFGSCC : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGSCC() : FunctionPass(&ID) {} + CFGSCC() : FunctionPass(ID) {} bool runOnFunction(Function& func); void print(raw_ostream &O, const Module* = 0) const { } @@ -48,7 +48,7 @@ struct CallGraphSCC : public ModulePass { static char ID; // Pass identification, replacement for typeid - CallGraphSCC() : ModulePass(&ID) {} + CallGraphSCC() : ModulePass(ID) {} // run - Print out SCCs in the call graph for the specified module. bool runOnModule(Module &M); Modified: llvm/trunk/tools/opt/opt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/tools/opt/opt.cpp (original) +++ llvm/trunk/tools/opt/opt.cpp Thu Aug 5 18:42:04 2010 @@ -139,7 +139,7 @@ static char ID; const PassInfo *PassToPrint; CallGraphSCCPassPrinter(const PassInfo *PI) : - CallGraphSCCPass(&ID), PassToPrint(PI) {} + CallGraphSCCPass(ID), PassToPrint(PI) {} virtual bool runOnSCC(CallGraphSCC &SCC) { if (!Quiet) { @@ -148,7 +148,8 @@ for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) { Function *F = (*I)->getFunction(); if (F) - getAnalysisID(PassToPrint).print(outs(), F->getParent()); + getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), + F->getParent()); } } // Get and print pass... @@ -158,7 +159,7 @@ virtual const char *getPassName() const { return "'Pass' Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint); + AU.addRequiredID(PassToPrint->getTypeInfo()); AU.setPreservesAll(); } }; @@ -168,13 +169,13 @@ struct ModulePassPrinter : public ModulePass { static char ID; const PassInfo *PassToPrint; - ModulePassPrinter(const PassInfo *PI) : ModulePass(&ID), + ModulePassPrinter(const PassInfo *PI) : ModulePass(ID), PassToPrint(PI) {} virtual bool runOnModule(Module &M) { if (!Quiet) { outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; - getAnalysisID(PassToPrint).print(outs(), &M); + getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), &M); } // Get and print pass... @@ -184,7 +185,7 @@ virtual const char *getPassName() const { return "'Pass' Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint); + AU.addRequiredID(PassToPrint->getTypeInfo()); AU.setPreservesAll(); } }; @@ -193,7 +194,7 @@ struct FunctionPassPrinter : public FunctionPass { const PassInfo *PassToPrint; static char ID; - FunctionPassPrinter(const PassInfo *PI) : FunctionPass(&ID), + FunctionPassPrinter(const PassInfo *PI) : FunctionPass(ID), PassToPrint(PI) {} virtual bool runOnFunction(Function &F) { @@ -202,14 +203,15 @@ << "' for function '" << F.getName() << "':\n"; } // Get and print pass... - getAnalysisID(PassToPrint).print(outs(), F.getParent()); + getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), + F.getParent()); return false; } virtual const char *getPassName() const { return "FunctionPass Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint); + AU.addRequiredID(PassToPrint->getTypeInfo()); AU.setPreservesAll(); } }; @@ -220,12 +222,12 @@ static char ID; const PassInfo *PassToPrint; LoopPassPrinter(const PassInfo *PI) : - LoopPass(&ID), PassToPrint(PI) {} + LoopPass(ID), PassToPrint(PI) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM) { if (!Quiet) { outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; - getAnalysisID(PassToPrint).print(outs(), + getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), L->getHeader()->getParent()->getParent()); } // Get and print pass... @@ -235,7 +237,7 @@ virtual const char *getPassName() const { return "'Pass' Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint); + AU.addRequiredID(PassToPrint->getTypeInfo()); AU.setPreservesAll(); } }; @@ -246,7 +248,7 @@ const PassInfo *PassToPrint; static char ID; BasicBlockPassPrinter(const PassInfo *PI) - : BasicBlockPass(&ID), PassToPrint(PI) {} + : BasicBlockPass(ID), PassToPrint(PI) {} virtual bool runOnBasicBlock(BasicBlock &BB) { if (!Quiet) { @@ -255,14 +257,15 @@ } // Get and print pass... - getAnalysisID(PassToPrint).print(outs(), BB.getParent()->getParent()); + getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), + BB.getParent()->getParent()); return false; } virtual const char *getPassName() const { return "BasicBlockPass Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint); + AU.addRequiredID(PassToPrint->getTypeInfo()); AU.setPreservesAll(); } }; Modified: llvm/trunk/unittests/VMCore/PassManagerTest.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/VMCore/PassManagerTest.cpp?rev=110396&r1=110395&r2=110396&view=diff ============================================================================== --- llvm/trunk/unittests/VMCore/PassManagerTest.cpp (original) +++ llvm/trunk/unittests/VMCore/PassManagerTest.cpp Thu Aug 5 18:42:04 2010 @@ -40,7 +40,7 @@ public: static char run; static char ID; - ModuleNDNM() : ModulePass(&ID) {} + ModuleNDNM() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { run++; return false; @@ -56,7 +56,7 @@ public: static char run; static char ID; - ModuleNDM() : ModulePass(&ID) {} + ModuleNDM() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { run++; return true; @@ -70,7 +70,7 @@ public: static char run; static char ID; - ModuleNDM2() : ModulePass(&ID) {} + ModuleNDM2() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { run++; return true; @@ -83,7 +83,7 @@ public: static char run; static char ID; - ModuleDNM() : ModulePass(&ID) {} + ModuleDNM() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { EXPECT_TRUE(getAnalysisIfAvailable()); run++; @@ -119,7 +119,7 @@ EXPECT_TRUE(finalized); EXPECT_EQ(run, runc); } - PassTestBase() : P(&ID), allocated(0) { + PassTestBase() : P(ID), allocated(0) { initialized = false; finalized = false; runc = 0; @@ -253,7 +253,7 @@ struct OnTheFlyTest: public ModulePass { public: static char ID; - OnTheFlyTest() : ModulePass(&ID) {} + OnTheFlyTest() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { EXPECT_TRUE(getAnalysisIfAvailable()); for (Module::iterator I=M.begin(),E=M.end(); I != E; ++I) { From gohman at apple.com Thu Aug 5 18:44:45 2010 From: gohman at apple.com (Dan Gohman) Date: Thu, 05 Aug 2010 23:44:45 -0000 Subject: [llvm-commits] [llvm] r110398 - /llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Message-ID: <20100805234445.E90972A6C12C@llvm.org> Author: djg Date: Thu Aug 5 18:44:45 2010 New Revision: 110398 URL: http://llvm.org/viewvc/llvm-project?rev=110398&view=rev Log: Make AA private, since subclasses shouldn't (aren't don't) access it directly. Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=110398&r1=110397&r2=110398&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Thu Aug 5 18:44:45 2010 @@ -43,8 +43,11 @@ class AliasAnalysis { protected: const TargetData *TD; + +private: AliasAnalysis *AA; // Previous Alias Analysis to chain to. +protected: /// InitializeAliasAnalysis - Subclasses must call this method to initialize /// the AliasAnalysis interface before any other methods are called. This is /// typically called by the run* methods of these subclasses. This may be From gohman at apple.com Thu Aug 5 18:48:14 2010 From: gohman at apple.com (Dan Gohman) Date: Thu, 05 Aug 2010 23:48:14 -0000 Subject: [llvm-commits] [llvm] r110401 - /llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <20100805234814.2B99F2A6C12C@llvm.org> Author: djg Date: Thu Aug 5 18:48:14 2010 New Revision: 110401 URL: http://llvm.org/viewvc/llvm-project?rev=110401&view=rev Log: Fix 80-column violations. Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110401&r1=110400&r2=110401&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Thu Aug 5 18:48:14 2010 @@ -166,9 +166,9 @@ virtual void copyValue(Value *From, Value *To) {} /// getAdjustedAnalysisPointer - This method is used when a pass implements - /// an analysis interface through multiple inheritance. If needed, it should - /// override this to adjust the this pointer as needed for the specified pass - /// info. + /// an analysis interface through multiple inheritance. If needed, it + /// should override this to adjust the this pointer as needed for the + /// specified pass info. virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; @@ -237,9 +237,9 @@ bool pointsToConstantMemory(const Value *P); /// getAdjustedAnalysisPointer - This method is used when a pass implements - /// an analysis interface through multiple inheritance. If needed, it should - /// override this to adjust the this pointer as needed for the specified pass - /// info. + /// an analysis interface through multiple inheritance. If needed, it + /// should override this to adjust the this pointer as needed for the + /// specified pass info. virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; From stoklund at 2pi.dk Thu Aug 5 18:51:26 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Thu, 05 Aug 2010 23:51:26 -0000 Subject: [llvm-commits] [llvm] r110402 - /llvm/trunk/lib/CodeGen/MachineVerifier.cpp Message-ID: <20100805235126.ABF162A6C12C@llvm.org> Author: stoklund Date: Thu Aug 5 18:51:26 2010 New Revision: 110402 URL: http://llvm.org/viewvc/llvm-project?rev=110402&view=rev Log: Don't verify LiveVariables if LiveIntervals is available. LiveVariables becomes horribly wrong while the coalescer is running, but the analysis is not zapped until after the coalescer pass has run. This causes tons of false reports when calling verify form the coalescer. Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=110402&r1=110401&r2=110402&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Thu Aug 5 18:51:26 2010 @@ -245,12 +245,13 @@ TRI = TM->getRegisterInfo(); MRI = &MF.getRegInfo(); + LiveVars = NULL; + LiveInts = NULL; if (PASS) { - LiveVars = PASS->getAnalysisIfAvailable(); LiveInts = PASS->getAnalysisIfAvailable(); - } else { - LiveVars = NULL; - LiveInts = NULL; + // We don't want to verify LiveVariables if LiveIntervals is available. + if (!LiveInts) + LiveVars = PASS->getAnalysisIfAvailable(); } visitMachineFunctionBefore(); @@ -576,16 +577,16 @@ } else isKill = MO->isKill(); - if (isKill) { + if (isKill) addRegWithSubRegs(regsKilled, Reg); - // Check that LiveVars knows this kill - if (LiveVars && TargetRegisterInfo::isVirtualRegister(Reg)) { - LiveVariables::VarInfo &VI = LiveVars->getVarInfo(Reg); - if (std::find(VI.Kills.begin(), - VI.Kills.end(), MI) == VI.Kills.end()) - report("Kill missing from LiveVariables", MO, MONum); - } + // Check that LiveVars knows this kill. + if (LiveVars && TargetRegisterInfo::isVirtualRegister(Reg) && + MO->isKill()) { + LiveVariables::VarInfo &VI = LiveVars->getVarInfo(Reg); + if (std::find(VI.Kills.begin(), + VI.Kills.end(), MI) == VI.Kills.end()) + report("Kill missing from LiveVariables", MO, MONum); } // Check LiveInts liveness and kill. From stoklund at 2pi.dk Thu Aug 5 18:51:29 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Thu, 05 Aug 2010 23:51:29 -0000 Subject: [llvm-commits] [llvm] r110403 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Message-ID: <20100805235129.1EDB72A6C12D@llvm.org> Author: stoklund Date: Thu Aug 5 18:51:28 2010 New Revision: 110403 URL: http://llvm.org/viewvc/llvm-project?rev=110403&view=rev Log: Be more aggressive about removing joined physreg copies. When a joined COPY changes subreg liveness, we keep it around as a KILL, otherwise it is safe to delete. Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=110403&r1=110402&r2=110403&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Thu Aug 5 18:51:28 2010 @@ -1726,7 +1726,8 @@ bool DoDelete = true; assert(MI->isCopyLike() && "Unrecognized copy instruction"); unsigned SrcReg = MI->getOperand(MI->isSubregToReg() ? 2 : 1).getReg(); - if (TargetRegisterInfo::isPhysicalRegister(SrcReg)) + if (TargetRegisterInfo::isPhysicalRegister(SrcReg) && + MI->getNumOperands() > 2) // Do not delete extract_subreg, insert_subreg of physical // registers unless the definition is dead. e.g. // %DO = INSERT_SUBREG %D0, %S0, 1 @@ -1740,9 +1741,15 @@ ShortenDeadCopyLiveRange(li, MI); DoDelete = true; } - if (!DoDelete) + if (!DoDelete) { + // We need the instruction to adjust liveness, so make it a KILL. + if (MI->isSubregToReg()) { + MI->RemoveOperand(3); + MI->RemoveOperand(1); + } + MI->setDesc(tii_->get(TargetOpcode::KILL)); mii = llvm::next(mii); - else { + } else { li_->RemoveMachineInstrFromMaps(MI); mii = mbbi->erase(mii); ++numPeep; From echristo at apple.com Thu Aug 5 18:57:43 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 05 Aug 2010 23:57:43 -0000 Subject: [llvm-commits] [llvm] r110404 - in /llvm/trunk: lib/Target/X86/X86RegisterInfo.cpp test/CodeGen/X86/force-align-stack.ll Message-ID: <20100805235743.910D82A6C12C@llvm.org> Author: echristo Date: Thu Aug 5 18:57:43 2010 New Revision: 110404 URL: http://llvm.org/viewvc/llvm-project?rev=110404&view=rev Log: Add an option to always emit realignment code for a particular module. Added: llvm/trunk/test/CodeGen/X86/force-align-stack.ll Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=110404&r1=110403&r2=110404&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Thu Aug 5 18:57:43 2010 @@ -38,8 +38,15 @@ #include "llvm/ADT/BitVector.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/CommandLine.h" using namespace llvm; +static cl::opt +ForceStackAlign("force-align-stack", + cl::desc("Force align the stack to the minimum alignment" + " needed for the function."), + cl::init(false), cl::Hidden); + X86RegisterInfo::X86RegisterInfo(X86TargetMachine &tm, const TargetInstrInfo &tii) : X86GenRegisterInfo(tm.getSubtarget().is64Bit() ? @@ -471,7 +478,11 @@ if (0 && requiresRealignment && MFI->hasVarSizedObjects()) report_fatal_error( "Stack realignment in presense of dynamic allocas is not supported"); - + + // If we've requested that we force align the stack do so now. + if (ForceStackAlign) + return canRealignStack(MF); + return requiresRealignment && canRealignStack(MF); } @@ -906,6 +917,17 @@ bool HasFP = hasFP(MF); DebugLoc DL; + // If we're forcing a stack realignment we can't rely on just the frame + // info, we need to know the ABI stack alignment as well in case we + // have a call out. Otherwise just make sure we have some alignment - we'll + // go with the minimum SlotSize. + if (ForceStackAlign) { + if (MFI->hasCalls()) + MaxAlign = (StackAlign > MaxAlign) ? StackAlign : MaxAlign; + else if (MaxAlign < SlotSize) + MaxAlign = SlotSize; + } + // Add RETADDR move area to callee saved frame size. int TailCallReturnAddrDelta = X86FI->getTCReturnAddrDelta(); if (TailCallReturnAddrDelta < 0) @@ -1177,6 +1199,17 @@ unsigned CSSize = X86FI->getCalleeSavedFrameSize(); uint64_t NumBytes = 0; + // If we're forcing a stack realignment we can't rely on just the frame + // info, we need to know the ABI stack alignment as well in case we + // have a call out. Otherwise just make sure we have some alignment - we'll + // go with the minimum. + if (ForceStackAlign) { + if (MFI->hasCalls()) + MaxAlign = (StackAlign > MaxAlign) ? StackAlign : MaxAlign; + else + MaxAlign = MaxAlign ? MaxAlign : 4; + } + if (hasFP(MF)) { // Calculate required stack adjustment. uint64_t FrameSize = StackSize - SlotSize; Added: llvm/trunk/test/CodeGen/X86/force-align-stack.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/force-align-stack.ll?rev=110404&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/force-align-stack.ll (added) +++ llvm/trunk/test/CodeGen/X86/force-align-stack.ll Thu Aug 5 18:57:43 2010 @@ -0,0 +1,21 @@ +; RUN: llc < %s -relocation-model=static -force-align-stack | FileCheck %s +; Tests to make sure that we always align the stack out to the minimum needed - +; in this case 16-bytes. +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32" +target triple = "i386-apple-darwin10.3" + +define void @a() nounwind ssp { +entry: +; CHECK: _a: +; CHECK: andl $-16, %esp + %z = alloca <16 x i8> ; <<16 x i8>*> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store <16 x i8> zeroinitializer, <16 x i8>* %z, align 16 + call void @b(<16 x i8>* %z) nounwind + br label %return + +return: ; preds = %entry + ret void +} + +declare void @b(<16 x i8>*) From echristo at apple.com Thu Aug 5 18:59:08 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 05 Aug 2010 23:59:08 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r110405 - /llvm-gcc-4.2/trunk/gcc/config/i386/i386.h Message-ID: <20100805235908.5DCDB2A6C12C@llvm.org> Author: echristo Date: Thu Aug 5 18:59:08 2010 New Revision: 110405 URL: http://llvm.org/viewvc/llvm-project?rev=110405&view=rev Log: Have the -mstackalign option forward to -force-align-stack. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.h Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.h?rev=110405&r1=110404&r2=110405&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/i386.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.h Thu Aug 5 18:59:08 2010 @@ -3966,7 +3966,7 @@ argvec.push_back("--disable-non-leaf-fp-elim"); \ \ if (ix86_force_align_arg_pointer) \ - argvec.push_back("-realign-stack"); \ + argvec.push_back("-force-align-stack"); \ } while (0) #endif /* ENABLE_LLVM */ /* LLVM LOCAL end */ From bruno.cardoso at gmail.com Thu Aug 5 19:04:07 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Fri, 06 Aug 2010 00:04:07 -0000 Subject: [llvm-commits] [llvm] r110407 - /llvm/trunk/include/llvm/IntrinsicsX86.td Message-ID: <20100806000407.46E142A6C12C@llvm.org> Author: bruno Date: Thu Aug 5 19:04:07 2010 New Revision: 110407 URL: http://llvm.org/viewvc/llvm-project?rev=110407&view=rev Log: Remove unused AVX intrinsics Modified: llvm/trunk/include/llvm/IntrinsicsX86.td Modified: llvm/trunk/include/llvm/IntrinsicsX86.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=110407&r1=110406&r2=110407&view=diff ============================================================================== --- llvm/trunk/include/llvm/IntrinsicsX86.td (original) +++ llvm/trunk/include/llvm/IntrinsicsX86.td Thu Aug 5 19:04:07 2010 @@ -982,30 +982,12 @@ // Arithmetic ops let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". - def int_x86_avx_add_pd_256 : GCCBuiltin<"__builtin_ia32_addpd256">, - Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, - llvm_v4f64_ty], [IntrNoMem]>; - def int_x86_avx_add_ps_256 : GCCBuiltin<"__builtin_ia32_addps256">, - Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, - llvm_v8f32_ty], [IntrNoMem]>; - def int_x86_avx_sub_pd_256 : GCCBuiltin<"__builtin_ia32_subpd256">, - Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, - llvm_v4f64_ty], [IntrNoMem]>; - def int_x86_avx_sub_ps_256 : GCCBuiltin<"__builtin_ia32_subps256">, - Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, - llvm_v8f32_ty], [IntrNoMem]>; def int_x86_avx_addsub_pd_256 : GCCBuiltin<"__builtin_ia32_addsubpd256">, Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty], [IntrNoMem]>; def int_x86_avx_addsub_ps_256 : GCCBuiltin<"__builtin_ia32_addsubps256">, Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty], [IntrNoMem]>; - def int_x86_avx_div_pd_256 : GCCBuiltin<"__builtin_ia32_divpd256">, - Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, - llvm_v4f64_ty], [IntrNoMem]>; - def int_x86_avx_div_ps_256 : GCCBuiltin<"__builtin_ia32_divps256">, - Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, - llvm_v8f32_ty], [IntrNoMem]>; def int_x86_avx_max_pd_256 : GCCBuiltin<"__builtin_ia32_maxpd256">, Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_v4f64_ty], [IntrNoMem]>; @@ -1018,12 +1000,6 @@ def int_x86_avx_min_ps_256 : GCCBuiltin<"__builtin_ia32_minps256">, Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_v8f32_ty], [IntrNoMem]>; - def int_x86_avx_mul_pd_256 : GCCBuiltin<"__builtin_ia32_mulpd256">, - Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, - llvm_v4f64_ty], [IntrNoMem]>; - def int_x86_avx_mul_ps_256 : GCCBuiltin<"__builtin_ia32_mulps256">, - Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, - llvm_v8f32_ty], [IntrNoMem]>; def int_x86_avx_sqrt_pd_256 : GCCBuiltin<"__builtin_ia32_sqrtpd256">, Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty], [IntrNoMem]>; @@ -1049,34 +1025,6 @@ llvm_i32_ty], [IntrNoMem]>; } -// Logical ops -let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". - def int_x86_avx_and_pd_256 : GCCBuiltin<"__builtin_ia32_andpd256">, - Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, - llvm_v4f64_ty], [IntrNoMem]>; - def int_x86_avx_and_ps_256 : GCCBuiltin<"__builtin_ia32_andps256">, - Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, - llvm_v8f32_ty], [IntrNoMem]>; - def int_x86_avx_andn_pd_256 : GCCBuiltin<"__builtin_ia32_andnpd256">, - Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, - llvm_v4f64_ty], [IntrNoMem]>; - def int_x86_avx_andn_ps_256 : GCCBuiltin<"__builtin_ia32_andnps256">, - Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, - llvm_v8f32_ty], [IntrNoMem]>; - def int_x86_avx_or_pd_256 : GCCBuiltin<"__builtin_ia32_orpd256">, - Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, - llvm_v4f64_ty], [IntrNoMem]>; - def int_x86_avx_or_ps_256 : GCCBuiltin<"__builtin_ia32_orps256">, - Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, - llvm_v8f32_ty], [IntrNoMem]>; - def int_x86_avx_xor_pd_256 : GCCBuiltin<"__builtin_ia32_xorpd256">, - Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, - llvm_v4f64_ty], [IntrNoMem]>; - def int_x86_avx_xor_ps_256 : GCCBuiltin<"__builtin_ia32_xorps256">, - Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, - llvm_v8f32_ty], [IntrNoMem]>; -} - // Horizontal ops let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_avx_hadd_pd_256 : GCCBuiltin<"__builtin_ia32_haddpd256">, From resistor at mac.com Thu Aug 5 19:23:36 2010 From: resistor at mac.com (Owen Anderson) Date: Fri, 06 Aug 2010 00:23:36 -0000 Subject: [llvm-commits] [llvm] r110410 - in /llvm/trunk: include/llvm/ include/llvm/Analysis/ include/llvm/CodeGen/ include/llvm/Target/ include/llvm/Transforms/ include/llvm/Transforms/IPO/ include/llvm/Transforms/Utils/ lib/Analysis/ lib/Analysis/IPA/ lib/Bitcode/Writer/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/CBackend/ lib/Target/CppBackend/ lib/Target/MBlaze/ lib/Target/MSIL/ lib/Target/MSP430/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PIC16... Message-ID: <20100806002338.BDDFF2A6C12C@llvm.org> Author: resistor Date: Thu Aug 5 19:23:35 2010 New Revision: 110410 URL: http://llvm.org/viewvc/llvm-project?rev=110410&view=rev Log: Revert r110396 to fix buildbots. Modified: llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h llvm/trunk/include/llvm/Analysis/Dominators.h llvm/trunk/include/llvm/Analysis/FindUsedTypes.h llvm/trunk/include/llvm/Analysis/IntervalPartition.h llvm/trunk/include/llvm/Analysis/LazyValueInfo.h llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h llvm/trunk/include/llvm/Analysis/LoopInfo.h llvm/trunk/include/llvm/Analysis/LoopPass.h llvm/trunk/include/llvm/Analysis/Passes.h llvm/trunk/include/llvm/Analysis/PostDominators.h llvm/trunk/include/llvm/CallGraphSCCPass.h llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h llvm/trunk/include/llvm/CodeGen/LiveVariables.h llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h llvm/trunk/include/llvm/CodeGen/Passes.h llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h llvm/trunk/include/llvm/CodeGen/SlotIndexes.h llvm/trunk/include/llvm/Pass.h llvm/trunk/include/llvm/PassAnalysisSupport.h llvm/trunk/include/llvm/PassManagers.h llvm/trunk/include/llvm/PassRegistry.h llvm/trunk/include/llvm/PassSupport.h llvm/trunk/include/llvm/Target/TargetData.h llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h llvm/trunk/include/llvm/Transforms/Scalar.h llvm/trunk/include/llvm/Transforms/Utils/SSI.h llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp llvm/trunk/lib/Analysis/AliasDebugger.cpp llvm/trunk/lib/Analysis/AliasSetTracker.cpp llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/CFGPrinter.cpp llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp llvm/trunk/lib/Analysis/DomPrinter.cpp llvm/trunk/lib/Analysis/IPA/CallGraph.cpp llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp llvm/trunk/lib/Analysis/IVUsers.cpp llvm/trunk/lib/Analysis/InstCount.cpp llvm/trunk/lib/Analysis/IntervalPartition.cpp llvm/trunk/lib/Analysis/Lint.cpp llvm/trunk/lib/Analysis/LiveValues.cpp llvm/trunk/lib/Analysis/LoopPass.cpp llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp llvm/trunk/lib/Analysis/PointerTracking.cpp llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp llvm/trunk/lib/Analysis/ProfileInfo.cpp llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp llvm/trunk/lib/Analysis/RegionInfo.cpp llvm/trunk/lib/Analysis/RegionPrinter.cpp llvm/trunk/lib/Analysis/ScalarEvolution.cpp llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/BranchFolding.cpp llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp llvm/trunk/lib/CodeGen/ELFWriter.cpp llvm/trunk/lib/CodeGen/GCMetadata.cpp llvm/trunk/lib/CodeGen/GCStrategy.cpp llvm/trunk/lib/CodeGen/IfConversion.cpp llvm/trunk/lib/CodeGen/LowerSubregs.cpp llvm/trunk/lib/CodeGen/MachineCSE.cpp llvm/trunk/lib/CodeGen/MachineDominators.cpp llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp llvm/trunk/lib/CodeGen/MachineLICM.cpp llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp llvm/trunk/lib/CodeGen/MachineSink.cpp llvm/trunk/lib/CodeGen/MachineVerifier.cpp llvm/trunk/lib/CodeGen/OptimizeExts.cpp llvm/trunk/lib/CodeGen/OptimizePHIs.cpp llvm/trunk/lib/CodeGen/PHIElimination.cpp llvm/trunk/lib/CodeGen/PHIElimination.h llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp llvm/trunk/lib/CodeGen/PrologEpilogInserter.h llvm/trunk/lib/CodeGen/RegAllocFast.cpp llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp llvm/trunk/lib/CodeGen/RenderMachineFunction.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp llvm/trunk/lib/CodeGen/Splitter.h llvm/trunk/lib/CodeGen/StackProtector.cpp llvm/trunk/lib/CodeGen/StackSlotColoring.cpp llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp llvm/trunk/lib/CodeGen/TailDuplication.cpp llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp llvm/trunk/lib/CodeGen/VirtRegMap.h llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp llvm/trunk/lib/Target/CBackend/CBackend.cpp llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp llvm/trunk/lib/Target/MSIL/MSILWriter.h llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp llvm/trunk/lib/Target/Sparc/FPMover.cpp llvm/trunk/lib/Target/TargetData.cpp llvm/trunk/lib/Target/X86/SSEDomainFix.cpp llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp llvm/trunk/lib/Transforms/Hello/Hello.cpp llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp llvm/trunk/lib/Transforms/IPO/Inliner.cpp llvm/trunk/lib/Transforms/IPO/Internalize.cpp llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp llvm/trunk/lib/Transforms/IPO/PruneEH.cpp llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp llvm/trunk/lib/Transforms/InstCombine/InstCombine.h llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp llvm/trunk/lib/Transforms/Scalar/ABCD.cpp llvm/trunk/lib/Transforms/Scalar/ADCE.cpp llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp llvm/trunk/lib/Transforms/Scalar/DCE.cpp llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp llvm/trunk/lib/Transforms/Scalar/GVN.cpp llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp llvm/trunk/lib/Transforms/Scalar/LICM.cpp llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp llvm/trunk/lib/Transforms/Scalar/SCCP.cpp llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp llvm/trunk/lib/Transforms/Scalar/Sink.cpp llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp llvm/trunk/lib/Transforms/Utils/LCSSA.cpp llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp llvm/trunk/lib/Transforms/Utils/SSI.cpp llvm/trunk/lib/VMCore/Pass.cpp llvm/trunk/lib/VMCore/PassManager.cpp llvm/trunk/lib/VMCore/PassRegistry.cpp llvm/trunk/lib/VMCore/PrintModulePass.cpp llvm/trunk/lib/VMCore/Verifier.cpp llvm/trunk/tools/bugpoint/ExtractFunction.cpp llvm/trunk/tools/bugpoint/TestPasses.cpp llvm/trunk/tools/bugpoint/bugpoint.cpp llvm/trunk/tools/llvm-prof/llvm-prof.cpp llvm/trunk/tools/opt/AnalysisWrappers.cpp llvm/trunk/tools/opt/GraphPrinters.cpp llvm/trunk/tools/opt/PrintSCC.cpp llvm/trunk/tools/opt/opt.cpp llvm/trunk/unittests/VMCore/PassManagerTest.cpp Modified: llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h (original) +++ llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h Thu Aug 5 19:23:35 2010 @@ -22,7 +22,7 @@ struct DOTGraphTraitsViewer : public FunctionPass { std::string Name; - DOTGraphTraitsViewer(std::string GraphName, char &ID) : FunctionPass(ID) { + DOTGraphTraitsViewer(std::string GraphName, const void *ID) : FunctionPass(ID) { Name = GraphName; } @@ -48,7 +48,7 @@ std::string Name; - DOTGraphTraitsPrinter(std::string GraphName, char &ID) + DOTGraphTraitsPrinter(std::string GraphName, const void *ID) : FunctionPass(ID) { Name = GraphName; } Modified: llvm/trunk/include/llvm/Analysis/Dominators.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/Dominators.h (original) +++ llvm/trunk/include/llvm/Analysis/Dominators.h Thu Aug 5 19:23:35 2010 @@ -702,7 +702,7 @@ static char ID; // Pass ID, replacement for typeid DominatorTreeBase* DT; - DominatorTree() : FunctionPass(ID) { + DominatorTree() : FunctionPass(&ID) { DT = new DominatorTreeBase(false); } @@ -890,7 +890,7 @@ const bool IsPostDominators; public: - DominanceFrontierBase(char &ID, bool isPostDom) + DominanceFrontierBase(void *ID, bool isPostDom) : FunctionPass(ID), IsPostDominators(isPostDom) {} /// getRoots - Return the root blocks of the current CFG. This may include @@ -1009,7 +1009,7 @@ public: static char ID; // Pass ID, replacement for typeid DominanceFrontier() : - DominanceFrontierBase(ID, false) {} + DominanceFrontierBase(&ID, false) {} BasicBlock *getRoot() const { assert(Roots.size() == 1 && "Should always have entry node!"); Modified: llvm/trunk/include/llvm/Analysis/FindUsedTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/FindUsedTypes.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/FindUsedTypes.h (original) +++ llvm/trunk/include/llvm/Analysis/FindUsedTypes.h Thu Aug 5 19:23:35 2010 @@ -26,7 +26,7 @@ std::set UsedTypes; public: static char ID; // Pass identification, replacement for typeid - FindUsedTypes() : ModulePass(ID) {} + FindUsedTypes() : ModulePass(&ID) {} /// getTypes - After the pass has been run, return the set containing all of /// the types used in the module. Modified: llvm/trunk/include/llvm/Analysis/IntervalPartition.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/IntervalPartition.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/IntervalPartition.h (original) +++ llvm/trunk/include/llvm/Analysis/IntervalPartition.h Thu Aug 5 19:23:35 2010 @@ -48,7 +48,7 @@ public: static char ID; // Pass identification, replacement for typeid - IntervalPartition() : FunctionPass(ID), RootInterval(0) {} + IntervalPartition() : FunctionPass(&ID), RootInterval(0) {} // run - Calculate the interval partition for this function virtual bool runOnFunction(Function &F); Modified: llvm/trunk/include/llvm/Analysis/LazyValueInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LazyValueInfo.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LazyValueInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LazyValueInfo.h Thu Aug 5 19:23:35 2010 @@ -31,7 +31,7 @@ void operator=(const LazyValueInfo&); // DO NOT IMPLEMENT. public: static char ID; - LazyValueInfo() : FunctionPass(ID), PImpl(0) {} + LazyValueInfo() : FunctionPass(&ID), PImpl(0) {} ~LazyValueInfo() { assert(PImpl == 0 && "releaseMemory not called"); } /// Tristate - This is used to return true/false/dunno results. Modified: llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h Thu Aug 5 19:23:35 2010 @@ -28,9 +28,9 @@ LibCallInfo *LCI; explicit LibCallAliasAnalysis(LibCallInfo *LC = 0) - : FunctionPass(ID), LCI(LC) { + : FunctionPass(&ID), LCI(LC) { } - explicit LibCallAliasAnalysis(char &ID, LibCallInfo *LC) + explicit LibCallAliasAnalysis(const void *ID, LibCallInfo *LC) : FunctionPass(ID), LCI(LC) { } ~LibCallAliasAnalysis(); @@ -55,8 +55,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const void *PI) { - if (PI == &AliasAnalysis::ID) + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { + if (PI->isPassID(&AliasAnalysis::ID)) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h Thu Aug 5 19:23:35 2010 @@ -91,7 +91,7 @@ public: static char ID; // Class identification, replacement for typeinfo - LoopDependenceAnalysis() : LoopPass(ID) {} + LoopDependenceAnalysis() : LoopPass(&ID) {} /// isDependencePair - Check whether two values can possibly give rise to /// a data dependence: that is the case if both are instructions accessing Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Thu Aug 5 19:23:35 2010 @@ -940,7 +940,7 @@ public: static char ID; // Pass identification, replacement for typeid - LoopInfo() : FunctionPass(ID) {} + LoopInfo() : FunctionPass(&ID) {} LoopInfoBase& getBase() { return LI; } Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopPass.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopPass.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopPass.h Thu Aug 5 19:23:35 2010 @@ -28,7 +28,8 @@ class LoopPass : public Pass { public: - explicit LoopPass(char &pid) : Pass(PT_Loop, pid) {} + explicit LoopPass(intptr_t pid) : Pass(PT_Loop, pid) {} + explicit LoopPass(void *pid) : Pass(PT_Loop, pid) {} /// getPrinterPass - Get a pass to print the function corresponding /// to a Loop. Modified: llvm/trunk/include/llvm/Analysis/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Passes.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/Passes.h (original) +++ llvm/trunk/include/llvm/Analysis/Passes.h Thu Aug 5 19:23:35 2010 @@ -92,7 +92,7 @@ // file. // ModulePass *createProfileLoaderPass(); - extern char &ProfileLoaderPassID; + extern const PassInfo *ProfileLoaderPassID; //===--------------------------------------------------------------------===// // @@ -106,7 +106,7 @@ // instead of loading it from a previous run. // FunctionPass *createProfileEstimatorPass(); - extern char &ProfileEstimatorPassID; + extern const PassInfo *ProfileEstimatorPassID; //===--------------------------------------------------------------------===// // Modified: llvm/trunk/include/llvm/Analysis/PostDominators.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/PostDominators.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/PostDominators.h (original) +++ llvm/trunk/include/llvm/Analysis/PostDominators.h Thu Aug 5 19:23:35 2010 @@ -25,7 +25,7 @@ static char ID; // Pass identification, replacement for typeid DominatorTreeBase* DT; - PostDominatorTree() : FunctionPass(ID) { + PostDominatorTree() : FunctionPass(&ID) { DT = new DominatorTreeBase(true); } @@ -106,7 +106,7 @@ struct PostDominanceFrontier : public DominanceFrontierBase { static char ID; PostDominanceFrontier() - : DominanceFrontierBase(ID, true) {} + : DominanceFrontierBase(&ID, true) {} virtual bool runOnFunction(Function &) { Frontiers.clear(); Modified: llvm/trunk/include/llvm/CallGraphSCCPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CallGraphSCCPass.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/CallGraphSCCPass.h (original) +++ llvm/trunk/include/llvm/CallGraphSCCPass.h Thu Aug 5 19:23:35 2010 @@ -33,7 +33,8 @@ class CallGraphSCCPass : public Pass { public: - explicit CallGraphSCCPass(char &pid) : Pass(PT_CallGraphSCC, pid) {} + explicit CallGraphSCCPass(intptr_t pid) : Pass(PT_CallGraphSCC, pid) {} + explicit CallGraphSCCPass(void *pid) : Pass(PT_CallGraphSCC, pid) {} /// createPrinterPass - Get a pass that prints the Module /// corresponding to a CallGraph. Modified: llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h (original) +++ llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h Thu Aug 5 19:23:35 2010 @@ -23,7 +23,7 @@ public: static char ID; - CalculateSpillWeights() : MachineFunctionPass(ID) {} + CalculateSpillWeights() : MachineFunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Thu Aug 5 19:23:35 2010 @@ -68,7 +68,7 @@ public: static char ID; // Pass identification, replacement for typeid - LiveIntervals() : MachineFunctionPass(ID) {} + LiveIntervals() : MachineFunctionPass(&ID) {} // Calculate the spill weight to assign to a single instruction. static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth); Modified: llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h Thu Aug 5 19:23:35 2010 @@ -39,7 +39,7 @@ public: static char ID; // Pass identification, replacement for typeid - LiveStacks() : MachineFunctionPass(ID) {} + LiveStacks() : MachineFunctionPass(&ID) {} typedef SS2IntervalMap::iterator iterator; typedef SS2IntervalMap::const_iterator const_iterator; Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveVariables.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveVariables.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveVariables.h Thu Aug 5 19:23:35 2010 @@ -46,7 +46,7 @@ class LiveVariables : public MachineFunctionPass { public: static char ID; // Pass identification, replacement for typeid - LiveVariables() : MachineFunctionPass(ID) {} + LiveVariables() : MachineFunctionPass(&ID) {} /// VarInfo - This represents the regions where a virtual register is live in /// the program. We represent this with three different pieces of Modified: llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h Thu Aug 5 19:23:35 2010 @@ -31,7 +31,8 @@ /// override runOnMachineFunction. class MachineFunctionPass : public FunctionPass { protected: - explicit MachineFunctionPass(char &ID) : FunctionPass(ID) {} + explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {} + explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {} /// runOnMachineFunction - This method must be overloaded to perform the /// desired machine code transformation or analysis. Modified: llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h Thu Aug 5 19:23:35 2010 @@ -67,7 +67,7 @@ public: static char ID; // Pass identification, replacement for typeid - MachineLoopInfo() : MachineFunctionPass(ID) {} + MachineLoopInfo() : MachineFunctionPass(&ID) {} LoopInfoBase& getBase() { return LI; } Modified: llvm/trunk/include/llvm/CodeGen/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) +++ llvm/trunk/include/llvm/CodeGen/Passes.h Thu Aug 5 19:23:35 2010 @@ -43,18 +43,18 @@ /// MachineLoopInfo pass - This pass is a loop analysis pass. /// - extern char &MachineLoopInfoID; + extern const PassInfo *const MachineLoopInfoID; /// MachineDominators pass - This pass is a machine dominators analysis pass. /// - extern char &MachineDominatorsID; + extern const PassInfo *const MachineDominatorsID; /// PHIElimination pass - This pass eliminates machine instruction PHI nodes /// by inserting copy instructions. This destroys SSA information, but is the /// desired input for some register allocators. This pass is "required" by /// these register allocator like this: AU.addRequiredID(PHIEliminationID); /// - extern char &PHIEliminationID; + extern const PassInfo *const PHIEliminationID; /// StrongPHIElimination pass - This pass eliminates machine instruction PHI /// nodes by inserting copy instructions. This destroys SSA information, but @@ -62,23 +62,23 @@ /// "required" by these register allocator like this: /// AU.addRequiredID(PHIEliminationID); /// This pass is still in development - extern char &StrongPHIEliminationID; + extern const PassInfo *const StrongPHIEliminationID; - extern char &PreAllocSplittingID; + extern const PassInfo *const PreAllocSplittingID; /// SimpleRegisterCoalescing pass. Aggressively coalesces every register /// copy it can. /// - extern char &SimpleRegisterCoalescingID; + extern const PassInfo *const SimpleRegisterCoalescingID; /// TwoAddressInstruction pass - This pass reduces two-address instructions to /// use two operands. This destroys SSA information but it is desired by /// register allocators. - extern char &TwoAddressInstructionPassID; + extern const PassInfo *const TwoAddressInstructionPassID; /// UnreachableMachineBlockElimination pass - This pass removes unreachable /// machine basic blocks. - extern char &UnreachableMachineBlockElimID; + extern const PassInfo *const UnreachableMachineBlockElimID; /// DeadMachineInstructionElim pass - This pass removes dead machine /// instructions. Modified: llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h (original) +++ llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h Thu Aug 5 19:23:35 2010 @@ -31,7 +31,7 @@ public: static char ID; - ProcessImplicitDefs() : MachineFunctionPass(ID) {} + ProcessImplicitDefs() : MachineFunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/include/llvm/CodeGen/SlotIndexes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SlotIndexes.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SlotIndexes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SlotIndexes.h Thu Aug 5 19:23:35 2010 @@ -475,7 +475,7 @@ public: static char ID; - SlotIndexes() : MachineFunctionPass(ID), indexListHead(0) {} + SlotIndexes() : MachineFunctionPass(&ID), indexListHead(0) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; virtual void releaseMemory(); Modified: llvm/trunk/include/llvm/Pass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Pass.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Pass.h (original) +++ llvm/trunk/include/llvm/Pass.h Thu Aug 5 19:23:35 2010 @@ -50,7 +50,7 @@ class StringRef; // AnalysisID - Use the PassInfo to identify a pass... -typedef const void* AnalysisID; +typedef const PassInfo* AnalysisID; /// Different types of internal pass managers. External pass managers /// (PassManager and FunctionPassManager) are not represented here. @@ -82,13 +82,14 @@ /// class Pass { AnalysisResolver *Resolver; // Used to resolve analysis - const void *PassID; + intptr_t PassID; PassKind Kind; void operator=(const Pass&); // DO NOT IMPLEMENT Pass(const Pass &); // DO NOT IMPLEMENT public: - explicit Pass(PassKind K, char &pid); + explicit Pass(PassKind K, intptr_t pid); + explicit Pass(PassKind K, const void *pid); virtual ~Pass(); @@ -100,10 +101,10 @@ /// virtual const char *getPassName() const; - /// getPassID - Return the PassID number that corresponds to this pass. - virtual AnalysisID getPassID() const { - return PassID; - } + /// getPassInfo - Return the PassInfo data structure that corresponds to this + /// pass... If the pass has not been registered, this will return null. + /// + const PassInfo *getPassInfo() const; /// print - Print out the internal state of the pass. This is called by /// Analyze to print out the contents of an analysis. Otherwise it is not @@ -158,7 +159,7 @@ /// an analysis interface through multiple inheritance. If needed, it should /// override this to adjust the this pointer as needed for the specified pass /// info. - virtual void *getAdjustedAnalysisPointer(AnalysisID ID); + virtual void *getAdjustedAnalysisPointer(const PassInfo *); virtual ImmutablePass *getAsImmutablePass(); virtual PMDataManager *getAsPMDataManager(); @@ -169,9 +170,14 @@ // dumpPassStructure - Implement the -debug-passes=PassStructure option virtual void dumpPassStructure(unsigned Offset = 0); + template + static const PassInfo *getClassPassInfo() { + return lookupPassInfo(intptr_t(&AnalysisClass::ID)); + } + // lookupPassInfo - Return the pass info object for the specified pass class, // or null if it is not known. - static const PassInfo *lookupPassInfo(const void *TI); + static const PassInfo *lookupPassInfo(intptr_t TI); // lookupPassInfo - Return the pass info object for the pass with the given // argument string, or null if it is not known. @@ -194,7 +200,7 @@ /// don't have the class name available (use getAnalysisIfAvailable if you /// do), but it can tell you if you need to preserve the pass at least. /// - bool mustPreserveAnalysisID(char &AID) const; + bool mustPreserveAnalysisID(const PassInfo *AnalysisID) const; /// getAnalysis() - This function is used by subclasses to get /// to the analysis information that they claim to use by overriding the @@ -207,10 +213,10 @@ AnalysisType &getAnalysis(Function &F); // Defined in PassAnalysisSupport.h template - AnalysisType &getAnalysisID(AnalysisID PI) const; + AnalysisType &getAnalysisID(const PassInfo *PI) const; template - AnalysisType &getAnalysisID(AnalysisID PI, Function &F); + AnalysisType &getAnalysisID(const PassInfo *PI, Function &F); }; @@ -234,7 +240,8 @@ /// Return what kind of Pass Manager can manage this pass. virtual PassManagerType getPotentialPassManagerType() const; - explicit ModulePass(char &pid) : Pass(PT_Module, pid) {} + explicit ModulePass(intptr_t pid) : Pass(PT_Module, pid) {} + explicit ModulePass(const void *pid) : Pass(PT_Module, pid) {} // Force out-of-line virtual method. virtual ~ModulePass(); }; @@ -261,7 +268,8 @@ /// bool runOnModule(Module &) { return false; } - explicit ImmutablePass(char &pid) + explicit ImmutablePass(intptr_t pid) : ModulePass(pid) {} + explicit ImmutablePass(const void *pid) : ModulePass(pid) {} // Force out-of-line virtual method. @@ -279,7 +287,8 @@ /// class FunctionPass : public Pass { public: - explicit FunctionPass(char &pid) : Pass(PT_Function, pid) {} + explicit FunctionPass(intptr_t pid) : Pass(PT_Function, pid) {} + explicit FunctionPass(const void *pid) : Pass(PT_Function, pid) {} /// createPrinterPass - Get a function printer pass. Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const; @@ -331,7 +340,8 @@ /// class BasicBlockPass : public Pass { public: - explicit BasicBlockPass(char &pid) : Pass(PT_BasicBlock, pid) {} + explicit BasicBlockPass(intptr_t pid) : Pass(PT_BasicBlock, pid) {} + explicit BasicBlockPass(const void *pid) : Pass(PT_BasicBlock, pid) {} /// createPrinterPass - Get a function printer pass. Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const; Modified: llvm/trunk/include/llvm/PassAnalysisSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassAnalysisSupport.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassAnalysisSupport.h (original) +++ llvm/trunk/include/llvm/PassAnalysisSupport.h Thu Aug 5 19:23:35 2010 @@ -49,37 +49,34 @@ // addRequired - Add the specified ID to the required set of the usage info // for a pass. // - AnalysisUsage &addRequiredID(const void *ID); - AnalysisUsage &addRequiredID(char &ID); + AnalysisUsage &addRequiredID(AnalysisID ID); template AnalysisUsage &addRequired() { - return addRequiredID(PassClass::ID); + return addRequiredID(Pass::getClassPassInfo()); } - AnalysisUsage &addRequiredTransitiveID(char &ID); + AnalysisUsage &addRequiredTransitiveID(AnalysisID ID); template AnalysisUsage &addRequiredTransitive() { - return addRequiredTransitiveID(PassClass::ID); + AnalysisID ID = Pass::getClassPassInfo(); + return addRequiredTransitiveID(ID); } // addPreserved - Add the specified ID to the set of analyses preserved by // this pass // - AnalysisUsage &addPreservedID(const void *ID) { + AnalysisUsage &addPreservedID(AnalysisID ID) { Preserved.push_back(ID); return *this; } - AnalysisUsage &addPreservedID(char &ID) { - Preserved.push_back(&ID); - return *this; - } // addPreserved - Add the specified Pass class to the set of analyses // preserved by this pass. // template AnalysisUsage &addPreserved() { - Preserved.push_back(&PassClass::ID); + assert(Pass::getClassPassInfo() && "Pass class not registered!"); + Preserved.push_back(Pass::getClassPassInfo()); return *this; } @@ -88,7 +85,12 @@ // This can be useful when a pass is trivially preserved, but may not be // linked in. Be careful about spelling! // - AnalysisUsage &addPreserved(StringRef Arg); + AnalysisUsage &addPreserved(StringRef Arg) { + const PassInfo *PI = Pass::lookupPassInfo(Arg); + // If the pass exists, preserve it. Otherwise silently do nothing. + if (PI) Preserved.push_back(PI); + return *this; + } // setPreservesAll - Set by analyses that do not transform their input at all void setPreservesAll() { PreservesAll = true; } @@ -128,7 +130,7 @@ inline PMDataManager &getPMDataManager() { return PM; } // Find pass that is implementing PI. - Pass *findImplPass(AnalysisID PI) { + Pass *findImplPass(const PassInfo *PI) { Pass *ResultPass = 0; for (unsigned i = 0; i < AnalysisImpls.size() ; ++i) { if (AnalysisImpls[i].first == PI) { @@ -140,10 +142,10 @@ } // Find pass that is implementing PI. Initialize pass for Function F. - Pass *findImplPass(Pass *P, AnalysisID PI, Function &F); + Pass *findImplPass(Pass *P, const PassInfo *PI, Function &F); - void addAnalysisImplsPair(AnalysisID PI, Pass *P) { - std::pair pir = std::make_pair(PI,P); + void addAnalysisImplsPair(const PassInfo *PI, Pass *P) { + std::pair pir = std::make_pair(PI,P); AnalysisImpls.push_back(pir); } @@ -158,7 +160,7 @@ // AnalysisImpls - This keeps track of which passes implements the interfaces // that are required by the current pass (to implement getAnalysis()). - std::vector > AnalysisImpls; + std::vector > AnalysisImpls; private: // PassManager that is used to resolve analysis info @@ -177,7 +179,8 @@ AnalysisType *Pass::getAnalysisIfAvailable() const { assert(Resolver && "Pass not resident in a PassManager object!"); - const void *PI = &AnalysisType::ID; + const PassInfo *PI = getClassPassInfo(); + if (PI == 0) return 0; Pass *ResultPass = Resolver->getAnalysisIfAvailable(PI, true); if (ResultPass == 0) return 0; @@ -196,11 +199,11 @@ template AnalysisType &Pass::getAnalysis() const { assert(Resolver && "Pass has not been inserted into a PassManager object!"); - return getAnalysisID(&AnalysisType::ID); + return getAnalysisID(getClassPassInfo()); } template -AnalysisType &Pass::getAnalysisID(AnalysisID PI) const { +AnalysisType &Pass::getAnalysisID(const PassInfo *PI) const { assert(PI && "getAnalysis for unregistered pass!"); assert(Resolver&&"Pass has not been inserted into a PassManager object!"); // PI *must* appear in AnalysisImpls. Because the number of passes used @@ -226,11 +229,11 @@ AnalysisType &Pass::getAnalysis(Function &F) { assert(Resolver &&"Pass has not been inserted into a PassManager object!"); - return getAnalysisID(&AnalysisType::ID, F); + return getAnalysisID(getClassPassInfo(), F); } template -AnalysisType &Pass::getAnalysisID(AnalysisID PI, Function &F) { +AnalysisType &Pass::getAnalysisID(const PassInfo *PI, Function &F) { assert(PI && "getAnalysis for unregistered pass!"); assert(Resolver && "Pass has not been inserted into a PassManager object!"); // PI *must* appear in AnalysisImpls. Because the number of passes used Modified: llvm/trunk/include/llvm/PassManagers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassManagers.h (original) +++ llvm/trunk/include/llvm/PassManagers.h Thu Aug 5 19:23:35 2010 @@ -302,7 +302,7 @@ /// through getAnalysis interface. virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass); - virtual Pass *getOnTheFlyPass(Pass *P, AnalysisID PI, Function &F); + virtual Pass *getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F); /// Initialize available analysis information. void initializeAnalysisInfo() { @@ -414,7 +414,7 @@ public: static char ID; explicit FPPassManager(int Depth) - : ModulePass(ID), PMDataManager(Depth) { } + : ModulePass(&ID), PMDataManager(Depth) { } /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. Modified: llvm/trunk/include/llvm/PassRegistry.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassRegistry.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassRegistry.h (original) +++ llvm/trunk/include/llvm/PassRegistry.h Thu Aug 5 19:23:35 2010 @@ -34,7 +34,7 @@ mutable sys::SmartMutex Lock; /// PassInfoMap - Keep track of the PassInfo object for each registered pass. - typedef std::map MapType; + typedef std::map MapType; MapType PassInfoMap; typedef StringMap StringMapType; @@ -51,14 +51,14 @@ public: static PassRegistry *getPassRegistry(); - const PassInfo *getPassInfo(const void *TI) const; + const PassInfo *getPassInfo(intptr_t TI) const; const PassInfo *getPassInfo(StringRef Arg) const; void registerPass(const PassInfo &PI); void unregisterPass(const PassInfo &PI); /// Analysis Group Mechanisms. - void registerAnalysisGroup(const void *InterfaceID, const void *PassID, + void registerAnalysisGroup(intptr_t InterfaceID, intptr_t PassID, PassInfo& Registeree, bool isDefault); void enumerateWith(PassRegistrationListener *L); Modified: llvm/trunk/include/llvm/PassSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassSupport.h (original) +++ llvm/trunk/include/llvm/PassSupport.h Thu Aug 5 19:23:35 2010 @@ -41,7 +41,7 @@ private: const char *const PassName; // Nice name for Pass const char *const PassArgument; // Command Line argument to run this pass - const void *PassID; + const intptr_t PassID; const bool IsCFGOnlyPass; // Pass only looks at the CFG. const bool IsAnalysis; // True if an analysis pass. const bool IsAnalysisGroup; // True if an analysis group. @@ -52,7 +52,7 @@ public: /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. - PassInfo(const char *name, const char *arg, const void *pi, + PassInfo(const char *name, const char *arg, intptr_t pi, NormalCtor_t normal = 0, bool isCFGOnly = false, bool is_analysis = false) : PassName(name), PassArgument(arg), PassID(pi), @@ -63,7 +63,7 @@ /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. This version is for use by analysis groups; it /// does not auto-register the pass. - PassInfo(const char *name, const void *pi) + PassInfo(const char *name, intptr_t pi) : PassName(name), PassArgument(""), PassID(pi), IsCFGOnlyPass(false), IsAnalysis(false), IsAnalysisGroup(true), NormalCtor(0) { @@ -81,11 +81,11 @@ /// getTypeInfo - Return the id object for the pass... /// TODO : Rename - const void *getTypeInfo() const { return PassID; } + intptr_t getTypeInfo() const { return PassID; } /// Return true if this PassID implements the specified ID pointer. - bool isPassID(const void *IDPtr) const { - return PassID == IDPtr; + bool isPassID(void *IDPtr) const { + return PassID == (intptr_t)IDPtr; } /// isAnalysisGroup - Return true if this is an analysis group, not a normal @@ -161,7 +161,7 @@ // Register Pass using default constructor... RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false, bool is_analysis = false) - : PassInfo(Name, PassArg, &passName::ID, + : PassInfo(Name, PassArg, intptr_t(&passName::ID), PassInfo::NormalCtor_t(callDefaultCtor), CFGOnly, is_analysis) { @@ -191,8 +191,8 @@ class RegisterAGBase : public PassInfo { protected: RegisterAGBase(const char *Name, - const void *InterfaceID, - const void *PassID = 0, + intptr_t InterfaceID, + intptr_t PassID = 0, bool isDefault = false); }; @@ -200,12 +200,12 @@ struct RegisterAnalysisGroup : public RegisterAGBase { explicit RegisterAnalysisGroup(PassInfo &RPB) : RegisterAGBase(RPB.getPassName(), - &Interface::ID, RPB.getTypeInfo(), + intptr_t(&Interface::ID), RPB.getTypeInfo(), Default) { } explicit RegisterAnalysisGroup(const char *Name) - : RegisterAGBase(Name, &Interface::ID) { + : RegisterAGBase(Name, intptr_t(&Interface::ID)) { } }; Modified: llvm/trunk/include/llvm/Target/TargetData.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetData.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetData.h (original) +++ llvm/trunk/include/llvm/Target/TargetData.h Thu Aug 5 19:23:35 2010 @@ -110,7 +110,7 @@ /// Constructs a TargetData from a specification string. See init(). explicit TargetData(StringRef TargetDescription) - : ImmutablePass(ID) { + : ImmutablePass(&ID) { init(TargetDescription); } @@ -118,7 +118,7 @@ explicit TargetData(const Module *M); TargetData(const TargetData &TD) : - ImmutablePass(ID), + ImmutablePass(&ID), LittleEndian(TD.isLittleEndian()), PointerMemSize(TD.PointerMemSize), PointerABIAlign(TD.PointerABIAlign), Modified: llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h (original) +++ llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h Thu Aug 5 19:23:35 2010 @@ -30,8 +30,8 @@ /// perform the inlining operations that do not depend on the policy. /// struct Inliner : public CallGraphSCCPass { - explicit Inliner(char &ID); - explicit Inliner(char &ID, int Threshold); + explicit Inliner(void *ID); + explicit Inliner(void *ID, int Threshold); /// getAnalysisUsage - For this class, we declare that we require and preserve /// the call graph. If the derived class implements this method, it should Modified: llvm/trunk/include/llvm/Transforms/Scalar.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Scalar.h (original) +++ llvm/trunk/include/llvm/Transforms/Scalar.h Thu Aug 5 19:23:35 2010 @@ -149,7 +149,7 @@ // ret i32 %Y // FunctionPass *createPromoteMemoryToRegisterPass(); -extern char &PromoteMemoryToRegisterID; +extern const PassInfo *const PromoteMemoryToRegisterID; //===----------------------------------------------------------------------===// // @@ -158,7 +158,7 @@ // hacking easier. // FunctionPass *createDemoteRegisterToMemoryPass(); -extern char &DemoteRegisterToMemoryID; +extern const PassInfo *const DemoteRegisterToMemoryID; //===----------------------------------------------------------------------===// // @@ -202,7 +202,7 @@ // (set, immediate dominators, tree, and frontier) information. // FunctionPass *createBreakCriticalEdgesPass(); -extern char &BreakCriticalEdgesID; +extern const PassInfo *const BreakCriticalEdgesID; //===----------------------------------------------------------------------===// // @@ -213,7 +213,7 @@ // AU.addRequiredID(LoopSimplifyID); // Pass *createLoopSimplifyPass(); -extern char &LoopSimplifyID; +extern const PassInfo *const LoopSimplifyID; //===----------------------------------------------------------------------===// // @@ -228,7 +228,7 @@ // chained binary branch instructions. // FunctionPass *createLowerSwitchPass(); -extern char &LowerSwitchID; +extern const PassInfo *const LowerSwitchID; //===----------------------------------------------------------------------===// // @@ -243,7 +243,7 @@ FunctionPass *createLowerInvokePass(const TargetLowering *TLI = 0); FunctionPass *createLowerInvokePass(const TargetLowering *TLI, bool useExpensiveEHSupport); -extern char &LowerInvokePassID; +extern const PassInfo *const LowerInvokePassID; //===----------------------------------------------------------------------===// // @@ -258,7 +258,7 @@ // optimizations. // Pass *createLCSSAPass(); -extern char &LCSSAID; +extern const PassInfo *const LCSSAID; //===----------------------------------------------------------------------===// // @@ -304,7 +304,7 @@ // InstructionNamer - Give any unnamed non-void instructions "tmp" names. // FunctionPass *createInstructionNamerPass(); -extern char &InstructionNamerID; +extern const PassInfo *const InstructionNamerID; //===----------------------------------------------------------------------===// // Modified: llvm/trunk/include/llvm/Transforms/Utils/SSI.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/SSI.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/SSI.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/SSI.h Thu Aug 5 19:23:35 2010 @@ -39,7 +39,7 @@ public: static char ID; // Pass identification, replacement for typeid. SSI() : - FunctionPass(ID) { + FunctionPass(&ID) { } void getAnalysisUsage(AnalysisUsage &AU) const; Modified: llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h Thu Aug 5 19:23:35 2010 @@ -26,7 +26,7 @@ BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock; public: static char ID; // Pass identification, replacement for typeid - UnifyFunctionExitNodes() : FunctionPass(ID), + UnifyFunctionExitNodes() : FunctionPass(&ID), ReturnBlock(0), UnwindBlock(0) {} // We can preserve non-critical-edgeness when we unify function exit nodes Modified: llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp Thu Aug 5 19:23:35 2010 @@ -34,7 +34,7 @@ Module *M; public: static char ID; // Class identification, replacement for typeinfo - AliasAnalysisCounter() : ModulePass(ID) { + AliasAnalysisCounter() : ModulePass(&ID) { No = May = Must = 0; NoMR = JustRef = JustMod = MR = 0; } @@ -87,8 +87,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { - if (PI == &AliasAnalysis::ID) + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { + if (PI->isPassID(&AliasAnalysis::ID)) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Thu Aug 5 19:23:35 2010 @@ -50,7 +50,7 @@ public: static char ID; // Pass identification, replacement for typeid - AAEval() : FunctionPass(ID) {} + AAEval() : FunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Analysis/AliasDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasDebugger.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasDebugger.cpp (original) +++ llvm/trunk/lib/Analysis/AliasDebugger.cpp Thu Aug 5 19:23:35 2010 @@ -39,7 +39,7 @@ public: static char ID; // Class identification, replacement for typeinfo - AliasDebugger() : ModulePass(ID) {} + AliasDebugger() : ModulePass(&ID) {} bool runOnModule(Module &M) { InitializeAliasAnalysis(this); // set up super class @@ -83,8 +83,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { - if (PI == &AliasAnalysis::ID) + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { + if (PI->isPassID(&AliasAnalysis::ID)) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original) +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Thu Aug 5 19:23:35 2010 @@ -579,7 +579,7 @@ AliasSetTracker *Tracker; public: static char ID; // Pass identification, replacement for typeid - AliasSetPrinter() : FunctionPass(ID) {} + AliasSetPrinter() : FunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Thu Aug 5 19:23:35 2010 @@ -137,8 +137,8 @@ /// struct NoAA : public ImmutablePass, public AliasAnalysis { static char ID; // Class identification, replacement for typeinfo - NoAA() : ImmutablePass(ID) {} - explicit NoAA(char &PID) : ImmutablePass(PID) { } + NoAA() : ImmutablePass(&ID) {} + explicit NoAA(void *PID) : ImmutablePass(PID) { } virtual void getAnalysisUsage(AnalysisUsage &AU) const { } @@ -215,7 +215,7 @@ /// derives from the NoAA class. struct BasicAliasAnalysis : public NoAA { static char ID; // Class identification, replacement for typeinfo - BasicAliasAnalysis() : NoAA(ID) {} + BasicAliasAnalysis() : NoAA(&ID) {} AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size) { Modified: llvm/trunk/lib/Analysis/CFGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFGPrinter.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/CFGPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/CFGPrinter.cpp Thu Aug 5 19:23:35 2010 @@ -25,7 +25,7 @@ namespace { struct CFGViewer : public FunctionPass { static char ID; // Pass identifcation, replacement for typeid - CFGViewer() : FunctionPass(ID) {} + CFGViewer() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F) { F.viewCFG(); @@ -46,7 +46,7 @@ namespace { struct CFGOnlyViewer : public FunctionPass { static char ID; // Pass identifcation, replacement for typeid - CFGOnlyViewer() : FunctionPass(ID) {} + CFGOnlyViewer() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F) { F.viewCFGOnly(); @@ -68,8 +68,8 @@ namespace { struct CFGPrinter : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGPrinter() : FunctionPass(ID) {} - explicit CFGPrinter(char &pid) : FunctionPass(pid) {} + CFGPrinter() : FunctionPass(&ID) {} + explicit CFGPrinter(void *pid) : FunctionPass(pid) {} virtual bool runOnFunction(Function &F) { std::string Filename = "cfg." + F.getNameStr() + ".dot"; @@ -101,8 +101,8 @@ namespace { struct CFGOnlyPrinter : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGOnlyPrinter() : FunctionPass(ID) {} - explicit CFGOnlyPrinter(char &pid) : FunctionPass(pid) {} + CFGOnlyPrinter() : FunctionPass(&ID) {} + explicit CFGOnlyPrinter(void *pid) : FunctionPass(pid) {} virtual bool runOnFunction(Function &F) { std::string Filename = "cfg." + F.getNameStr() + ".dot"; errs() << "Writing '" << Filename << "'..."; Modified: llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp Thu Aug 5 19:23:35 2010 @@ -40,7 +40,7 @@ void printVariableDeclaration(const Value *V); public: static char ID; // Pass identification - PrintDbgInfo() : FunctionPass(ID), Out(outs()) {} + PrintDbgInfo() : FunctionPass(&ID), Out(outs()) {} virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/lib/Analysis/DomPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DomPrinter.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DomPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/DomPrinter.cpp Thu Aug 5 19:23:35 2010 @@ -86,27 +86,27 @@ struct DomViewer : public DOTGraphTraitsViewer { static char ID; - DomViewer() : DOTGraphTraitsViewer("dom", ID){} + DomViewer() : DOTGraphTraitsViewer("dom", &ID){} }; struct DomOnlyViewer : public DOTGraphTraitsViewer { static char ID; - DomOnlyViewer() : DOTGraphTraitsViewer("domonly", ID){} + DomOnlyViewer() : DOTGraphTraitsViewer("domonly", &ID){} }; struct PostDomViewer : public DOTGraphTraitsViewer { static char ID; PostDomViewer() : - DOTGraphTraitsViewer("postdom", ID){} + DOTGraphTraitsViewer("postdom", &ID){} }; struct PostDomOnlyViewer : public DOTGraphTraitsViewer { static char ID; PostDomOnlyViewer() : - DOTGraphTraitsViewer("postdomonly", ID){} + DOTGraphTraitsViewer("postdomonly", &ID){} }; } // end anonymous namespace @@ -133,27 +133,27 @@ struct DomPrinter : public DOTGraphTraitsPrinter { static char ID; - DomPrinter() : DOTGraphTraitsPrinter("dom", ID) {} + DomPrinter() : DOTGraphTraitsPrinter("dom", &ID) {} }; struct DomOnlyPrinter : public DOTGraphTraitsPrinter { static char ID; - DomOnlyPrinter() : DOTGraphTraitsPrinter("domonly", ID) {} + DomOnlyPrinter() : DOTGraphTraitsPrinter("domonly", &ID) {} }; struct PostDomPrinter : public DOTGraphTraitsPrinter { static char ID; PostDomPrinter() : - DOTGraphTraitsPrinter("postdom", ID) {} + DOTGraphTraitsPrinter("postdom", &ID) {} }; struct PostDomOnlyPrinter : public DOTGraphTraitsPrinter { static char ID; PostDomOnlyPrinter() : - DOTGraphTraitsPrinter("postdomonly", ID) {} + DOTGraphTraitsPrinter("postdomonly", &ID) {} }; } // end anonymous namespace Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Thu Aug 5 19:23:35 2010 @@ -42,7 +42,7 @@ public: static char ID; // Class identification, replacement for typeinfo - BasicCallGraph() : ModulePass(ID), Root(0), + BasicCallGraph() : ModulePass(&ID), Root(0), ExternalCallingNode(0), CallsExternalNode(0) {} // runOnModule - Compute the call graph for the specified module. @@ -86,8 +86,8 @@ /// an analysis interface through multiple inheritance. If needed, it should /// override this to adjust the this pointer as needed for the specified pass /// info. - virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { - if (PI == &CallGraph::ID) + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { + if (PI->isPassID(&CallGraph::ID)) return (CallGraph*)this; return this; } Modified: llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp Thu Aug 5 19:23:35 2010 @@ -45,7 +45,7 @@ public: static char ID; explicit CGPassManager(int Depth) - : ModulePass(ID), PMDataManager(Depth) { } + : ModulePass(&ID), PMDataManager(Depth) { } /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. @@ -582,9 +582,9 @@ public: static char ID; - PrintCallGraphPass() : CallGraphSCCPass(ID), Out(dbgs()) {} + PrintCallGraphPass() : CallGraphSCCPass(&ID), Out(dbgs()) {} PrintCallGraphPass(const std::string &B, raw_ostream &o) - : CallGraphSCCPass(ID), Banner(B), Out(o) {} + : CallGraphSCCPass(&ID), Banner(B), Out(o) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp Thu Aug 5 19:23:35 2010 @@ -88,7 +88,7 @@ public: static char ID; - GlobalsModRef() : ModulePass(ID) {} + GlobalsModRef() : ModulePass(&ID) {} bool runOnModule(Module &M) { InitializeAliasAnalysis(this); // set up super class @@ -150,8 +150,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { - if (PI == &AliasAnalysis::ID) + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { + if (PI->isPassID(&AliasAnalysis::ID)) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/IVUsers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IVUsers.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IVUsers.cpp (original) +++ llvm/trunk/lib/Analysis/IVUsers.cpp Thu Aug 5 19:23:35 2010 @@ -140,7 +140,7 @@ } IVUsers::IVUsers() - : LoopPass(ID) { + : LoopPass(&ID) { } void IVUsers::getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/lib/Analysis/InstCount.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstCount.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/InstCount.cpp (original) +++ llvm/trunk/lib/Analysis/InstCount.cpp Thu Aug 5 19:23:35 2010 @@ -51,7 +51,7 @@ } public: static char ID; // Pass identification, replacement for typeid - InstCount() : FunctionPass(ID) {} + InstCount() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Analysis/IntervalPartition.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IntervalPartition.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IntervalPartition.cpp (original) +++ llvm/trunk/lib/Analysis/IntervalPartition.cpp Thu Aug 5 19:23:35 2010 @@ -91,7 +91,7 @@ // distinguish it from a copy constructor. Always pass in false for now. // IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) - : FunctionPass(ID) { + : FunctionPass(&ID) { assert(IP.getRootInterval() && "Cannot operate on empty IntervalPartitions!"); // Pass false to intervals_begin because we take ownership of it's memory Modified: llvm/trunk/lib/Analysis/Lint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Lint.cpp (original) +++ llvm/trunk/lib/Analysis/Lint.cpp Thu Aug 5 19:23:35 2010 @@ -108,7 +108,7 @@ raw_string_ostream MessagesStr; static char ID; // Pass identification, replacement for typeid - Lint() : FunctionPass(ID), MessagesStr(Messages) {} + Lint() : FunctionPass(&ID), MessagesStr(Messages) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Analysis/LiveValues.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LiveValues.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LiveValues.cpp (original) +++ llvm/trunk/lib/Analysis/LiveValues.cpp Thu Aug 5 19:23:35 2010 @@ -25,7 +25,7 @@ INITIALIZE_PASS(LiveValues, "live-values", "Value Liveness Analysis", false, true); -LiveValues::LiveValues() : FunctionPass(ID) {} +LiveValues::LiveValues() : FunctionPass(&ID) {} void LiveValues::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Analysis/LoopPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopPass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LoopPass.cpp (original) +++ llvm/trunk/lib/Analysis/LoopPass.cpp Thu Aug 5 19:23:35 2010 @@ -30,9 +30,9 @@ public: static char ID; - PrintLoopPass() : LoopPass(ID), Out(dbgs()) {} + PrintLoopPass() : LoopPass(&ID), Out(dbgs()) {} PrintLoopPass(const std::string &B, raw_ostream &o) - : LoopPass(ID), Banner(B), Out(o) {} + : LoopPass(&ID), Banner(B), Out(o) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -59,7 +59,7 @@ char LPPassManager::ID = 0; LPPassManager::LPPassManager(int Depth) - : FunctionPass(ID), PMDataManager(Depth) { + : FunctionPass(&ID), PMDataManager(Depth) { skipThisLoop = false; redoThisLoop = false; LI = NULL; Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Thu Aug 5 19:23:35 2010 @@ -50,7 +50,7 @@ "Memory Dependence Analysis", false, true); MemoryDependenceAnalysis::MemoryDependenceAnalysis() -: FunctionPass(ID), PredCache(0) { +: FunctionPass(&ID), PredCache(0) { } MemoryDependenceAnalysis::~MemoryDependenceAnalysis() { } Modified: llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp Thu Aug 5 19:23:35 2010 @@ -30,7 +30,7 @@ DebugInfoFinder Finder; public: static char ID; // Pass identification, replacement for typeid - ModuleDebugInfoPrinter() : ModulePass(ID) {} + ModuleDebugInfoPrinter() : ModulePass(&ID) {} virtual bool runOnModule(Module &M); Modified: llvm/trunk/lib/Analysis/PointerTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/PointerTracking.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/PointerTracking.cpp (original) +++ llvm/trunk/lib/Analysis/PointerTracking.cpp Thu Aug 5 19:23:35 2010 @@ -28,7 +28,7 @@ using namespace llvm; char PointerTracking::ID = 0; -PointerTracking::PointerTracking() : FunctionPass(ID) {} +PointerTracking::PointerTracking() : FunctionPass(&ID) {} bool PointerTracking::runOnFunction(Function &F) { predCache.clear(); Modified: llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp Thu Aug 5 19:23:35 2010 @@ -39,7 +39,7 @@ public: static char ID; // Class identification, replacement for typeinfo explicit ProfileEstimatorPass(const double execcount = 0) - : FunctionPass(ID), ExecCount(execcount) { + : FunctionPass(&ID), ExecCount(execcount) { if (execcount == 0) ExecCount = LoopWeight; } @@ -59,8 +59,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { - if (PI == &ProfileInfo::ID) + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { + if (PI->isPassID(&ProfileInfo::ID)) return (ProfileInfo*)this; return this; } @@ -78,7 +78,7 @@ static RegisterAnalysisGroup Y(X); namespace llvm { - char &ProfileEstimatorPassID = ProfileEstimatorPass::ID; + const PassInfo *ProfileEstimatorPassID = &X; FunctionPass *createProfileEstimatorPass() { return new ProfileEstimatorPass(); Modified: llvm/trunk/lib/Analysis/ProfileInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfo.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileInfo.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileInfo.cpp Thu Aug 5 19:23:35 2010 @@ -1076,14 +1076,14 @@ namespace { struct NoProfileInfo : public ImmutablePass, public ProfileInfo { static char ID; // Class identification, replacement for typeinfo - NoProfileInfo() : ImmutablePass(ID) {} + NoProfileInfo() : ImmutablePass(&ID) {} /// getAdjustedAnalysisPointer - This method is used when a pass implements /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { - if (PI == &ProfileInfo::ID) + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { + if (PI->isPassID(&ProfileInfo::ID)) return (ProfileInfo*)this; return this; } Modified: llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp Thu Aug 5 19:23:35 2010 @@ -45,7 +45,7 @@ public: static char ID; // Class identification, replacement for typeinfo explicit LoaderPass(const std::string &filename = "") - : ModulePass(ID), Filename(filename) { + : ModulePass(&ID), Filename(filename) { if (filename.empty()) Filename = ProfileInfoFilename; } @@ -67,8 +67,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { - if (PI == &ProfileInfo::ID) + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { + if (PI->isPassID(&ProfileInfo::ID)) return (ProfileInfo*)this; return this; } @@ -84,7 +84,7 @@ static RegisterAnalysisGroup Y(X); -char &llvm::ProfileLoaderPassID = LoaderPass::ID; +const PassInfo *llvm::ProfileLoaderPassID = &X; ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); } Modified: llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp Thu Aug 5 19:23:35 2010 @@ -59,10 +59,10 @@ public: static char ID; // Class identification, replacement for typeinfo - explicit ProfileVerifierPassT () : FunctionPass(ID) { + explicit ProfileVerifierPassT () : FunctionPass(&ID) { DisableAssertions = ProfileVerifierDisableAssertions; } - explicit ProfileVerifierPassT (bool da) : FunctionPass(ID), + explicit ProfileVerifierPassT (bool da) : FunctionPass(&ID), DisableAssertions(da) { } Modified: llvm/trunk/lib/Analysis/RegionInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionInfo.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/RegionInfo.cpp (original) +++ llvm/trunk/lib/Analysis/RegionInfo.cpp Thu Aug 5 19:23:35 2010 @@ -589,7 +589,7 @@ TopLevelRegion = 0; } -RegionInfo::RegionInfo() : FunctionPass(ID) { +RegionInfo::RegionInfo() : FunctionPass(&ID) { TopLevelRegion = 0; } Modified: llvm/trunk/lib/Analysis/RegionPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionPrinter.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/RegionPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/RegionPrinter.cpp Thu Aug 5 19:23:35 2010 @@ -121,7 +121,7 @@ struct RegionViewer : public DOTGraphTraitsViewer { static char ID; - RegionViewer() : DOTGraphTraitsViewer("reg", ID){} + RegionViewer() : DOTGraphTraitsViewer("reg", &ID){} }; char RegionViewer::ID = 0; @@ -131,7 +131,7 @@ struct RegionOnlyViewer : public DOTGraphTraitsViewer { static char ID; - RegionOnlyViewer() : DOTGraphTraitsViewer("regonly", ID){} + RegionOnlyViewer() : DOTGraphTraitsViewer("regonly", &ID){} }; char RegionOnlyViewer::ID = 0; @@ -143,7 +143,7 @@ : public DOTGraphTraitsPrinter { static char ID; RegionPrinter() : - DOTGraphTraitsPrinter("reg", ID) {} + DOTGraphTraitsPrinter("reg", &ID) {} }; } //end anonymous namespace @@ -157,7 +157,7 @@ : public DOTGraphTraitsPrinter { static char ID; RegionOnlyPrinter() : - DOTGraphTraitsPrinter("reg", ID) {} + DOTGraphTraitsPrinter("reg", &ID) {} }; } Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Thu Aug 5 19:23:35 2010 @@ -5742,7 +5742,7 @@ //===----------------------------------------------------------------------===// ScalarEvolution::ScalarEvolution() - : FunctionPass(ID), FirstUnknown(0) { + : FunctionPass(&ID), FirstUnknown(0) { } bool ScalarEvolution::runOnFunction(Function &F) { Modified: llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp Thu Aug 5 19:23:35 2010 @@ -34,14 +34,14 @@ public: static char ID; // Class identification, replacement for typeinfo - ScalarEvolutionAliasAnalysis() : FunctionPass(ID), SE(0) {} + ScalarEvolutionAliasAnalysis() : FunctionPass(&ID), SE(0) {} /// getAdjustedAnalysisPointer - This method is used when a pass implements /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { - if (PI == &AliasAnalysis::ID) + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { + if (PI->isPassID(&AliasAnalysis::ID)) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Thu Aug 5 19:23:35 2010 @@ -82,14 +82,14 @@ public AliasAnalysis { public: static char ID; // Class identification, replacement for typeinfo - TypeBasedAliasAnalysis() : ImmutablePass(ID) {} + TypeBasedAliasAnalysis() : ImmutablePass(&ID) {} /// getAdjustedAnalysisPointer - This method is used when a pass implements /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const void *PI) { - if (PI == &AliasAnalysis::ID) + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { + if (PI->isPassID(&AliasAnalysis::ID)) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp Thu Aug 5 19:23:35 2010 @@ -21,7 +21,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit WriteBitcodePass(raw_ostream &o) - : ModulePass(ID), OS(o) {} + : ModulePass(&ID), OS(o) {} const char *getPassName() const { return "Bitcode Writer"; } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Aug 5 19:23:35 2010 @@ -91,7 +91,7 @@ AsmPrinter::AsmPrinter(TargetMachine &tm, MCStreamer &Streamer) - : MachineFunctionPass(ID), + : MachineFunctionPass(&ID), TM(tm), MAI(tm.getMCAsmInfo()), OutContext(Streamer.getContext()), OutStreamer(Streamer), Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original) +++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Thu Aug 5 19:23:35 2010 @@ -65,7 +65,7 @@ public: static char ID; explicit BranchFolderPass(bool defaultEnableTailMerge) - : MachineFunctionPass(ID), BranchFolder(defaultEnableTailMerge) {} + : MachineFunctionPass(&ID), BranchFolder(defaultEnableTailMerge) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Control Flow Optimizer"; } Modified: llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp (original) +++ llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp Thu Aug 5 19:23:35 2010 @@ -36,7 +36,7 @@ public: static char ID; - CodePlacementOpt() : MachineFunctionPass(ID) {} + CodePlacementOpt() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { Modified: llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp (original) +++ llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp Thu Aug 5 19:23:35 2010 @@ -36,7 +36,7 @@ public: static char ID; // Pass identification, replacement for typeid - DeadMachineInstructionElim() : MachineFunctionPass(ID) {} + DeadMachineInstructionElim() : MachineFunctionPass(&ID) {} private: bool isDead(const MachineInstr *MI) const; Modified: llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp (original) +++ llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp Thu Aug 5 19:23:35 2010 @@ -160,7 +160,7 @@ public: static char ID; // Pass identification, replacement for typeid. DwarfEHPrepare(const TargetMachine *tm, bool fast) : - FunctionPass(ID), TM(tm), TLI(TM->getTargetLowering()), + FunctionPass(&ID), TM(tm), TLI(TM->getTargetLowering()), CompileFast(fast), ExceptionValueIntrinsic(0), SelectorIntrinsic(0), URoR(0), EHCatchAllValue(0), RewindFunction(0) {} Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Thu Aug 5 19:23:35 2010 @@ -63,7 +63,7 @@ //===----------------------------------------------------------------------===// ELFWriter::ELFWriter(raw_ostream &o, TargetMachine &tm) - : MachineFunctionPass(ID), O(o), TM(tm), + : MachineFunctionPass(&ID), O(o), TM(tm), OutContext(*new MCContext(*TM.getMCAsmInfo())), TLOF(TM.getTargetLowering()->getObjFileLowering()), is64Bit(TM.getTargetData()->getPointerSizeInBits() == 64), Modified: llvm/trunk/lib/CodeGen/GCMetadata.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCMetadata.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/GCMetadata.cpp (original) +++ llvm/trunk/lib/CodeGen/GCMetadata.cpp Thu Aug 5 19:23:35 2010 @@ -30,8 +30,8 @@ raw_ostream &OS; public: - Printer() : FunctionPass(ID), OS(errs()) {} - explicit Printer(raw_ostream &OS) : FunctionPass(ID), OS(OS) {} + Printer() : FunctionPass(&ID), OS(errs()) {} + explicit Printer(raw_ostream &OS) : FunctionPass(&ID), OS(OS) {} const char *getPassName() const; @@ -70,7 +70,7 @@ char GCModuleInfo::ID = 0; GCModuleInfo::GCModuleInfo() - : ImmutablePass(ID) {} + : ImmutablePass(&ID) {} GCModuleInfo::~GCModuleInfo() { clear(); @@ -189,7 +189,7 @@ return new Deleter(); } -Deleter::Deleter() : FunctionPass(ID) {} +Deleter::Deleter() : FunctionPass(&ID) {} const char *Deleter::getPassName() const { return "Delete Garbage Collector Information"; Modified: llvm/trunk/lib/CodeGen/GCStrategy.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCStrategy.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/GCStrategy.cpp (original) +++ llvm/trunk/lib/CodeGen/GCStrategy.cpp Thu Aug 5 19:23:35 2010 @@ -130,7 +130,7 @@ char LowerIntrinsics::ID = 0; LowerIntrinsics::LowerIntrinsics() - : FunctionPass(ID) {} + : FunctionPass(&ID) {} const char *LowerIntrinsics::getPassName() const { return "Lower Garbage Collection Instructions"; @@ -318,7 +318,7 @@ char MachineCodeAnalysis::ID = 0; MachineCodeAnalysis::MachineCodeAnalysis() - : MachineFunctionPass(ID) {} + : MachineFunctionPass(&ID) {} const char *MachineCodeAnalysis::getPassName() const { return "Analyze Machine Code For Garbage Collection"; Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IfConversion.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/IfConversion.cpp (original) +++ llvm/trunk/lib/CodeGen/IfConversion.cpp Thu Aug 5 19:23:35 2010 @@ -154,7 +154,7 @@ int FnNum; public: static char ID; - IfConverter() : MachineFunctionPass(ID), FnNum(-1) {} + IfConverter() : MachineFunctionPass(&ID), FnNum(-1) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "If Converter"; } Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original) +++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Thu Aug 5 19:23:35 2010 @@ -36,7 +36,7 @@ public: static char ID; // Pass identification, replacement for typeid - LowerSubregsInstructionPass() : MachineFunctionPass(ID) {} + LowerSubregsInstructionPass() : MachineFunctionPass(&ID) {} const char *getPassName() const { return "Subregister lowering instruction pass"; Modified: llvm/trunk/lib/CodeGen/MachineCSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCSE.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineCSE.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineCSE.cpp Thu Aug 5 19:23:35 2010 @@ -41,7 +41,7 @@ MachineRegisterInfo *MRI; public: static char ID; // Pass identification - MachineCSE() : MachineFunctionPass(ID), LookAheadLimit(5), CurrVN(0) {} + MachineCSE() : MachineFunctionPass(&ID), LookAheadLimit(5), CurrVN(0) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/MachineDominators.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineDominators.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineDominators.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineDominators.cpp Thu Aug 5 19:23:35 2010 @@ -27,7 +27,7 @@ static RegisterPass E("machinedomtree", "MachineDominator Tree Construction", true); -char &llvm::MachineDominatorsID = MachineDominatorTree::ID; +const PassInfo *const llvm::MachineDominatorsID = &E; void MachineDominatorTree::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -41,7 +41,7 @@ } MachineDominatorTree::MachineDominatorTree() - : MachineFunctionPass(ID) { + : MachineFunctionPass(&ID) { DT = new DominatorTreeBase(false); } Modified: llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp Thu Aug 5 19:23:35 2010 @@ -20,14 +20,14 @@ // a default constructor. static PassInfo X("Machine Function Analysis", "machine-function-analysis", - &MachineFunctionAnalysis::ID, 0, + intptr_t(&MachineFunctionAnalysis::ID), 0, /*CFGOnly=*/false, /*is_analysis=*/true); char MachineFunctionAnalysis::ID = 0; MachineFunctionAnalysis::MachineFunctionAnalysis(const TargetMachine &tm, CodeGenOpt::Level OL) : - FunctionPass(ID), TM(tm), OptLevel(OL), MF(0) { + FunctionPass(&ID), TM(tm), OptLevel(OL), MF(0) { } MachineFunctionAnalysis::~MachineFunctionAnalysis() { Modified: llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp Thu Aug 5 19:23:35 2010 @@ -29,7 +29,7 @@ const std::string Banner; MachineFunctionPrinterPass(raw_ostream &os, const std::string &banner) - : MachineFunctionPass(ID), OS(os), Banner(banner) {} + : MachineFunctionPass(&ID), OS(os), Banner(banner) {} const char *getPassName() const { return "MachineFunction Printer"; } Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Thu Aug 5 19:23:35 2010 @@ -74,10 +74,10 @@ public: static char ID; // Pass identification, replacement for typeid MachineLICM() : - MachineFunctionPass(ID), PreRegAlloc(true) {} + MachineFunctionPass(&ID), PreRegAlloc(true) {} explicit MachineLICM(bool PreRA) : - MachineFunctionPass(ID), PreRegAlloc(PreRA) {} + MachineFunctionPass(&ID), PreRegAlloc(PreRA) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp Thu Aug 5 19:23:35 2010 @@ -33,7 +33,7 @@ static RegisterPass X("machine-loops", "Machine Natural Loop Construction", true); -char &llvm::MachineLoopInfoID = MachineLoopInfo::ID; +const PassInfo *const llvm::MachineLoopInfoID = &X; bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) { releaseMemory(); Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Thu Aug 5 19:23:35 2010 @@ -254,7 +254,7 @@ //===----------------------------------------------------------------------===// MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI) -: ImmutablePass(ID), Context(MAI), +: ImmutablePass(&ID), Context(MAI), ObjFileMMI(0), CurCallSite(0), CallsEHReturn(0), CallsUnwindInit(0), DbgInfoAvailable(false){ // Always emit some info, by default "no personality" info. @@ -264,7 +264,7 @@ } MachineModuleInfo::MachineModuleInfo() -: ImmutablePass(ID), Context(*(MCAsmInfo*)0) { +: ImmutablePass(&ID), Context(*(MCAsmInfo*)0) { assert(0 && "This MachineModuleInfo constructor should never be called, MMI " "should always be explicitly constructed by LLVMTargetMachine"); abort(); Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineSink.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineSink.cpp Thu Aug 5 19:23:35 2010 @@ -44,7 +44,7 @@ public: static char ID; // Pass identification - MachineSinking() : MachineFunctionPass(ID) {} + MachineSinking() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Thu Aug 5 19:23:35 2010 @@ -194,7 +194,7 @@ static char ID; // Pass ID, replacement for typeid MachineVerifierPass() - : MachineFunctionPass(ID) {} + : MachineFunctionPass(&ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/CodeGen/OptimizeExts.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizeExts.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/OptimizeExts.cpp (original) +++ llvm/trunk/lib/CodeGen/OptimizeExts.cpp Thu Aug 5 19:23:35 2010 @@ -43,7 +43,7 @@ public: static char ID; // Pass identification - OptimizeExts() : MachineFunctionPass(ID) {} + OptimizeExts() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/OptimizePHIs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizePHIs.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/OptimizePHIs.cpp (original) +++ llvm/trunk/lib/CodeGen/OptimizePHIs.cpp Thu Aug 5 19:23:35 2010 @@ -33,7 +33,7 @@ public: static char ID; // Pass identification - OptimizePHIs() : MachineFunctionPass(ID) {} + OptimizePHIs() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Thu Aug 5 19:23:35 2010 @@ -40,7 +40,7 @@ static RegisterPass X("phi-node-elimination", "Eliminate PHI nodes for register allocation"); -char &llvm::PHIEliminationID = PHIElimination::ID; +const PassInfo *const llvm::PHIEliminationID = &X; void llvm::PHIElimination::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); Modified: llvm/trunk/lib/CodeGen/PHIElimination.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.h (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.h Thu Aug 5 19:23:35 2010 @@ -25,7 +25,7 @@ public: static char ID; // Pass identification, replacement for typeid - PHIElimination() : MachineFunctionPass(ID) {} + PHIElimination() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original) +++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Thu Aug 5 19:23:35 2010 @@ -85,7 +85,7 @@ public: static char ID; PostRAScheduler(CodeGenOpt::Level ol) : - MachineFunctionPass(ID), OptLevel(ol) {} + MachineFunctionPass(&ID), OptLevel(ol) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); Modified: llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp (original) +++ llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp Thu Aug 5 19:23:35 2010 @@ -92,7 +92,7 @@ public: static char ID; PreAllocSplitting() - : MachineFunctionPass(ID) {} + : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); @@ -206,7 +206,7 @@ static RegisterPass X("pre-alloc-splitting", "Pre-Register Allocation Live Interval Splitting"); -char &llvm::PreAllocSplittingID = PreAllocSplitting::ID; +const PassInfo *const llvm::PreAllocSplittingID = &X; /// findSpillPoint - Find a gap as far away from the given MI that's suitable /// for spilling the current live interval. The index must be before any Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.h (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.h Thu Aug 5 19:23:35 2010 @@ -36,7 +36,7 @@ class PEI : public MachineFunctionPass { public: static char ID; - PEI() : MachineFunctionPass(ID) {} + PEI() : MachineFunctionPass(&ID) {} const char *getPassName() const { return "Prolog/Epilog Insertion & Frame Finalization"; Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Thu Aug 5 19:23:35 2010 @@ -47,7 +47,7 @@ class RAFast : public MachineFunctionPass { public: static char ID; - RAFast() : MachineFunctionPass(ID), StackSlotForVirtReg(-1), + RAFast() : MachineFunctionPass(&ID), StackSlotForVirtReg(-1), isBulkSpilling(false) {} private: const TargetMachine *TM; Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Thu Aug 5 19:23:35 2010 @@ -90,7 +90,7 @@ struct RALinScan : public MachineFunctionPass { static char ID; - RALinScan() : MachineFunctionPass(ID) { + RALinScan() : MachineFunctionPass(&ID) { // Initialize the queue to record recently-used registers. if (NumRecentlyUsedRegs > 0) RecentRegs.resize(NumRecentlyUsedRegs, 0); Modified: llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp Thu Aug 5 19:23:35 2010 @@ -84,7 +84,7 @@ static char ID; /// Construct a PBQP register allocator. - PBQPRegAlloc() : MachineFunctionPass(ID) {} + PBQPRegAlloc() : MachineFunctionPass(&ID) {} /// Return the pass name. virtual const char* getPassName() const { Modified: llvm/trunk/lib/CodeGen/RenderMachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RenderMachineFunction.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RenderMachineFunction.h (original) +++ llvm/trunk/lib/CodeGen/RenderMachineFunction.h Thu Aug 5 19:23:35 2010 @@ -198,7 +198,7 @@ public: static char ID; - RenderMachineFunction() : MachineFunctionPass(ID) {} + RenderMachineFunction() : MachineFunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Aug 5 19:23:35 2010 @@ -171,7 +171,7 @@ //===----------------------------------------------------------------------===// SelectionDAGISel::SelectionDAGISel(const TargetMachine &tm, CodeGenOpt::Level OL) : - MachineFunctionPass(ID), TM(tm), TLI(*tm.getTargetLowering()), + MachineFunctionPass(&ID), TM(tm), TLI(*tm.getTargetLowering()), FuncInfo(new FunctionLoweringInfo(TLI)), CurDAG(new SelectionDAG(tm)), SDB(new SelectionDAGBuilder(*CurDAG, *FuncInfo, OL)), Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Thu Aug 5 19:23:35 2010 @@ -65,7 +65,7 @@ // Declare that we implement the RegisterCoalescer interface static RegisterAnalysisGroup V(X); -char &llvm::SimpleRegisterCoalescingID = SimpleRegisterCoalescing::ID; +const PassInfo *const llvm::SimpleRegisterCoalescingID = &X; void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h Thu Aug 5 19:23:35 2010 @@ -64,7 +64,7 @@ public: static char ID; // Pass identifcation, replacement for typeid - SimpleRegisterCoalescing() : MachineFunctionPass(ID) {} + SimpleRegisterCoalescing() : MachineFunctionPass(&ID) {} struct InstrSlots { enum { Modified: llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp (original) +++ llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp Thu Aug 5 19:23:35 2010 @@ -58,7 +58,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit SjLjEHPass(const TargetLowering *tli = NULL) - : FunctionPass(ID), TLI(tli) { } + : FunctionPass(&ID), TLI(tli) { } bool doInitialization(Module &M); bool runOnFunction(Function &F); Modified: llvm/trunk/lib/CodeGen/Splitter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Splitter.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/Splitter.h (original) +++ llvm/trunk/lib/CodeGen/Splitter.h Thu Aug 5 19:23:35 2010 @@ -36,7 +36,7 @@ public: static char ID; - LoopSplitter() : MachineFunctionPass(ID) {} + LoopSplitter() : MachineFunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackProtector.cpp (original) +++ llvm/trunk/lib/CodeGen/StackProtector.cpp Thu Aug 5 19:23:35 2010 @@ -62,9 +62,9 @@ bool RequiresStackProtector() const; public: static char ID; // Pass identification, replacement for typeid. - StackProtector() : FunctionPass(ID), TLI(0) {} + StackProtector() : FunctionPass(&ID), TLI(0) {} StackProtector(const TargetLowering *tli) - : FunctionPass(ID), TLI(tli) {} + : FunctionPass(&ID), TLI(tli) {} virtual bool runOnFunction(Function &Fn); }; Modified: llvm/trunk/lib/CodeGen/StackSlotColoring.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackSlotColoring.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackSlotColoring.cpp (original) +++ llvm/trunk/lib/CodeGen/StackSlotColoring.cpp Thu Aug 5 19:23:35 2010 @@ -95,9 +95,9 @@ public: static char ID; // Pass identification StackSlotColoring() : - MachineFunctionPass(ID), ColorWithRegs(false), NextColor(-1) {} + MachineFunctionPass(&ID), ColorWithRegs(false), NextColor(-1) {} StackSlotColoring(bool RegColor) : - MachineFunctionPass(ID), ColorWithRegs(RegColor), NextColor(-1) {} + MachineFunctionPass(&ID), ColorWithRegs(RegColor), NextColor(-1) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Thu Aug 5 19:23:35 2010 @@ -39,7 +39,7 @@ namespace { struct StrongPHIElimination : public MachineFunctionPass { static char ID; // Pass identification, replacement for typeid - StrongPHIElimination() : MachineFunctionPass(ID) {} + StrongPHIElimination() : MachineFunctionPass(&ID) {} // Waiting stores, for each MBB, the set of copies that need to // be inserted into that MBB @@ -154,7 +154,7 @@ X("strong-phi-node-elimination", "Eliminate PHI nodes for register allocation, intelligently"); -char &llvm::StrongPHIEliminationID = StrongPHIElimination::ID; +const PassInfo *const llvm::StrongPHIEliminationID = &X; /// computeDFS - Computes the DFS-in and DFS-out numbers of the dominator tree /// of the given MachineFunction. These numbers are then used in other parts Modified: llvm/trunk/lib/CodeGen/TailDuplication.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TailDuplication.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TailDuplication.cpp (original) +++ llvm/trunk/lib/CodeGen/TailDuplication.cpp Thu Aug 5 19:23:35 2010 @@ -69,7 +69,7 @@ public: static char ID; explicit TailDuplicatePass(bool PreRA) : - MachineFunctionPass(ID), PreRegAlloc(PreRA) {} + MachineFunctionPass(&ID), PreRegAlloc(PreRA) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Tail Duplication"; } Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Thu Aug 5 19:23:35 2010 @@ -138,7 +138,7 @@ public: static char ID; // Pass identification, replacement for typeid - TwoAddressInstructionPass() : MachineFunctionPass(ID) {} + TwoAddressInstructionPass() : MachineFunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); @@ -162,7 +162,7 @@ static RegisterPass X("twoaddressinstruction", "Two-Address instruction pass"); -char &llvm::TwoAddressInstructionPassID = TwoAddressInstructionPass::ID; +const PassInfo *const llvm::TwoAddressInstructionPassID = &X; /// Sink3AddrInstruction - A two-address instruction has been converted to a /// three-address instruction to avoid clobbering a register. Try to sink it Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp (original) +++ llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Thu Aug 5 19:23:35 2010 @@ -43,7 +43,7 @@ virtual bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - UnreachableBlockElim() : FunctionPass(ID) {} + UnreachableBlockElim() : FunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); @@ -100,7 +100,7 @@ MachineModuleInfo *MMI; public: static char ID; // Pass identification, replacement for typeid - UnreachableMachineBlockElim() : MachineFunctionPass(ID) {} + UnreachableMachineBlockElim() : MachineFunctionPass(&ID) {} }; } char UnreachableMachineBlockElim::ID = 0; @@ -109,7 +109,7 @@ Y("unreachable-mbb-elimination", "Remove unreachable machine basic blocks"); -char &llvm::UnreachableMachineBlockElimID = UnreachableMachineBlockElim::ID; +const PassInfo *const llvm::UnreachableMachineBlockElimID = &Y; void UnreachableMachineBlockElim::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); Modified: llvm/trunk/lib/CodeGen/VirtRegMap.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/VirtRegMap.h (original) +++ llvm/trunk/lib/CodeGen/VirtRegMap.h Thu Aug 5 19:23:35 2010 @@ -139,7 +139,7 @@ public: static char ID; - VirtRegMap() : MachineFunctionPass(ID), Virt2PhysMap(NO_PHYS_REG), + VirtRegMap() : MachineFunctionPass(&ID), Virt2PhysMap(NO_PHYS_REG), Virt2StackSlotMap(NO_STACK_SLOT), Virt2ReMatIdMap(NO_STACK_SLOT), Virt2SplitMap(0), Virt2SplitKillMap(SlotIndex()), ReMatMap(NULL), Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Thu Aug 5 19:23:35 2010 @@ -65,7 +65,7 @@ static char ID; public: ARMCodeEmitter(TargetMachine &tm, JITCodeEmitter &mce) - : MachineFunctionPass(ID), JTI(0), + : MachineFunctionPass(&ID), JTI(0), II((const ARMInstrInfo *)tm.getInstrInfo()), TD(tm.getTargetData()), TM(tm), MCE(mce), MCPEs(0), MJTEs(0), Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Thu Aug 5 19:23:35 2010 @@ -173,7 +173,7 @@ bool isThumb2; public: static char ID; - ARMConstantIslands() : MachineFunctionPass(ID) {} + ARMConstantIslands() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp Thu Aug 5 19:23:35 2010 @@ -26,7 +26,7 @@ class ARMExpandPseudo : public MachineFunctionPass { public: static char ID; - ARMExpandPseudo() : MachineFunctionPass(ID) {} + ARMExpandPseudo() : MachineFunctionPass(&ID) {} const TargetInstrInfo *TII; const TargetRegisterInfo *TRI; Modified: llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp Thu Aug 5 19:23:35 2010 @@ -78,7 +78,7 @@ public: static char ID; // Pass identification, replacement for typeid. explicit ARMGlobalMerge(const TargetLowering *tli) - : FunctionPass(ID), TLI(tli) {} + : FunctionPass(&ID), TLI(tli) {} virtual bool doInitialization(Module &M); virtual bool runOnFunction(Function& F); Modified: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Thu Aug 5 19:23:35 2010 @@ -57,7 +57,7 @@ namespace { struct ARMLoadStoreOpt : public MachineFunctionPass { static char ID; - ARMLoadStoreOpt() : MachineFunctionPass(ID) {} + ARMLoadStoreOpt() : MachineFunctionPass(&ID) {} const TargetInstrInfo *TII; const TargetRegisterInfo *TRI; @@ -1268,7 +1268,7 @@ namespace { struct ARMPreAllocLoadStoreOpt : public MachineFunctionPass{ static char ID; - ARMPreAllocLoadStoreOpt() : MachineFunctionPass(ID) {} + ARMPreAllocLoadStoreOpt() : MachineFunctionPass(&ID) {} const TargetData *TD; const TargetInstrInfo *TII; Modified: llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp (original) +++ llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp Thu Aug 5 19:23:35 2010 @@ -24,7 +24,7 @@ namespace { struct NEONMoveFixPass : public MachineFunctionPass { static char ID; - NEONMoveFixPass() : MachineFunctionPass(ID) {} + NEONMoveFixPass() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); Modified: llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp Thu Aug 5 19:23:35 2010 @@ -23,7 +23,7 @@ public: static char ID; - NEONPreAllocPass() : MachineFunctionPass(ID) {} + NEONPreAllocPass() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp Thu Aug 5 19:23:35 2010 @@ -27,7 +27,7 @@ public: static char ID; - Thumb2ITBlockPass() : MachineFunctionPass(ID) {} + Thumb2ITBlockPass() : MachineFunctionPass(&ID) {} const Thumb2InstrInfo *TII; const TargetRegisterInfo *TRI; Modified: llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp Thu Aug 5 19:23:35 2010 @@ -173,7 +173,7 @@ char Thumb2SizeReduce::ID = 0; } -Thumb2SizeReduce::Thumb2SizeReduce() : MachineFunctionPass(ID) { +Thumb2SizeReduce::Thumb2SizeReduce() : MachineFunctionPass(&ID) { for (unsigned i = 0, e = array_lengthof(ReduceTable); i != e; ++i) { unsigned FromOpc = ReduceTable[i].WideOpc; if (!ReduceOpcodeMap.insert(std::make_pair(FromOpc, i)).second) Modified: llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp Thu Aug 5 19:23:35 2010 @@ -22,7 +22,7 @@ namespace { struct AlphaBSel : public MachineFunctionPass { static char ID; - AlphaBSel() : MachineFunctionPass(ID) {} + AlphaBSel() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); Modified: llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp Thu Aug 5 19:23:35 2010 @@ -34,7 +34,7 @@ public: static char ID; - AlphaCodeEmitter(JITCodeEmitter &mce) : MachineFunctionPass(ID), + AlphaCodeEmitter(JITCodeEmitter &mce) : MachineFunctionPass(&ID), MCE(mce) {} /// getBinaryCodeForInstr - This function, generated by the Modified: llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp Thu Aug 5 19:23:35 2010 @@ -39,7 +39,7 @@ static char ID; AlphaLLRPPass(AlphaTargetMachine &tm) - : MachineFunctionPass(ID), TM(tm) { } + : MachineFunctionPass(&ID), TM(tm) { } virtual const char *getPassName() const { return "Alpha NOP inserter"; Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Thu Aug 5 19:23:35 2010 @@ -73,7 +73,7 @@ public: static char ID; CBackendNameAllUsedStructsAndMergeFunctions() - : ModulePass(ID) {} + : ModulePass(&ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); } @@ -110,7 +110,7 @@ public: static char ID; explicit CWriter(formatted_raw_ostream &o) - : FunctionPass(ID), Out(o), IL(0), Mang(0), LI(0), + : FunctionPass(&ID), Out(o), IL(0), Mang(0), LI(0), TheModule(0), TAsm(0), TCtx(0), TD(0), OpaqueCounter(0), NextAnonValueNumber(0) { FPCounter = 0; Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Thu Aug 5 19:23:35 2010 @@ -104,7 +104,7 @@ public: static char ID; explicit CppWriter(formatted_raw_ostream &o) : - ModulePass(ID), Out(o), uniqueNum(0), is_inline(false), indent_level(0){} + ModulePass(&ID), Out(o), uniqueNum(0), is_inline(false), indent_level(0){} virtual const char *getPassName() const { return "C++ backend"; } Modified: llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp Thu Aug 5 19:23:35 2010 @@ -32,7 +32,7 @@ static char ID; Filler(TargetMachine &tm) - : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { } + : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { } virtual const char *getPassName() const { return "MBlaze Delay Slot Filler"; Modified: llvm/trunk/lib/Target/MSIL/MSILWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/MSILWriter.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSIL/MSILWriter.h (original) +++ llvm/trunk/lib/Target/MSIL/MSILWriter.h Thu Aug 5 19:23:35 2010 @@ -40,7 +40,7 @@ static char ID; MSILModule(const std::set*& _UsedTypes, const TargetData*& _TD) - : ModulePass(ID), UsedTypes(_UsedTypes), TD(_TD) {} + : ModulePass(&ID), UsedTypes(_UsedTypes), TD(_TD) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); @@ -86,7 +86,7 @@ DenseMap AnonValueNumbers; unsigned NextAnonValueNumber; - MSILWriter(formatted_raw_ostream &o) : FunctionPass(ID), Out(o), + MSILWriter(formatted_raw_ostream &o) : FunctionPass(&ID), Out(o), NextAnonValueNumber(0) { UniqID = 0; } Modified: llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp (original) +++ llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp Thu Aug 5 19:23:35 2010 @@ -30,7 +30,7 @@ namespace { struct MSP430BSel : public MachineFunctionPass { static char ID; - MSP430BSel() : MachineFunctionPass(ID) {} + MSP430BSel() : MachineFunctionPass(&ID) {} /// BlockSizes - The sizes of the basic blocks in the function. std::vector BlockSizes; Modified: llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp Thu Aug 5 19:23:35 2010 @@ -32,7 +32,7 @@ static char ID; Filler(TargetMachine &tm) - : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { } + : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { } virtual const char *getPassName() const { return "Mips Delay Slot Filler"; Modified: llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp Thu Aug 5 19:23:35 2010 @@ -38,7 +38,7 @@ namespace { struct MemSelOpt : public MachineFunctionPass { static char ID; - MemSelOpt() : MachineFunctionPass(ID) {} + MemSelOpt() : MachineFunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreservedID(MachineLoopInfoID); Modified: llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h Thu Aug 5 19:23:35 2010 @@ -35,7 +35,7 @@ class PIC16Cloner : public ModulePass { public: static char ID; // Class identification - PIC16Cloner() : ModulePass(ID) {} + PIC16Cloner() : ModulePass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h Thu Aug 5 19:23:35 2010 @@ -39,7 +39,7 @@ unsigned IndirectCallColor; public: static char ID; // Class identification - PIC16Overlay() : ModulePass(ID) { + PIC16Overlay() : ModulePass(&ID) { OverlayStr = "Overlay="; InterruptDepth = PIC16OVERLAY::StartInterruptColor; IndirectCallColor = PIC16OVERLAY::StartIndirectCallColor; Modified: llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp Thu Aug 5 19:23:35 2010 @@ -31,7 +31,7 @@ namespace { struct PPCBSel : public MachineFunctionPass { static char ID; - PPCBSel() : MachineFunctionPass(ID) {} + PPCBSel() : MachineFunctionPass(&ID) {} /// BlockSizes - The sizes of the basic blocks in the function. std::vector BlockSizes; Modified: llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp Thu Aug 5 19:23:35 2010 @@ -45,7 +45,7 @@ public: PPCCodeEmitter(TargetMachine &tm, JITCodeEmitter &mce) - : MachineFunctionPass(ID), TM(tm), MCE(mce) {} + : MachineFunctionPass(&ID), TM(tm), MCE(mce) {} /// getBinaryCodeForInstr - This function, generated by the /// CodeEmitterGenerator using TableGen, produces the binary encoding for Modified: llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp (original) +++ llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp Thu Aug 5 19:23:35 2010 @@ -32,7 +32,7 @@ static char ID; Filler(TargetMachine &tm) - : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { } + : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { } virtual const char *getPassName() const { return "SPARC Delay Slot Filler"; Modified: llvm/trunk/lib/Target/Sparc/FPMover.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/FPMover.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/FPMover.cpp (original) +++ llvm/trunk/lib/Target/Sparc/FPMover.cpp Thu Aug 5 19:23:35 2010 @@ -36,7 +36,7 @@ static char ID; explicit FPMover(TargetMachine &tm) - : MachineFunctionPass(ID), TM(tm) { } + : MachineFunctionPass(&ID), TM(tm) { } virtual const char *getPassName() const { return "Sparc Double-FP Move Fixer"; Modified: llvm/trunk/lib/Target/TargetData.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetData.cpp (original) +++ llvm/trunk/lib/Target/TargetData.cpp Thu Aug 5 19:23:35 2010 @@ -226,13 +226,13 @@ /// /// @note This has to exist, because this is a pass, but it should never be /// used. -TargetData::TargetData() : ImmutablePass(ID) { +TargetData::TargetData() : ImmutablePass(&ID) { report_fatal_error("Bad TargetData ctor used. " "Tool did not specify a TargetData to use?"); } TargetData::TargetData(const Module *M) - : ImmutablePass(ID) { + : ImmutablePass(&ID) { init(M->getDataLayout()); } Modified: llvm/trunk/lib/Target/X86/SSEDomainFix.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/SSEDomainFix.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/SSEDomainFix.cpp (original) +++ llvm/trunk/lib/Target/X86/SSEDomainFix.cpp Thu Aug 5 19:23:35 2010 @@ -115,7 +115,7 @@ unsigned Distance; public: - SSEDomainFixPass() : MachineFunctionPass(ID) {} + SSEDomainFixPass() : MachineFunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Thu Aug 5 19:23:35 2010 @@ -53,12 +53,12 @@ public: static char ID; explicit Emitter(X86TargetMachine &tm, CodeEmitter &mce) - : MachineFunctionPass(ID), II(0), TD(0), TM(tm), + : MachineFunctionPass(&ID), II(0), TD(0), TM(tm), MCE(mce), PICBaseOffset(0), Is64BitMode(false), IsPIC(TM.getRelocationModel() == Reloc::PIC_) {} Emitter(X86TargetMachine &tm, CodeEmitter &mce, const X86InstrInfo &ii, const TargetData &td, bool is64) - : MachineFunctionPass(ID), II(&ii), TD(&td), TM(tm), + : MachineFunctionPass(&ID), II(&ii), TD(&td), TM(tm), MCE(mce), PICBaseOffset(0), Is64BitMode(is64), IsPIC(TM.getRelocationModel() == Reloc::PIC_) {} Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Thu Aug 5 19:23:35 2010 @@ -50,7 +50,7 @@ namespace { struct FPS : public MachineFunctionPass { static char ID; - FPS() : MachineFunctionPass(ID) { + FPS() : MachineFunctionPass(&ID) { // This is really only to keep valgrind quiet. // The logic in isLive() is too much for it. memset(Stack, 0, sizeof(Stack)); Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Thu Aug 5 19:23:35 2010 @@ -3029,7 +3029,7 @@ /// global base register for x86-32. struct CGBR : public MachineFunctionPass { static char ID; - CGBR() : MachineFunctionPass(ID) {} + CGBR() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF) { const X86TargetMachine *TM = Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Thu Aug 5 19:23:35 2010 @@ -1557,7 +1557,7 @@ namespace { struct MSAH : public MachineFunctionPass { static char ID; - MSAH() : MachineFunctionPass(ID) {} + MSAH() : MachineFunctionPass(&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF) { const X86TargetMachine *TM = Modified: llvm/trunk/lib/Transforms/Hello/Hello.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Hello/Hello.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Hello/Hello.cpp (original) +++ llvm/trunk/lib/Transforms/Hello/Hello.cpp Thu Aug 5 19:23:35 2010 @@ -25,7 +25,7 @@ // Hello - The first implementation, without getAnalysisUsage. struct Hello : public FunctionPass { static char ID; // Pass identification, replacement for typeid - Hello() : FunctionPass(ID) {} + Hello() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F) { ++HelloCounter; @@ -43,7 +43,7 @@ // Hello2 - The second implementation with getAnalysisUsage implemented. struct Hello2 : public FunctionPass { static char ID; // Pass identification, replacement for typeid - Hello2() : FunctionPass(ID) {} + Hello2() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F) { ++HelloCounter; Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Thu Aug 5 19:23:35 2010 @@ -67,7 +67,7 @@ virtual bool runOnSCC(CallGraphSCC &SCC); static char ID; // Pass identification, replacement for typeid explicit ArgPromotion(unsigned maxElements = 3) - : CallGraphSCCPass(ID), maxElements(maxElements) {} + : CallGraphSCCPass(&ID), maxElements(maxElements) {} /// A vector used to hold the indices of a single GEP instruction typedef std::vector IndicesVector; Modified: llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp Thu Aug 5 19:23:35 2010 @@ -31,7 +31,7 @@ namespace { struct ConstantMerge : public ModulePass { static char ID; // Pass identification, replacement for typeid - ConstantMerge() : ModulePass(ID) {} + ConstantMerge() : ModulePass(&ID) {} // run - For this pass, process all of the globals in the module, // eliminating duplicate constants. Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Thu Aug 5 19:23:35 2010 @@ -122,11 +122,11 @@ protected: // DAH uses this to specify a different ID. - explicit DAE(char &ID) : ModulePass(ID) {} + explicit DAE(void *ID) : ModulePass(ID) {} public: static char ID; // Pass identification, replacement for typeid - DAE() : ModulePass(ID) {} + DAE() : ModulePass(&ID) {} bool runOnModule(Module &M); @@ -159,7 +159,7 @@ /// by bugpoint. struct DAH : public DAE { static char ID; - DAH() : DAE(ID) {} + DAH() : DAE(&ID) {} virtual bool ShouldHackArguments() const { return true; } }; Modified: llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp Thu Aug 5 19:23:35 2010 @@ -26,7 +26,7 @@ namespace { struct DTE : public ModulePass { static char ID; // Pass identification, replacement for typeid - DTE() : ModulePass(ID) {} + DTE() : ModulePass(&ID) {} // doPassInitialization - For this pass, it removes global symbol table // entries for primitive types. These are never used for linking in GCC and Modified: llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp Thu Aug 5 19:23:35 2010 @@ -35,7 +35,7 @@ /// explicit GVExtractorPass(std::vector& GVs, bool deleteS = true, bool relinkCallees = false) - : ModulePass(ID), Named(GVs), deleteStuff(deleteS), + : ModulePass(&ID), Named(GVs), deleteStuff(deleteS), reLink(relinkCallees) {} bool runOnModule(Module &M) { Modified: llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp Thu Aug 5 19:23:35 2010 @@ -41,7 +41,7 @@ namespace { struct FunctionAttrs : public CallGraphSCCPass { static char ID; // Pass identification, replacement for typeid - FunctionAttrs() : CallGraphSCCPass(ID) {} + FunctionAttrs() : CallGraphSCCPass(&ID) {} // runOnSCC - Analyze the SCC, performing the transformation if possible. bool runOnSCC(CallGraphSCC &SCC); Modified: llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp Thu Aug 5 19:23:35 2010 @@ -31,7 +31,7 @@ namespace { struct GlobalDCE : public ModulePass { static char ID; // Pass identification, replacement for typeid - GlobalDCE() : ModulePass(ID) {} + GlobalDCE() : ModulePass(&ID) {} // run - Do the GlobalDCE pass on the specified module, optionally updating // the specified callgraph to reflect the changes. Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Thu Aug 5 19:23:35 2010 @@ -59,7 +59,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { } static char ID; // Pass identification, replacement for typeid - GlobalOpt() : ModulePass(ID) {} + GlobalOpt() : ModulePass(&ID) {} bool runOnModule(Module &M); Modified: llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp Thu Aug 5 19:23:35 2010 @@ -35,7 +35,7 @@ /// struct IPCP : public ModulePass { static char ID; // Pass identification, replacement for typeid - IPCP() : ModulePass(ID) {} + IPCP() : ModulePass(&ID) {} bool runOnModule(Module &M); private: Modified: llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp Thu Aug 5 19:23:35 2010 @@ -36,7 +36,7 @@ InlineCostAnalyzer CA; public: // Use extremely low threshold. - AlwaysInliner() : Inliner(ID, -2000000000) {} + AlwaysInliner() : Inliner(&ID, -2000000000) {} static char ID; // Pass identification, replacement for typeid InlineCost getInlineCost(CallSite CS) { return CA.getInlineCost(CS, NeverInline); Modified: llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp Thu Aug 5 19:23:35 2010 @@ -33,8 +33,8 @@ SmallPtrSet NeverInline; InlineCostAnalyzer CA; public: - SimpleInliner() : Inliner(ID) {} - SimpleInliner(int Threshold) : Inliner(ID, Threshold) {} + SimpleInliner() : Inliner(&ID) {} + SimpleInliner(int Threshold) : Inliner(&ID, Threshold) {} static char ID; // Pass identification, replacement for typeid InlineCost getInlineCost(CallSite CS) { return CA.getInlineCost(CS, NeverInline); Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Thu Aug 5 19:23:35 2010 @@ -48,10 +48,10 @@ // Threshold to use when optsize is specified (and there is no -inline-limit). const int OptSizeThreshold = 75; -Inliner::Inliner(char &ID) +Inliner::Inliner(void *ID) : CallGraphSCCPass(ID), InlineThreshold(InlineLimit) {} -Inliner::Inliner(char &ID, int Threshold) +Inliner::Inliner(void *ID, int Threshold) : CallGraphSCCPass(ID), InlineThreshold(Threshold) {} /// getAnalysisUsage - For this class, we declare that we require and preserve Modified: llvm/trunk/lib/Transforms/IPO/Internalize.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Internalize.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Internalize.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Internalize.cpp Thu Aug 5 19:23:35 2010 @@ -67,7 +67,7 @@ "Internalize Global Symbols", false, false); InternalizePass::InternalizePass(bool AllButMain) - : ModulePass(ID), AllButMain(AllButMain){ + : ModulePass(&ID), AllButMain(AllButMain){ if (!APIFile.empty()) // If a filename is specified, use it. LoadFile(APIFile.c_str()); if (!APIList.empty()) // If a list is specified, use it as well. @@ -75,7 +75,7 @@ } InternalizePass::InternalizePass(const std::vector&exportList) - : ModulePass(ID), AllButMain(false){ + : ModulePass(&ID), AllButMain(false){ for(std::vector::const_iterator itr = exportList.begin(); itr != exportList.end(); itr++) { ExternalNames.insert(*itr); Modified: llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp Thu Aug 5 19:23:35 2010 @@ -37,7 +37,7 @@ unsigned NumLoops; explicit LoopExtractor(unsigned numLoops = ~0) - : LoopPass(ID), NumLoops(numLoops) {} + : LoopPass(&ID), NumLoops(numLoops) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -147,7 +147,7 @@ std::vector > BlocksToNotExtractByName; public: static char ID; // Pass identification, replacement for typeid - BlockExtractorPass() : ModulePass(ID) { + BlockExtractorPass() : ModulePass(&ID) { if (!BlockFile.empty()) LoadFile(BlockFile.c_str()); } Modified: llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp Thu Aug 5 19:23:35 2010 @@ -109,7 +109,7 @@ bool IsTransformableFunction(StringRef Name); public: static char ID; // Pass identification, replacement for typeid - LowerSetJmp() : ModulePass(ID) {} + LowerSetJmp() : ModulePass(&ID) {} void visitCallInst(CallInst& CI); void visitInvokeInst(InvokeInst& II); Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Thu Aug 5 19:23:35 2010 @@ -88,7 +88,7 @@ /// struct MergeFunctions : public ModulePass { static char ID; // Pass identification, replacement for typeid - MergeFunctions() : ModulePass(ID) {} + MergeFunctions() : ModulePass(&ID) {} bool runOnModule(Module &M); }; Modified: llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp Thu Aug 5 19:23:35 2010 @@ -30,7 +30,7 @@ struct PartialInliner : public ModulePass { virtual void getAnalysisUsage(AnalysisUsage &AU) const { } static char ID; // Pass identification, replacement for typeid - PartialInliner() : ModulePass(ID) {} + PartialInliner() : ModulePass(&ID) {} bool runOnModule(Module& M); Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Thu Aug 5 19:23:35 2010 @@ -50,7 +50,7 @@ int scanDistribution(Function&, int, std::map&); public : static char ID; // Pass identification, replacement for typeid - PartSpec() : ModulePass(ID) {} + PartSpec() : ModulePass(&ID) {} bool runOnModule(Module &M); }; } Modified: llvm/trunk/lib/Transforms/IPO/PruneEH.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PruneEH.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PruneEH.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PruneEH.cpp Thu Aug 5 19:23:35 2010 @@ -37,7 +37,7 @@ namespace { struct PruneEH : public CallGraphSCCPass { static char ID; // Pass identification, replacement for typeid - PruneEH() : CallGraphSCCPass(ID) {} + PruneEH() : CallGraphSCCPass(&ID) {} // runOnSCC - Analyze the SCC, performing the transformation if possible. bool runOnSCC(CallGraphSCC &SCC); Modified: llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp Thu Aug 5 19:23:35 2010 @@ -29,7 +29,7 @@ class StripDeadPrototypesPass : public ModulePass { public: static char ID; // Pass identification, replacement for typeid - StripDeadPrototypesPass() : ModulePass(ID) { } + StripDeadPrototypesPass() : ModulePass(&ID) { } virtual bool runOnModule(Module &M); }; Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Thu Aug 5 19:23:35 2010 @@ -39,7 +39,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripSymbols(bool ODI = false) - : ModulePass(ID), OnlyDebugInfo(ODI) {} + : ModulePass(&ID), OnlyDebugInfo(ODI) {} virtual bool runOnModule(Module &M); @@ -52,7 +52,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripNonDebugSymbols() - : ModulePass(ID) {} + : ModulePass(&ID) {} virtual bool runOnModule(Module &M); @@ -65,7 +65,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripDebugDeclare() - : ModulePass(ID) {} + : ModulePass(&ID) {} virtual bool runOnModule(Module &M); @@ -78,7 +78,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripDeadDebugInfo() - : ModulePass(ID) {} + : ModulePass(&ID) {} virtual bool runOnModule(Module &M); Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Thu Aug 5 19:23:35 2010 @@ -50,7 +50,7 @@ virtual bool runOnSCC(CallGraphSCC &SCC); static char ID; // Pass identification, replacement for typeid - SRETPromotion() : CallGraphSCCPass(ID) {} + SRETPromotion() : CallGraphSCCPass(&ID) {} private: CallGraphNode *PromoteReturn(CallGraphNode *CGN); Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombine.h?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/InstCombine/InstCombine.h (original) +++ llvm/trunk/lib/Transforms/InstCombine/InstCombine.h Thu Aug 5 19:23:35 2010 @@ -81,7 +81,7 @@ BuilderTy *Builder; static char ID; // Pass identification, replacement for typeid - InstCombiner() : FunctionPass(ID), TD(0), Builder(0) {} + InstCombiner() : FunctionPass(&ID), TD(0), Builder(0) {} public: virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp Thu Aug 5 19:23:35 2010 @@ -34,7 +34,7 @@ bool runOnModule(Module &M); public: static char ID; // Pass identification, replacement for typeid - EdgeProfiler() : ModulePass(ID) {} + EdgeProfiler() : ModulePass(&ID) {} virtual const char *getPassName() const { return "Edge Profiler"; Modified: llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp Thu Aug 5 19:23:35 2010 @@ -36,7 +36,7 @@ bool runOnModule(Module &M); public: static char ID; // Pass identification, replacement for typeid - OptimalEdgeProfiler() : ModulePass(ID) {} + OptimalEdgeProfiler() : ModulePass(&ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(ProfileEstimatorPassID); Modified: llvm/trunk/lib/Transforms/Scalar/ABCD.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ABCD.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ABCD.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ABCD.cpp Thu Aug 5 19:23:35 2010 @@ -49,7 +49,7 @@ class ABCD : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid. - ABCD() : FunctionPass(ID) {} + ABCD() : FunctionPass(&ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Transforms/Scalar/ADCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ADCE.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ADCE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ADCE.cpp Thu Aug 5 19:23:35 2010 @@ -33,7 +33,7 @@ namespace { struct ADCE : public FunctionPass { static char ID; // Pass identification, replacement for typeid - ADCE() : FunctionPass(ID) {} + ADCE() : FunctionPass(&ID) {} virtual bool runOnFunction(Function& F); Modified: llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp Thu Aug 5 19:23:35 2010 @@ -41,7 +41,7 @@ namespace { struct BlockPlacement : public FunctionPass { static char ID; // Pass identification, replacement for typeid - BlockPlacement() : FunctionPass(ID) {} + BlockPlacement() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Thu Aug 5 19:23:35 2010 @@ -54,7 +54,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit CodeGenPrepare(const TargetLowering *tli = 0) - : FunctionPass(ID), TLI(tli) {} + : FunctionPass(&ID), TLI(tli) {} bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp Thu Aug 5 19:23:35 2010 @@ -34,7 +34,7 @@ namespace { struct ConstantPropagation : public FunctionPass { static char ID; // Pass identification, replacement for typeid - ConstantPropagation() : FunctionPass(ID) {} + ConstantPropagation() : FunctionPass(&ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/DCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DCE.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DCE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DCE.cpp Thu Aug 5 19:23:35 2010 @@ -35,7 +35,7 @@ // struct DeadInstElimination : public BasicBlockPass { static char ID; // Pass identification, replacement for typeid - DeadInstElimination() : BasicBlockPass(ID) {} + DeadInstElimination() : BasicBlockPass(&ID) {} virtual bool runOnBasicBlock(BasicBlock &BB) { bool Changed = false; for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); ) { @@ -70,7 +70,7 @@ // struct DCE : public FunctionPass { static char ID; // Pass identification, replacement for typeid - DCE() : FunctionPass(ID) {} + DCE() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Thu Aug 5 19:23:35 2010 @@ -40,7 +40,7 @@ TargetData *TD; static char ID; // Pass identification, replacement for typeid - DSE() : FunctionPass(ID) {} + DSE() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F) { bool Changed = false; Modified: llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp Thu Aug 5 19:23:35 2010 @@ -27,7 +27,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const; public: static char ID; // Pass identification, replacement for typeid - explicit GEPSplitter() : FunctionPass(ID) {} + explicit GEPSplitter() : FunctionPass(&ID) {} }; } Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Thu Aug 5 19:23:35 2010 @@ -665,7 +665,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit GVN(bool noloads = false) - : FunctionPass(ID), NoLoads(noloads), MD(0) { } + : FunctionPass(&ID), NoLoads(noloads), MD(0) { } private: bool NoLoads; Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Thu Aug 5 19:23:35 2010 @@ -77,7 +77,7 @@ public: static char ID; // Pass identification, replacement for typeid - IndVarSimplify() : LoopPass(ID) {} + IndVarSimplify() : LoopPass(&ID) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM); Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Thu Aug 5 19:23:35 2010 @@ -79,7 +79,7 @@ #endif public: static char ID; // Pass identification - JumpThreading() : FunctionPass(ID) {} + JumpThreading() : FunctionPass(&ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Thu Aug 5 19:23:35 2010 @@ -66,7 +66,7 @@ namespace { struct LICM : public LoopPass { static char ID; // Pass identification, replacement for typeid - LICM() : LoopPass(ID) {} + LICM() : LoopPass(&ID) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM); Modified: llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp Thu Aug 5 19:23:35 2010 @@ -28,7 +28,7 @@ class LoopDeletion : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopDeletion() : LoopPass(ID) {} + LoopDeletion() : LoopPass(&ID) {} // Possibly eliminate loop L if it is dead. bool runOnLoop(Loop* L, LPPassManager& LPM); Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Thu Aug 5 19:23:35 2010 @@ -74,7 +74,7 @@ class LoopIndexSplit : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopIndexSplit() : LoopPass(ID) {} + LoopIndexSplit() : LoopPass(&ID) {} // Index split Loop L. Return true if loop is split. bool runOnLoop(Loop *L, LPPassManager &LPM); Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Thu Aug 5 19:23:35 2010 @@ -35,7 +35,7 @@ class LoopRotate : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopRotate() : LoopPass(ID) {} + LoopRotate() : LoopPass(&ID) {} // Rotate Loop L as many times as possible. Return true if // loop is rotated at least once. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Thu Aug 5 19:23:35 2010 @@ -3751,7 +3751,7 @@ } LoopStrengthReduce::LoopStrengthReduce(const TargetLowering *tli) - : LoopPass(ID), TLI(tli) {} + : LoopPass(&ID), TLI(tli) {} void LoopStrengthReduce::getAnalysisUsage(AnalysisUsage &AU) const { // We split critical edges, so we change the CFG. However, we do update Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp Thu Aug 5 19:23:35 2010 @@ -43,7 +43,7 @@ class LoopUnroll : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopUnroll() : LoopPass(ID) {} + LoopUnroll() : LoopPass(&ID) {} /// A magic value for use with the Threshold parameter to indicate /// that the loop unroll should be performed regardless of how much Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Thu Aug 5 19:23:35 2010 @@ -92,7 +92,7 @@ public: static char ID; // Pass ID, replacement for typeid explicit LoopUnswitch(bool Os = false) : - LoopPass(ID), OptimizeForSize(Os), redoLoop(false), + LoopPass(&ID), OptimizeForSize(Os), redoLoop(false), currentLoop(NULL), DF(NULL), DT(NULL), loopHeader(NULL), loopPreheader(NULL) {} Modified: llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp Thu Aug 5 19:23:35 2010 @@ -138,7 +138,7 @@ struct LowerAtomic : public BasicBlockPass { static char ID; - LowerAtomic() : BasicBlockPass(ID) {} + LowerAtomic() : BasicBlockPass(&ID) {} bool runOnBasicBlock(BasicBlock &BB) { bool Changed = false; for (BasicBlock::iterator DI = BB.begin(), DE = BB.end(); DI != DE; ) { Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Thu Aug 5 19:23:35 2010 @@ -304,7 +304,7 @@ bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - MemCpyOpt() : FunctionPass(ID) {} + MemCpyOpt() : FunctionPass(&ID) {} private: // This transformation requires dominator postdominator info Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Thu Aug 5 19:23:35 2010 @@ -77,7 +77,7 @@ bool MadeChange; public: static char ID; // Pass identification, replacement for typeid - Reassociate() : FunctionPass(ID) {} + Reassociate() : FunctionPass(&ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp Thu Aug 5 19:23:35 2010 @@ -36,7 +36,7 @@ namespace { struct RegToMem : public FunctionPass { static char ID; // Pass identification, replacement for typeid - RegToMem() : FunctionPass(ID) {} + RegToMem() : FunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(BreakCriticalEdgesID); @@ -124,7 +124,7 @@ // createDemoteRegisterToMemory - Provide an entry point to create this pass. // -char &llvm::DemoteRegisterToMemoryID = RegToMem::ID; +const PassInfo *const llvm::DemoteRegisterToMemoryID = &X; FunctionPass *llvm::createDemoteRegisterToMemoryPass() { return new RegToMem(); } Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Thu Aug 5 19:23:35 2010 @@ -1586,7 +1586,7 @@ /// struct SCCP : public FunctionPass { static char ID; // Pass identification, replacement for typeid - SCCP() : FunctionPass(ID) {} + SCCP() : FunctionPass(&ID) {} // runOnFunction - Run the Sparse Conditional Constant Propagation // algorithm, and return true if the function was modified. @@ -1702,7 +1702,7 @@ /// struct IPSCCP : public ModulePass { static char ID; - IPSCCP() : ModulePass(ID) {} + IPSCCP() : ModulePass(&ID) {} bool runOnModule(Module &M); }; } // end anonymous namespace Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Thu Aug 5 19:23:35 2010 @@ -51,7 +51,7 @@ namespace { struct SROA : public FunctionPass { static char ID; // Pass identification, replacement for typeid - explicit SROA(signed T = -1) : FunctionPass(ID) { + explicit SROA(signed T = -1) : FunctionPass(&ID) { if (T == -1) SRThreshold = 128; else Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp Thu Aug 5 19:23:35 2010 @@ -42,7 +42,7 @@ namespace { struct CFGSimplifyPass : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGSimplifyPass() : FunctionPass(ID) {} + CFGSimplifyPass() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); }; Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp Thu Aug 5 19:23:35 2010 @@ -32,7 +32,7 @@ const TargetData *TD; public: static char ID; // Pass identification - SimplifyHalfPowrLibCalls() : FunctionPass(ID) {} + SimplifyHalfPowrLibCalls() : FunctionPass(&ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Thu Aug 5 19:23:35 2010 @@ -1237,7 +1237,7 @@ bool Modified; // This is only used by doInitialization. public: static char ID; // Pass identification - SimplifyLibCalls() : FunctionPass(ID), StrCpy(false), StrCpyChk(true) {} + SimplifyLibCalls() : FunctionPass(&ID), StrCpy(false), StrCpyChk(true) {} void InitOptimizations(); bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/Sink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Sink.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Sink.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Sink.cpp Thu Aug 5 19:23:35 2010 @@ -35,7 +35,7 @@ public: static char ID; // Pass identification - Sinking() : FunctionPass(ID) {} + Sinking() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp Thu Aug 5 19:23:35 2010 @@ -49,7 +49,7 @@ bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - TailDup() : FunctionPass(ID) {} + TailDup() : FunctionPass(&ID) {} private: inline bool shouldEliminateUnconditionalBranch(TerminatorInst *, unsigned); Modified: llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp Thu Aug 5 19:23:35 2010 @@ -72,7 +72,7 @@ namespace { struct TailCallElim : public FunctionPass { static char ID; // Pass identification, replacement for typeid - TailCallElim() : FunctionPass(ID) {} + TailCallElim() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Thu Aug 5 19:23:35 2010 @@ -36,7 +36,7 @@ namespace { struct BreakCriticalEdges : public FunctionPass { static char ID; // Pass identification, replacement for typeid - BreakCriticalEdges() : FunctionPass(ID) {} + BreakCriticalEdges() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); @@ -57,7 +57,7 @@ X("break-crit-edges", "Break critical edges in CFG"); // Publically exposed interface to pass... -char &llvm::BreakCriticalEdgesID = BreakCriticalEdges::ID; +const PassInfo *const llvm::BreakCriticalEdgesID = &X; FunctionPass *llvm::createBreakCriticalEdgesPass() { return new BreakCriticalEdges(); } Modified: llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp Thu Aug 5 19:23:35 2010 @@ -23,7 +23,7 @@ namespace { struct InstNamer : public FunctionPass { static char ID; // Pass identification, replacement for typeid - InstNamer() : FunctionPass(ID) {} + InstNamer() : FunctionPass(&ID) {} void getAnalysisUsage(AnalysisUsage &Info) const { Info.setPreservesAll(); @@ -53,7 +53,7 @@ } -char &llvm::InstructionNamerID = InstNamer::ID; +const PassInfo *const llvm::InstructionNamerID = &X; //===----------------------------------------------------------------------===// // // InstructionNamer - Give any unnamed non-void instructions "tmp" names. Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LCSSA.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Thu Aug 5 19:23:35 2010 @@ -47,7 +47,7 @@ namespace { struct LCSSA : public LoopPass { static char ID; // Pass identification, replacement for typeid - LCSSA() : LoopPass(ID) {} + LCSSA() : LoopPass(&ID) {} // Cached analysis information for the current function. DominatorTree *DT; @@ -93,7 +93,7 @@ static RegisterPass X("lcssa", "Loop-Closed SSA Form Pass"); Pass *llvm::createLCSSAPass() { return new LCSSA(); } -char &llvm::LCSSAID = LCSSA::ID; +const PassInfo *const llvm::LCSSAID = &X; /// BlockDominatesAnExit - Return true if the specified block dominates at least Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Thu Aug 5 19:23:35 2010 @@ -65,7 +65,7 @@ namespace { struct LoopSimplify : public LoopPass { static char ID; // Pass identification, replacement for typeid - LoopSimplify() : LoopPass(ID) {} + LoopSimplify() : LoopPass(&ID) {} // AA - If we have an alias analysis object to update, this is it, otherwise // this is null. @@ -110,7 +110,7 @@ X("loopsimplify", "Canonicalize natural loops", true); // Publically exposed interface to pass... -char &llvm::LoopSimplifyID = LoopSimplify::ID; +const PassInfo *const llvm::LoopSimplifyID = &X; Pass *llvm::createLoopSimplifyPass() { return new LoopSimplify(); } /// runOnLoop - Run down all loops in the CFG (recursively, but we could do Modified: llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp Thu Aug 5 19:23:35 2010 @@ -78,7 +78,7 @@ static char ID; // Pass identification, replacement for typeid explicit LowerInvoke(const TargetLowering *tli = NULL, bool useExpensiveEHSupport = ExpensiveEHSupport) - : FunctionPass(ID), useExpensiveEHSupport(useExpensiveEHSupport), + : FunctionPass(&ID), useExpensiveEHSupport(useExpensiveEHSupport), TLI(tli) { } bool doInitialization(Module &M); bool runOnFunction(Function &F); @@ -103,7 +103,7 @@ static RegisterPass X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); -char &llvm::LowerInvokePassID = LowerInvoke::ID; +const PassInfo *const llvm::LowerInvokePassID = &X; // Public Interface To the LowerInvoke pass. FunctionPass *llvm::createLowerInvokePass(const TargetLowering *TLI) { Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Thu Aug 5 19:23:35 2010 @@ -34,7 +34,7 @@ class LowerSwitch : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid - LowerSwitch() : FunctionPass(ID) {} + LowerSwitch() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F); @@ -85,7 +85,7 @@ X("lowerswitch", "Lower SwitchInst's to branches"); // Publically exposed interface to pass... -char &llvm::LowerSwitchID = LowerSwitch::ID; +const PassInfo *const llvm::LowerSwitchID = &X; // createLowerSwitchPass - Interface to this file... FunctionPass *llvm::createLowerSwitchPass() { return new LowerSwitch(); Modified: llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp Thu Aug 5 19:23:35 2010 @@ -27,7 +27,7 @@ namespace { struct PromotePass : public FunctionPass { static char ID; // Pass identification, replacement for typeid - PromotePass() : FunctionPass(ID) {} + PromotePass() : FunctionPass(&ID) {} // runOnFunction - To run this pass, first we calculate the alloca // instructions that are safe for promotion, then we promote each one. @@ -82,7 +82,7 @@ } // Publically exposed interface to pass... -char &llvm::PromoteMemoryToRegisterID = PromotePass::ID; +const PassInfo *const llvm::PromoteMemoryToRegisterID = &X; // createPromoteMemoryToRegister - Provide an entry point to create this pass. // FunctionPass *llvm::createPromoteMemoryToRegisterPass() { Modified: llvm/trunk/lib/Transforms/Utils/SSI.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SSI.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/SSI.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/SSI.cpp Thu Aug 5 19:23:35 2010 @@ -399,7 +399,7 @@ namespace { struct SSIEverything : public FunctionPass { static char ID; // Pass identification, replacement for typeid - SSIEverything() : FunctionPass(ID) {} + SSIEverything() : FunctionPass(&ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/VMCore/Pass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Pass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Pass.cpp (original) +++ llvm/trunk/lib/VMCore/Pass.cpp Thu Aug 5 19:23:35 2010 @@ -36,7 +36,14 @@ // Pass Implementation // -Pass::Pass(PassKind K, char &pid) : Resolver(0), PassID(&pid), Kind(K) { } +Pass::Pass(PassKind K, intptr_t pid) : Resolver(0), PassID(pid), Kind(K) { + assert(pid && "pid cannot be 0"); +} + +Pass::Pass(PassKind K, const void *pid) + : Resolver(0), PassID((intptr_t)pid), Kind(K) { + assert(pid && "pid cannot be 0"); +} // Force out-of-line virtual method. Pass::~Pass() { @@ -55,8 +62,8 @@ return PMT_ModulePassManager; } -bool Pass::mustPreserveAnalysisID(char &AID) const { - return Resolver->getAnalysisIfAvailable(&AID, true) != 0; +bool Pass::mustPreserveAnalysisID(const PassInfo *AnalysisID) const { + return Resolver->getAnalysisIfAvailable(AnalysisID, true) != 0; } // dumpPassStructure - Implement the -debug-passes=Structure option @@ -69,9 +76,7 @@ /// Registration templates, but can be overloaded directly. /// const char *Pass::getPassName() const { - AnalysisID AID = getPassID(); - const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(AID); - if (PI) + if (const PassInfo *PI = getPassInfo()) return PI->getPassName(); return "Unnamed pass: implement Pass::getPassName()"; } @@ -97,7 +102,7 @@ // By default, don't do anything. } -void *Pass::getAdjustedAnalysisPointer(AnalysisID AID) { +void *Pass::getAdjustedAnalysisPointer(const PassInfo *) { return this; } @@ -229,7 +234,13 @@ return PMT_BasicBlockPassManager; } -const PassInfo *Pass::lookupPassInfo(const void *TI) { +// getPassInfo - Return the PassInfo data structure that corresponds to this +// pass... +const PassInfo *Pass::getPassInfo() const { + return lookupPassInfo(PassID); +} + +const PassInfo *Pass::lookupPassInfo(intptr_t TI) { return PassRegistry::getPassRegistry()->getPassInfo(TI); } @@ -251,8 +262,8 @@ // RegisterAGBase implementation // -RegisterAGBase::RegisterAGBase(const char *Name, const void *InterfaceID, - const void *PassID, bool isDefault) +RegisterAGBase::RegisterAGBase(const char *Name, intptr_t InterfaceID, + intptr_t PassID, bool isDefault) : PassInfo(Name, InterfaceID) { PassRegistry::getPassRegistry()->registerAnalysisGroup(InterfaceID, PassID, *this, isDefault); @@ -295,7 +306,7 @@ void passEnumerate(const PassInfo *P) { if (P->isCFGOnlyPass()) - CFGOnlyList.push_back(P->getTypeInfo()); + CFGOnlyList.push_back(P); } }; } @@ -315,25 +326,15 @@ GetCFGOnlyPasses(Preserved).enumeratePasses(); } -AnalysisUsage &AnalysisUsage::addPreserved(StringRef Arg) { - const PassInfo *PI = Pass::lookupPassInfo(Arg); - // If the pass exists, preserve it. Otherwise silently do nothing. - if (PI) Preserved.push_back(PI->getTypeInfo()); - return *this; -} - -AnalysisUsage &AnalysisUsage::addRequiredID(const void *ID) { +AnalysisUsage &AnalysisUsage::addRequiredID(AnalysisID ID) { + assert(ID && "Pass class not registered!"); Required.push_back(ID); return *this; } -AnalysisUsage &AnalysisUsage::addRequiredID(char &ID) { - Required.push_back(&ID); - return *this; -} - -AnalysisUsage &AnalysisUsage::addRequiredTransitiveID(char &ID) { - Required.push_back(&ID); - RequiredTransitive.push_back(&ID); +AnalysisUsage &AnalysisUsage::addRequiredTransitiveID(AnalysisID ID) { + assert(ID && "Pass class not registered!"); + Required.push_back(ID); + RequiredTransitive.push_back(ID); return *this; } Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Thu Aug 5 19:23:35 2010 @@ -84,15 +84,13 @@ static bool ShouldPrintBeforeOrAfterPass(Pass *P, PassOptionList &PassesToPrint) { - if (const llvm::PassInfo *PI = - PassRegistry::getPassRegistry()->getPassInfo(P->getPassID())) { - for (unsigned i = 0, ie = PassesToPrint.size(); i < ie; ++i) { - const llvm::PassInfo *PassInf = PassesToPrint[i]; - if (PassInf) - if (PassInf->getPassArgument() == PI->getPassArgument()) { - return true; - } - } + for (unsigned i = 0, ie = PassesToPrint.size(); i < ie; ++i) { + const llvm::PassInfo *PassInf = PassesToPrint[i]; + if (PassInf && P->getPassInfo()) + if (PassInf->getPassArgument() == + P->getPassInfo()->getPassArgument()) { + return true; + } } return false; } @@ -165,7 +163,7 @@ public: static char ID; explicit BBPassManager(int Depth) - : PMDataManager(Depth), FunctionPass(ID) {} + : PMDataManager(Depth), FunctionPass(&ID) {} /// Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the function, and if so, return true. @@ -226,7 +224,7 @@ public: static char ID; explicit FunctionPassManagerImpl(int Depth) : - Pass(PT_PassManager, ID), PMDataManager(Depth), + Pass(PT_PassManager, &ID), PMDataManager(Depth), PMTopLevelManager(TLM_Function), wasRun(false) { } /// add - Add a pass to the queue of passes to run. This passes ownership of @@ -300,7 +298,7 @@ public: static char ID; explicit MPPassManager(int Depth) : - Pass(PT_PassManager, ID), PMDataManager(Depth) { } + Pass(PT_PassManager, &ID), PMDataManager(Depth) { } // Delete on the fly managers. virtual ~MPPassManager() { @@ -334,7 +332,7 @@ /// Return function pass corresponding to PassInfo PI, that is /// required by module pass MP. Instantiate analysis pass, by using /// its runOnFunction() for function F. - virtual Pass* getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F); + virtual Pass* getOnTheFlyPass(Pass *MP, const PassInfo *PI, Function &F); virtual const char *getPassName() const { return "Module Pass Manager"; @@ -385,7 +383,7 @@ public: static char ID; explicit PassManagerImpl(int Depth) : - Pass(PT_PassManager, ID), PMDataManager(Depth), + Pass(PT_PassManager, &ID), PMDataManager(Depth), PMTopLevelManager(TLM_Pass) { } /// add - Add a pass to the queue of passes to run. This passes ownership of @@ -570,9 +568,8 @@ // If P is an analysis pass and it is available then do not // generate the analysis again. Stale analysis info should not be // available at this point. - const PassInfo *PI = - PassRegistry::getPassRegistry()->getPassInfo(P->getPassID()); - if (PI && PI->isAnalysis() && findAnalysisPass(P->getPassID())) { + if (P->getPassInfo() && + P->getPassInfo()->isAnalysis() && findAnalysisPass(P->getPassInfo())) { delete P; return; } @@ -589,8 +586,7 @@ Pass *AnalysisPass = findAnalysisPass(*I); if (!AnalysisPass) { - const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(*I); - AnalysisPass = PI->createPass(); + AnalysisPass = (*I)->createPass(); if (P->getPotentialPassManagerType () == AnalysisPass->getPotentialPassManagerType()) // Schedule analysis pass that is managed by the same pass manager. @@ -636,21 +632,16 @@ for (SmallVector::iterator I = ImmutablePasses.begin(), E = ImmutablePasses.end(); P == NULL && I != E; ++I) { - AnalysisID PI = (*I)->getPassID(); + const PassInfo *PI = (*I)->getPassInfo(); if (PI == AID) P = *I; // If Pass not found then check the interfaces implemented by Immutable Pass if (!P) { - const PassInfo *PassInf = - PassRegistry::getPassRegistry()->getPassInfo(PI); const std::vector &ImmPI = - PassInf->getInterfacesImplemented(); - for (std::vector::const_iterator II = ImmPI.begin(), - EE = ImmPI.end(); II != EE; ++II) { - if ((*II)->getTypeInfo() == AID) - P = *I; - } + PI->getInterfacesImplemented(); + if (std::find(ImmPI.begin(), ImmPI.end(), AID) != ImmPI.end()) + P = *I; } } @@ -733,19 +724,16 @@ /// Augement AvailableAnalysis by adding analysis made available by pass P. void PMDataManager::recordAvailableAnalysis(Pass *P) { - AnalysisID PI = P->getPassID(); + const PassInfo *PI = P->getPassInfo(); + if (PI == 0) return; AvailableAnalysis[PI] = P; - - assert(AvailableAnalysis.size()); //This pass is the current implementation of all of the interfaces it //implements as well. - const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(PI); - if (PInf == 0) return; - const std::vector &II = PInf->getInterfacesImplemented(); + const std::vector &II = PI->getInterfacesImplemented(); for (unsigned i = 0, e = II.size(); i != e; ++i) - AvailableAnalysis[II[i]->getTypeInfo()] = P; + AvailableAnalysis[II[i]] = P; } // Return true if P preserves high level analysis used by other @@ -761,7 +749,7 @@ Pass *P1 = *I; if (P1->getAsImmutablePass() == 0 && std::find(PreservedSet.begin(), PreservedSet.end(), - P1->getPassID()) == + P1->getPassInfo()) == PreservedSet.end()) return false; } @@ -811,7 +799,7 @@ AvailableAnalysis.erase(Info); } } - + // Check inherited analysis also. If P is not preserving analysis // provided by parent manager then remove it here. for (unsigned Index = 0; Index < PMT_Last; ++Index) { @@ -873,17 +861,16 @@ P->releaseMemory(); } - AnalysisID PI = P->getPassID(); - if (const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(PI)) { + if (const PassInfo *PI = P->getPassInfo()) { // Remove the pass itself (if it is not already removed). AvailableAnalysis.erase(PI); // Remove all interfaces this pass implements, for which it is also // listed as the available implementation. - const std::vector &II = PInf->getInterfacesImplemented(); + const std::vector &II = PI->getInterfacesImplemented(); for (unsigned i = 0, e = II.size(); i != e; ++i) { std::map::iterator Pos = - AvailableAnalysis.find(II[i]->getTypeInfo()); + AvailableAnalysis.find(II[i]); if (Pos != AvailableAnalysis.end() && Pos->second == P) AvailableAnalysis.erase(Pos); } @@ -954,8 +941,7 @@ for (SmallVector::iterator I = ReqAnalysisNotAvailable.begin(), E = ReqAnalysisNotAvailable.end() ;I != E; ++I) { - const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(*I); - Pass *AnalysisPass = PI->createPass(); + Pass *AnalysisPass = (*I)->createPass(); this->addLowerLevelRequiredPass(P, AnalysisPass); } @@ -1058,8 +1044,7 @@ if (PMDataManager *PMD = (*I)->getAsPMDataManager()) PMD->dumpPassArguments(); else - if (const PassInfo *PI = - PassRegistry::getPassRegistry()->getPassInfo((*I)->getPassID())) + if (const PassInfo *PI = (*I)->getPassInfo()) if (!PI->isAnalysisGroup()) dbgs() << " -" << PI->getPassArgument(); } @@ -1131,8 +1116,7 @@ dbgs() << (void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:"; for (unsigned i = 0; i != Set.size(); ++i) { if (i) dbgs() << ','; - const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(Set[i]); - dbgs() << ' ' << PInf->getPassName(); + dbgs() << ' ' << Set[i]->getPassName(); } dbgs() << '\n'; } @@ -1163,7 +1147,7 @@ llvm_unreachable("Unable to schedule pass"); } -Pass *PMDataManager::getOnTheFlyPass(Pass *P, AnalysisID PI, Function &F) { +Pass *PMDataManager::getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F) { assert(0 && "Unable to find on the fly pass"); return NULL; } @@ -1182,7 +1166,7 @@ return PM.findAnalysisPass(ID, dir); } -Pass *AnalysisResolver::findImplPass(Pass *P, AnalysisID AnalysisPI, +Pass *AnalysisResolver::findImplPass(Pass *P, const PassInfo *AnalysisPI, Function &F) { return PM.getOnTheFlyPass(P, AnalysisPI, F); } @@ -1577,7 +1561,7 @@ /// Return function pass corresponding to PassInfo PI, that is /// required by module pass MP. Instantiate analysis pass, by using /// its runOnFunction() for function F. -Pass* MPPassManager::getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F){ +Pass* MPPassManager::getOnTheFlyPass(Pass *MP, const PassInfo *PI, Function &F){ FunctionPassManagerImpl *FPP = OnTheFlyManagers[MP]; assert(FPP && "Unable to find on the fly pass"); Modified: llvm/trunk/lib/VMCore/PassRegistry.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassRegistry.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassRegistry.cpp (original) +++ llvm/trunk/lib/VMCore/PassRegistry.cpp Thu Aug 5 19:23:35 2010 @@ -60,7 +60,7 @@ } -const PassInfo *PassRegistry::getPassInfo(const void *TI) const { +const PassInfo *PassRegistry::getPassInfo(intptr_t TI) const { sys::SmartScopedLock Guard(Lock); MapType::const_iterator I = PassInfoMap.find(TI); return I != PassInfoMap.end() ? I->second : 0; @@ -108,8 +108,8 @@ /// Analysis Group Mechanisms. -void PassRegistry::registerAnalysisGroup(const void *InterfaceID, - const void *PassID, +void PassRegistry::registerAnalysisGroup(intptr_t InterfaceID, + intptr_t PassID, PassInfo& Registeree, bool isDefault) { PassInfo *InterfaceInfo = const_cast(getPassInfo(InterfaceID)); Modified: llvm/trunk/lib/VMCore/PrintModulePass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PrintModulePass.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PrintModulePass.cpp (original) +++ llvm/trunk/lib/VMCore/PrintModulePass.cpp Thu Aug 5 19:23:35 2010 @@ -28,10 +28,10 @@ bool DeleteStream; // Delete the ostream in our dtor? public: static char ID; - PrintModulePass() : ModulePass(ID), Out(&dbgs()), + PrintModulePass() : ModulePass(&ID), Out(&dbgs()), DeleteStream(false) {} PrintModulePass(const std::string &B, raw_ostream *o, bool DS) - : ModulePass(ID), Banner(B), Out(o), DeleteStream(DS) {} + : ModulePass(&ID), Banner(B), Out(o), DeleteStream(DS) {} ~PrintModulePass() { if (DeleteStream) delete Out; @@ -53,10 +53,10 @@ bool DeleteStream; // Delete the ostream in our dtor? public: static char ID; - PrintFunctionPass() : FunctionPass(ID), Banner(""), Out(&dbgs()), + PrintFunctionPass() : FunctionPass(&ID), Banner(""), Out(&dbgs()), DeleteStream(false) {} PrintFunctionPass(const std::string &B, raw_ostream *o, bool DS) - : FunctionPass(ID), Banner(B), Out(o), DeleteStream(DS) {} + : FunctionPass(&ID), Banner(B), Out(o), DeleteStream(DS) {} inline ~PrintFunctionPass() { if (DeleteStream) delete Out; Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Thu Aug 5 19:23:35 2010 @@ -72,7 +72,7 @@ struct PreVerifier : public FunctionPass { static char ID; // Pass ID, replacement for typeid - PreVerifier() : FunctionPass(ID) { } + PreVerifier() : FunctionPass(&ID) { } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -104,7 +104,7 @@ char PreVerifier::ID = 0; static RegisterPass PreVer("preverify", "Preliminary module verification"); -char &PreVerifyID = PreVerifier::ID; +static const PassInfo *const PreVerifyID = &PreVer; namespace { class TypeSet : public AbstractTypeUser { @@ -182,20 +182,20 @@ SmallPtrSet MDNodes; Verifier() - : FunctionPass(ID), + : FunctionPass(&ID), Broken(false), RealPass(true), action(AbortProcessAction), Mod(0), Context(0), DT(0), MessagesStr(Messages) {} explicit Verifier(VerifierFailureAction ctn) - : FunctionPass(ID), + : FunctionPass(&ID), Broken(false), RealPass(true), action(ctn), Mod(0), Context(0), DT(0), MessagesStr(Messages) {} explicit Verifier(bool AB) - : FunctionPass(ID), + : FunctionPass(&ID), Broken(false), RealPass(true), action( AB ? AbortProcessAction : PrintMessageAction), Mod(0), Context(0), DT(0), MessagesStr(Messages) {} explicit Verifier(DominatorTree &dt) - : FunctionPass(ID), + : FunctionPass(&ID), Broken(false), RealPass(false), action(PrintMessageAction), Mod(0), Context(0), DT(&dt), MessagesStr(Messages) {} Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original) +++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Thu Aug 5 19:23:35 2010 @@ -100,8 +100,7 @@ } static const PassInfo *getPI(Pass *P) { - const void *ID = P->getPassID(); - const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID); + const PassInfo *PI = P->getPassInfo(); delete P; return PI; } Modified: llvm/trunk/tools/bugpoint/TestPasses.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/TestPasses.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/TestPasses.cpp (original) +++ llvm/trunk/tools/bugpoint/TestPasses.cpp Thu Aug 5 19:23:35 2010 @@ -27,7 +27,7 @@ class CrashOnCalls : public BasicBlockPass { public: static char ID; // Pass ID, replacement for typeid - CrashOnCalls() : BasicBlockPass(ID) {} + CrashOnCalls() : BasicBlockPass(&ID) {} private: virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -54,7 +54,7 @@ class DeleteCalls : public BasicBlockPass { public: static char ID; // Pass ID, replacement for typeid - DeleteCalls() : BasicBlockPass(ID) {} + DeleteCalls() : BasicBlockPass(&ID) {} private: bool runOnBasicBlock(BasicBlock &BB) { for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/bugpoint.cpp (original) +++ llvm/trunk/tools/bugpoint/bugpoint.cpp Thu Aug 5 19:23:35 2010 @@ -90,8 +90,7 @@ AddToDriver(BugDriver &_D) : D(_D) {} virtual void add(Pass *P) { - const void *ID = P->getPassID(); - const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID); + const PassInfo *PI = P->getPassInfo(); D.addPasses(&PI, &PI + 1); } }; Modified: llvm/trunk/tools/llvm-prof/llvm-prof.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-prof/llvm-prof.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/tools/llvm-prof/llvm-prof.cpp (original) +++ llvm/trunk/tools/llvm-prof/llvm-prof.cpp Thu Aug 5 19:23:35 2010 @@ -128,7 +128,7 @@ public: static char ID; // Class identification, replacement for typeinfo. explicit ProfileInfoPrinterPass(ProfileInfoLoader &_PIL) - : ModulePass(ID), PIL(_PIL) {} + : ModulePass(&ID), PIL(_PIL) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/tools/opt/AnalysisWrappers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/AnalysisWrappers.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/tools/opt/AnalysisWrappers.cpp (original) +++ llvm/trunk/tools/opt/AnalysisWrappers.cpp Thu Aug 5 19:23:35 2010 @@ -31,7 +31,7 @@ /// or handle in alias analyses. struct ExternalFunctionsPassedConstants : public ModulePass { static char ID; // Pass ID, replacement for typeid - ExternalFunctionsPassedConstants() : ModulePass(ID) {} + ExternalFunctionsPassedConstants() : ModulePass(&ID) {} virtual bool runOnModule(Module &M) { for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { if (!I->isDeclaration()) continue; @@ -74,7 +74,7 @@ struct CallGraphPrinter : public ModulePass { static char ID; // Pass ID, replacement for typeid - CallGraphPrinter() : ModulePass(ID) {} + CallGraphPrinter() : ModulePass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/tools/opt/GraphPrinters.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/GraphPrinters.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/tools/opt/GraphPrinters.cpp (original) +++ llvm/trunk/tools/opt/GraphPrinters.cpp Thu Aug 5 19:23:35 2010 @@ -65,7 +65,7 @@ namespace { struct CallGraphPrinter : public ModulePass { static char ID; // Pass ID, replacement for typeid - CallGraphPrinter() : ModulePass(ID) {} + CallGraphPrinter() : ModulePass(&ID) {} virtual bool runOnModule(Module &M) { WriteGraphToFile(llvm::errs(), "callgraph", &getAnalysis()); @@ -93,7 +93,7 @@ class DomInfoPrinter : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid - DomInfoPrinter() : FunctionPass(ID) {} + DomInfoPrinter() : FunctionPass(&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/tools/opt/PrintSCC.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/PrintSCC.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/tools/opt/PrintSCC.cpp (original) +++ llvm/trunk/tools/opt/PrintSCC.cpp Thu Aug 5 19:23:35 2010 @@ -36,7 +36,7 @@ namespace { struct CFGSCC : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGSCC() : FunctionPass(ID) {} + CFGSCC() : FunctionPass(&ID) {} bool runOnFunction(Function& func); void print(raw_ostream &O, const Module* = 0) const { } @@ -48,7 +48,7 @@ struct CallGraphSCC : public ModulePass { static char ID; // Pass identification, replacement for typeid - CallGraphSCC() : ModulePass(ID) {} + CallGraphSCC() : ModulePass(&ID) {} // run - Print out SCCs in the call graph for the specified module. bool runOnModule(Module &M); Modified: llvm/trunk/tools/opt/opt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/tools/opt/opt.cpp (original) +++ llvm/trunk/tools/opt/opt.cpp Thu Aug 5 19:23:35 2010 @@ -139,7 +139,7 @@ static char ID; const PassInfo *PassToPrint; CallGraphSCCPassPrinter(const PassInfo *PI) : - CallGraphSCCPass(ID), PassToPrint(PI) {} + CallGraphSCCPass(&ID), PassToPrint(PI) {} virtual bool runOnSCC(CallGraphSCC &SCC) { if (!Quiet) { @@ -148,8 +148,7 @@ for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) { Function *F = (*I)->getFunction(); if (F) - getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), - F->getParent()); + getAnalysisID(PassToPrint).print(outs(), F->getParent()); } } // Get and print pass... @@ -159,7 +158,7 @@ virtual const char *getPassName() const { return "'Pass' Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint->getTypeInfo()); + AU.addRequiredID(PassToPrint); AU.setPreservesAll(); } }; @@ -169,13 +168,13 @@ struct ModulePassPrinter : public ModulePass { static char ID; const PassInfo *PassToPrint; - ModulePassPrinter(const PassInfo *PI) : ModulePass(ID), + ModulePassPrinter(const PassInfo *PI) : ModulePass(&ID), PassToPrint(PI) {} virtual bool runOnModule(Module &M) { if (!Quiet) { outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; - getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), &M); + getAnalysisID(PassToPrint).print(outs(), &M); } // Get and print pass... @@ -185,7 +184,7 @@ virtual const char *getPassName() const { return "'Pass' Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint->getTypeInfo()); + AU.addRequiredID(PassToPrint); AU.setPreservesAll(); } }; @@ -194,7 +193,7 @@ struct FunctionPassPrinter : public FunctionPass { const PassInfo *PassToPrint; static char ID; - FunctionPassPrinter(const PassInfo *PI) : FunctionPass(ID), + FunctionPassPrinter(const PassInfo *PI) : FunctionPass(&ID), PassToPrint(PI) {} virtual bool runOnFunction(Function &F) { @@ -203,15 +202,14 @@ << "' for function '" << F.getName() << "':\n"; } // Get and print pass... - getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), - F.getParent()); + getAnalysisID(PassToPrint).print(outs(), F.getParent()); return false; } virtual const char *getPassName() const { return "FunctionPass Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint->getTypeInfo()); + AU.addRequiredID(PassToPrint); AU.setPreservesAll(); } }; @@ -222,12 +220,12 @@ static char ID; const PassInfo *PassToPrint; LoopPassPrinter(const PassInfo *PI) : - LoopPass(ID), PassToPrint(PI) {} + LoopPass(&ID), PassToPrint(PI) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM) { if (!Quiet) { outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; - getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), + getAnalysisID(PassToPrint).print(outs(), L->getHeader()->getParent()->getParent()); } // Get and print pass... @@ -237,7 +235,7 @@ virtual const char *getPassName() const { return "'Pass' Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint->getTypeInfo()); + AU.addRequiredID(PassToPrint); AU.setPreservesAll(); } }; @@ -248,7 +246,7 @@ const PassInfo *PassToPrint; static char ID; BasicBlockPassPrinter(const PassInfo *PI) - : BasicBlockPass(ID), PassToPrint(PI) {} + : BasicBlockPass(&ID), PassToPrint(PI) {} virtual bool runOnBasicBlock(BasicBlock &BB) { if (!Quiet) { @@ -257,15 +255,14 @@ } // Get and print pass... - getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), - BB.getParent()->getParent()); + getAnalysisID(PassToPrint).print(outs(), BB.getParent()->getParent()); return false; } virtual const char *getPassName() const { return "BasicBlockPass Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint->getTypeInfo()); + AU.addRequiredID(PassToPrint); AU.setPreservesAll(); } }; Modified: llvm/trunk/unittests/VMCore/PassManagerTest.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/VMCore/PassManagerTest.cpp?rev=110410&r1=110409&r2=110410&view=diff ============================================================================== --- llvm/trunk/unittests/VMCore/PassManagerTest.cpp (original) +++ llvm/trunk/unittests/VMCore/PassManagerTest.cpp Thu Aug 5 19:23:35 2010 @@ -40,7 +40,7 @@ public: static char run; static char ID; - ModuleNDNM() : ModulePass(ID) {} + ModuleNDNM() : ModulePass(&ID) {} virtual bool runOnModule(Module &M) { run++; return false; @@ -56,7 +56,7 @@ public: static char run; static char ID; - ModuleNDM() : ModulePass(ID) {} + ModuleNDM() : ModulePass(&ID) {} virtual bool runOnModule(Module &M) { run++; return true; @@ -70,7 +70,7 @@ public: static char run; static char ID; - ModuleNDM2() : ModulePass(ID) {} + ModuleNDM2() : ModulePass(&ID) {} virtual bool runOnModule(Module &M) { run++; return true; @@ -83,7 +83,7 @@ public: static char run; static char ID; - ModuleDNM() : ModulePass(ID) {} + ModuleDNM() : ModulePass(&ID) {} virtual bool runOnModule(Module &M) { EXPECT_TRUE(getAnalysisIfAvailable()); run++; @@ -119,7 +119,7 @@ EXPECT_TRUE(finalized); EXPECT_EQ(run, runc); } - PassTestBase() : P(ID), allocated(0) { + PassTestBase() : P(&ID), allocated(0) { initialized = false; finalized = false; runc = 0; @@ -253,7 +253,7 @@ struct OnTheFlyTest: public ModulePass { public: static char ID; - OnTheFlyTest() : ModulePass(ID) {} + OnTheFlyTest() : ModulePass(&ID) {} virtual bool runOnModule(Module &M) { EXPECT_TRUE(getAnalysisIfAvailable()); for (Module::iterator I=M.begin(),E=M.end(); I != E; ++I) { From dpatel at apple.com Thu Aug 5 19:26:18 2010 From: dpatel at apple.com (Devang Patel) Date: Fri, 06 Aug 2010 00:26:18 -0000 Subject: [llvm-commits] [llvm] r110411 - /llvm/trunk/lib/CodeGen/RegAllocFast.cpp Message-ID: <20100806002618.451742A6C12C@llvm.org> Author: dpatel Date: Thu Aug 5 19:26:18 2010 New Revision: 110411 URL: http://llvm.org/viewvc/llvm-project?rev=110411&view=rev Log: While emitting DBG_VALUE for registers spilled at the end of a block do not use location of MBB->end(). If a block does not have terminator then incoming iterator points to end(). Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=110411&r1=110410&r2=110411&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Thu Aug 5 19:26:18 2010 @@ -277,7 +277,14 @@ int64_t Offset = 0; if (DBG->getOperand(1).isImm()) Offset = DBG->getOperand(1).getImm(); - DebugLoc DL = MI->getDebugLoc(); + DebugLoc DL; + if (MI == MBB->end()) { + // If MI is at basic block end then use last instruction's location. + MachineBasicBlock::iterator EI = MI; + DL = (--EI)->getDebugLoc(); + } + else + DL = MI->getDebugLoc(); if (MachineInstr *NewDV = TII->emitFrameIndexDebugValue(*MF, FI, Offset, MDPtr, DL)) { MachineBasicBlock *MBB = DBG->getParent(); From resistor at mac.com Thu Aug 5 19:36:20 2010 From: resistor at mac.com (Owen Anderson) Date: Fri, 06 Aug 2010 00:36:20 -0000 Subject: [llvm-commits] [llvm] r110416 - /llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <20100806003620.30E5B2A6C12C@llvm.org> Author: resistor Date: Thu Aug 5 19:36:20 2010 New Revision: 110416 URL: http://llvm.org/viewvc/llvm-project?rev=110416&view=rev Log: Fix botched revert. Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110416&r1=110415&r2=110416&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Thu Aug 5 19:36:20 2010 @@ -169,8 +169,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { - if (PI == &AliasAnalysis::ID) + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { + if (PI->isPassID(&AliasAnalysis::ID)) return (AliasAnalysis*)this; return this; } @@ -240,8 +240,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { - if (PI == &AliasAnalysis::ID) + virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { + if (PI->isPassID(&AliasAnalysis::ID)) return (AliasAnalysis*)this; return this; } From natebegeman at mac.com Thu Aug 5 20:24:11 2010 From: natebegeman at mac.com (Nate Begeman) Date: Fri, 06 Aug 2010 01:24:11 -0000 Subject: [llvm-commits] [llvm] r110419 - /llvm/trunk/utils/TableGen/NeonEmitter.cpp Message-ID: <20100806012411.E1E0A2A6C12C@llvm.org> Author: sampo Date: Thu Aug 5 20:24:11 2010 New Revision: 110419 URL: http://llvm.org/viewvc/llvm-project?rev=110419&view=rev Log: Add tablegen support for vdup_lane Modified: llvm/trunk/utils/TableGen/NeonEmitter.cpp Modified: llvm/trunk/utils/TableGen/NeonEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/NeonEmitter.cpp?rev=110419&r1=110418&r2=110419&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/NeonEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/NeonEmitter.cpp Thu Aug 5 20:24:11 2010 @@ -145,6 +145,9 @@ type = 'f'; usgn = false; break; + case 'g': + quad = false; + break; case 'w': type = Widen(type); quad = true; @@ -686,15 +689,15 @@ bool cnst = false; bool pntr = false; - // base type to get the type string for. + // Base type to get the type string for. char type = ClassifyType(typestr, quad, poly, usgn); // Based on the modifying character, change the type and width if necessary. type = ModType(mod, type, quad, poly, usgn, scal, cnst, pntr); - + if (usgn) ret |= 0x08; - if (quad) + if (quad && proto[1] != 'g') ret |= 0x10; switch (type) { From gohman at apple.com Thu Aug 5 20:25:49 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 06 Aug 2010 01:25:49 -0000 Subject: [llvm-commits] [llvm] r110421 - in /llvm/trunk/lib/Analysis: AliasAnalysis.cpp BasicAliasAnalysis.cpp Message-ID: <20100806012549.C095F2A6C12C@llvm.org> Author: djg Date: Thu Aug 5 20:25:49 2010 New Revision: 110421 URL: http://llvm.org/viewvc/llvm-project?rev=110421&view=rev Log: Move all the logic for function attributes and call attributes out of the AliasAnalysis base class and into BasicAliasAnalyais. This avoids confusion about where such logic is happening when there are other AliasAnalysis implementations present. Move the logic for translating two-callsite getModRefInfo queries into other AliasAnalysis queries out of BasicAliasAnalysis and into the AliasAnalysis base class, as it is useful for other AliasAnalysis implementations. Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=110421&r1=110420&r2=110421&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Thu Aug 5 20:25:49 2010 @@ -65,9 +65,127 @@ } AliasAnalysis::ModRefResult +AliasAnalysis::getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size) { + // Don't assert AA because BasicAA calls us in order to make use of the + // logic here. + + ModRefBehavior MRB = getModRefBehavior(CS); + if (MRB == DoesNotAccessMemory) + return NoModRef; + + ModRefResult Mask = ModRef; + if (MRB == OnlyReadsMemory) + Mask = Ref; + else if (MRB == AliasAnalysis::AccessesArguments) { + bool doesAlias = false; + for (ImmutableCallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end(); + AI != AE; ++AI) + if (!isNoAlias(*AI, ~0U, P, Size)) { + doesAlias = true; + break; + } + + if (!doesAlias) + return NoModRef; + } + + // If P points to a constant memory location, the call definitely could not + // modify the memory location. + if ((Mask & Mod) && pointsToConstantMemory(P)) + Mask = ModRefResult(Mask & ~Mod); + + // If this is BasicAA, don't forward. + if (!AA) return Mask; + + // Otherwise, fall back to the next AA in the chain. But we can merge + // in any mask we've managed to compute. + return ModRefResult(AA->getModRefInfo(CS, P, Size) & Mask); +} + +AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo(ImmutableCallSite CS1, ImmutableCallSite CS2) { + // Don't assert AA because BasicAA calls us in order to make use of the + // logic here. + + // If CS1 or CS2 are readnone, they don't interact. + ModRefBehavior CS1B = getModRefBehavior(CS1); + if (CS1B == DoesNotAccessMemory) return NoModRef; + + ModRefBehavior CS2B = getModRefBehavior(CS2); + if (CS2B == DoesNotAccessMemory) return NoModRef; + + // If they both only read from memory, there is no dependence. + if (CS1B == OnlyReadsMemory && CS2B == OnlyReadsMemory) + return NoModRef; + + AliasAnalysis::ModRefResult Mask = ModRef; + + // If CS1 only reads memory, the only dependence on CS2 can be + // from CS1 reading memory written by CS2. + if (CS1B == OnlyReadsMemory) + Mask = ModRefResult(Mask & Ref); + + // If CS2 only access memory through arguments, accumulate the mod/ref + // information from CS1's references to the memory referenced by + // CS2's arguments. + if (CS2B == AccessesArguments) { + AliasAnalysis::ModRefResult R = NoModRef; + for (ImmutableCallSite::arg_iterator + I = CS2.arg_begin(), E = CS2.arg_end(); I != E; ++I) { + R = ModRefResult((R | getModRefInfo(CS1, *I, UnknownSize)) & Mask); + if (R == Mask) + break; + } + return R; + } + + // If CS1 only accesses memory through arguments, check if CS2 references + // any of the memory referenced by CS1's arguments. If not, return NoModRef. + if (CS1B == AccessesArguments) { + AliasAnalysis::ModRefResult R = NoModRef; + for (ImmutableCallSite::arg_iterator + I = CS1.arg_begin(), E = CS1.arg_end(); I != E; ++I) + if (getModRefInfo(CS2, *I, UnknownSize) != NoModRef) { + R = Mask; + break; + } + if (R == NoModRef) + return R; + } + + // If this is BasicAA, don't forward. + if (!AA) return Mask; + + // Otherwise, fall back to the next AA in the chain. But we can merge + // in any mask we've managed to compute. + return ModRefResult(AA->getModRefInfo(CS1, CS2) & Mask); +} + +AliasAnalysis::ModRefBehavior +AliasAnalysis::getModRefBehavior(ImmutableCallSite CS) { + // Don't assert AA because BasicAA calls us in order to make use of the + // logic here. + + ModRefBehavior Min = UnknownModRefBehavior; + + // Call back into the alias analysis with the other form of getModRefBehavior + // to see if it can give a better response. + if (const Function *F = CS.getCalledFunction()) + Min = getModRefBehavior(F); + + // If this is BasicAA, don't forward. + if (!AA) return Min; + + // Otherwise, fall back to the next AA in the chain. But we can merge + // in any result we've managed to compute. + return std::min(AA->getModRefBehavior(CS), Min); +} + +AliasAnalysis::ModRefBehavior +AliasAnalysis::getModRefBehavior(const Function *F) { assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!"); - return AA->getModRefInfo(CS1, CS2); + return AA->getModRefBehavior(F); } @@ -112,70 +230,12 @@ } AliasAnalysis::ModRefBehavior -AliasAnalysis::getModRefBehavior(ImmutableCallSite CS) { - if (CS.doesNotAccessMemory()) - // Can't do better than this. - return DoesNotAccessMemory; - ModRefBehavior MRB = getModRefBehavior(CS.getCalledFunction()); - if (MRB != DoesNotAccessMemory && CS.onlyReadsMemory()) - return OnlyReadsMemory; - return MRB; -} - -AliasAnalysis::ModRefBehavior -AliasAnalysis::getModRefBehavior(const Function *F) { - if (F) { - if (F->doesNotAccessMemory()) - // Can't do better than this. - return DoesNotAccessMemory; - if (F->onlyReadsMemory()) - return OnlyReadsMemory; - if (unsigned id = F->getIntrinsicID()) - return getIntrinsicModRefBehavior(id); - } - return UnknownModRefBehavior; -} - -AliasAnalysis::ModRefBehavior AliasAnalysis::getIntrinsicModRefBehavior(unsigned iid) { #define GET_INTRINSIC_MODREF_BEHAVIOR #include "llvm/Intrinsics.gen" #undef GET_INTRINSIC_MODREF_BEHAVIOR } -AliasAnalysis::ModRefResult -AliasAnalysis::getModRefInfo(ImmutableCallSite CS, - const Value *P, unsigned Size) { - ModRefBehavior MRB = getModRefBehavior(CS); - if (MRB == DoesNotAccessMemory) - return NoModRef; - - ModRefResult Mask = ModRef; - if (MRB == OnlyReadsMemory) - Mask = Ref; - else if (MRB == AliasAnalysis::AccessesArguments) { - bool doesAlias = false; - for (ImmutableCallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end(); - AI != AE; ++AI) - if (!isNoAlias(*AI, ~0U, P, Size)) { - doesAlias = true; - break; - } - - if (!doesAlias) - return NoModRef; - } - - if (!AA) return Mask; - - // If P points to a constant memory location, the call definitely could not - // modify the memory location. - if ((Mask & Mod) && AA->pointsToConstantMemory(P)) - Mask = ModRefResult(Mask & ~Mod); - - return ModRefResult(Mask & AA->getModRefInfo(CS, P, Size)); -} - // AliasAnalysis destructor: DO NOT move this to the header file for // AliasAnalysis or else clients of the AliasAnalysis class may not depend on // the AliasAnalysis.o file in the current .a file, causing alias analysis Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110421&r1=110420&r2=110421&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Thu Aug 5 20:25:49 2010 @@ -152,6 +152,13 @@ return MayAlias; } + virtual ModRefBehavior getModRefBehavior(ImmutableCallSite CS) { + return UnknownModRefBehavior; + } + virtual ModRefBehavior getModRefBehavior(const Function *F) { + return UnknownModRefBehavior; + } + virtual bool pointsToConstantMemory(const Value *P) { return false; } virtual ModRefResult getModRefInfo(ImmutableCallSite CS, const Value *P, unsigned Size) { @@ -217,8 +224,8 @@ static char ID; // Class identification, replacement for typeinfo BasicAliasAnalysis() : NoAA(&ID) {} - AliasResult alias(const Value *V1, unsigned V1Size, - const Value *V2, unsigned V2Size) { + virtual AliasResult alias(const Value *V1, unsigned V1Size, + const Value *V2, unsigned V2Size) { assert(Visited.empty() && "Visited must be cleared after use!"); assert(notDifferentParent(V1, V2) && "BasicAliasAnalysis doesn't support interprocedural queries."); @@ -227,14 +234,26 @@ return Alias; } - ModRefResult getModRefInfo(ImmutableCallSite CS, - const Value *P, unsigned Size); - ModRefResult getModRefInfo(ImmutableCallSite CS1, - ImmutableCallSite CS2); + virtual ModRefResult getModRefInfo(ImmutableCallSite CS, + const Value *P, unsigned Size); + + virtual ModRefResult getModRefInfo(ImmutableCallSite CS1, + ImmutableCallSite CS2) { + // The AliasAnalysis base class has some smarts, lets use them. + return AliasAnalysis::getModRefInfo(CS1, CS2); + } /// pointsToConstantMemory - Chase pointers until we find a (constant /// global) or not. - bool pointsToConstantMemory(const Value *P); + virtual bool pointsToConstantMemory(const Value *P); + + /// getModRefBehavior - Return the behavior when calling the given + /// call site. + virtual ModRefBehavior getModRefBehavior(ImmutableCallSite CS); + + /// getModRefBehavior - Return the behavior when calling the given function. + /// For use when the call site is not known. + virtual ModRefBehavior getModRefBehavior(const Function *F); /// getAdjustedAnalysisPointer - This method is used when a pass implements /// an analysis interface through multiple inheritance. If needed, it @@ -290,9 +309,42 @@ // global to be marked constant in some modules and non-constant in others. // GV may even be a declaration, not a definition. return GV->isConstant(); - return false; + + return NoAA::pointsToConstantMemory(P); } +/// getModRefBehavior - Return the behavior when calling the given call site. +AliasAnalysis::ModRefBehavior +BasicAliasAnalysis::getModRefBehavior(ImmutableCallSite CS) { + if (CS.doesNotAccessMemory()) + // Can't do better than this. + return DoesNotAccessMemory; + + ModRefBehavior Min = UnknownModRefBehavior; + + // If the callsite knows it only reads memory, don't return worse + // than that. + if (CS.onlyReadsMemory()) + Min = OnlyReadsMemory; + + // The AliasAnalysis base class has some smarts, lets use them. + return std::min(AliasAnalysis::getModRefBehavior(CS), Min); +} + +/// getModRefBehavior - Return the behavior when calling the given function. +/// For use when the call site is not known. +AliasAnalysis::ModRefBehavior +BasicAliasAnalysis::getModRefBehavior(const Function *F) { + if (F->doesNotAccessMemory()) + // Can't do better than this. + return DoesNotAccessMemory; + if (F->onlyReadsMemory()) + return OnlyReadsMemory; + if (unsigned id = F->getIntrinsicID()) + return getIntrinsicModRefBehavior(id); + + return NoAA::getModRefBehavior(F); +} /// getModRefInfo - Check to see if the specified callsite can clobber the /// specified memory object. Since we only look at local properties of this @@ -346,128 +398,75 @@ // Finally, handle specific knowledge of intrinsics. const IntrinsicInst *II = dyn_cast(CS.getInstruction()); - if (II == 0) - return AliasAnalysis::getModRefInfo(CS, P, Size); - - switch (II->getIntrinsicID()) { - default: break; - case Intrinsic::memcpy: - case Intrinsic::memmove: { - unsigned Len = UnknownSize; - if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) - Len = LenCI->getZExtValue(); - Value *Dest = II->getArgOperand(0); - Value *Src = II->getArgOperand(1); - if (isNoAlias(Dest, Len, P, Size)) { - if (isNoAlias(Src, Len, P, Size)) - return NoModRef; - return Ref; - } - break; - } - case Intrinsic::memset: - // Since memset is 'accesses arguments' only, the AliasAnalysis base class - // will handle it for the variable length case. - if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) { - unsigned Len = LenCI->getZExtValue(); + if (II != 0) + switch (II->getIntrinsicID()) { + default: break; + case Intrinsic::memcpy: + case Intrinsic::memmove: { + unsigned Len = UnknownSize; + if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) + Len = LenCI->getZExtValue(); Value *Dest = II->getArgOperand(0); - if (isNoAlias(Dest, Len, P, Size)) + Value *Src = II->getArgOperand(1); + if (isNoAlias(Dest, Len, P, Size)) { + if (isNoAlias(Src, Len, P, Size)) + return NoModRef; + return Ref; + } + break; + } + case Intrinsic::memset: + // Since memset is 'accesses arguments' only, the AliasAnalysis base class + // will handle it for the variable length case. + if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) { + unsigned Len = LenCI->getZExtValue(); + Value *Dest = II->getArgOperand(0); + if (isNoAlias(Dest, Len, P, Size)) + return NoModRef; + } + break; + case Intrinsic::atomic_cmp_swap: + case Intrinsic::atomic_swap: + case Intrinsic::atomic_load_add: + case Intrinsic::atomic_load_sub: + case Intrinsic::atomic_load_and: + case Intrinsic::atomic_load_nand: + case Intrinsic::atomic_load_or: + case Intrinsic::atomic_load_xor: + case Intrinsic::atomic_load_max: + case Intrinsic::atomic_load_min: + case Intrinsic::atomic_load_umax: + case Intrinsic::atomic_load_umin: + if (TD) { + Value *Op1 = II->getArgOperand(0); + unsigned Op1Size = TD->getTypeStoreSize(Op1->getType()); + if (isNoAlias(Op1, Op1Size, P, Size)) + return NoModRef; + } + break; + case Intrinsic::lifetime_start: + case Intrinsic::lifetime_end: + case Intrinsic::invariant_start: { + unsigned PtrSize = + cast(II->getArgOperand(0))->getZExtValue(); + if (isNoAlias(II->getArgOperand(1), PtrSize, P, Size)) return NoModRef; + break; } - break; - case Intrinsic::atomic_cmp_swap: - case Intrinsic::atomic_swap: - case Intrinsic::atomic_load_add: - case Intrinsic::atomic_load_sub: - case Intrinsic::atomic_load_and: - case Intrinsic::atomic_load_nand: - case Intrinsic::atomic_load_or: - case Intrinsic::atomic_load_xor: - case Intrinsic::atomic_load_max: - case Intrinsic::atomic_load_min: - case Intrinsic::atomic_load_umax: - case Intrinsic::atomic_load_umin: - if (TD) { - Value *Op1 = II->getArgOperand(0); - unsigned Op1Size = TD->getTypeStoreSize(Op1->getType()); - if (isNoAlias(Op1, Op1Size, P, Size)) + case Intrinsic::invariant_end: { + unsigned PtrSize = + cast(II->getArgOperand(1))->getZExtValue(); + if (isNoAlias(II->getArgOperand(2), PtrSize, P, Size)) return NoModRef; + break; + } } - break; - case Intrinsic::lifetime_start: - case Intrinsic::lifetime_end: - case Intrinsic::invariant_start: { - unsigned PtrSize = cast(II->getArgOperand(0))->getZExtValue(); - if (isNoAlias(II->getArgOperand(1), PtrSize, P, Size)) - return NoModRef; - break; - } - case Intrinsic::invariant_end: { - unsigned PtrSize = cast(II->getArgOperand(1))->getZExtValue(); - if (isNoAlias(II->getArgOperand(2), PtrSize, P, Size)) - return NoModRef; - break; - } - } // The AliasAnalysis base class has some smarts, lets use them. return AliasAnalysis::getModRefInfo(CS, P, Size); } -AliasAnalysis::ModRefResult -BasicAliasAnalysis::getModRefInfo(ImmutableCallSite CS1, - ImmutableCallSite CS2) { - // If CS1 or CS2 are readnone, they don't interact. - ModRefBehavior CS1B = AliasAnalysis::getModRefBehavior(CS1); - if (CS1B == DoesNotAccessMemory) return NoModRef; - - ModRefBehavior CS2B = AliasAnalysis::getModRefBehavior(CS2); - if (CS2B == DoesNotAccessMemory) return NoModRef; - - // If they both only read from memory, there is no dependence. - if (CS1B == OnlyReadsMemory && CS2B == OnlyReadsMemory) - return NoModRef; - - AliasAnalysis::ModRefResult Mask = ModRef; - - // If CS1 only reads memory, the only dependence on CS2 can be - // from CS1 reading memory written by CS2. - if (CS1B == OnlyReadsMemory) - Mask = ModRefResult(Mask & Ref); - - // If CS2 only access memory through arguments, accumulate the mod/ref - // information from CS1's references to the memory referenced by - // CS2's arguments. - if (CS2B == AccessesArguments) { - AliasAnalysis::ModRefResult R = NoModRef; - for (ImmutableCallSite::arg_iterator - I = CS2.arg_begin(), E = CS2.arg_end(); I != E; ++I) { - R = ModRefResult((R | getModRefInfo(CS1, *I, UnknownSize)) & Mask); - if (R == Mask) - break; - } - return R; - } - - // If CS1 only accesses memory through arguments, check if CS2 references - // any of the memory referenced by CS1's arguments. If not, return NoModRef. - if (CS1B == AccessesArguments) { - AliasAnalysis::ModRefResult R = NoModRef; - for (ImmutableCallSite::arg_iterator - I = CS1.arg_begin(), E = CS1.arg_end(); I != E; ++I) - if (getModRefInfo(CS2, *I, UnknownSize) != NoModRef) { - R = Mask; - break; - } - if (R == NoModRef) - return R; - } - - // Otherwise, fall back to NoAA (mod+ref). - return ModRefResult(NoAA::getModRefInfo(CS1, CS2) & Mask); -} - /// GetIndexDifference - Dest and Src are the variable indices from two /// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base /// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic @@ -843,7 +842,7 @@ if (const SelectInst *S1 = dyn_cast(V1)) return aliasSelect(S1, V1Size, V2, V2Size); - return MayAlias; + return NoAA::alias(V1, V1Size, V2, V2Size); } // Make sure that anything that uses AliasAnalysis pulls in this file. From echristo at apple.com Thu Aug 5 20:30:54 2010 From: echristo at apple.com (Eric Christopher) Date: Fri, 06 Aug 2010 01:30:54 -0000 Subject: [llvm-commits] [llvm] r110422 - /llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp Message-ID: <20100806013054.EC5852A6C12C@llvm.org> Author: echristo Date: Thu Aug 5 20:30:54 2010 New Revision: 110422 URL: http://llvm.org/viewvc/llvm-project?rev=110422&view=rev Log: Moar words! Modified: llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp Modified: llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp?rev=110422&r1=110421&r2=110422&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp Thu Aug 5 20:30:54 2010 @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file contains code to generate C++ code a matcher. +// This file contains code to generate C++ code for a matcher. // //===----------------------------------------------------------------------===// From isanbard at gmail.com Thu Aug 5 20:32:49 2010 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 06 Aug 2010 01:32:49 -0000 Subject: [llvm-commits] [llvm] r110423 - in /llvm/trunk: include/llvm/CodeGen/Passes.h include/llvm/Target/TargetInstrInfo.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/OptimizeCmps.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h Message-ID: <20100806013249.25D8E2A6C12C@llvm.org> Author: void Date: Thu Aug 5 20:32:48 2010 New Revision: 110423 URL: http://llvm.org/viewvc/llvm-project?rev=110423&view=rev Log: Add the Optimize Compares pass (disabled by default). This pass tries to remove comparison instructions when possible. For instance, if you have this code: sub r1, 1 cmp r1, 0 bz L1 and "sub" either sets the same flag as the "cmp" instruction or could be converted to set the same flag, then we can eliminate the "cmp" instruction all together. This is a important for ARM where the ALU instructions could set the CPSR flag, but need a special suffix ('s') to do so. Added: llvm/trunk/lib/CodeGen/OptimizeCmps.cpp Modified: llvm/trunk/include/llvm/CodeGen/Passes.h llvm/trunk/include/llvm/Target/TargetInstrInfo.h llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Modified: llvm/trunk/include/llvm/CodeGen/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=110423&r1=110422&r2=110423&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) +++ llvm/trunk/include/llvm/CodeGen/Passes.h Thu Aug 5 20:32:48 2010 @@ -180,6 +180,10 @@ /// to take advantage of opportunities created during DAG legalization. FunctionPass *createOptimizePHIsPass(); + /// createOptimizeCmpsPass - This pass performs redundant comparison removal + /// optimization. + FunctionPass *createOptimizeCmpsPass(); + /// createStackSlotColoringPass - This pass performs stack slot coloring. FunctionPass *createStackSlotColoringPass(bool); Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=110423&r1=110422&r2=110423&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Thu Aug 5 20:32:48 2010 @@ -576,6 +576,21 @@ /// register allocation. virtual ScheduleHazardRecognizer* CreateTargetPostRAHazardRecognizer(const InstrItineraryData&) const = 0; + + /// isCompareInstr - If the machine instruction is a comparison instruction, + /// then return true. Also return the source register in SrcReg and the value + /// it compares against in CmpValue. + virtual bool isCompareInstr(const MachineInstr *MI, + unsigned &SrcReg, int &CmpValue) const { + return false; + } + + /// convertToSetZeroFlag - Convert the instruction to set the zero flag so + /// that we can remove a "comparison with zero". + virtual bool convertToSetZeroFlag(MachineInstr *Instr, + MachineInstr *CmpInstr) const { + return false; + } }; /// TargetInstrInfoImpl - This is the default implementation of Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=110423&r1=110422&r2=110423&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Thu Aug 5 20:32:48 2010 @@ -354,6 +354,7 @@ printAndVerify(PM, "After codegen DCE pass"); PM.add(createOptimizeExtsPass()); + PM.add(createOptimizeCmpsPass()); if (!DisableMachineLICM) PM.add(createMachineLICMPass()); PM.add(createMachineCSEPass()); Added: llvm/trunk/lib/CodeGen/OptimizeCmps.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizeCmps.cpp?rev=110423&view=auto ============================================================================== --- llvm/trunk/lib/CodeGen/OptimizeCmps.cpp (added) +++ llvm/trunk/lib/CodeGen/OptimizeCmps.cpp Thu Aug 5 20:32:48 2010 @@ -0,0 +1,112 @@ +//===-- OptimizeCmps.cpp - Optimize comparison instrs ---------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This pass performs optimization of comparison instructions. For instance, in +// this code: +// +// sub r1, 1 +// cmp r1, 0 +// bz L1 +// +// If the "sub" instruction all ready sets (or could be modified to set) the +// same flag that the "cmp" instruction sets and that "bz" uses, then we can +// eliminate the "cmp" instruction. +// +//===----------------------------------------------------------------------===// + +#define DEBUG_TYPE "opt-compares" +#include "llvm/CodeGen/Passes.h" +#include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/Target/TargetInstrInfo.h" +#include "llvm/Target/TargetRegisterInfo.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/ADT/Statistic.h" +using namespace llvm; + +STATISTIC(NumEliminated, "Number of compares eliminated"); + +static cl::opt +EnableOptCmps("enable-optimize-cmps", cl::init(false), cl::Hidden); + +namespace { + class OptimizeCmps : public MachineFunctionPass { + const TargetMachine *TM; + const TargetInstrInfo *TII; + MachineRegisterInfo *MRI; + + bool OptimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB); + + public: + static char ID; // Pass identification + OptimizeCmps() : MachineFunctionPass(&ID) {} + + virtual bool runOnMachineFunction(MachineFunction &MF); + + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesCFG(); + MachineFunctionPass::getAnalysisUsage(AU); + } + }; +} + +char OptimizeCmps::ID = 0; +INITIALIZE_PASS(OptimizeCmps, "opt-cmps", + "Optimize comparison instrs", false, false); + +FunctionPass *llvm::createOptimizeCmpsPass() { return new OptimizeCmps(); } + +/// OptimizeCmpInstr - If the instruction is a compare and the previous +/// instruction it's comparing against all ready sets (or could be modified to +/// set) the same flag as the compare, then we can remove the comparison and use +/// the flag from the previous instruction. +bool OptimizeCmps::OptimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB) { + // If this instruction is a comparison against zero and isn't comparing a + // physical register, we can try to optimize it. + unsigned SrcReg; + int CmpValue; + if (!TII->isCompareInstr(MI, SrcReg, CmpValue) || + TargetRegisterInfo::isPhysicalRegister(SrcReg) || + CmpValue != 0) + return false; + + MachineRegisterInfo::def_iterator DI = MRI->def_begin(SrcReg); + if (llvm::next(DI) != MRI->def_end()) + // Only support one definition. + return false; + + // Attempt to convert the defining instruction to set the "zero" flag. + if (TII->convertToSetZeroFlag(&*DI, MI)) { + ++NumEliminated; + return true; + } + + return false; +} + +bool OptimizeCmps::runOnMachineFunction(MachineFunction &MF) { + TM = &MF.getTarget(); + TII = TM->getInstrInfo(); + MRI = &MF.getRegInfo(); + + if (!EnableOptCmps) return false; + + bool Changed = false; + for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) { + MachineBasicBlock *MBB = &*I; + for (MachineBasicBlock::iterator + MII = MBB->begin(), ME = MBB->end(); MII != ME; ) { + MachineInstr *MI = &*MII++; + Changed |= OptimizeCmpInstr(MI, MBB); + } + } + + return Changed; +} Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=110423&r1=110422&r2=110423&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Aug 5 20:32:48 2010 @@ -1353,3 +1353,59 @@ Offset = (isSub) ? -Offset : Offset; return Offset == 0; } + +bool ARMBaseInstrInfo:: +isCompareInstr(const MachineInstr *MI, unsigned &SrcReg, int &CmpValue) const { + switch (MI->getOpcode()) { + default: break; + case ARM::t2CMPri: + case ARM::t2CMPzri: + SrcReg = MI->getOperand(0).getReg(); + CmpValue = MI->getOperand(1).getImm(); + return true; + } + + return false; +} + +/// convertToSetZeroFlag - Convert the instruction to set the "zero" flag so +/// that we can remove a "comparison with zero". +bool ARMBaseInstrInfo:: +convertToSetZeroFlag(MachineInstr *MI, MachineInstr *CmpInstr) const { + // Conservatively refuse to convert an instruction which isn't in the same BB + // as the comparison. + if (MI->getParent() != CmpInstr->getParent()) + return false; + + // Check that CPSR isn't set between the comparison instruction and the one we + // want to change. + MachineBasicBlock::const_iterator I = CmpInstr, E = MI; + --I; + for (; I != E; --I) { + const MachineInstr &Instr = *I; + + for (unsigned IO = 0, EO = Instr.getNumOperands(); IO != EO; ++IO) { + const MachineOperand &MO = Instr.getOperand(IO); + if (!MO.isDef() || !MO.isReg()) continue; + + // This instruction modifies CPSR before the one we want to change. We + // can't do this transformation. + if (MO.getReg() == ARM::CPSR) + return false; + } + } + + // Set the "zero" bit in CPSR. + switch (MI->getOpcode()) { + default: break; + case ARM::t2SUBri: { + MI->RemoveOperand(5); + MachineInstrBuilder MB(MI); + MB.addReg(ARM::CPSR, RegState::Define | RegState::Implicit); + CmpInstr->eraseFromParent(); + return true; + } + } + + return false; +} Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=110423&r1=110422&r2=110423&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Thu Aug 5 20:32:48 2010 @@ -336,6 +336,17 @@ unsigned NumInstrs) const { return NumInstrs && NumInstrs == 1; } + + /// isCompareInstr - If the machine instruction is a comparison instruction, + /// then return true. Also return the source register in SrcReg and the value + /// it compares against in CmpValue. + virtual bool isCompareInstr(const MachineInstr *MI, unsigned &SrcReg, + int &CmpValue) const; + + /// convertToSetZeroFlag - Convert the instruction to set the zero flag so + /// that we can remove a "comparison with zero". + virtual bool convertToSetZeroFlag(MachineInstr *Instr, + MachineInstr *CmpInstr) const; }; static inline From isanbard at gmail.com Thu Aug 5 20:36:09 2010 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 06 Aug 2010 01:36:09 -0000 Subject: [llvm-commits] [llvm] r110424 - in /llvm/trunk: include/llvm/Target/Target.td include/llvm/Target/TargetInstrDesc.h utils/TableGen/CodeGenInstruction.cpp utils/TableGen/CodeGenInstruction.h utils/TableGen/InstrInfoEmitter.cpp Message-ID: <20100806013609.C92122A6C12C@llvm.org> Author: void Date: Thu Aug 5 20:36:09 2010 New Revision: 110424 URL: http://llvm.org/viewvc/llvm-project?rev=110424&view=rev Log: Revert r109901. The implementation of (r110423) doesn't need the Compare flag after all. --- Reverse-merging r109901 into '.': U include/llvm/Target/TargetInstrDesc.h U include/llvm/Target/Target.td U utils/TableGen/InstrInfoEmitter.cpp U utils/TableGen/CodeGenInstruction.cpp U utils/TableGen/CodeGenInstruction.h Modified: llvm/trunk/include/llvm/Target/Target.td llvm/trunk/include/llvm/Target/TargetInstrDesc.h llvm/trunk/utils/TableGen/CodeGenInstruction.cpp llvm/trunk/utils/TableGen/CodeGenInstruction.h llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Modified: llvm/trunk/include/llvm/Target/Target.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/Target.td?rev=110424&r1=110423&r2=110424&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/Target.td (original) +++ llvm/trunk/include/llvm/Target/Target.td Thu Aug 5 20:36:09 2010 @@ -198,7 +198,6 @@ bit isReturn = 0; // Is this instruction a return instruction? bit isBranch = 0; // Is this instruction a branch instruction? bit isIndirectBranch = 0; // Is this instruction an indirect branch? - bit isCompare = 0; // Is this instruction a comparison instruction? bit isBarrier = 0; // Can control flow fall through this instruction? bit isCall = 0; // Is this instruction a call instruction? bit canFoldAsLoad = 0; // Can this be folded as a simple memory operand? Modified: llvm/trunk/include/llvm/Target/TargetInstrDesc.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrDesc.h?rev=110424&r1=110423&r2=110424&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrDesc.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrDesc.h Thu Aug 5 20:36:09 2010 @@ -105,7 +105,6 @@ IndirectBranch, Predicable, NotDuplicable, - Compare, DelaySlot, FoldableAsLoad, MayLoad, @@ -316,7 +315,7 @@ bool isIndirectBranch() const { return Flags & (1 << TID::IndirectBranch); } - + /// isConditionalBranch - Return true if this is a branch which may fall /// through to the next instruction or may transfer control flow to some other /// block. The TargetInstrInfo::AnalyzeBranch method can be used to get more @@ -341,11 +340,6 @@ return Flags & (1 << TID::Predicable); } - /// isCompare - Return true if this instruction is a comparison. - bool isCompare() const { - return Flags & (1 << TID::Compare); - } - /// isNotDuplicable - Return true if this instruction cannot be safely /// duplicated. For example, if the instruction has a unique labels attached /// to it, duplicating it would cause multiple definition errors. Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.cpp?rev=110424&r1=110423&r2=110424&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenInstruction.cpp (original) +++ llvm/trunk/utils/TableGen/CodeGenInstruction.cpp Thu Aug 5 20:36:09 2010 @@ -102,7 +102,6 @@ isReturn = R->getValueAsBit("isReturn"); isBranch = R->getValueAsBit("isBranch"); isIndirectBranch = R->getValueAsBit("isIndirectBranch"); - isCompare = R->getValueAsBit("isCompare"); isBarrier = R->getValueAsBit("isBarrier"); isCall = R->getValueAsBit("isCall"); canFoldAsLoad = R->getValueAsBit("canFoldAsLoad"); Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.h?rev=110424&r1=110423&r2=110424&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenInstruction.h (original) +++ llvm/trunk/utils/TableGen/CodeGenInstruction.h Thu Aug 5 20:36:09 2010 @@ -123,7 +123,6 @@ bool isReturn; bool isBranch; bool isIndirectBranch; - bool isCompare; bool isBarrier; bool isCall; bool canFoldAsLoad; Modified: llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp?rev=110424&r1=110423&r2=110424&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Thu Aug 5 20:36:09 2010 @@ -270,7 +270,6 @@ if (Inst.isReturn) OS << "|(1< Author: bruno Date: Thu Aug 5 20:52:29 2010 New Revision: 110425 URL: http://llvm.org/viewvc/llvm-project?rev=110425&view=rev Log: Patterns to match AVX 256-bit arithmetic intrinsics Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=110425&r1=110424&r2=110425&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Thu Aug 5 20:52:29 2010 @@ -142,7 +142,7 @@ !if(Is2Addr, !strconcat(asm, "\t{$src2, $dst|$dst, $src2}"), !strconcat(asm, "\t{$src2, $src1, $dst|$dst, $src1, $src2}")), - [(set RC:$dst, (!nameconcat("int_x86_sse", + [(set RC:$dst, (!nameconcat("int_x86_", !strconcat(SSEVer, !strconcat("_", !strconcat(OpcodeStr, FPSizeStr)))) RC:$src1, RC:$src2))], d>; @@ -150,7 +150,7 @@ !if(Is2Addr, !strconcat(asm, "\t{$src2, $dst|$dst, $src2}"), !strconcat(asm, "\t{$src2, $src1, $dst|$dst, $src1, $src2}")), - [(set RC:$dst, (!nameconcat("int_x86_sse", + [(set RC:$dst, (!nameconcat("int_x86_", !strconcat(SSEVer, !strconcat("_", !strconcat(OpcodeStr, FPSizeStr)))) RC:$src1, (mem_frag addr:$src2)))], d>; @@ -1643,6 +1643,9 @@ /// /// These three forms can each be reg+reg or reg+mem. /// + +/// FIXME: once all 256-bit intrinsics are matched, cleanup and refactor those +/// classes below multiclass basic_sse12_fp_binop_s opc, string OpcodeStr, SDNode OpNode, bit Is2Addr = 1> { defm SS : sse12_fp_scalar opc, string OpcodeStr, bit Is2Addr = 1> { defm PS : sse12_fp_packed_int, TB; defm PD : sse12_fp_packed_int, TB, OpSize; } +multiclass basic_sse12_fp_binop_p_y_int opc, string OpcodeStr> { + defm PSY : sse12_fp_packed_int, TB; + + defm PDY : sse12_fp_packed_int, TB, OpSize; +} + // Binary Arithmetic instructions let isAsmParserOnly = 1 in { defm VADD : basic_sse12_fp_binop_s<0x58, "add", fadd, 0>, @@ -1714,11 +1727,13 @@ basic_sse12_fp_binop_s_int<0x5F, "max", 0>, basic_sse12_fp_binop_p<0x5F, "max", X86fmax, 0>, basic_sse12_fp_binop_p_int<0x5F, "max", 0>, - basic_sse12_fp_binop_p_y<0x5F, "max", X86fmax>, VEX_4V; + basic_sse12_fp_binop_p_y<0x5F, "max", X86fmax>, + basic_sse12_fp_binop_p_y_int<0x5F, "max">, VEX_4V; defm VMIN : basic_sse12_fp_binop_s<0x5D, "min", X86fmin, 0>, basic_sse12_fp_binop_s_int<0x5D, "min", 0>, basic_sse12_fp_binop_p<0x5D, "min", X86fmin, 0>, basic_sse12_fp_binop_p_int<0x5D, "min", 0>, + basic_sse12_fp_binop_p_y_int<0x5D, "min">, basic_sse12_fp_binop_p_y<0x5D, "min", X86fmin>, VEX_4V; } } @@ -1830,6 +1845,16 @@ [(set VR128:$dst, (V4F32Int (memopv4f32 addr:$src)))]>; } +/// sse1_fp_unop_p_y_int - AVX 256-bit intrinsics unops in packed forms. +multiclass sse1_fp_unop_p_y_int opc, string OpcodeStr, + Intrinsic V4F32Int> { + def PSYr_Int : PSI; + def PSYm_Int : PSI; +} /// sse2_fp_unop_s - SSE2 unops in scalar form. multiclass sse2_fp_unop_s opc, string OpcodeStr, @@ -1900,6 +1925,17 @@ [(set VR128:$dst, (V2F64Int (memopv2f64 addr:$src)))]>; } +/// sse2_fp_unop_p_y_int - AVX 256-bit intrinsic unops in vector forms. +multiclass sse2_fp_unop_p_y_int opc, string OpcodeStr, + Intrinsic V2F64Int> { + def PDYr_Int : PDI; + def PDYm_Int : PDI; +} + let isAsmParserOnly = 1, Predicates = [HasAVX] in { // Square root. defm VSQRT : sse1_fp_unop_s_avx<0x51, "vsqrt", fsqrt, int_x86_sse_sqrt_ss>, @@ -1910,8 +1946,10 @@ sse2_fp_unop_p<0x51, "vsqrt", fsqrt>, sse1_fp_unop_p_y<0x51, "vsqrt", fsqrt>, sse2_fp_unop_p_y<0x51, "vsqrt", fsqrt>, - sse1_fp_unop_p_int<0x51, "vsqrt", int_x86_sse_sqrt_ps>, + sse1_fp_unop_p_int<0x51, "vsqrt", int_x86_sse_sqrt_ps>, sse2_fp_unop_p_int<0x51, "vsqrt", int_x86_sse2_sqrt_pd>, + sse1_fp_unop_p_y_int<0x51, "vsqrt", int_x86_avx_sqrt_ps_256>, + sse2_fp_unop_p_y_int<0x51, "vsqrt", int_x86_avx_sqrt_pd_256>, VEX; // Reciprocal approximations. Note that these typically require refinement @@ -1920,12 +1958,14 @@ int_x86_sse_rsqrt_ss>, VEX_4V; defm VRSQRT : sse1_fp_unop_p<0x52, "vrsqrt", X86frsqrt>, sse1_fp_unop_p_y<0x52, "vrsqrt", X86frsqrt>, + sse1_fp_unop_p_y_int<0x52, "vrsqrt", int_x86_avx_rsqrt_ps_256>, sse1_fp_unop_p_int<0x52, "vrsqrt", int_x86_sse_rsqrt_ps>, VEX; defm VRCP : sse1_fp_unop_s_avx<0x53, "vrcp", X86frcp, int_x86_sse_rcp_ss>, VEX_4V; defm VRCP : sse1_fp_unop_p<0x53, "vrcp", X86frcp>, sse1_fp_unop_p_y<0x53, "vrcp", X86frcp>, + sse1_fp_unop_p_y_int<0x53, "vrcp", int_x86_avx_rcp_ps_256>, sse1_fp_unop_p_int<0x53, "vrcp", int_x86_sse_rcp_ps>, VEX; } @@ -3327,12 +3367,10 @@ f128mem, 0>, XD, VEX_4V; defm VADDSUBPD : sse3_addsub, OpSize, VEX_4V; - let Pattern = [] in { - defm VADDSUBPSY : sse3_addsub, XD, VEX_4V; - defm VADDSUBPDY : sse3_addsub, OpSize, VEX_4V; - } } let Constraints = "$src1 = $dst", Predicates = [HasSSE3], ExeDomain = SSEPackedDouble in { @@ -4350,44 +4388,44 @@ // SSE4.1 - Round Instructions //===----------------------------------------------------------------------===// -multiclass sse41_fp_unop_rm opcps, bits<8> opcpd, - string OpcodeStr, - Intrinsic V4F32Int, - Intrinsic V2F64Int> { +multiclass sse41_fp_unop_rm opcps, bits<8> opcpd, string OpcodeStr, + X86MemOperand x86memop, RegisterClass RC, + PatFrag mem_frag32, PatFrag mem_frag64, + Intrinsic V4F32Int, Intrinsic V2F64Int> { // Intrinsic operation, reg. // Vector intrinsic operation, reg def PSr_Int : SS4AIi8, + [(set RC:$dst, (V4F32Int RC:$src1, imm:$src2))]>, OpSize; // Vector intrinsic operation, mem def PSm_Int : Ii8, + [(set RC:$dst, + (V4F32Int (mem_frag32 addr:$src1),imm:$src2))]>, TA, OpSize, Requires<[HasSSE41]>; // Vector intrinsic operation, reg def PDr_Int : SS4AIi8, + [(set RC:$dst, (V2F64Int RC:$src1, imm:$src2))]>, OpSize; // Vector intrinsic operation, mem def PDm_Int : SS4AIi8, + [(set RC:$dst, + (V2F64Int (mem_frag64 addr:$src1),imm:$src2))]>, OpSize; } @@ -4508,12 +4546,18 @@ // FP round - roundss, roundps, roundsd, roundpd let isAsmParserOnly = 1, Predicates = [HasAVX] in { // Intrinsic form - defm VROUND : sse41_fp_unop_rm<0x08, 0x09, "vround", - int_x86_sse41_round_ps, int_x86_sse41_round_pd>, - VEX; + defm VROUND : sse41_fp_unop_rm<0x08, 0x09, "vround", f128mem, VR128, + memopv4f32, memopv2f64, + int_x86_sse41_round_ps, + int_x86_sse41_round_pd>, VEX; + defm VROUNDY : sse41_fp_unop_rm<0x08, 0x09, "vround", f256mem, VR256, + memopv8f32, memopv4f64, + int_x86_avx_round_ps_256, + int_x86_avx_round_pd_256>, VEX; defm VROUND : sse41_fp_binop_rm<0x0A, 0x0B, "vround", - int_x86_sse41_round_ss, int_x86_sse41_round_sd, - 0>, VEX_4V; + int_x86_sse41_round_ss, + int_x86_sse41_round_sd, 0>, VEX_4V; + // Instructions for the assembler defm VROUND : sse41_fp_unop_rm_avx_p<0x08, 0x09, VR128, f128mem, "vround">, VEX; @@ -4522,7 +4566,8 @@ defm VROUND : sse41_fp_binop_rm_avx_s<0x0A, 0x0B, "vround">, VEX_4V; } -defm ROUND : sse41_fp_unop_rm<0x08, 0x09, "round", +defm ROUND : sse41_fp_unop_rm<0x08, 0x09, "round", f128mem, VR128, + memopv4f32, memopv2f64, int_x86_sse41_round_ps, int_x86_sse41_round_pd>; let Constraints = "$src1 = $dst" in defm ROUND : sse41_fp_binop_rm<0x0A, 0x0B, "round", From gohman at apple.com Thu Aug 5 21:04:07 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 06 Aug 2010 02:04:07 -0000 Subject: [llvm-commits] [llvm] r110426 - /llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Message-ID: <20100806020407.3E4EC2A6C12C@llvm.org> Author: djg Date: Thu Aug 5 21:04:07 2010 New Revision: 110426 URL: http://llvm.org/viewvc/llvm-project?rev=110426&view=rev Log: Add a comment. Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=110426&r1=110425&r2=110426&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Thu Aug 5 21:04:07 2010 @@ -169,7 +169,8 @@ virtual ModRefBehavior getModRefBehavior(const Function *F); /// getIntrinsicModRefBehavior - Return the modref behavior of the intrinsic - /// with the given id. + /// with the given id. Most clients won't need this, because the regular + /// getModRefBehavior incorporates this information. static ModRefBehavior getIntrinsicModRefBehavior(unsigned iid); /// doesNotAccessMemory - If the specified call is known to never read or From bruno.cardoso at gmail.com Thu Aug 5 21:10:30 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Fri, 06 Aug 2010 02:10:30 -0000 Subject: [llvm-commits] [llvm] r110427 - /llvm/trunk/lib/Target/X86/X86InstrSSE.td Message-ID: <20100806021030.51E3D2A6C12C@llvm.org> Author: bruno Date: Thu Aug 5 21:10:30 2010 New Revision: 110427 URL: http://llvm.org/viewvc/llvm-project?rev=110427&view=rev Log: Patterns to match AVX 256-bit horizontal arithmetic intrinsics Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=110427&r1=110426&r2=110427&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Thu Aug 5 21:10:30 2010 @@ -3415,24 +3415,22 @@ } let isAsmParserOnly = 1, Predicates = [HasAVX] in { - defm VHADDPS : S3D_Int<0x7C, "vhaddps", v4f32, VR128, f128mem, - int_x86_sse3_hadd_ps, 0>, VEX_4V; - defm VHADDPD : S3_Int <0x7C, "vhaddpd", v2f64, VR128, f128mem, - int_x86_sse3_hadd_pd, 0>, VEX_4V; - defm VHSUBPS : S3D_Int<0x7D, "vhsubps", v4f32, VR128, f128mem, - int_x86_sse3_hsub_ps, 0>, VEX_4V; - defm VHSUBPD : S3_Int <0x7D, "vhsubpd", v2f64, VR128, f128mem, - int_x86_sse3_hsub_pd, 0>, VEX_4V; - let Pattern = [] in { - defm VHADDPSY : S3D_Int<0x7C, "vhaddps", v8f32, VR256, f256mem, + defm VHADDPS : S3D_Int<0x7C, "vhaddps", v4f32, VR128, f128mem, int_x86_sse3_hadd_ps, 0>, VEX_4V; - defm VHADDPDY : S3_Int <0x7C, "vhaddpd", v4f64, VR256, f256mem, + defm VHADDPD : S3_Int <0x7C, "vhaddpd", v2f64, VR128, f128mem, int_x86_sse3_hadd_pd, 0>, VEX_4V; - defm VHSUBPSY : S3D_Int<0x7D, "vhsubps", v8f32, VR256, f256mem, + defm VHSUBPS : S3D_Int<0x7D, "vhsubps", v4f32, VR128, f128mem, int_x86_sse3_hsub_ps, 0>, VEX_4V; - defm VHSUBPDY : S3_Int <0x7D, "vhsubpd", v4f64, VR256, f256mem, + defm VHSUBPD : S3_Int <0x7D, "vhsubpd", v2f64, VR128, f128mem, int_x86_sse3_hsub_pd, 0>, VEX_4V; - } + defm VHADDPSY : S3D_Int<0x7C, "vhaddps", v8f32, VR256, f256mem, + int_x86_avx_hadd_ps_256, 0>, VEX_4V; + defm VHADDPDY : S3_Int <0x7C, "vhaddpd", v4f64, VR256, f256mem, + int_x86_avx_hadd_pd_256, 0>, VEX_4V; + defm VHSUBPSY : S3D_Int<0x7D, "vhsubps", v8f32, VR256, f256mem, + int_x86_avx_hsub_ps_256, 0>, VEX_4V; + defm VHSUBPDY : S3_Int <0x7D, "vhsubpd", v4f64, VR256, f256mem, + int_x86_avx_hsub_pd_256, 0>, VEX_4V; } let Constraints = "$src1 = $dst" in { From peter at pcc.me.uk Thu Aug 5 21:13:25 2010 From: peter at pcc.me.uk (Peter Collingbourne) Date: Fri, 06 Aug 2010 02:13:25 -0000 Subject: [llvm-commits] [llvm] r110428 - /llvm/trunk/docs/Passes.html Message-ID: <20100806021326.325932A6C12C@llvm.org> Author: pcc Date: Thu Aug 5 21:13:25 2010 New Revision: 110428 URL: http://llvm.org/viewvc/llvm-project?rev=110428&view=rev Log: Fix missing tag error introduced by addition of LowerAtomic pass. While at it, fix all other HTML validation errors in docs/Passes.html. Modified: llvm/trunk/docs/Passes.html Modified: llvm/trunk/docs/Passes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Passes.html?rev=110428&r1=110427&r2=110428&view=diff ============================================================================== --- llvm/trunk/docs/Passes.html (original) +++ llvm/trunk/docs/Passes.html Thu Aug 5 21:13:25 2010 @@ -680,15 +680,13 @@ -print-dbginfo: Print debug info in human readable form
    -

    Pass that prints instructions, and associated debug info: +

    Pass that prints instructions, and associated debug info:

    • source/line/col information
    • original variable name
    • original type name
    - -

    @@ -1550,7 +1548,7 @@
    -

    This pass implements code stripping. Specifically, it can delete: +

    This pass implements code stripping. Specifically, it can delete:

    • names for virtual registers
    • symbols for internal globals and functions
    • debug information
    +

    Note that this transformation makes code much less readable, so it should only be used in situations where the 'strip' utility would be used, such as reducing code size or making it harder to reverse engineer code. @@ -1977,12 +1976,13 @@ -strip-nondebug: Strip all symbols, except dbg symbols, from a module

    -

    This pass implements code stripping. Specifically, it can delete: +

    This pass implements code stripping. Specifically, it can delete:

    • names for virtual registers
    • symbols for internal globals and functions
    • debug information
    +

    Note that this transformation makes code much less readable, so it should only be used in situations where the 'strip' utility would be used, such as reducing code size or making it harder to reverse engineer code. From espindola at google.com Thu Aug 5 21:43:49 2010 From: espindola at google.com (Rafael Espindola) Date: Thu, 5 Aug 2010 22:43:49 -0400 Subject: [llvm-commits] [patch][arm] Fix eabi calling convention when a 64 bit value shadows r3 In-Reply-To: References: Message-ID: I noticed I could use inheritance to make the patch a bit smaller. Cheers, -- Rafael ?vila de Esp?ndola -------------- next part -------------- A non-text attachment was scrubbed... Name: shadow.patch Type: text/x-patch Size: 3454 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100805/4622900f/attachment.bin From kremenek at apple.com Thu Aug 5 23:05:21 2010 From: kremenek at apple.com (Ted Kremenek) Date: Fri, 06 Aug 2010 04:05:21 -0000 Subject: [llvm-commits] [llvm] r110429 - /llvm/trunk/lib/CodeGen/CMakeLists.txt Message-ID: <20100806040521.D2F0C2A6C12C@llvm.org> Author: kremenek Date: Thu Aug 5 23:05:21 2010 New Revision: 110429 URL: http://llvm.org/viewvc/llvm-project?rev=110429&view=rev Log: Update CMake build. Modified: llvm/trunk/lib/CodeGen/CMakeLists.txt Modified: llvm/trunk/lib/CodeGen/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CMakeLists.txt?rev=110429&r1=110428&r2=110429&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/CMakeLists.txt (original) +++ llvm/trunk/lib/CodeGen/CMakeLists.txt Thu Aug 5 23:05:21 2010 @@ -42,6 +42,7 @@ MachineVerifier.cpp ObjectCodeEmitter.cpp OcamlGC.cpp + OptimizeCmps.cpp OptimizeExts.cpp OptimizePHIs.cpp PHIElimination.cpp From evan.cheng at apple.com Fri Aug 6 01:02:19 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 05 Aug 2010 23:02:19 -0700 Subject: [llvm-commits] [llvm] r110423 - in /llvm/trunk: include/llvm/CodeGen/Passes.h include/llvm/Target/TargetInstrInfo.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/OptimizeCmps.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h In-Reply-To: <20100806013249.25D8E2A6C12C@llvm.org> References: <20100806013249.25D8E2A6C12C@llvm.org> Message-ID: Hi Bill, I thought you are adding a new target instruction property? Why do you decide to add the target hook instead? Evan On Aug 5, 2010, at 6:32 PM, Bill Wendling wrote: > Author: void > Date: Thu Aug 5 20:32:48 2010 > New Revision: 110423 > > URL: http://llvm.org/viewvc/llvm-project?rev=110423&view=rev > Log: > Add the Optimize Compares pass (disabled by default). > > This pass tries to remove comparison instructions when possible. For instance, > if you have this code: > > sub r1, 1 > cmp r1, 0 > bz L1 > > and "sub" either sets the same flag as the "cmp" instruction or could be > converted to set the same flag, then we can eliminate the "cmp" instruction all > together. This is a important for ARM where the ALU instructions could set the > CPSR flag, but need a special suffix ('s') to do so. > > Added: > llvm/trunk/lib/CodeGen/OptimizeCmps.cpp > Modified: > llvm/trunk/include/llvm/CodeGen/Passes.h > llvm/trunk/include/llvm/Target/TargetInstrInfo.h > llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp > llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp > llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h > > Modified: llvm/trunk/include/llvm/CodeGen/Passes.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=110423&r1=110422&r2=110423&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) > +++ llvm/trunk/include/llvm/CodeGen/Passes.h Thu Aug 5 20:32:48 2010 > @@ -180,6 +180,10 @@ > /// to take advantage of opportunities created during DAG legalization. > FunctionPass *createOptimizePHIsPass(); > > + /// createOptimizeCmpsPass - This pass performs redundant comparison removal > + /// optimization. > + FunctionPass *createOptimizeCmpsPass(); > + > /// createStackSlotColoringPass - This pass performs stack slot coloring. > FunctionPass *createStackSlotColoringPass(bool); > > > Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=110423&r1=110422&r2=110423&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) > +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Thu Aug 5 20:32:48 2010 > @@ -576,6 +576,21 @@ > /// register allocation. > virtual ScheduleHazardRecognizer* > CreateTargetPostRAHazardRecognizer(const InstrItineraryData&) const = 0; > + > + /// isCompareInstr - If the machine instruction is a comparison instruction, > + /// then return true. Also return the source register in SrcReg and the value > + /// it compares against in CmpValue. > + virtual bool isCompareInstr(const MachineInstr *MI, > + unsigned &SrcReg, int &CmpValue) const { > + return false; > + } > + > + /// convertToSetZeroFlag - Convert the instruction to set the zero flag so > + /// that we can remove a "comparison with zero". > + virtual bool convertToSetZeroFlag(MachineInstr *Instr, > + MachineInstr *CmpInstr) const { > + return false; > + } > }; > > /// TargetInstrInfoImpl - This is the default implementation of > > Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=110423&r1=110422&r2=110423&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) > +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Thu Aug 5 20:32:48 2010 > @@ -354,6 +354,7 @@ > printAndVerify(PM, "After codegen DCE pass"); > > PM.add(createOptimizeExtsPass()); > + PM.add(createOptimizeCmpsPass()); > if (!DisableMachineLICM) > PM.add(createMachineLICMPass()); > PM.add(createMachineCSEPass()); > > Added: llvm/trunk/lib/CodeGen/OptimizeCmps.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizeCmps.cpp?rev=110423&view=auto > ============================================================================== > --- llvm/trunk/lib/CodeGen/OptimizeCmps.cpp (added) > +++ llvm/trunk/lib/CodeGen/OptimizeCmps.cpp Thu Aug 5 20:32:48 2010 > @@ -0,0 +1,112 @@ > +//===-- OptimizeCmps.cpp - Optimize comparison instrs ---------------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open Source > +// License. See LICENSE.TXT for details. > +// > +//===----------------------------------------------------------------------===// > +// > +// This pass performs optimization of comparison instructions. For instance, in > +// this code: > +// > +// sub r1, 1 > +// cmp r1, 0 > +// bz L1 > +// > +// If the "sub" instruction all ready sets (or could be modified to set) the > +// same flag that the "cmp" instruction sets and that "bz" uses, then we can > +// eliminate the "cmp" instruction. > +// > +//===----------------------------------------------------------------------===// > + > +#define DEBUG_TYPE "opt-compares" > +#include "llvm/CodeGen/Passes.h" > +#include "llvm/CodeGen/MachineFunctionPass.h" > +#include "llvm/CodeGen/MachineInstrBuilder.h" > +#include "llvm/CodeGen/MachineRegisterInfo.h" > +#include "llvm/Target/TargetInstrInfo.h" > +#include "llvm/Target/TargetRegisterInfo.h" > +#include "llvm/Support/CommandLine.h" > +#include "llvm/ADT/Statistic.h" > +using namespace llvm; > + > +STATISTIC(NumEliminated, "Number of compares eliminated"); > + > +static cl::opt > +EnableOptCmps("enable-optimize-cmps", cl::init(false), cl::Hidden); > + > +namespace { > + class OptimizeCmps : public MachineFunctionPass { > + const TargetMachine *TM; > + const TargetInstrInfo *TII; > + MachineRegisterInfo *MRI; > + > + bool OptimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB); > + > + public: > + static char ID; // Pass identification > + OptimizeCmps() : MachineFunctionPass(&ID) {} > + > + virtual bool runOnMachineFunction(MachineFunction &MF); > + > + virtual void getAnalysisUsage(AnalysisUsage &AU) const { > + AU.setPreservesCFG(); > + MachineFunctionPass::getAnalysisUsage(AU); > + } > + }; > +} > + > +char OptimizeCmps::ID = 0; > +INITIALIZE_PASS(OptimizeCmps, "opt-cmps", > + "Optimize comparison instrs", false, false); > + > +FunctionPass *llvm::createOptimizeCmpsPass() { return new OptimizeCmps(); } > + > +/// OptimizeCmpInstr - If the instruction is a compare and the previous > +/// instruction it's comparing against all ready sets (or could be modified to > +/// set) the same flag as the compare, then we can remove the comparison and use > +/// the flag from the previous instruction. > +bool OptimizeCmps::OptimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB) { > + // If this instruction is a comparison against zero and isn't comparing a > + // physical register, we can try to optimize it. > + unsigned SrcReg; > + int CmpValue; > + if (!TII->isCompareInstr(MI, SrcReg, CmpValue) || > + TargetRegisterInfo::isPhysicalRegister(SrcReg) || > + CmpValue != 0) > + return false; > + > + MachineRegisterInfo::def_iterator DI = MRI->def_begin(SrcReg); > + if (llvm::next(DI) != MRI->def_end()) > + // Only support one definition. > + return false; > + > + // Attempt to convert the defining instruction to set the "zero" flag. > + if (TII->convertToSetZeroFlag(&*DI, MI)) { > + ++NumEliminated; > + return true; > + } > + > + return false; > +} > + > +bool OptimizeCmps::runOnMachineFunction(MachineFunction &MF) { > + TM = &MF.getTarget(); > + TII = TM->getInstrInfo(); > + MRI = &MF.getRegInfo(); > + > + if (!EnableOptCmps) return false; > + > + bool Changed = false; > + for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) { > + MachineBasicBlock *MBB = &*I; > + for (MachineBasicBlock::iterator > + MII = MBB->begin(), ME = MBB->end(); MII != ME; ) { > + MachineInstr *MI = &*MII++; > + Changed |= OptimizeCmpInstr(MI, MBB); > + } > + } > + > + return Changed; > +} > > Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=110423&r1=110422&r2=110423&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) > +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Aug 5 20:32:48 2010 > @@ -1353,3 +1353,59 @@ > Offset = (isSub) ? -Offset : Offset; > return Offset == 0; > } > + > +bool ARMBaseInstrInfo:: > +isCompareInstr(const MachineInstr *MI, unsigned &SrcReg, int &CmpValue) const { > + switch (MI->getOpcode()) { > + default: break; > + case ARM::t2CMPri: > + case ARM::t2CMPzri: > + SrcReg = MI->getOperand(0).getReg(); > + CmpValue = MI->getOperand(1).getImm(); > + return true; > + } > + > + return false; > +} > + > +/// convertToSetZeroFlag - Convert the instruction to set the "zero" flag so > +/// that we can remove a "comparison with zero". > +bool ARMBaseInstrInfo:: > +convertToSetZeroFlag(MachineInstr *MI, MachineInstr *CmpInstr) const { > + // Conservatively refuse to convert an instruction which isn't in the same BB > + // as the comparison. > + if (MI->getParent() != CmpInstr->getParent()) > + return false; > + > + // Check that CPSR isn't set between the comparison instruction and the one we > + // want to change. > + MachineBasicBlock::const_iterator I = CmpInstr, E = MI; > + --I; > + for (; I != E; --I) { > + const MachineInstr &Instr = *I; > + > + for (unsigned IO = 0, EO = Instr.getNumOperands(); IO != EO; ++IO) { > + const MachineOperand &MO = Instr.getOperand(IO); > + if (!MO.isDef() || !MO.isReg()) continue; > + > + // This instruction modifies CPSR before the one we want to change. We > + // can't do this transformation. > + if (MO.getReg() == ARM::CPSR) > + return false; > + } > + } > + > + // Set the "zero" bit in CPSR. > + switch (MI->getOpcode()) { > + default: break; > + case ARM::t2SUBri: { > + MI->RemoveOperand(5); > + MachineInstrBuilder MB(MI); > + MB.addReg(ARM::CPSR, RegState::Define | RegState::Implicit); > + CmpInstr->eraseFromParent(); > + return true; > + } > + } > + > + return false; > +} > > Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=110423&r1=110422&r2=110423&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original) > +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Thu Aug 5 20:32:48 2010 > @@ -336,6 +336,17 @@ > unsigned NumInstrs) const { > return NumInstrs && NumInstrs == 1; > } > + > + /// isCompareInstr - If the machine instruction is a comparison instruction, > + /// then return true. Also return the source register in SrcReg and the value > + /// it compares against in CmpValue. > + virtual bool isCompareInstr(const MachineInstr *MI, unsigned &SrcReg, > + int &CmpValue) const; > + > + /// convertToSetZeroFlag - Convert the instruction to set the zero flag so > + /// that we can remove a "comparison with zero". > + virtual bool convertToSetZeroFlag(MachineInstr *Instr, > + MachineInstr *CmpInstr) const; > }; > > static inline > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Fri Aug 6 01:03:36 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 05 Aug 2010 23:03:36 -0700 Subject: [llvm-commits] [llvm] r110424 - in /llvm/trunk: include/llvm/Target/Target.td include/llvm/Target/TargetInstrDesc.h utils/TableGen/CodeGenInstruction.cpp utils/TableGen/CodeGenInstruction.h utils/TableGen/InstrInfoEmitter.cpp In-Reply-To: <20100806013609.C92122A6C12C@llvm.org> References: <20100806013609.C92122A6C12C@llvm.org> Message-ID: But the target hook is called for every instruction. That seems unnecessarily slow. Evan On Aug 5, 2010, at 6:36 PM, Bill Wendling wrote: > Author: void > Date: Thu Aug 5 20:36:09 2010 > New Revision: 110424 > > URL: http://llvm.org/viewvc/llvm-project?rev=110424&view=rev > Log: > Revert r109901. The implementation of (r110423) doesn't > need the Compare flag after all. > > --- Reverse-merging r109901 into '.': > U include/llvm/Target/TargetInstrDesc.h > U include/llvm/Target/Target.td > U utils/TableGen/InstrInfoEmitter.cpp > U utils/TableGen/CodeGenInstruction.cpp > U utils/TableGen/CodeGenInstruction.h > > > Modified: > llvm/trunk/include/llvm/Target/Target.td > llvm/trunk/include/llvm/Target/TargetInstrDesc.h > llvm/trunk/utils/TableGen/CodeGenInstruction.cpp > llvm/trunk/utils/TableGen/CodeGenInstruction.h > llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp > > Modified: llvm/trunk/include/llvm/Target/Target.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/Target.td?rev=110424&r1=110423&r2=110424&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Target/Target.td (original) > +++ llvm/trunk/include/llvm/Target/Target.td Thu Aug 5 20:36:09 2010 > @@ -198,7 +198,6 @@ > bit isReturn = 0; // Is this instruction a return instruction? > bit isBranch = 0; // Is this instruction a branch instruction? > bit isIndirectBranch = 0; // Is this instruction an indirect branch? > - bit isCompare = 0; // Is this instruction a comparison instruction? > bit isBarrier = 0; // Can control flow fall through this instruction? > bit isCall = 0; // Is this instruction a call instruction? > bit canFoldAsLoad = 0; // Can this be folded as a simple memory operand? > > Modified: llvm/trunk/include/llvm/Target/TargetInstrDesc.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrDesc.h?rev=110424&r1=110423&r2=110424&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Target/TargetInstrDesc.h (original) > +++ llvm/trunk/include/llvm/Target/TargetInstrDesc.h Thu Aug 5 20:36:09 2010 > @@ -105,7 +105,6 @@ > IndirectBranch, > Predicable, > NotDuplicable, > - Compare, > DelaySlot, > FoldableAsLoad, > MayLoad, > @@ -316,7 +315,7 @@ > bool isIndirectBranch() const { > return Flags & (1 << TID::IndirectBranch); > } > - > + > /// isConditionalBranch - Return true if this is a branch which may fall > /// through to the next instruction or may transfer control flow to some other > /// block. The TargetInstrInfo::AnalyzeBranch method can be used to get more > @@ -341,11 +340,6 @@ > return Flags & (1 << TID::Predicable); > } > > - /// isCompare - Return true if this instruction is a comparison. > - bool isCompare() const { > - return Flags & (1 << TID::Compare); > - } > - > /// isNotDuplicable - Return true if this instruction cannot be safely > /// duplicated. For example, if the instruction has a unique labels attached > /// to it, duplicating it would cause multiple definition errors. > > Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.cpp?rev=110424&r1=110423&r2=110424&view=diff > ============================================================================== > --- llvm/trunk/utils/TableGen/CodeGenInstruction.cpp (original) > +++ llvm/trunk/utils/TableGen/CodeGenInstruction.cpp Thu Aug 5 20:36:09 2010 > @@ -102,7 +102,6 @@ > isReturn = R->getValueAsBit("isReturn"); > isBranch = R->getValueAsBit("isBranch"); > isIndirectBranch = R->getValueAsBit("isIndirectBranch"); > - isCompare = R->getValueAsBit("isCompare"); > isBarrier = R->getValueAsBit("isBarrier"); > isCall = R->getValueAsBit("isCall"); > canFoldAsLoad = R->getValueAsBit("canFoldAsLoad"); > > Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.h?rev=110424&r1=110423&r2=110424&view=diff > ============================================================================== > --- llvm/trunk/utils/TableGen/CodeGenInstruction.h (original) > +++ llvm/trunk/utils/TableGen/CodeGenInstruction.h Thu Aug 5 20:36:09 2010 > @@ -123,7 +123,6 @@ > bool isReturn; > bool isBranch; > bool isIndirectBranch; > - bool isCompare; > bool isBarrier; > bool isCall; > bool canFoldAsLoad; > > Modified: llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp?rev=110424&r1=110423&r2=110424&view=diff > ============================================================================== > --- llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp (original) > +++ llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Thu Aug 5 20:36:09 2010 > @@ -270,7 +270,6 @@ > if (Inst.isReturn) OS << "|(1< if (Inst.isBranch) OS << "|(1< if (Inst.isIndirectBranch) OS << "|(1< - if (Inst.isCompare) OS << "|(1< if (Inst.isBarrier) OS << "|(1< if (Inst.hasDelaySlot) OS << "|(1< if (Inst.isCall) OS << "|(1< > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Fri Aug 6 01:44:10 2010 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 5 Aug 2010 23:44:10 -0700 Subject: [llvm-commits] [llvm] r110423 - in /llvm/trunk: include/llvm/CodeGen/Passes.h include/llvm/Target/TargetInstrInfo.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/OptimizeCmps.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h In-Reply-To: References: <20100806013249.25D8E2A6C12C@llvm.org> Message-ID: <622C6683-5F93-46E6-9F55-CB5AAB43B1C5@gmail.com> Hi Evan, When I was implementing it, I realized that I needed to know more about the compare statement then just that it's a compare. (The src reg and compare number for instance.) It just seemed like duplicated effort to have it be both a target instruction property and a target hook call. But it is more expensive, so I can put the instruction property back and do both. -bw On Aug 5, 2010, at 11:02 PM, Evan Cheng wrote: > Hi Bill, > > I thought you are adding a new target instruction property? Why do you decide to add the target hook instead? > > Evan > > On Aug 5, 2010, at 6:32 PM, Bill Wendling wrote: > >> Author: void >> Date: Thu Aug 5 20:32:48 2010 >> New Revision: 110423 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=110423&view=rev >> Log: >> Add the Optimize Compares pass (disabled by default). >> >> This pass tries to remove comparison instructions when possible. For instance, >> if you have this code: >> >> sub r1, 1 >> cmp r1, 0 >> bz L1 >> >> and "sub" either sets the same flag as the "cmp" instruction or could be >> converted to set the same flag, then we can eliminate the "cmp" instruction all >> together. This is a important for ARM where the ALU instructions could set the >> CPSR flag, but need a special suffix ('s') to do so. >> >> Added: >> llvm/trunk/lib/CodeGen/OptimizeCmps.cpp >> Modified: >> llvm/trunk/include/llvm/CodeGen/Passes.h >> llvm/trunk/include/llvm/Target/TargetInstrInfo.h >> llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp >> llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp >> llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h >> >> Modified: llvm/trunk/include/llvm/CodeGen/Passes.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=110423&r1=110422&r2=110423&view=diff >> ============================================================================== >> --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) >> +++ llvm/trunk/include/llvm/CodeGen/Passes.h Thu Aug 5 20:32:48 2010 >> @@ -180,6 +180,10 @@ >> /// to take advantage of opportunities created during DAG legalization. >> FunctionPass *createOptimizePHIsPass(); >> >> + /// createOptimizeCmpsPass - This pass performs redundant comparison removal >> + /// optimization. >> + FunctionPass *createOptimizeCmpsPass(); >> + >> /// createStackSlotColoringPass - This pass performs stack slot coloring. >> FunctionPass *createStackSlotColoringPass(bool); >> >> >> Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=110423&r1=110422&r2=110423&view=diff >> ============================================================================== >> --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) >> +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Thu Aug 5 20:32:48 2010 >> @@ -576,6 +576,21 @@ >> /// register allocation. >> virtual ScheduleHazardRecognizer* >> CreateTargetPostRAHazardRecognizer(const InstrItineraryData&) const = 0; >> + >> + /// isCompareInstr - If the machine instruction is a comparison instruction, >> + /// then return true. Also return the source register in SrcReg and the value >> + /// it compares against in CmpValue. >> + virtual bool isCompareInstr(const MachineInstr *MI, >> + unsigned &SrcReg, int &CmpValue) const { >> + return false; >> + } >> + >> + /// convertToSetZeroFlag - Convert the instruction to set the zero flag so >> + /// that we can remove a "comparison with zero". >> + virtual bool convertToSetZeroFlag(MachineInstr *Instr, >> + MachineInstr *CmpInstr) const { >> + return false; >> + } >> }; >> >> /// TargetInstrInfoImpl - This is the default implementation of >> >> Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=110423&r1=110422&r2=110423&view=diff >> ============================================================================== >> --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) >> +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Thu Aug 5 20:32:48 2010 >> @@ -354,6 +354,7 @@ >> printAndVerify(PM, "After codegen DCE pass"); >> >> PM.add(createOptimizeExtsPass()); >> + PM.add(createOptimizeCmpsPass()); >> if (!DisableMachineLICM) >> PM.add(createMachineLICMPass()); >> PM.add(createMachineCSEPass()); >> >> Added: llvm/trunk/lib/CodeGen/OptimizeCmps.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizeCmps.cpp?rev=110423&view=auto >> ============================================================================== >> --- llvm/trunk/lib/CodeGen/OptimizeCmps.cpp (added) >> +++ llvm/trunk/lib/CodeGen/OptimizeCmps.cpp Thu Aug 5 20:32:48 2010 >> @@ -0,0 +1,112 @@ >> +//===-- OptimizeCmps.cpp - Optimize comparison instrs ---------------------===// >> +// >> +// The LLVM Compiler Infrastructure >> +// >> +// This file is distributed under the University of Illinois Open Source >> +// License. See LICENSE.TXT for details. >> +// >> +//===----------------------------------------------------------------------===// >> +// >> +// This pass performs optimization of comparison instructions. For instance, in >> +// this code: >> +// >> +// sub r1, 1 >> +// cmp r1, 0 >> +// bz L1 >> +// >> +// If the "sub" instruction all ready sets (or could be modified to set) the >> +// same flag that the "cmp" instruction sets and that "bz" uses, then we can >> +// eliminate the "cmp" instruction. >> +// >> +//===----------------------------------------------------------------------===// >> + >> +#define DEBUG_TYPE "opt-compares" >> +#include "llvm/CodeGen/Passes.h" >> +#include "llvm/CodeGen/MachineFunctionPass.h" >> +#include "llvm/CodeGen/MachineInstrBuilder.h" >> +#include "llvm/CodeGen/MachineRegisterInfo.h" >> +#include "llvm/Target/TargetInstrInfo.h" >> +#include "llvm/Target/TargetRegisterInfo.h" >> +#include "llvm/Support/CommandLine.h" >> +#include "llvm/ADT/Statistic.h" >> +using namespace llvm; >> + >> +STATISTIC(NumEliminated, "Number of compares eliminated"); >> + >> +static cl::opt >> +EnableOptCmps("enable-optimize-cmps", cl::init(false), cl::Hidden); >> + >> +namespace { >> + class OptimizeCmps : public MachineFunctionPass { >> + const TargetMachine *TM; >> + const TargetInstrInfo *TII; >> + MachineRegisterInfo *MRI; >> + >> + bool OptimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB); >> + >> + public: >> + static char ID; // Pass identification >> + OptimizeCmps() : MachineFunctionPass(&ID) {} >> + >> + virtual bool runOnMachineFunction(MachineFunction &MF); >> + >> + virtual void getAnalysisUsage(AnalysisUsage &AU) const { >> + AU.setPreservesCFG(); >> + MachineFunctionPass::getAnalysisUsage(AU); >> + } >> + }; >> +} >> + >> +char OptimizeCmps::ID = 0; >> +INITIALIZE_PASS(OptimizeCmps, "opt-cmps", >> + "Optimize comparison instrs", false, false); >> + >> +FunctionPass *llvm::createOptimizeCmpsPass() { return new OptimizeCmps(); } >> + >> +/// OptimizeCmpInstr - If the instruction is a compare and the previous >> +/// instruction it's comparing against all ready sets (or could be modified to >> +/// set) the same flag as the compare, then we can remove the comparison and use >> +/// the flag from the previous instruction. >> +bool OptimizeCmps::OptimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB) { >> + // If this instruction is a comparison against zero and isn't comparing a >> + // physical register, we can try to optimize it. >> + unsigned SrcReg; >> + int CmpValue; >> + if (!TII->isCompareInstr(MI, SrcReg, CmpValue) || >> + TargetRegisterInfo::isPhysicalRegister(SrcReg) || >> + CmpValue != 0) >> + return false; >> + >> + MachineRegisterInfo::def_iterator DI = MRI->def_begin(SrcReg); >> + if (llvm::next(DI) != MRI->def_end()) >> + // Only support one definition. >> + return false; >> + >> + // Attempt to convert the defining instruction to set the "zero" flag. >> + if (TII->convertToSetZeroFlag(&*DI, MI)) { >> + ++NumEliminated; >> + return true; >> + } >> + >> + return false; >> +} >> + >> +bool OptimizeCmps::runOnMachineFunction(MachineFunction &MF) { >> + TM = &MF.getTarget(); >> + TII = TM->getInstrInfo(); >> + MRI = &MF.getRegInfo(); >> + >> + if (!EnableOptCmps) return false; >> + >> + bool Changed = false; >> + for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) { >> + MachineBasicBlock *MBB = &*I; >> + for (MachineBasicBlock::iterator >> + MII = MBB->begin(), ME = MBB->end(); MII != ME; ) { >> + MachineInstr *MI = &*MII++; >> + Changed |= OptimizeCmpInstr(MI, MBB); >> + } >> + } >> + >> + return Changed; >> +} >> >> Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=110423&r1=110422&r2=110423&view=diff >> ============================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) >> +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Aug 5 20:32:48 2010 >> @@ -1353,3 +1353,59 @@ >> Offset = (isSub) ? -Offset : Offset; >> return Offset == 0; >> } >> + >> +bool ARMBaseInstrInfo:: >> +isCompareInstr(const MachineInstr *MI, unsigned &SrcReg, int &CmpValue) const { >> + switch (MI->getOpcode()) { >> + default: break; >> + case ARM::t2CMPri: >> + case ARM::t2CMPzri: >> + SrcReg = MI->getOperand(0).getReg(); >> + CmpValue = MI->getOperand(1).getImm(); >> + return true; >> + } >> + >> + return false; >> +} >> + >> +/// convertToSetZeroFlag - Convert the instruction to set the "zero" flag so >> +/// that we can remove a "comparison with zero". >> +bool ARMBaseInstrInfo:: >> +convertToSetZeroFlag(MachineInstr *MI, MachineInstr *CmpInstr) const { >> + // Conservatively refuse to convert an instruction which isn't in the same BB >> + // as the comparison. >> + if (MI->getParent() != CmpInstr->getParent()) >> + return false; >> + >> + // Check that CPSR isn't set between the comparison instruction and the one we >> + // want to change. >> + MachineBasicBlock::const_iterator I = CmpInstr, E = MI; >> + --I; >> + for (; I != E; --I) { >> + const MachineInstr &Instr = *I; >> + >> + for (unsigned IO = 0, EO = Instr.getNumOperands(); IO != EO; ++IO) { >> + const MachineOperand &MO = Instr.getOperand(IO); >> + if (!MO.isDef() || !MO.isReg()) continue; >> + >> + // This instruction modifies CPSR before the one we want to change. We >> + // can't do this transformation. >> + if (MO.getReg() == ARM::CPSR) >> + return false; >> + } >> + } >> + >> + // Set the "zero" bit in CPSR. >> + switch (MI->getOpcode()) { >> + default: break; >> + case ARM::t2SUBri: { >> + MI->RemoveOperand(5); >> + MachineInstrBuilder MB(MI); >> + MB.addReg(ARM::CPSR, RegState::Define | RegState::Implicit); >> + CmpInstr->eraseFromParent(); >> + return true; >> + } >> + } >> + >> + return false; >> +} >> >> Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=110423&r1=110422&r2=110423&view=diff >> ============================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original) >> +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Thu Aug 5 20:32:48 2010 >> @@ -336,6 +336,17 @@ >> unsigned NumInstrs) const { >> return NumInstrs && NumInstrs == 1; >> } >> + >> + /// isCompareInstr - If the machine instruction is a comparison instruction, >> + /// then return true. Also return the source register in SrcReg and the value >> + /// it compares against in CmpValue. >> + virtual bool isCompareInstr(const MachineInstr *MI, unsigned &SrcReg, >> + int &CmpValue) const; >> + >> + /// convertToSetZeroFlag - Convert the instruction to set the zero flag so >> + /// that we can remove a "comparison with zero". >> + virtual bool convertToSetZeroFlag(MachineInstr *Instr, >> + MachineInstr *CmpInstr) const; >> }; >> >> static inline >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From nicholas at mxc.ca Fri Aug 6 02:21:30 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Fri, 06 Aug 2010 07:21:30 -0000 Subject: [llvm-commits] [llvm] r110434 - /llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Message-ID: <20100806072130.B99B82A6C12C@llvm.org> Author: nicholas Date: Fri Aug 6 02:21:30 2010 New Revision: 110434 URL: http://llvm.org/viewvc/llvm-project?rev=110434&view=rev Log: Work in progress, cleaning up MergeFuncs. Further clean up the comparison function by removing overly generalized "domains". Remove all understanding of ELF aliases and simplify folding code and comments. Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=110434&r1=110433&r2=110434&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Fri Aug 6 02:21:30 2010 @@ -42,19 +42,6 @@ // other doesn't. We should learn to peer through bitcasts without imposing bad // performance properties. // -// * emit aliases for ELF -// -// ELF supports symbol aliases which are represented with GlobalAlias in the -// Module, and we could emit them in the case that the addresses don't need to -// be distinct. The problem is that not all object formats support equivalent -// functionality. There's a few approaches to this problem; -// a) teach codegen to lower global aliases to thunks on platforms which don't -// support them. -// b) always emit thunks, and create a separate thunk-to-alias pass which -// runs on ELF systems. This has the added benefit of transforming other -// thunks such as those produced by a C++ frontend into aliases when legal -// to do so. -// //===----------------------------------------------------------------------===// #define DEBUG_TYPE "mergefunc" @@ -108,7 +95,7 @@ class FunctionComparator { public: FunctionComparator(TargetData *TD, Function *F1, Function *F2) - : F1(F1), F2(F2), TD(TD) {} + : F1(F1), F2(F2), TD(TD), IDMap1Count(0), IDMap2Count(0) {} // Compare - test whether the two functions have equivalent behaviour. bool Compare(); @@ -117,10 +104,6 @@ // Compare - test whether two basic blocks have equivalent behaviour. bool Compare(const BasicBlock *BB1, const BasicBlock *BB2); - // getDomain - a value's domain is its parent function if it is specific to a - // function, or NULL otherwise. - const Function *getDomain(const Value *V) const; - // Enumerate - Assign or look up previously assigned numbers for the two // values, and return whether the numbers are equal. Numbers are assigned in // the order visited. @@ -134,6 +117,7 @@ // isEquivalentGEP - Compare two GEPs for equivalent pointer arithmetic. bool isEquivalentGEP(const GEPOperator *GEP1, const GEPOperator *GEP2); + bool isEquivalentGEP(const GetElementPtrInst *GEP1, const GetElementPtrInst *GEP2) { return isEquivalentGEP(cast(GEP1), cast(GEP2)); @@ -148,9 +132,8 @@ TargetData *TD; typedef DenseMap IDMap; - IDMap Map; - DenseMap Domains; - DenseMap DomainCount; + IDMap Map1, Map2; + unsigned long IDMap1Count, IDMap2Count; }; } @@ -171,8 +154,8 @@ return ID.ComputeHash(); } -/// isEquivalentType - any two pointers are equivalent. Otherwise, standard -/// type equivalence rules apply. +/// isEquivalentType - any two pointers in the same address space are +/// equivalent. Otherwise, standard type equivalence rules apply. bool FunctionComparator::isEquivalentType(const Type *Ty1, const Type *Ty2) const { if (Ty1 == Ty2) @@ -259,6 +242,7 @@ return ATy1->getNumElements() == ATy2->getNumElements() && isEquivalentType(ATy1->getElementType(), ATy2->getElementType()); } + case Type::VectorTyID: { const VectorType *VTy1 = cast(Ty1); const VectorType *VTy2 = cast(Ty2); @@ -355,19 +339,6 @@ return true; } -/// getDomain - a value's domain is its parent function if it is specific to a -/// function, or NULL otherwise. -const Function *FunctionComparator::getDomain(const Value *V) const { - if (const Argument *A = dyn_cast(V)) { - return A->getParent(); - } else if (const BasicBlock *BB = dyn_cast(V)) { - return BB->getParent(); - } else if (const Instruction *I = dyn_cast(V)) { - return I->getParent()->getParent(); - } - return NULL; -} - /// Enumerate - Compare two values used by the two functions under pair-wise /// comparison. If this is the first time the values are seen, they're added to /// the mapping so that we will detect mismatches on next use. @@ -375,9 +346,10 @@ // Check for function @f1 referring to itself and function @f2 referring to // itself, or referring to each other, or both referring to either of them. // They're all equivalent if the two functions are otherwise equivalent. - if (V1 == F1 || V1 == F2) - if (V2 == F1 || V2 == F2) - return true; + if (V1 == F1 && V2 == F2) + return true; + if (V1 == F2 && V2 == F1) + return true; // TODO: constant expressions with GEP or references to F1 or F2. if (isa(V1)) @@ -390,25 +362,13 @@ IA1->getConstraintString() == IA2->getConstraintString(); } - // We enumerate constants globally and arguments, basic blocks or - // instructions within the function they belong to. - const Function *Domain1 = getDomain(V1); - const Function *Domain2 = getDomain(V2); - - // The domains have to either be both NULL, or F1, F2. - if (Domain1 != Domain2) - if (Domain1 != F1 && Domain1 != F2) - return false; - - IDMap &Map1 = Domains[Domain1]; unsigned long &ID1 = Map1[V1]; if (!ID1) - ID1 = ++DomainCount[Domain1]; + ID1 = ++IDMap1Count; - IDMap &Map2 = Domains[Domain2]; unsigned long &ID2 = Map2[V2]; if (!ID2) - ID2 = ++DomainCount[Domain2]; + ID2 = ++IDMap2Count; return ID1 == ID2; } @@ -503,20 +463,26 @@ // artifact, this also means that unreachable blocks are ignored. SmallVector F1BBs, F2BBs; SmallSet VisitedBBs; // in terms of F1. + F1BBs.push_back(&F1->getEntryBlock()); F2BBs.push_back(&F2->getEntryBlock()); + VisitedBBs.insert(F1BBs[0]); while (!F1BBs.empty()) { const BasicBlock *F1BB = F1BBs.pop_back_val(); const BasicBlock *F2BB = F2BBs.pop_back_val(); + if (!Enumerate(F1BB, F2BB) || !Compare(F1BB, F2BB)) return false; + const TerminatorInst *F1TI = F1BB->getTerminator(); const TerminatorInst *F2TI = F2BB->getTerminator(); + assert(F1TI->getNumSuccessors() == F2TI->getNumSuccessors()); for (unsigned i = 0, e = F1TI->getNumSuccessors(); i != e; ++i) { if (!VisitedBBs.insert(F1TI->getSuccessor(i))) continue; + F1BBs.push_back(F1TI->getSuccessor(i)); F2BBs.push_back(F2TI->getSuccessor(i)); } @@ -530,70 +496,24 @@ // Cases: // * F is external strong, G is external strong: -// turn G into a thunk to F (1) +// turn G into a thunk to F // * F is external strong, G is external weak: -// turn G into a thunk to F (1) +// turn G into a thunk to F // * F is external weak, G is external weak: // unfoldable // * F is external strong, G is internal: -// address of G taken: -// turn G into a thunk to F (1) -// address of G not taken: -// make G an alias to F (2) +// turn G into a thunk to F // * F is internal, G is external weak -// address of F is taken: -// turn G into a thunk to F (1) -// address of F is not taken: -// make G an alias of F (2) +// turn G into a thunk to F // * F is internal, G is internal: -// address of F and G are taken: -// turn G into a thunk to F (1) -// address of G is not taken: -// make G an alias to F (2) +// turn G into a thunk to F // -// alias requires linkage == (external,local,weak) fallback to creating a thunk // external means 'externally visible' linkage != (internal,private) // internal means linkage == (internal,private) // weak means linkage mayBeOverridable -// being external implies that the address is taken -// -// 1. turn G into a thunk to F -// 2. make G an alias to F - -enum LinkageCategory { - ExternalStrong, - ExternalWeak, - Internal -}; - -static LinkageCategory categorize(const Function *F) { - switch (F->getLinkage()) { - case GlobalValue::InternalLinkage: - case GlobalValue::PrivateLinkage: - case GlobalValue::LinkerPrivateLinkage: - return Internal; - - case GlobalValue::WeakAnyLinkage: - case GlobalValue::WeakODRLinkage: - case GlobalValue::ExternalWeakLinkage: - case GlobalValue::LinkerPrivateWeakLinkage: - return ExternalWeak; - - case GlobalValue::ExternalLinkage: - case GlobalValue::AvailableExternallyLinkage: - case GlobalValue::LinkOnceAnyLinkage: - case GlobalValue::LinkOnceODRLinkage: - case GlobalValue::AppendingLinkage: - case GlobalValue::DLLImportLinkage: - case GlobalValue::DLLExportLinkage: - case GlobalValue::CommonLinkage: - return ExternalStrong; - } - - llvm_unreachable("Unknown LinkageType."); - return ExternalWeak; -} +/// ThunkGToF - Replace G with a simple tail call to bitcast(F). Also replace +/// direct uses of G with bitcast(F). static void ThunkGToF(Function *F, Function *G) { if (!G->mayBeOverridden()) { // Redirect direct callers of G to F. @@ -608,6 +528,13 @@ } } + // If G was internal then we may have replaced all uses if G with F. If so, + // stop here and delete G. There's no need for a thunk. + if (G->hasLocalLinkage() && G->use_empty()) { + G->eraseFromParent(); + return; + } + Function *NewG = Function::Create(G->getFunctionType(), G->getLinkage(), "", G->getParent()); BasicBlock *BB = BasicBlock::Create(F->getContext(), "", NewG); @@ -643,59 +570,19 @@ G->eraseFromParent(); } -static void AliasGToF(Function *F, Function *G) { - // Darwin will trigger llvm_unreachable if asked to codegen an alias. - return ThunkGToF(F, G); - -#if 0 - if (!G->hasExternalLinkage() && !G->hasLocalLinkage() && !G->hasWeakLinkage()) - return ThunkGToF(F, G); - - GlobalAlias *GA = new GlobalAlias( - G->getType(), G->getLinkage(), "", - ConstantExpr::getBitCast(F, G->getType()), G->getParent()); - F->setAlignment(std::max(F->getAlignment(), G->getAlignment())); - GA->takeName(G); - GA->setVisibility(G->getVisibility()); - G->replaceAllUsesWith(GA); - G->eraseFromParent(); -#endif -} - static bool fold(std::vector &FnVec, unsigned i, unsigned j) { Function *F = FnVec[i]; Function *G = FnVec[j]; - LinkageCategory catF = categorize(F); - LinkageCategory catG = categorize(G); - - if (catF == ExternalWeak || (catF == Internal && catG == ExternalStrong)) { + if (F->isWeakForLinker() && !G->isWeakForLinker()) { std::swap(FnVec[i], FnVec[j]); std::swap(F, G); - std::swap(catF, catG); } - switch (catF) { - case ExternalStrong: - switch (catG) { - case ExternalStrong: - case ExternalWeak: - ThunkGToF(F, G); - break; - case Internal: - if (G->hasAddressTaken()) - ThunkGToF(F, G); - else - AliasGToF(F, G); - break; - } - break; - - case ExternalWeak: { - assert(catG == ExternalWeak); + if (F->isWeakForLinker()) { + assert(G->isWeakForLinker()); // Make them both thunks to the same internal function. - F->setAlignment(std::max(F->getAlignment(), G->getAlignment())); Function *H = Function::Create(F->getFunctionType(), F->getLinkage(), "", F->getParent()); H->copyAttributesFrom(F); @@ -705,37 +592,10 @@ ThunkGToF(F, G); ThunkGToF(F, H); + F->setAlignment(std::max(G->getAlignment(), H->getAlignment())); F->setLinkage(GlobalValue::InternalLinkage); - } break; - - case Internal: - switch (catG) { - case ExternalStrong: - llvm_unreachable(0); - // fall-through - case ExternalWeak: - if (F->hasAddressTaken()) - ThunkGToF(F, G); - else - AliasGToF(F, G); - break; - case Internal: { - bool addrTakenF = F->hasAddressTaken(); - bool addrTakenG = G->hasAddressTaken(); - if (!addrTakenF && addrTakenG) { - std::swap(FnVec[i], FnVec[j]); - std::swap(F, G); - std::swap(addrTakenF, addrTakenG); - } - - if (addrTakenF && addrTakenG) { - ThunkGToF(F, G); - } else { - assert(!addrTakenG); - AliasGToF(F, G); - } - } break; - } break; + } else { + ThunkGToF(F, G); } ++NumFunctionsMerged; @@ -752,7 +612,7 @@ std::map > FnMap; for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) { - if (F->isDeclaration()) + if (F->isDeclaration() || F->hasAvailableExternallyLinkage()) continue; FnMap[ProfileFunction(F)].push_back(F); From nicholas at mxc.ca Fri Aug 6 02:43:46 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Fri, 06 Aug 2010 07:43:46 -0000 Subject: [llvm-commits] [llvm] r110435 - /llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp Message-ID: <20100806074346.3BCEB2A6C12D@llvm.org> Author: nicholas Date: Fri Aug 6 02:43:46 2010 New Revision: 110435 URL: http://llvm.org/viewvc/llvm-project?rev=110435&view=rev Log: Fix uninitialized variable warning. Also move 'default' case next to a real case to help compiler optimize in non-Debug builds. No functionality change. Modified: llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp?rev=110435&r1=110434&r2=110435&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp Fri Aug 6 02:43:46 2010 @@ -52,8 +52,9 @@ Value *Delta = CI->getArgOperand(1); LoadInst *Orig = Builder.CreateLoad(Ptr); - Value *Res; + Value *Res = NULL; switch (IID) { + default: assert(0 && "Unrecognized atomic modify operation"); case Intrinsic::atomic_load_add: Res = Builder.CreateAdd(Orig, Delta); break; @@ -92,7 +93,6 @@ Orig, Delta); break; - default: assert(0 && "Unrecognized atomic modify operation"); } Builder.CreateStore(Res, Ptr); From deeppatel1987 at gmail.com Fri Aug 6 09:55:11 2010 From: deeppatel1987 at gmail.com (Sandeep Patel) Date: Fri, 6 Aug 2010 14:55:11 +0000 Subject: [llvm-commits] [patch][arm] Fix eabi calling convention when a 64 bit value shadows r3 In-Reply-To: References: Message-ID: This is PR4058, right? arguments-nosplit-i64.ll seems to be testing the same thing. If the problem is that R3 isn't marked as used and can get backfilled by mistake, shouldn't we expand the test to confirm that? deep On Fri, Aug 6, 2010 at 2:43 AM, Rafael Espindola wrote: > I noticed I could use inheritance to make the patch a bit smaller. > > Cheers, > -- > Rafael ?vila de Esp?ndola > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > From espindola at google.com Fri Aug 6 10:18:29 2010 From: espindola at google.com (Rafael Espindola) Date: Fri, 6 Aug 2010 11:18:29 -0400 Subject: [llvm-commits] [patch][arm] Fix eabi calling convention when a 64 bit value shadows r3 In-Reply-To: References: Message-ID: On 6 August 2010 10:55, Sandeep Patel wrote: > This is PR4058, right? arguments-nosplit-i64.ll seems to be testing > the same thing. If the problem is that R3 isn't marked as used and can > get backfilled by mistake, shouldn't we expand the test to confirm > that? I don't think that is exactly the same problem. What I have seen was * R3 is not marked as "used" * ARM backend thinks it has to save it to the stack because of vaarg * Offset computation correctly ignores it * Offsets are wrong That is why in the test I check that there is a load from [sp] immediately followed by a ret. Without this patch we would get the same load followed by a stack adjustment and then a ret. Note that this is only an issue with vaarg. A new test is probably appropriate. > deep > Cheers, -- Rafael ?vila de Esp?ndola From deeppatel1987 at gmail.com Fri Aug 6 10:24:50 2010 From: deeppatel1987 at gmail.com (Sandeep Patel) Date: Fri, 6 Aug 2010 15:24:50 +0000 Subject: [llvm-commits] [patch][arm] Fix eabi calling convention when a 64 bit value shadows r3 In-Reply-To: References: Message-ID: On Fri, Aug 6, 2010 at 3:18 PM, Rafael Espindola wrote: > On 6 August 2010 10:55, Sandeep Patel wrote: >> This is PR4058, right? arguments-nosplit-i64.ll seems to be testing >> the same thing. If the problem is that R3 isn't marked as used and can >> get backfilled by mistake, shouldn't we expand the test to confirm >> that? > > I don't think that is exactly the same problem. What I have seen was > > * R3 is not marked as "used" > * ARM backend thinks it has to save it to the stack because of vaarg > * Offset computation correctly ignores it > * Offsets are wrong > > That is why in the test I check that there is a load from [sp] > immediately followed by a ret. Without this patch we would get the > same load followed by a stack adjustment and then a ret. > > Note that this is only an issue with vaarg. A new test is probably appropriate. Sounds good then. deep From rafael.espindola at gmail.com Fri Aug 6 10:35:32 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Fri, 06 Aug 2010 15:35:32 -0000 Subject: [llvm-commits] [llvm] r110446 - in /llvm/trunk: include/llvm/CodeGen/CallingConvLower.h include/llvm/Target/TargetCallingConv.td lib/Target/ARM/ARMCallingConv.td test/CodeGen/ARM/arguments.ll utils/TableGen/CallingConvEmitter.cpp Message-ID: <20100806153532.6589A2A6C12C@llvm.org> Author: rafael Date: Fri Aug 6 10:35:32 2010 New Revision: 110446 URL: http://llvm.org/viewvc/llvm-project?rev=110446&view=rev Log: Fix eabi calling convention when a 64 bit value shadows r3. Without this what was happening was: * R3 is not marked as "used" * ARM backend thinks it has to save it to the stack because of vaarg * Offset computation correctly ignores it * Offsets are wrong Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h llvm/trunk/include/llvm/Target/TargetCallingConv.td llvm/trunk/lib/Target/ARM/ARMCallingConv.td llvm/trunk/test/CodeGen/ARM/arguments.ll llvm/trunk/utils/TableGen/CallingConvEmitter.cpp Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CallingConvLower.h?rev=110446&r1=110445&r2=110446&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/CallingConvLower.h (original) +++ llvm/trunk/include/llvm/CodeGen/CallingConvLower.h Fri Aug 6 10:35:32 2010 @@ -275,6 +275,12 @@ return Result; } + /// Version of AllocateStack with extra register to be shadowed. + unsigned AllocateStack(unsigned Size, unsigned Align, unsigned ShadowReg) { + MarkAllocated(ShadowReg); + return AllocateStack(Size, Align); + } + // HandleByVal - Allocate a stack slot large enough to pass an argument by // value. The size and alignment information of the argument is encoded in its // parameter attribute. Modified: llvm/trunk/include/llvm/Target/TargetCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetCallingConv.td?rev=110446&r1=110445&r2=110446&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetCallingConv.td (original) +++ llvm/trunk/include/llvm/Target/TargetCallingConv.td Fri Aug 6 10:35:32 2010 @@ -89,6 +89,13 @@ int Align = align; } +/// CCAssignToStackWithShadow - Same as CCAssignToStack, but with a register +/// to be shadowed. +class CCAssignToStackWithShadow : + CCAssignToStack { + Register ShadowReg = reg; +} + /// CCPassByVal - This action always matches: it assigns the value to a stack /// slot to implement ByVal aggregate parameter passing. Size and alignment /// specify the minimum size and alignment for the stack slot. Modified: llvm/trunk/lib/Target/ARM/ARMCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCallingConv.td?rev=110446&r1=110445&r2=110446&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCallingConv.td (original) +++ llvm/trunk/lib/Target/ARM/ARMCallingConv.td Fri Aug 6 10:35:32 2010 @@ -68,7 +68,7 @@ "ArgFlags.getOrigAlign() != 8", CCAssignToReg<[R0, R1, R2, R3]>>>, - CCIfType<[i32], CCIfAlign<"8", CCAssignToStack<4, 8>>>, + CCIfType<[i32], CCIfAlign<"8", CCAssignToStackWithShadow<4, 8, R3>>>, CCIfType<[i32, f32], CCAssignToStack<4, 4>>, CCIfType<[f64], CCAssignToStack<8, 8>>, CCIfType<[v2f64], CCAssignToStack<16, 8>> Modified: llvm/trunk/test/CodeGen/ARM/arguments.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/arguments.ll?rev=110446&r1=110445&r2=110446&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/arguments.ll (original) +++ llvm/trunk/test/CodeGen/ARM/arguments.ll Fri Aug 6 10:35:32 2010 @@ -24,6 +24,20 @@ ret i32 %.0 } +; test that on gnueabi a 64 bit value at this position will cause r3 to go +; unused and the value stored in [sp] +; ELF: f3: +; ELF: ldr r0, [sp] +; ELF-NEXT: mov pc, lr +; DARWIN: f3: +; DARWIN: mov r0, r3 +; DARWIN-NEXT: mov pc, lr +define i32 @f3(i32 %i, i32 %j, i32 %k, i64 %l, ...) { +entry: + %0 = trunc i64 %l to i32 + ret i32 %0 +} + declare i32 @g1(i64) declare i32 @g2(i32 %i, ...) Modified: llvm/trunk/utils/TableGen/CallingConvEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CallingConvEmitter.cpp?rev=110446&r1=110445&r2=110446&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CallingConvEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/CallingConvEmitter.cpp Fri Aug 6 10:35:32 2010 @@ -169,6 +169,8 @@ else O << "\n" << IndentStr << " State.getTarget().getTargetData()" "->getABITypeAlignment(LocVT.getTypeForEVT(State.getContext()))"; + if (Action->isSubClassOf("CCAssignToStackWithShadow")) + O << ", " << getQualifiedName(Action->getValueAsDef("ShadowReg")); O << ");\n" << IndentStr << "State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset" << Counter << ", LocVT, LocInfo));\n"; From daniel at zuster.org Fri Aug 6 11:07:29 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Fri, 06 Aug 2010 16:07:29 -0000 Subject: [llvm-commits] [zorg] r110447 - /zorg/trunk/lnt/lnt/tests/nt.py Message-ID: <20100806160729.25A4B2A6C12C@llvm.org> Author: ddunbar Date: Fri Aug 6 11:07:28 2010 New Revision: 110447 URL: http://llvm.org/viewvc/llvm-project?rev=110447&view=rev Log: LNT/nt: Use realpath when passing the test suite externals path to configure -- this makes it easier to use remote execution when your test suite externals path is a symlink, but only the root drive is shared. Modified: zorg/trunk/lnt/lnt/tests/nt.py Modified: zorg/trunk/lnt/lnt/tests/nt.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/tests/nt.py?rev=110447&r1=110446&r2=110447&view=diff ============================================================================== --- zorg/trunk/lnt/lnt/tests/nt.py (original) +++ zorg/trunk/lnt/lnt/tests/nt.py Fri Aug 6 11:07:28 2010 @@ -242,7 +242,8 @@ 'configure')), '--with-llvmsrc=%s' % opts.llvm_src_root, '--with-llvmobj=%s' % opts.llvm_obj_root, - '--with-externals=%s' % opts.test_suite_externals] + '--with-externals=%s' % os.path.realpath( + opts.test_suite_externals)] print >>configure_log, '%s: running: %s' % (timestamp(), ' '.join('"%s"' % a for a in args)) From evan.cheng at apple.com Fri Aug 6 11:28:37 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 6 Aug 2010 09:28:37 -0700 Subject: [llvm-commits] [llvm] r110423 - in /llvm/trunk: include/llvm/CodeGen/Passes.h include/llvm/Target/TargetInstrInfo.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/OptimizeCmps.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h In-Reply-To: <622C6683-5F93-46E6-9F55-CB5AAB43B1C5@gmail.com> References: <20100806013249.25D8E2A6C12C@llvm.org> <622C6683-5F93-46E6-9F55-CB5AAB43B1C5@gmail.com> Message-ID: On Aug 5, 2010, at 11:44 PM, Bill Wendling wrote: > Hi Evan, > > When I was implementing it, I realized that I needed to know more about the compare statement then just that it's a compare. (The src reg and compare number for instance.) It just seemed like duplicated effort to have it be both a target instruction property and a target hook call. But it is more expensive, so I can put the instruction property back and do both. I think the instruction property makes sense. Thanks. Evan > > -bw > > On Aug 5, 2010, at 11:02 PM, Evan Cheng wrote: > >> Hi Bill, >> >> I thought you are adding a new target instruction property? Why do you decide to add the target hook instead? >> >> Evan >> >> On Aug 5, 2010, at 6:32 PM, Bill Wendling wrote: >> >>> Author: void >>> Date: Thu Aug 5 20:32:48 2010 >>> New Revision: 110423 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=110423&view=rev >>> Log: >>> Add the Optimize Compares pass (disabled by default). >>> >>> This pass tries to remove comparison instructions when possible. For instance, >>> if you have this code: >>> >>> sub r1, 1 >>> cmp r1, 0 >>> bz L1 >>> >>> and "sub" either sets the same flag as the "cmp" instruction or could be >>> converted to set the same flag, then we can eliminate the "cmp" instruction all >>> together. This is a important for ARM where the ALU instructions could set the >>> CPSR flag, but need a special suffix ('s') to do so. >>> >>> Added: >>> llvm/trunk/lib/CodeGen/OptimizeCmps.cpp >>> Modified: >>> llvm/trunk/include/llvm/CodeGen/Passes.h >>> llvm/trunk/include/llvm/Target/TargetInstrInfo.h >>> llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp >>> llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp >>> llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h >>> >>> Modified: llvm/trunk/include/llvm/CodeGen/Passes.h >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=110423&r1=110422&r2=110423&view=diff >>> ============================================================================== >>> --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) >>> +++ llvm/trunk/include/llvm/CodeGen/Passes.h Thu Aug 5 20:32:48 2010 >>> @@ -180,6 +180,10 @@ >>> /// to take advantage of opportunities created during DAG legalization. >>> FunctionPass *createOptimizePHIsPass(); >>> >>> + /// createOptimizeCmpsPass - This pass performs redundant comparison removal >>> + /// optimization. >>> + FunctionPass *createOptimizeCmpsPass(); >>> + >>> /// createStackSlotColoringPass - This pass performs stack slot coloring. >>> FunctionPass *createStackSlotColoringPass(bool); >>> >>> >>> Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=110423&r1=110422&r2=110423&view=diff >>> ============================================================================== >>> --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) >>> +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Thu Aug 5 20:32:48 2010 >>> @@ -576,6 +576,21 @@ >>> /// register allocation. >>> virtual ScheduleHazardRecognizer* >>> CreateTargetPostRAHazardRecognizer(const InstrItineraryData&) const = 0; >>> + >>> + /// isCompareInstr - If the machine instruction is a comparison instruction, >>> + /// then return true. Also return the source register in SrcReg and the value >>> + /// it compares against in CmpValue. >>> + virtual bool isCompareInstr(const MachineInstr *MI, >>> + unsigned &SrcReg, int &CmpValue) const { >>> + return false; >>> + } >>> + >>> + /// convertToSetZeroFlag - Convert the instruction to set the zero flag so >>> + /// that we can remove a "comparison with zero". >>> + virtual bool convertToSetZeroFlag(MachineInstr *Instr, >>> + MachineInstr *CmpInstr) const { >>> + return false; >>> + } >>> }; >>> >>> /// TargetInstrInfoImpl - This is the default implementation of >>> >>> Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=110423&r1=110422&r2=110423&view=diff >>> ============================================================================== >>> --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) >>> +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Thu Aug 5 20:32:48 2010 >>> @@ -354,6 +354,7 @@ >>> printAndVerify(PM, "After codegen DCE pass"); >>> >>> PM.add(createOptimizeExtsPass()); >>> + PM.add(createOptimizeCmpsPass()); >>> if (!DisableMachineLICM) >>> PM.add(createMachineLICMPass()); >>> PM.add(createMachineCSEPass()); >>> >>> Added: llvm/trunk/lib/CodeGen/OptimizeCmps.cpp >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizeCmps.cpp?rev=110423&view=auto >>> ============================================================================== >>> --- llvm/trunk/lib/CodeGen/OptimizeCmps.cpp (added) >>> +++ llvm/trunk/lib/CodeGen/OptimizeCmps.cpp Thu Aug 5 20:32:48 2010 >>> @@ -0,0 +1,112 @@ >>> +//===-- OptimizeCmps.cpp - Optimize comparison instrs ---------------------===// >>> +// >>> +// The LLVM Compiler Infrastructure >>> +// >>> +// This file is distributed under the University of Illinois Open Source >>> +// License. See LICENSE.TXT for details. >>> +// >>> +//===----------------------------------------------------------------------===// >>> +// >>> +// This pass performs optimization of comparison instructions. For instance, in >>> +// this code: >>> +// >>> +// sub r1, 1 >>> +// cmp r1, 0 >>> +// bz L1 >>> +// >>> +// If the "sub" instruction all ready sets (or could be modified to set) the >>> +// same flag that the "cmp" instruction sets and that "bz" uses, then we can >>> +// eliminate the "cmp" instruction. >>> +// >>> +//===----------------------------------------------------------------------===// >>> + >>> +#define DEBUG_TYPE "opt-compares" >>> +#include "llvm/CodeGen/Passes.h" >>> +#include "llvm/CodeGen/MachineFunctionPass.h" >>> +#include "llvm/CodeGen/MachineInstrBuilder.h" >>> +#include "llvm/CodeGen/MachineRegisterInfo.h" >>> +#include "llvm/Target/TargetInstrInfo.h" >>> +#include "llvm/Target/TargetRegisterInfo.h" >>> +#include "llvm/Support/CommandLine.h" >>> +#include "llvm/ADT/Statistic.h" >>> +using namespace llvm; >>> + >>> +STATISTIC(NumEliminated, "Number of compares eliminated"); >>> + >>> +static cl::opt >>> +EnableOptCmps("enable-optimize-cmps", cl::init(false), cl::Hidden); >>> + >>> +namespace { >>> + class OptimizeCmps : public MachineFunctionPass { >>> + const TargetMachine *TM; >>> + const TargetInstrInfo *TII; >>> + MachineRegisterInfo *MRI; >>> + >>> + bool OptimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB); >>> + >>> + public: >>> + static char ID; // Pass identification >>> + OptimizeCmps() : MachineFunctionPass(&ID) {} >>> + >>> + virtual bool runOnMachineFunction(MachineFunction &MF); >>> + >>> + virtual void getAnalysisUsage(AnalysisUsage &AU) const { >>> + AU.setPreservesCFG(); >>> + MachineFunctionPass::getAnalysisUsage(AU); >>> + } >>> + }; >>> +} >>> + >>> +char OptimizeCmps::ID = 0; >>> +INITIALIZE_PASS(OptimizeCmps, "opt-cmps", >>> + "Optimize comparison instrs", false, false); >>> + >>> +FunctionPass *llvm::createOptimizeCmpsPass() { return new OptimizeCmps(); } >>> + >>> +/// OptimizeCmpInstr - If the instruction is a compare and the previous >>> +/// instruction it's comparing against all ready sets (or could be modified to >>> +/// set) the same flag as the compare, then we can remove the comparison and use >>> +/// the flag from the previous instruction. >>> +bool OptimizeCmps::OptimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB) { >>> + // If this instruction is a comparison against zero and isn't comparing a >>> + // physical register, we can try to optimize it. >>> + unsigned SrcReg; >>> + int CmpValue; >>> + if (!TII->isCompareInstr(MI, SrcReg, CmpValue) || >>> + TargetRegisterInfo::isPhysicalRegister(SrcReg) || >>> + CmpValue != 0) >>> + return false; >>> + >>> + MachineRegisterInfo::def_iterator DI = MRI->def_begin(SrcReg); >>> + if (llvm::next(DI) != MRI->def_end()) >>> + // Only support one definition. >>> + return false; >>> + >>> + // Attempt to convert the defining instruction to set the "zero" flag. >>> + if (TII->convertToSetZeroFlag(&*DI, MI)) { >>> + ++NumEliminated; >>> + return true; >>> + } >>> + >>> + return false; >>> +} >>> + >>> +bool OptimizeCmps::runOnMachineFunction(MachineFunction &MF) { >>> + TM = &MF.getTarget(); >>> + TII = TM->getInstrInfo(); >>> + MRI = &MF.getRegInfo(); >>> + >>> + if (!EnableOptCmps) return false; >>> + >>> + bool Changed = false; >>> + for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) { >>> + MachineBasicBlock *MBB = &*I; >>> + for (MachineBasicBlock::iterator >>> + MII = MBB->begin(), ME = MBB->end(); MII != ME; ) { >>> + MachineInstr *MI = &*MII++; >>> + Changed |= OptimizeCmpInstr(MI, MBB); >>> + } >>> + } >>> + >>> + return Changed; >>> +} >>> >>> Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=110423&r1=110422&r2=110423&view=diff >>> ============================================================================== >>> --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) >>> +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Aug 5 20:32:48 2010 >>> @@ -1353,3 +1353,59 @@ >>> Offset = (isSub) ? -Offset : Offset; >>> return Offset == 0; >>> } >>> + >>> +bool ARMBaseInstrInfo:: >>> +isCompareInstr(const MachineInstr *MI, unsigned &SrcReg, int &CmpValue) const { >>> + switch (MI->getOpcode()) { >>> + default: break; >>> + case ARM::t2CMPri: >>> + case ARM::t2CMPzri: >>> + SrcReg = MI->getOperand(0).getReg(); >>> + CmpValue = MI->getOperand(1).getImm(); >>> + return true; >>> + } >>> + >>> + return false; >>> +} >>> + >>> +/// convertToSetZeroFlag - Convert the instruction to set the "zero" flag so >>> +/// that we can remove a "comparison with zero". >>> +bool ARMBaseInstrInfo:: >>> +convertToSetZeroFlag(MachineInstr *MI, MachineInstr *CmpInstr) const { >>> + // Conservatively refuse to convert an instruction which isn't in the same BB >>> + // as the comparison. >>> + if (MI->getParent() != CmpInstr->getParent()) >>> + return false; >>> + >>> + // Check that CPSR isn't set between the comparison instruction and the one we >>> + // want to change. >>> + MachineBasicBlock::const_iterator I = CmpInstr, E = MI; >>> + --I; >>> + for (; I != E; --I) { >>> + const MachineInstr &Instr = *I; >>> + >>> + for (unsigned IO = 0, EO = Instr.getNumOperands(); IO != EO; ++IO) { >>> + const MachineOperand &MO = Instr.getOperand(IO); >>> + if (!MO.isDef() || !MO.isReg()) continue; >>> + >>> + // This instruction modifies CPSR before the one we want to change. We >>> + // can't do this transformation. >>> + if (MO.getReg() == ARM::CPSR) >>> + return false; >>> + } >>> + } >>> + >>> + // Set the "zero" bit in CPSR. >>> + switch (MI->getOpcode()) { >>> + default: break; >>> + case ARM::t2SUBri: { >>> + MI->RemoveOperand(5); >>> + MachineInstrBuilder MB(MI); >>> + MB.addReg(ARM::CPSR, RegState::Define | RegState::Implicit); >>> + CmpInstr->eraseFromParent(); >>> + return true; >>> + } >>> + } >>> + >>> + return false; >>> +} >>> >>> Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=110423&r1=110422&r2=110423&view=diff >>> ============================================================================== >>> --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original) >>> +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Thu Aug 5 20:32:48 2010 >>> @@ -336,6 +336,17 @@ >>> unsigned NumInstrs) const { >>> return NumInstrs && NumInstrs == 1; >>> } >>> + >>> + /// isCompareInstr - If the machine instruction is a comparison instruction, >>> + /// then return true. Also return the source register in SrcReg and the value >>> + /// it compares against in CmpValue. >>> + virtual bool isCompareInstr(const MachineInstr *MI, unsigned &SrcReg, >>> + int &CmpValue) const; >>> + >>> + /// convertToSetZeroFlag - Convert the instruction to set the zero flag so >>> + /// that we can remove a "comparison with zero". >>> + virtual bool convertToSetZeroFlag(MachineInstr *Instr, >>> + MachineInstr *CmpInstr) const; >>> }; >>> >>> static inline >>> >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From criswell at uiuc.edu Fri Aug 6 11:31:35 2010 From: criswell at uiuc.edu (John Criswell) Date: Fri, 06 Aug 2010 16:31:35 -0000 Subject: [llvm-commits] [poolalloc] r110449 - in /poolalloc/trunk/lib/AssistDS: Devirt.cpp SVADevirt.cpp Message-ID: <20100806163135.A86922A6C12C@llvm.org> Author: criswell Date: Fri Aug 6 11:31:35 2010 New Revision: 110449 URL: http://llvm.org/viewvc/llvm-project?rev=110449&view=rev Log: Moved Devirt.cpp to SVADevirt.cpp because the SVA version works slightly differently from what we might try with user-space. Added: poolalloc/trunk/lib/AssistDS/SVADevirt.cpp - copied unchanged from r110448, poolalloc/trunk/lib/AssistDS/Devirt.cpp Removed: poolalloc/trunk/lib/AssistDS/Devirt.cpp Removed: poolalloc/trunk/lib/AssistDS/Devirt.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/Devirt.cpp?rev=110448&view=auto ============================================================================== --- poolalloc/trunk/lib/AssistDS/Devirt.cpp (original) +++ poolalloc/trunk/lib/AssistDS/Devirt.cpp (removed) @@ -1,256 +0,0 @@ -//===- Devirt.cpp - Devirtualize using the sig match intrinsic in llva ----===// -// -// 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. -// -//===----------------------------------------------------------------------===// -#define DEBUG_TYPE "devirt" -#include "llvm/Constants.h" -#include "llvm/Transforms/IPO.h" -#include "dsa/CallTargets.h" -#include "llvm/Pass.h" -#include "llvm/Module.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/DerivedTypes.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/ADT/Statistic.h" - -#include -#include -#include - -using namespace llvm; - -#if 0 - -// -// Function: castTo() -// -// Description: // Given an LLVM value, insert a cast instruction to make it a given type. -// -static inline Value * -castTo (Value * V, const Type * Ty, Instruction * InsertPt) { // - // Don't bother creating a cast if it's already the correct type. - // - if (V->getType() == Ty) - return V; - - // - // If it's a constant, just create a constant expression. - // - if (Constant * C = dyn_cast(V)) { - Constant * CE = ConstantExpr::getCast (C, Ty); - return CE; - } - - // - // Otherwise, insert a cast instruction. - // - return new CastInst::Create(V, Ty, "cast", InsertPt); -} - -namespace { - - static cl::opt - VirtualLimit("devirt-limit", cl::Hidden, cl::init(16), - cl::desc("Maximum number of callees to devirtualize at a call site")); - STATISTIC(FuncAdded, "Number of bounce functions added"); - STATISTIC(CSConvert, "Number of call sites converted"); - - - class Devirtualize : public ModulePass { - - - Function * IndirectFuncFail; - - std::map >, Function*> cache; - int fnum; - - // - // Method: buildBounce() - // - // Description: - // Replaces the given call site with a call to a bounce function. The - // bounce function compares the function pointer to one of the given - // target functions and calls the function directly if the pointer - // matches. - Function* buildBounce (CallSite cs, - std::vector& Targets, - Module& M) { - - Value* ptr = cs.getCalledValue(); - const FunctionType* OrigType = - cast(cast(ptr->getType())->getElementType());; - ++FuncAdded; - - std::vector< const Type *> TP(OrigType->param_begin(), OrigType->param_end()); - TP.insert(TP.begin(), ptr->getType()); - const FunctionType* NewTy = FunctionType::get(OrigType->getReturnType(), TP, false); - Function* F = new Function(NewTy, GlobalValue::InternalLinkage, "devirtbounce", &M); - std::map targets; - - F->arg_begin()->setName("funcPtr"); - std::vector fargs; - for(Function::arg_iterator ai = F->arg_begin(), ae = F->arg_end(); ai != ae; ++ai) - if (ai != F->arg_begin()) { - fargs.push_back(ai); - ai->setName("arg"); - } - - for (std::vector::iterator i = Targets.begin(), e = Targets.end(); - i != e; ++i) { - Function* FL = *i; - BasicBlock* BL = new BasicBlock(FL->getName(), F); - targets[FL] = BL; - - //Make call - Value* call = new CallInst(FL, fargs, "", BL); - - //return correctly - if (OrigType->getReturnType() == Type::VoidTy) - new ReturnInst(0, BL); - else - new ReturnInst(call, BL); - } - - // Create a set of tests that search for the correct function target - // and call it directly. If none of the target functions match, - // call pchk_ind_fail() to note the failure. - - // - // Create the failure basic block. Then, add the following: - // o the terminating instruction - // o the indirect call to the original function - // o a call to phck_ind_fail() - // - BasicBlock* tail = new BasicBlock("fail", F, &F->getEntryBlock()); - Instruction * InsertPt; -#if 0 - InsertPt = new UnreachableInst(tail); -#else - Value* p = F->arg_begin(); - Instruction * realCall = new CallInst (p, fargs, "", tail); - if (OrigType->getReturnType() == Type::VoidTy) - InsertPt = new ReturnInst(0, tail); - else - InsertPt = new ReturnInst(realCall, tail); -#endif - Value * FuncVoidPtr = castTo (p, - PointerType::get(Type::SByteTy), - realCall); - new CallInst (IndirectFuncFail, FuncVoidPtr, "", realCall); - - - // Create basic blocks for valid target functions - for (std::vector::iterator i = Targets.begin(), e = Targets.end(); - i != e; ++i) { - BasicBlock* TB = targets[*i]; - BasicBlock* newB = new BasicBlock("test." + (*i)->getName(), F, &F->getEntryBlock()); - SetCondInst* setcc = new SetCondInst(Instruction::SetEQ, *i, p, "sc", newB); - new BranchInst(TB, tail, setcc, newB); - tail = newB; - } - return F; - } - - public: - static char ID; - Devirtualize() : ModulePass(&ID) {} - - virtual bool runOnModule(Module &M) { - CallTargetFinder* CTF = &getAnalysis(); - - // Get references to functions that are needed in the module - Function* ams = M.getNamedFunction ("llva_assert_match_sig"); - if (!ams) - return false; - - IndirectFuncFail = M.getOrInsertFunction ("pchk_ind_fail", - Type::VoidTy, - PointerType::getUnqual(Type::Int8Ty), - NULL); - - std::set safecalls; - std::vector toDelete; - - for (Value::use_iterator ii = ams->use_begin(), ee = ams->use_end(); - ii != ee; ++ii) { - if (CallInst* CI = dyn_cast(*ii)) { - std::cerr << "Found safe call site in " - << CI->getParent()->getParent()->getName() << "\n"; - Value* V = CI->getOperand(1); - toDelete.push_back(CI); - do { - //V->dump(); - safecalls.insert(V); - if (CastInst* CV = dyn_cast(V)) - V = CV->getOperand(0); - else V = 0; - } while (V); - } - } - - for(std::set::iterator i = safecalls.begin(), e = safecalls.end(); - i != e; ++i) { - for (Value::use_iterator uii = (*i)->use_begin(), uie = (*i)->use_end(); - uii != uie; ++uii) { - CallSite cs = CallSite::get(*uii); - bool isSafeCall = cs.getInstruction() && - safecalls.find(cs.getCalledValue()) != safecalls.end(); - if (cs.getInstruction() && !cs.getCalledFunction() && - (isSafeCall || CTF->isComplete(cs))) { - std::vector Targets; - for (std::vector::iterator ii = CTF->begin(cs), ee = CTF->end(cs); - ii != ee; ++ii) - if (!isSafeCall || (*ii)->getType() == cs.getCalledValue()->getType()) - Targets.push_back(*ii); - - if (Targets.size() > 0) { - std::cerr << "Target count: " << Targets.size() << " in " << cs.getInstruction()->getParent()->getParent()->getName() << "\n"; - Function* NF = buildBounce(cs, Targets, M); - if (CallInst* ci = dyn_cast(cs.getInstruction())) { - ++CSConvert; - std::vector Par(ci->op_begin(), ci->op_end()); - CallInst* cn = CallInst::Create(NF, Par.begin(), Par.end(), - ci->getName() + ".dv", ci); - ci->replaceAllUsesWith(cn); - toDelete.push_back(ci); - } else if (InvokeInst* ci = dyn_cast(cs.getInstruction())) { - ++CSConvert; - std::vector Par(ci->op_begin(), ci->op_end()); - InvokeInst* cn = InvokeInst::Create(NF, ci->getNormalDest(), - ci->getUnwindDest(), - Par, ci->getName()+".dv", - ci); - ci->replaceAllUsesWith(cn); - toDelete.push_back(ci); - } - } else //Target size == 0 - std::cerr << "Call site found, but no Targets\n"; - } - } - } - - bool changed = false; - for (std::vector::iterator ii = toDelete.begin(), ee = toDelete.end(); - ii != ee; ++ii) { - changed = true; - (*ii)->eraseFromParent(); - } - return changed; - } - - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); - } - - }; - - RegisterPass X("devirt", "Devirtualization"); - -} - -#endif From stoklund at 2pi.dk Fri Aug 6 13:04:14 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Fri, 06 Aug 2010 18:04:14 -0000 Subject: [llvm-commits] [llvm] r110452 - /llvm/trunk/lib/CodeGen/MachineVerifier.cpp Message-ID: <20100806180414.DE7472A6C12D@llvm.org> Author: stoklund Date: Fri Aug 6 13:04:14 2010 New Revision: 110452 URL: http://llvm.org/viewvc/llvm-project?rev=110452&view=rev Log: Don't try to verify LiveIntervals for physical registers. When a physical register is in use, some alias of that register has a live interval with a relevant live range. That is the sad state of intervals after physreg coalescing of subregs, and it is good enough for correct register allocation. Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=110452&r1=110451&r2=110452&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Fri Aug 6 13:04:14 2010 @@ -630,8 +630,9 @@ else addRegWithSubRegs(regsDefined, Reg); - // Check LiveInts for a live range. - if (LiveInts && !LiveInts->isNotInMIMap(MI)) { + // Check LiveInts for a live range, but only for virtual registers. + if (LiveInts && TargetRegisterInfo::isVirtualRegister(Reg) && + !LiveInts->isNotInMIMap(MI)) { SlotIndex DefIdx = LiveInts->getInstructionIndex(MI).getDefIndex(); if (LiveInts->hasInterval(Reg)) { const LiveInterval &LI = LiveInts->getInterval(Reg); @@ -642,16 +643,11 @@ *OS << "Valno " << LR->valno->id << " is not defined at " << DefIdx << " in " << LI << '\n'; } - if (LR->start != DefIdx) { - report("Live range doesn't start at def", MO, MONum); - LR->print(*OS); - *OS << " should start at " << DefIdx << " in " << LI << '\n'; - } } else { report("No live range at def", MO, MONum); *OS << DefIdx << " is not live in " << LI << '\n'; } - } else if (TargetRegisterInfo::isVirtualRegister(Reg)) { + } else { report("Virtual register has no Live interval", MO, MONum); } } From stoklund at 2pi.dk Fri Aug 6 13:04:17 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Fri, 06 Aug 2010 18:04:17 -0000 Subject: [llvm-commits] [llvm] r110453 - /llvm/trunk/lib/CodeGen/SplitKit.cpp Message-ID: <20100806180417.493192A6C12C@llvm.org> Author: stoklund Date: Fri Aug 6 13:04:17 2010 New Revision: 110453 URL: http://llvm.org/viewvc/llvm-project?rev=110453&view=rev Log: Fix swapped COPY operands. Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=110453&r1=110452&r2=110453&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SplitKit.cpp (original) +++ llvm/trunk/lib/CodeGen/SplitKit.cpp Fri Aug 6 13:04:17 2010 @@ -458,8 +458,8 @@ // Insert the COPY instruction. MachineInstr *MI = BuildMI(MBB, MBB.begin(), DebugLoc(), - tii_.get(TargetOpcode::COPY), openli_->reg) - .addReg(dupli_->reg); + tii_.get(TargetOpcode::COPY), dupli_->reg) + .addReg(openli_->reg); SlotIndex Idx = lis_.InsertMachineInstrInMaps(MI).getDefIndex(); // Adjust dupli and openli values. From stoklund at 2pi.dk Fri Aug 6 13:04:19 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Fri, 06 Aug 2010 18:04:19 -0000 Subject: [llvm-commits] [llvm] r110454 - /llvm/trunk/lib/CodeGen/MachineVerifier.cpp Message-ID: <20100806180419.9A2D72A6C12E@llvm.org> Author: stoklund Date: Fri Aug 6 13:04:19 2010 New Revision: 110454 URL: http://llvm.org/viewvc/llvm-project?rev=110454&view=rev Log: Add more verification of LiveIntervals. Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=110454&r1=110453&r2=110454&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Fri Aug 6 13:04:19 2010 @@ -167,7 +167,7 @@ // Analysis information if available LiveVariables *LiveVars; - LiveIntervals *LiveInts; + const LiveIntervals *LiveInts; void visitMachineFunctionBefore(); void visitMachineBasicBlockBefore(const MachineBasicBlock *MBB); @@ -188,6 +188,7 @@ void calcRegsRequired(); void verifyLiveVariables(); + void verifyLiveIntervals(); }; struct MachineVerifierPass : public MachineFunctionPass { @@ -843,11 +844,13 @@ checkPHIOps(MFI); } - // Now check LiveVariables info if available - if (LiveVars) { + // Now check liveness info if available + if (LiveVars || LiveInts) calcRegsRequired(); + if (LiveVars) verifyLiveVariables(); - } + if (LiveInts) + verifyLiveIntervals(); } void MachineVerifier::verifyLiveVariables() { @@ -877,4 +880,55 @@ } } +void MachineVerifier::verifyLiveIntervals() { + assert(LiveInts && "Don't call verifyLiveIntervals without LiveInts"); + for (LiveIntervals::const_iterator LVI = LiveInts->begin(), + LVE = LiveInts->end(); LVI != LVE; ++LVI) { + const LiveInterval &LI = *LVI->second; + assert(LVI->first == LI.reg && "Invalid reg to interval mapping"); + + for (LiveInterval::const_vni_iterator I = LI.vni_begin(), E = LI.vni_end(); + I!=E; ++I) { + VNInfo *VNI = *I; + const LiveRange *DefLR = LI.getLiveRangeContaining(VNI->def); + + if (!DefLR) { + if (!VNI->isUnused()) { + report("Valno not live at def and not marked unused", MF); + *OS << "Valno #" << VNI->id << " in " << LI << '\n'; + } + continue; + } + + if (VNI->isUnused()) + continue; + + if (DefLR->valno != VNI) { + report("Live range at def has different valno", MF); + DefLR->print(*OS); + *OS << " should use valno #" << VNI->id << " in " << LI << '\n'; + } + + } + + for (LiveInterval::const_iterator I = LI.begin(), E = LI.end(); I!=E; ++I) { + const LiveRange &LR = *I; + assert(LR.valno && "Live range has no valno"); + + if (LR.valno->id >= LI.getNumValNums() || + LR.valno != LI.getValNumInfo(LR.valno->id)) { + report("Foreign valno in live range", MF); + LR.print(*OS); + *OS << " has a valno not in " << LI << '\n'; + } + + if (LR.valno->isUnused()) { + report("Live range valno is marked unused", MF); + LR.print(*OS); + *OS << " in " << LI << '\n'; + } + + } + } +} From gohman at apple.com Fri Aug 6 13:10:45 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 06 Aug 2010 18:10:45 -0000 Subject: [llvm-commits] [llvm] r110455 - /llvm/trunk/lib/Analysis/AliasAnalysis.cpp Message-ID: <20100806181045.5410F2A6C12C@llvm.org> Author: djg Date: Fri Aug 6 13:10:45 2010 New Revision: 110455 URL: http://llvm.org/viewvc/llvm-project?rev=110455&view=rev Log: Fix a comment. Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=110455&r1=110454&r2=110455&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Fri Aug 6 13:10:45 2010 @@ -210,8 +210,8 @@ AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo(const StoreInst *S, const Value *P, unsigned Size) { - // If the stored address cannot alias the pointer in question, then the - // pointer cannot be modified by the store. + // If the store address cannot alias the pointer in question, then the + // specified memory cannot be modified by the store. if (!alias(S->getOperand(1), getTypeStoreSize(S->getOperand(0)->getType()), P, Size)) return NoModRef; From gohman at apple.com Fri Aug 6 13:11:28 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 06 Aug 2010 18:11:28 -0000 Subject: [llvm-commits] [llvm] r110456 - /llvm/trunk/lib/Analysis/AliasAnalysis.cpp Message-ID: <20100806181128.5F3F02A6C12C@llvm.org> Author: djg Date: Fri Aug 6 13:11:28 2010 New Revision: 110456 URL: http://llvm.org/viewvc/llvm-project?rev=110456&view=rev Log: Be more conservative in the face of volatile. Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=110456&r1=110455&r2=110456&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Fri Aug 6 13:11:28 2010 @@ -195,31 +195,31 @@ AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo(const LoadInst *L, const Value *P, unsigned Size) { + // Be conservative in the face of volatile. + if (L->isVolatile()) + return ModRef; + // If the load address doesn't alias the given address, it doesn't read // or write the specified memory. if (!alias(L->getOperand(0), getTypeStoreSize(L->getType()), P, Size)) return NoModRef; - // Be conservative in the face of volatile. - if (L->isVolatile()) - return ModRef; - // Otherwise, a load just reads. return Ref; } AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo(const StoreInst *S, const Value *P, unsigned Size) { + // Be conservative in the face of volatile. + if (S->isVolatile()) + return ModRef; + // If the store address cannot alias the pointer in question, then the // specified memory cannot be modified by the store. if (!alias(S->getOperand(1), getTypeStoreSize(S->getOperand(0)->getType()), P, Size)) return NoModRef; - // Be conservative in the face of volatile. - if (S->isVolatile()) - return ModRef; - // If the pointer is a pointer to constant memory, then it could not have been // modified by this store. if (pointsToConstantMemory(P)) From grosbach at apple.com Fri Aug 6 13:24:36 2010 From: grosbach at apple.com (Jim Grosbach) Date: Fri, 06 Aug 2010 18:24:36 -0000 Subject: [llvm-commits] [llvm] r110457 - /llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Message-ID: <20100806182436.523C92A6C12C@llvm.org> Author: grosbach Date: Fri Aug 6 13:24:36 2010 New Revision: 110457 URL: http://llvm.org/viewvc/llvm-project?rev=110457&view=rev Log: spelling Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=110457&r1=110456&r2=110457&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Fri Aug 6 13:24:36 2010 @@ -671,7 +671,7 @@ } /// processFunctionBeforeFrameFinalized - This method is called immediately - /// before the specified functions frame layout (MF.getFrameInfo()) is + /// before the specified function's frame layout (MF.getFrameInfo()) is /// finalized. Once the frame is finalized, MO_FrameIndex operands are /// replaced with direct constants. This method is optional. /// From gohman at apple.com Fri Aug 6 13:24:38 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 06 Aug 2010 18:24:38 -0000 Subject: [llvm-commits] [llvm] r110458 - in /llvm/trunk: include/llvm/Analysis/AliasAnalysis.h lib/Analysis/AliasAnalysis.cpp test/Analysis/BasicAA/modref.ll Message-ID: <20100806182438.72F942A6C12D@llvm.org> Author: djg Date: Fri Aug 6 13:24:38 2010 New Revision: 110458 URL: http://llvm.org/viewvc/llvm-project?rev=110458&view=rev Log: Implement a proper getModRefInfo for va_arg. Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h llvm/trunk/lib/Analysis/AliasAnalysis.cpp llvm/trunk/test/Analysis/BasicAA/modref.ll Modified: llvm/trunk/include/llvm/Analysis/AliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasAnalysis.h?rev=110458&r1=110457&r2=110458&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasAnalysis.h Fri Aug 6 13:24:38 2010 @@ -243,6 +243,7 @@ /// Convenience functions... ModRefResult getModRefInfo(const LoadInst *L, const Value *P, unsigned Size); ModRefResult getModRefInfo(const StoreInst *S, const Value *P, unsigned Size); + ModRefResult getModRefInfo(const VAArgInst* I, const Value* P, unsigned Size); ModRefResult getModRefInfo(const CallInst *C, const Value *P, unsigned Size) { return getModRefInfo(ImmutableCallSite(C), P, Size); } @@ -250,10 +251,6 @@ const Value *P, unsigned Size) { return getModRefInfo(ImmutableCallSite(I), P, Size); } - ModRefResult getModRefInfo(const VAArgInst* I, - const Value* P, unsigned Size) { - return AliasAnalysis::ModRef; - } ModRefResult getModRefInfo(const Instruction *I, const Value *P, unsigned Size) { switch (I->getOpcode()) { Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=110458&r1=110457&r2=110458&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Fri Aug 6 13:24:38 2010 @@ -229,6 +229,23 @@ return Mod; } +AliasAnalysis::ModRefResult +AliasAnalysis::getModRefInfo(const VAArgInst *V, const Value *P, unsigned Size) { + // If the va_arg address cannot alias the pointer in question, then the + // specified memory cannot be accessed by the va_arg. + if (!alias(V->getOperand(0), UnknownSize, P, Size)) + return NoModRef; + + // If the pointer is a pointer to constant memory, then it could not have been + // modified by this va_arg. + if (pointsToConstantMemory(P)) + return NoModRef; + + // Otherwise, a va_arg reads and writes. + return ModRef; +} + + AliasAnalysis::ModRefBehavior AliasAnalysis::getIntrinsicModRefBehavior(unsigned iid) { #define GET_INTRINSIC_MODREF_BEHAVIOR Modified: llvm/trunk/test/Analysis/BasicAA/modref.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/modref.ll?rev=110458&r1=110457&r2=110458&view=diff ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/modref.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/modref.ll Fri Aug 6 13:24:38 2010 @@ -123,3 +123,14 @@ ; CHECK: sub i32 %tmp, %tmp } +define i8 @test6(i8* %p, i8* noalias %a) { + %x = load i8* %a + %t = va_arg i8* %p, float + %y = load i8* %a + %z = add i8 %x, %y + ret i8 %z +; CHECK: @test6 +; CHECK: load i8* %a +; CHECK-NOT: load +; CHECK: ret +} From stuart at apple.com Fri Aug 6 13:31:05 2010 From: stuart at apple.com (Stuart Hastings) Date: Fri, 06 Aug 2010 18:31:05 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r110459 - /llvm-gcc-4.2/trunk/gcc/cp/call.c Message-ID: <20100806183105.C39792A6C12C@llvm.org> Author: stuart Date: Fri Aug 6 13:31:05 2010 New Revision: 110459 URL: http://llvm.org/viewvc/llvm-project?rev=110459&view=rev Log: Fix ObjC++ implicit setter codegen. Radar 8264751. Patch by Fariborz Jahanian! Modified: llvm-gcc-4.2/trunk/gcc/cp/call.c Modified: llvm-gcc-4.2/trunk/gcc/cp/call.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/call.c?rev=110459&r1=110458&r2=110459&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/call.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/call.c Fri Aug 6 13:31:05 2010 @@ -4538,6 +4538,10 @@ /* Take the address of the thing to which we will bind the reference. */ + /* LLVM LOCAL begin 8264751 */ + if (objc_property_reference_expr(expr)) + expr = objc_build_property_getter_func_call(expr); + /* LLVM LOCAL end 8264751 */ expr = build_unary_op (ADDR_EXPR, expr, 1); if (expr == error_mark_node) return error_mark_node; From resistor at mac.com Fri Aug 6 13:33:49 2010 From: resistor at mac.com (Owen Anderson) Date: Fri, 06 Aug 2010 18:33:49 -0000 Subject: [llvm-commits] [llvm] r110460 - in /llvm/trunk: include/llvm/ include/llvm/Analysis/ include/llvm/CodeGen/ include/llvm/Target/ include/llvm/Transforms/ include/llvm/Transforms/IPO/ include/llvm/Transforms/Utils/ lib/Analysis/ lib/Analysis/IPA/ lib/Bitcode/Writer/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/CBackend/ lib/Target/CppBackend/ lib/Target/MBlaze/ lib/Target/MSIL/ lib/Target/MSP430/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PIC16... Message-ID: <20100806183351.D0FCB2A6C12C@llvm.org> Author: resistor Date: Fri Aug 6 13:33:48 2010 New Revision: 110460 URL: http://llvm.org/viewvc/llvm-project?rev=110460&view=rev Log: Reapply r110396, with fixes to appease the Linux buildbot gods. Modified: llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h llvm/trunk/include/llvm/Analysis/Dominators.h llvm/trunk/include/llvm/Analysis/FindUsedTypes.h llvm/trunk/include/llvm/Analysis/IntervalPartition.h llvm/trunk/include/llvm/Analysis/LazyValueInfo.h llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h llvm/trunk/include/llvm/Analysis/LoopInfo.h llvm/trunk/include/llvm/Analysis/LoopPass.h llvm/trunk/include/llvm/Analysis/Passes.h llvm/trunk/include/llvm/Analysis/PostDominators.h llvm/trunk/include/llvm/CallGraphSCCPass.h llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h llvm/trunk/include/llvm/CodeGen/LiveVariables.h llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h llvm/trunk/include/llvm/CodeGen/Passes.h llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h llvm/trunk/include/llvm/CodeGen/SlotIndexes.h llvm/trunk/include/llvm/Pass.h llvm/trunk/include/llvm/PassAnalysisSupport.h llvm/trunk/include/llvm/PassManagers.h llvm/trunk/include/llvm/PassRegistry.h llvm/trunk/include/llvm/PassSupport.h llvm/trunk/include/llvm/Target/TargetData.h llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h llvm/trunk/include/llvm/Transforms/Scalar.h llvm/trunk/include/llvm/Transforms/Utils/SSI.h llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp llvm/trunk/lib/Analysis/AliasDebugger.cpp llvm/trunk/lib/Analysis/AliasSetTracker.cpp llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/CFGPrinter.cpp llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp llvm/trunk/lib/Analysis/DomPrinter.cpp llvm/trunk/lib/Analysis/IPA/CallGraph.cpp llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp llvm/trunk/lib/Analysis/IVUsers.cpp llvm/trunk/lib/Analysis/InstCount.cpp llvm/trunk/lib/Analysis/IntervalPartition.cpp llvm/trunk/lib/Analysis/Lint.cpp llvm/trunk/lib/Analysis/LiveValues.cpp llvm/trunk/lib/Analysis/LoopPass.cpp llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp llvm/trunk/lib/Analysis/PointerTracking.cpp llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp llvm/trunk/lib/Analysis/ProfileInfo.cpp llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp llvm/trunk/lib/Analysis/RegionInfo.cpp llvm/trunk/lib/Analysis/RegionPrinter.cpp llvm/trunk/lib/Analysis/ScalarEvolution.cpp llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/BranchFolding.cpp llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp llvm/trunk/lib/CodeGen/ELFWriter.cpp llvm/trunk/lib/CodeGen/GCMetadata.cpp llvm/trunk/lib/CodeGen/GCStrategy.cpp llvm/trunk/lib/CodeGen/IfConversion.cpp llvm/trunk/lib/CodeGen/LowerSubregs.cpp llvm/trunk/lib/CodeGen/MachineCSE.cpp llvm/trunk/lib/CodeGen/MachineDominators.cpp llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp llvm/trunk/lib/CodeGen/MachineLICM.cpp llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp llvm/trunk/lib/CodeGen/MachineSink.cpp llvm/trunk/lib/CodeGen/MachineVerifier.cpp llvm/trunk/lib/CodeGen/OptimizeCmps.cpp llvm/trunk/lib/CodeGen/OptimizeExts.cpp llvm/trunk/lib/CodeGen/OptimizePHIs.cpp llvm/trunk/lib/CodeGen/PHIElimination.cpp llvm/trunk/lib/CodeGen/PHIElimination.h llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp llvm/trunk/lib/CodeGen/PrologEpilogInserter.h llvm/trunk/lib/CodeGen/RegAllocFast.cpp llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp llvm/trunk/lib/CodeGen/RenderMachineFunction.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp llvm/trunk/lib/CodeGen/Splitter.h llvm/trunk/lib/CodeGen/StackProtector.cpp llvm/trunk/lib/CodeGen/StackSlotColoring.cpp llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp llvm/trunk/lib/CodeGen/TailDuplication.cpp llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp llvm/trunk/lib/CodeGen/VirtRegMap.h llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp llvm/trunk/lib/Target/CBackend/CBackend.cpp llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp llvm/trunk/lib/Target/MSIL/MSILWriter.h llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp llvm/trunk/lib/Target/Sparc/FPMover.cpp llvm/trunk/lib/Target/TargetData.cpp llvm/trunk/lib/Target/X86/SSEDomainFix.cpp llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp llvm/trunk/lib/Transforms/Hello/Hello.cpp llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp llvm/trunk/lib/Transforms/IPO/Inliner.cpp llvm/trunk/lib/Transforms/IPO/Internalize.cpp llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp llvm/trunk/lib/Transforms/IPO/PruneEH.cpp llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp llvm/trunk/lib/Transforms/InstCombine/InstCombine.h llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp llvm/trunk/lib/Transforms/Scalar/ABCD.cpp llvm/trunk/lib/Transforms/Scalar/ADCE.cpp llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp llvm/trunk/lib/Transforms/Scalar/DCE.cpp llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp llvm/trunk/lib/Transforms/Scalar/GVN.cpp llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp llvm/trunk/lib/Transforms/Scalar/LICM.cpp llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp llvm/trunk/lib/Transforms/Scalar/SCCP.cpp llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp llvm/trunk/lib/Transforms/Scalar/Sink.cpp llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp llvm/trunk/lib/Transforms/Utils/LCSSA.cpp llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp llvm/trunk/lib/Transforms/Utils/SSI.cpp llvm/trunk/lib/VMCore/Pass.cpp llvm/trunk/lib/VMCore/PassManager.cpp llvm/trunk/lib/VMCore/PassRegistry.cpp llvm/trunk/lib/VMCore/PrintModulePass.cpp llvm/trunk/lib/VMCore/Verifier.cpp llvm/trunk/tools/bugpoint/ExtractFunction.cpp llvm/trunk/tools/bugpoint/TestPasses.cpp llvm/trunk/tools/bugpoint/bugpoint.cpp llvm/trunk/tools/llvm-prof/llvm-prof.cpp llvm/trunk/tools/opt/AnalysisWrappers.cpp llvm/trunk/tools/opt/GraphPrinters.cpp llvm/trunk/tools/opt/PrintSCC.cpp llvm/trunk/tools/opt/opt.cpp llvm/trunk/unittests/VMCore/PassManagerTest.cpp Modified: llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h (original) +++ llvm/trunk/include/llvm/Analysis/DOTGraphTraitsPass.h Fri Aug 6 13:33:48 2010 @@ -22,7 +22,7 @@ struct DOTGraphTraitsViewer : public FunctionPass { std::string Name; - DOTGraphTraitsViewer(std::string GraphName, const void *ID) : FunctionPass(ID) { + DOTGraphTraitsViewer(std::string GraphName, char &ID) : FunctionPass(ID) { Name = GraphName; } @@ -48,7 +48,7 @@ std::string Name; - DOTGraphTraitsPrinter(std::string GraphName, const void *ID) + DOTGraphTraitsPrinter(std::string GraphName, char &ID) : FunctionPass(ID) { Name = GraphName; } Modified: llvm/trunk/include/llvm/Analysis/Dominators.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/Dominators.h (original) +++ llvm/trunk/include/llvm/Analysis/Dominators.h Fri Aug 6 13:33:48 2010 @@ -702,7 +702,7 @@ static char ID; // Pass ID, replacement for typeid DominatorTreeBase* DT; - DominatorTree() : FunctionPass(&ID) { + DominatorTree() : FunctionPass(ID) { DT = new DominatorTreeBase(false); } @@ -890,7 +890,7 @@ const bool IsPostDominators; public: - DominanceFrontierBase(void *ID, bool isPostDom) + DominanceFrontierBase(char &ID, bool isPostDom) : FunctionPass(ID), IsPostDominators(isPostDom) {} /// getRoots - Return the root blocks of the current CFG. This may include @@ -1009,7 +1009,7 @@ public: static char ID; // Pass ID, replacement for typeid DominanceFrontier() : - DominanceFrontierBase(&ID, false) {} + DominanceFrontierBase(ID, false) {} BasicBlock *getRoot() const { assert(Roots.size() == 1 && "Should always have entry node!"); Modified: llvm/trunk/include/llvm/Analysis/FindUsedTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/FindUsedTypes.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/FindUsedTypes.h (original) +++ llvm/trunk/include/llvm/Analysis/FindUsedTypes.h Fri Aug 6 13:33:48 2010 @@ -26,7 +26,7 @@ std::set UsedTypes; public: static char ID; // Pass identification, replacement for typeid - FindUsedTypes() : ModulePass(&ID) {} + FindUsedTypes() : ModulePass(ID) {} /// getTypes - After the pass has been run, return the set containing all of /// the types used in the module. Modified: llvm/trunk/include/llvm/Analysis/IntervalPartition.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/IntervalPartition.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/IntervalPartition.h (original) +++ llvm/trunk/include/llvm/Analysis/IntervalPartition.h Fri Aug 6 13:33:48 2010 @@ -48,7 +48,7 @@ public: static char ID; // Pass identification, replacement for typeid - IntervalPartition() : FunctionPass(&ID), RootInterval(0) {} + IntervalPartition() : FunctionPass(ID), RootInterval(0) {} // run - Calculate the interval partition for this function virtual bool runOnFunction(Function &F); Modified: llvm/trunk/include/llvm/Analysis/LazyValueInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LazyValueInfo.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LazyValueInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LazyValueInfo.h Fri Aug 6 13:33:48 2010 @@ -31,7 +31,7 @@ void operator=(const LazyValueInfo&); // DO NOT IMPLEMENT. public: static char ID; - LazyValueInfo() : FunctionPass(&ID), PImpl(0) {} + LazyValueInfo() : FunctionPass(ID), PImpl(0) {} ~LazyValueInfo() { assert(PImpl == 0 && "releaseMemory not called"); } /// Tristate - This is used to return true/false/dunno results. Modified: llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/LibCallAliasAnalysis.h Fri Aug 6 13:33:48 2010 @@ -28,9 +28,9 @@ LibCallInfo *LCI; explicit LibCallAliasAnalysis(LibCallInfo *LC = 0) - : FunctionPass(&ID), LCI(LC) { + : FunctionPass(ID), LCI(LC) { } - explicit LibCallAliasAnalysis(const void *ID, LibCallInfo *LC) + explicit LibCallAliasAnalysis(char &ID, LibCallInfo *LC) : FunctionPass(ID), LCI(LC) { } ~LibCallAliasAnalysis(); @@ -55,8 +55,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(const void *PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h Fri Aug 6 13:33:48 2010 @@ -91,7 +91,7 @@ public: static char ID; // Class identification, replacement for typeinfo - LoopDependenceAnalysis() : LoopPass(&ID) {} + LoopDependenceAnalysis() : LoopPass(ID) {} /// isDependencePair - Check whether two values can possibly give rise to /// a data dependence: that is the case if both are instructions accessing Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Fri Aug 6 13:33:48 2010 @@ -940,7 +940,7 @@ public: static char ID; // Pass identification, replacement for typeid - LoopInfo() : FunctionPass(&ID) {} + LoopInfo() : FunctionPass(ID) {} LoopInfoBase& getBase() { return LI; } Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopPass.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopPass.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopPass.h Fri Aug 6 13:33:48 2010 @@ -28,8 +28,7 @@ class LoopPass : public Pass { public: - explicit LoopPass(intptr_t pid) : Pass(PT_Loop, pid) {} - explicit LoopPass(void *pid) : Pass(PT_Loop, pid) {} + explicit LoopPass(char &pid) : Pass(PT_Loop, pid) {} /// getPrinterPass - Get a pass to print the function corresponding /// to a Loop. Modified: llvm/trunk/include/llvm/Analysis/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Passes.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/Passes.h (original) +++ llvm/trunk/include/llvm/Analysis/Passes.h Fri Aug 6 13:33:48 2010 @@ -92,7 +92,7 @@ // file. // ModulePass *createProfileLoaderPass(); - extern const PassInfo *ProfileLoaderPassID; + extern char &ProfileLoaderPassID; //===--------------------------------------------------------------------===// // @@ -106,7 +106,7 @@ // instead of loading it from a previous run. // FunctionPass *createProfileEstimatorPass(); - extern const PassInfo *ProfileEstimatorPassID; + extern char &ProfileEstimatorPassID; //===--------------------------------------------------------------------===// // Modified: llvm/trunk/include/llvm/Analysis/PostDominators.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/PostDominators.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/PostDominators.h (original) +++ llvm/trunk/include/llvm/Analysis/PostDominators.h Fri Aug 6 13:33:48 2010 @@ -25,7 +25,7 @@ static char ID; // Pass identification, replacement for typeid DominatorTreeBase* DT; - PostDominatorTree() : FunctionPass(&ID) { + PostDominatorTree() : FunctionPass(ID) { DT = new DominatorTreeBase(true); } @@ -106,7 +106,7 @@ struct PostDominanceFrontier : public DominanceFrontierBase { static char ID; PostDominanceFrontier() - : DominanceFrontierBase(&ID, true) {} + : DominanceFrontierBase(ID, true) {} virtual bool runOnFunction(Function &) { Frontiers.clear(); Modified: llvm/trunk/include/llvm/CallGraphSCCPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CallGraphSCCPass.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/CallGraphSCCPass.h (original) +++ llvm/trunk/include/llvm/CallGraphSCCPass.h Fri Aug 6 13:33:48 2010 @@ -33,8 +33,7 @@ class CallGraphSCCPass : public Pass { public: - explicit CallGraphSCCPass(intptr_t pid) : Pass(PT_CallGraphSCC, pid) {} - explicit CallGraphSCCPass(void *pid) : Pass(PT_CallGraphSCC, pid) {} + explicit CallGraphSCCPass(char &pid) : Pass(PT_CallGraphSCC, pid) {} /// createPrinterPass - Get a pass that prints the Module /// corresponding to a CallGraph. Modified: llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h (original) +++ llvm/trunk/include/llvm/CodeGen/CalcSpillWeights.h Fri Aug 6 13:33:48 2010 @@ -23,7 +23,7 @@ public: static char ID; - CalculateSpillWeights() : MachineFunctionPass(&ID) {} + CalculateSpillWeights() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Fri Aug 6 13:33:48 2010 @@ -68,7 +68,7 @@ public: static char ID; // Pass identification, replacement for typeid - LiveIntervals() : MachineFunctionPass(&ID) {} + LiveIntervals() : MachineFunctionPass(ID) {} // Calculate the spill weight to assign to a single instruction. static float getSpillWeight(bool isDef, bool isUse, unsigned loopDepth); Modified: llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveStackAnalysis.h Fri Aug 6 13:33:48 2010 @@ -39,7 +39,7 @@ public: static char ID; // Pass identification, replacement for typeid - LiveStacks() : MachineFunctionPass(&ID) {} + LiveStacks() : MachineFunctionPass(ID) {} typedef SS2IntervalMap::iterator iterator; typedef SS2IntervalMap::const_iterator const_iterator; Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveVariables.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveVariables.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveVariables.h Fri Aug 6 13:33:48 2010 @@ -46,7 +46,7 @@ class LiveVariables : public MachineFunctionPass { public: static char ID; // Pass identification, replacement for typeid - LiveVariables() : MachineFunctionPass(&ID) {} + LiveVariables() : MachineFunctionPass(ID) {} /// VarInfo - This represents the regions where a virtual register is live in /// the program. We represent this with three different pieces of Modified: llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineFunctionPass.h Fri Aug 6 13:33:48 2010 @@ -31,8 +31,7 @@ /// override runOnMachineFunction. class MachineFunctionPass : public FunctionPass { protected: - explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {} - explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {} + explicit MachineFunctionPass(char &ID) : FunctionPass(ID) {} /// runOnMachineFunction - This method must be overloaded to perform the /// desired machine code transformation or analysis. Modified: llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h Fri Aug 6 13:33:48 2010 @@ -67,7 +67,7 @@ public: static char ID; // Pass identification, replacement for typeid - MachineLoopInfo() : MachineFunctionPass(&ID) {} + MachineLoopInfo() : MachineFunctionPass(ID) {} LoopInfoBase& getBase() { return LI; } Modified: llvm/trunk/include/llvm/CodeGen/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) +++ llvm/trunk/include/llvm/CodeGen/Passes.h Fri Aug 6 13:33:48 2010 @@ -43,18 +43,18 @@ /// MachineLoopInfo pass - This pass is a loop analysis pass. /// - extern const PassInfo *const MachineLoopInfoID; + extern char &MachineLoopInfoID; /// MachineDominators pass - This pass is a machine dominators analysis pass. /// - extern const PassInfo *const MachineDominatorsID; + extern char &MachineDominatorsID; /// PHIElimination pass - This pass eliminates machine instruction PHI nodes /// by inserting copy instructions. This destroys SSA information, but is the /// desired input for some register allocators. This pass is "required" by /// these register allocator like this: AU.addRequiredID(PHIEliminationID); /// - extern const PassInfo *const PHIEliminationID; + extern char &PHIEliminationID; /// StrongPHIElimination pass - This pass eliminates machine instruction PHI /// nodes by inserting copy instructions. This destroys SSA information, but @@ -62,23 +62,23 @@ /// "required" by these register allocator like this: /// AU.addRequiredID(PHIEliminationID); /// This pass is still in development - extern const PassInfo *const StrongPHIEliminationID; + extern char &StrongPHIEliminationID; - extern const PassInfo *const PreAllocSplittingID; + extern char &PreAllocSplittingID; /// SimpleRegisterCoalescing pass. Aggressively coalesces every register /// copy it can. /// - extern const PassInfo *const SimpleRegisterCoalescingID; + extern char &SimpleRegisterCoalescingID; /// TwoAddressInstruction pass - This pass reduces two-address instructions to /// use two operands. This destroys SSA information but it is desired by /// register allocators. - extern const PassInfo *const TwoAddressInstructionPassID; + extern char &TwoAddressInstructionPassID; /// UnreachableMachineBlockElimination pass - This pass removes unreachable /// machine basic blocks. - extern const PassInfo *const UnreachableMachineBlockElimID; + extern char &UnreachableMachineBlockElimID; /// DeadMachineInstructionElim pass - This pass removes dead machine /// instructions. Modified: llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h (original) +++ llvm/trunk/include/llvm/CodeGen/ProcessImplicitDefs.h Fri Aug 6 13:33:48 2010 @@ -31,7 +31,7 @@ public: static char ID; - ProcessImplicitDefs() : MachineFunctionPass(&ID) {} + ProcessImplicitDefs() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/include/llvm/CodeGen/SlotIndexes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SlotIndexes.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SlotIndexes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SlotIndexes.h Fri Aug 6 13:33:48 2010 @@ -475,7 +475,7 @@ public: static char ID; - SlotIndexes() : MachineFunctionPass(&ID), indexListHead(0) {} + SlotIndexes() : MachineFunctionPass(ID), indexListHead(0) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; virtual void releaseMemory(); Modified: llvm/trunk/include/llvm/Pass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Pass.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Pass.h (original) +++ llvm/trunk/include/llvm/Pass.h Fri Aug 6 13:33:48 2010 @@ -50,7 +50,7 @@ class StringRef; // AnalysisID - Use the PassInfo to identify a pass... -typedef const PassInfo* AnalysisID; +typedef const void* AnalysisID; /// Different types of internal pass managers. External pass managers /// (PassManager and FunctionPassManager) are not represented here. @@ -82,14 +82,13 @@ /// class Pass { AnalysisResolver *Resolver; // Used to resolve analysis - intptr_t PassID; + const void *PassID; PassKind Kind; void operator=(const Pass&); // DO NOT IMPLEMENT Pass(const Pass &); // DO NOT IMPLEMENT public: - explicit Pass(PassKind K, intptr_t pid); - explicit Pass(PassKind K, const void *pid); + explicit Pass(PassKind K, char &pid); virtual ~Pass(); @@ -101,10 +100,10 @@ /// virtual const char *getPassName() const; - /// getPassInfo - Return the PassInfo data structure that corresponds to this - /// pass... If the pass has not been registered, this will return null. - /// - const PassInfo *getPassInfo() const; + /// getPassID - Return the PassID number that corresponds to this pass. + virtual AnalysisID getPassID() const { + return PassID; + } /// print - Print out the internal state of the pass. This is called by /// Analyze to print out the contents of an analysis. Otherwise it is not @@ -159,7 +158,7 @@ /// an analysis interface through multiple inheritance. If needed, it should /// override this to adjust the this pointer as needed for the specified pass /// info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *); + virtual void *getAdjustedAnalysisPointer(AnalysisID ID); virtual ImmutablePass *getAsImmutablePass(); virtual PMDataManager *getAsPMDataManager(); @@ -170,14 +169,9 @@ // dumpPassStructure - Implement the -debug-passes=PassStructure option virtual void dumpPassStructure(unsigned Offset = 0); - template - static const PassInfo *getClassPassInfo() { - return lookupPassInfo(intptr_t(&AnalysisClass::ID)); - } - // lookupPassInfo - Return the pass info object for the specified pass class, // or null if it is not known. - static const PassInfo *lookupPassInfo(intptr_t TI); + static const PassInfo *lookupPassInfo(const void *TI); // lookupPassInfo - Return the pass info object for the pass with the given // argument string, or null if it is not known. @@ -200,7 +194,7 @@ /// don't have the class name available (use getAnalysisIfAvailable if you /// do), but it can tell you if you need to preserve the pass at least. /// - bool mustPreserveAnalysisID(const PassInfo *AnalysisID) const; + bool mustPreserveAnalysisID(char &AID) const; /// getAnalysis() - This function is used by subclasses to get /// to the analysis information that they claim to use by overriding the @@ -213,10 +207,10 @@ AnalysisType &getAnalysis(Function &F); // Defined in PassAnalysisSupport.h template - AnalysisType &getAnalysisID(const PassInfo *PI) const; + AnalysisType &getAnalysisID(AnalysisID PI) const; template - AnalysisType &getAnalysisID(const PassInfo *PI, Function &F); + AnalysisType &getAnalysisID(AnalysisID PI, Function &F); }; @@ -240,8 +234,7 @@ /// Return what kind of Pass Manager can manage this pass. virtual PassManagerType getPotentialPassManagerType() const; - explicit ModulePass(intptr_t pid) : Pass(PT_Module, pid) {} - explicit ModulePass(const void *pid) : Pass(PT_Module, pid) {} + explicit ModulePass(char &pid) : Pass(PT_Module, pid) {} // Force out-of-line virtual method. virtual ~ModulePass(); }; @@ -268,8 +261,7 @@ /// bool runOnModule(Module &) { return false; } - explicit ImmutablePass(intptr_t pid) : ModulePass(pid) {} - explicit ImmutablePass(const void *pid) + explicit ImmutablePass(char &pid) : ModulePass(pid) {} // Force out-of-line virtual method. @@ -287,8 +279,7 @@ /// class FunctionPass : public Pass { public: - explicit FunctionPass(intptr_t pid) : Pass(PT_Function, pid) {} - explicit FunctionPass(const void *pid) : Pass(PT_Function, pid) {} + explicit FunctionPass(char &pid) : Pass(PT_Function, pid) {} /// createPrinterPass - Get a function printer pass. Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const; @@ -340,8 +331,7 @@ /// class BasicBlockPass : public Pass { public: - explicit BasicBlockPass(intptr_t pid) : Pass(PT_BasicBlock, pid) {} - explicit BasicBlockPass(const void *pid) : Pass(PT_BasicBlock, pid) {} + explicit BasicBlockPass(char &pid) : Pass(PT_BasicBlock, pid) {} /// createPrinterPass - Get a function printer pass. Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const; Modified: llvm/trunk/include/llvm/PassAnalysisSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassAnalysisSupport.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassAnalysisSupport.h (original) +++ llvm/trunk/include/llvm/PassAnalysisSupport.h Fri Aug 6 13:33:48 2010 @@ -49,34 +49,37 @@ // addRequired - Add the specified ID to the required set of the usage info // for a pass. // - AnalysisUsage &addRequiredID(AnalysisID ID); + AnalysisUsage &addRequiredID(const void *ID); + AnalysisUsage &addRequiredID(char &ID); template AnalysisUsage &addRequired() { - return addRequiredID(Pass::getClassPassInfo()); + return addRequiredID(PassClass::ID); } - AnalysisUsage &addRequiredTransitiveID(AnalysisID ID); + AnalysisUsage &addRequiredTransitiveID(char &ID); template AnalysisUsage &addRequiredTransitive() { - AnalysisID ID = Pass::getClassPassInfo(); - return addRequiredTransitiveID(ID); + return addRequiredTransitiveID(PassClass::ID); } // addPreserved - Add the specified ID to the set of analyses preserved by // this pass // - AnalysisUsage &addPreservedID(AnalysisID ID) { + AnalysisUsage &addPreservedID(const void *ID) { Preserved.push_back(ID); return *this; } + AnalysisUsage &addPreservedID(char &ID) { + Preserved.push_back(&ID); + return *this; + } // addPreserved - Add the specified Pass class to the set of analyses // preserved by this pass. // template AnalysisUsage &addPreserved() { - assert(Pass::getClassPassInfo() && "Pass class not registered!"); - Preserved.push_back(Pass::getClassPassInfo()); + Preserved.push_back(&PassClass::ID); return *this; } @@ -85,12 +88,7 @@ // This can be useful when a pass is trivially preserved, but may not be // linked in. Be careful about spelling! // - AnalysisUsage &addPreserved(StringRef Arg) { - const PassInfo *PI = Pass::lookupPassInfo(Arg); - // If the pass exists, preserve it. Otherwise silently do nothing. - if (PI) Preserved.push_back(PI); - return *this; - } + AnalysisUsage &addPreserved(StringRef Arg); // setPreservesAll - Set by analyses that do not transform their input at all void setPreservesAll() { PreservesAll = true; } @@ -130,7 +128,7 @@ inline PMDataManager &getPMDataManager() { return PM; } // Find pass that is implementing PI. - Pass *findImplPass(const PassInfo *PI) { + Pass *findImplPass(AnalysisID PI) { Pass *ResultPass = 0; for (unsigned i = 0; i < AnalysisImpls.size() ; ++i) { if (AnalysisImpls[i].first == PI) { @@ -142,10 +140,10 @@ } // Find pass that is implementing PI. Initialize pass for Function F. - Pass *findImplPass(Pass *P, const PassInfo *PI, Function &F); + Pass *findImplPass(Pass *P, AnalysisID PI, Function &F); - void addAnalysisImplsPair(const PassInfo *PI, Pass *P) { - std::pair pir = std::make_pair(PI,P); + void addAnalysisImplsPair(AnalysisID PI, Pass *P) { + std::pair pir = std::make_pair(PI,P); AnalysisImpls.push_back(pir); } @@ -160,7 +158,7 @@ // AnalysisImpls - This keeps track of which passes implements the interfaces // that are required by the current pass (to implement getAnalysis()). - std::vector > AnalysisImpls; + std::vector > AnalysisImpls; private: // PassManager that is used to resolve analysis info @@ -179,8 +177,7 @@ AnalysisType *Pass::getAnalysisIfAvailable() const { assert(Resolver && "Pass not resident in a PassManager object!"); - const PassInfo *PI = getClassPassInfo(); - if (PI == 0) return 0; + const void *PI = &AnalysisType::ID; Pass *ResultPass = Resolver->getAnalysisIfAvailable(PI, true); if (ResultPass == 0) return 0; @@ -199,11 +196,11 @@ template AnalysisType &Pass::getAnalysis() const { assert(Resolver && "Pass has not been inserted into a PassManager object!"); - return getAnalysisID(getClassPassInfo()); + return getAnalysisID(&AnalysisType::ID); } template -AnalysisType &Pass::getAnalysisID(const PassInfo *PI) const { +AnalysisType &Pass::getAnalysisID(AnalysisID PI) const { assert(PI && "getAnalysis for unregistered pass!"); assert(Resolver&&"Pass has not been inserted into a PassManager object!"); // PI *must* appear in AnalysisImpls. Because the number of passes used @@ -229,11 +226,11 @@ AnalysisType &Pass::getAnalysis(Function &F) { assert(Resolver &&"Pass has not been inserted into a PassManager object!"); - return getAnalysisID(getClassPassInfo(), F); + return getAnalysisID(&AnalysisType::ID, F); } template -AnalysisType &Pass::getAnalysisID(const PassInfo *PI, Function &F) { +AnalysisType &Pass::getAnalysisID(AnalysisID PI, Function &F) { assert(PI && "getAnalysis for unregistered pass!"); assert(Resolver && "Pass has not been inserted into a PassManager object!"); // PI *must* appear in AnalysisImpls. Because the number of passes used Modified: llvm/trunk/include/llvm/PassManagers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassManagers.h (original) +++ llvm/trunk/include/llvm/PassManagers.h Fri Aug 6 13:33:48 2010 @@ -302,7 +302,7 @@ /// through getAnalysis interface. virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass); - virtual Pass *getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F); + virtual Pass *getOnTheFlyPass(Pass *P, AnalysisID PI, Function &F); /// Initialize available analysis information. void initializeAnalysisInfo() { @@ -414,7 +414,7 @@ public: static char ID; explicit FPPassManager(int Depth) - : ModulePass(&ID), PMDataManager(Depth) { } + : ModulePass(ID), PMDataManager(Depth) { } /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. Modified: llvm/trunk/include/llvm/PassRegistry.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassRegistry.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassRegistry.h (original) +++ llvm/trunk/include/llvm/PassRegistry.h Fri Aug 6 13:33:48 2010 @@ -34,7 +34,7 @@ mutable sys::SmartMutex Lock; /// PassInfoMap - Keep track of the PassInfo object for each registered pass. - typedef std::map MapType; + typedef std::map MapType; MapType PassInfoMap; typedef StringMap StringMapType; @@ -51,14 +51,14 @@ public: static PassRegistry *getPassRegistry(); - const PassInfo *getPassInfo(intptr_t TI) const; + const PassInfo *getPassInfo(const void *TI) const; const PassInfo *getPassInfo(StringRef Arg) const; void registerPass(const PassInfo &PI); void unregisterPass(const PassInfo &PI); /// Analysis Group Mechanisms. - void registerAnalysisGroup(intptr_t InterfaceID, intptr_t PassID, + void registerAnalysisGroup(const void *InterfaceID, const void *PassID, PassInfo& Registeree, bool isDefault); void enumerateWith(PassRegistrationListener *L); Modified: llvm/trunk/include/llvm/PassSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassSupport.h (original) +++ llvm/trunk/include/llvm/PassSupport.h Fri Aug 6 13:33:48 2010 @@ -41,7 +41,7 @@ private: const char *const PassName; // Nice name for Pass const char *const PassArgument; // Command Line argument to run this pass - const intptr_t PassID; + const void *PassID; const bool IsCFGOnlyPass; // Pass only looks at the CFG. const bool IsAnalysis; // True if an analysis pass. const bool IsAnalysisGroup; // True if an analysis group. @@ -52,7 +52,7 @@ public: /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. - PassInfo(const char *name, const char *arg, intptr_t pi, + PassInfo(const char *name, const char *arg, const void *pi, NormalCtor_t normal = 0, bool isCFGOnly = false, bool is_analysis = false) : PassName(name), PassArgument(arg), PassID(pi), @@ -63,7 +63,7 @@ /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. This version is for use by analysis groups; it /// does not auto-register the pass. - PassInfo(const char *name, intptr_t pi) + PassInfo(const char *name, const void *pi) : PassName(name), PassArgument(""), PassID(pi), IsCFGOnlyPass(false), IsAnalysis(false), IsAnalysisGroup(true), NormalCtor(0) { @@ -81,11 +81,11 @@ /// getTypeInfo - Return the id object for the pass... /// TODO : Rename - intptr_t getTypeInfo() const { return PassID; } + const void *getTypeInfo() const { return PassID; } /// Return true if this PassID implements the specified ID pointer. - bool isPassID(void *IDPtr) const { - return PassID == (intptr_t)IDPtr; + bool isPassID(const void *IDPtr) const { + return PassID == IDPtr; } /// isAnalysisGroup - Return true if this is an analysis group, not a normal @@ -161,7 +161,7 @@ // Register Pass using default constructor... RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false, bool is_analysis = false) - : PassInfo(Name, PassArg, intptr_t(&passName::ID), + : PassInfo(Name, PassArg, &passName::ID, PassInfo::NormalCtor_t(callDefaultCtor), CFGOnly, is_analysis) { @@ -191,8 +191,8 @@ class RegisterAGBase : public PassInfo { protected: RegisterAGBase(const char *Name, - intptr_t InterfaceID, - intptr_t PassID = 0, + const void *InterfaceID, + const void *PassID = 0, bool isDefault = false); }; @@ -200,12 +200,12 @@ struct RegisterAnalysisGroup : public RegisterAGBase { explicit RegisterAnalysisGroup(PassInfo &RPB) : RegisterAGBase(RPB.getPassName(), - intptr_t(&Interface::ID), RPB.getTypeInfo(), + &Interface::ID, RPB.getTypeInfo(), Default) { } explicit RegisterAnalysisGroup(const char *Name) - : RegisterAGBase(Name, intptr_t(&Interface::ID)) { + : RegisterAGBase(Name, &Interface::ID) { } }; Modified: llvm/trunk/include/llvm/Target/TargetData.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetData.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetData.h (original) +++ llvm/trunk/include/llvm/Target/TargetData.h Fri Aug 6 13:33:48 2010 @@ -110,7 +110,7 @@ /// Constructs a TargetData from a specification string. See init(). explicit TargetData(StringRef TargetDescription) - : ImmutablePass(&ID) { + : ImmutablePass(ID) { init(TargetDescription); } @@ -118,7 +118,7 @@ explicit TargetData(const Module *M); TargetData(const TargetData &TD) : - ImmutablePass(&ID), + ImmutablePass(ID), LittleEndian(TD.isLittleEndian()), PointerMemSize(TD.PointerMemSize), PointerABIAlign(TD.PointerABIAlign), Modified: llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h (original) +++ llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h Fri Aug 6 13:33:48 2010 @@ -30,8 +30,8 @@ /// perform the inlining operations that do not depend on the policy. /// struct Inliner : public CallGraphSCCPass { - explicit Inliner(void *ID); - explicit Inliner(void *ID, int Threshold); + explicit Inliner(char &ID); + explicit Inliner(char &ID, int Threshold); /// getAnalysisUsage - For this class, we declare that we require and preserve /// the call graph. If the derived class implements this method, it should Modified: llvm/trunk/include/llvm/Transforms/Scalar.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Scalar.h (original) +++ llvm/trunk/include/llvm/Transforms/Scalar.h Fri Aug 6 13:33:48 2010 @@ -149,7 +149,7 @@ // ret i32 %Y // FunctionPass *createPromoteMemoryToRegisterPass(); -extern const PassInfo *const PromoteMemoryToRegisterID; +extern char &PromoteMemoryToRegisterID; //===----------------------------------------------------------------------===// // @@ -158,7 +158,7 @@ // hacking easier. // FunctionPass *createDemoteRegisterToMemoryPass(); -extern const PassInfo *const DemoteRegisterToMemoryID; +extern char &DemoteRegisterToMemoryID; //===----------------------------------------------------------------------===// // @@ -202,7 +202,7 @@ // (set, immediate dominators, tree, and frontier) information. // FunctionPass *createBreakCriticalEdgesPass(); -extern const PassInfo *const BreakCriticalEdgesID; +extern char &BreakCriticalEdgesID; //===----------------------------------------------------------------------===// // @@ -213,7 +213,7 @@ // AU.addRequiredID(LoopSimplifyID); // Pass *createLoopSimplifyPass(); -extern const PassInfo *const LoopSimplifyID; +extern char &LoopSimplifyID; //===----------------------------------------------------------------------===// // @@ -228,7 +228,7 @@ // chained binary branch instructions. // FunctionPass *createLowerSwitchPass(); -extern const PassInfo *const LowerSwitchID; +extern char &LowerSwitchID; //===----------------------------------------------------------------------===// // @@ -243,7 +243,7 @@ FunctionPass *createLowerInvokePass(const TargetLowering *TLI = 0); FunctionPass *createLowerInvokePass(const TargetLowering *TLI, bool useExpensiveEHSupport); -extern const PassInfo *const LowerInvokePassID; +extern char &LowerInvokePassID; //===----------------------------------------------------------------------===// // @@ -258,7 +258,7 @@ // optimizations. // Pass *createLCSSAPass(); -extern const PassInfo *const LCSSAID; +extern char &LCSSAID; //===----------------------------------------------------------------------===// // @@ -304,7 +304,7 @@ // InstructionNamer - Give any unnamed non-void instructions "tmp" names. // FunctionPass *createInstructionNamerPass(); -extern const PassInfo *const InstructionNamerID; +extern char &InstructionNamerID; //===----------------------------------------------------------------------===// // Modified: llvm/trunk/include/llvm/Transforms/Utils/SSI.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/SSI.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/SSI.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/SSI.h Fri Aug 6 13:33:48 2010 @@ -39,7 +39,7 @@ public: static char ID; // Pass identification, replacement for typeid. SSI() : - FunctionPass(&ID) { + FunctionPass(ID) { } void getAnalysisUsage(AnalysisUsage &AU) const; Modified: llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h Fri Aug 6 13:33:48 2010 @@ -26,7 +26,7 @@ BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock; public: static char ID; // Pass identification, replacement for typeid - UnifyFunctionExitNodes() : FunctionPass(&ID), + UnifyFunctionExitNodes() : FunctionPass(ID), ReturnBlock(0), UnwindBlock(0) {} // We can preserve non-critical-edgeness when we unify function exit nodes Modified: llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp Fri Aug 6 13:33:48 2010 @@ -34,7 +34,7 @@ Module *M; public: static char ID; // Class identification, replacement for typeinfo - AliasAnalysisCounter() : ModulePass(&ID) { + AliasAnalysisCounter() : ModulePass(ID) { No = May = Must = 0; NoMR = JustRef = JustMod = MR = 0; } @@ -87,8 +87,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original) +++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Fri Aug 6 13:33:48 2010 @@ -50,7 +50,7 @@ public: static char ID; // Pass identification, replacement for typeid - AAEval() : FunctionPass(&ID) {} + AAEval() : FunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Analysis/AliasDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasDebugger.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasDebugger.cpp (original) +++ llvm/trunk/lib/Analysis/AliasDebugger.cpp Fri Aug 6 13:33:48 2010 @@ -39,7 +39,7 @@ public: static char ID; // Class identification, replacement for typeinfo - AliasDebugger() : ModulePass(&ID) {} + AliasDebugger() : ModulePass(ID) {} bool runOnModule(Module &M) { InitializeAliasAnalysis(this); // set up super class @@ -83,8 +83,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original) +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Fri Aug 6 13:33:48 2010 @@ -579,7 +579,7 @@ AliasSetTracker *Tracker; public: static char ID; // Pass identification, replacement for typeid - AliasSetPrinter() : FunctionPass(&ID) {} + AliasSetPrinter() : FunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Fri Aug 6 13:33:48 2010 @@ -137,8 +137,8 @@ /// struct NoAA : public ImmutablePass, public AliasAnalysis { static char ID; // Class identification, replacement for typeinfo - NoAA() : ImmutablePass(&ID) {} - explicit NoAA(void *PID) : ImmutablePass(PID) { } + NoAA() : ImmutablePass(ID) {} + explicit NoAA(char &PID) : ImmutablePass(PID) { } virtual void getAnalysisUsage(AnalysisUsage &AU) const { } @@ -176,8 +176,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(const void *ID) { + if (ID == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } @@ -222,7 +222,7 @@ /// derives from the NoAA class. struct BasicAliasAnalysis : public NoAA { static char ID; // Class identification, replacement for typeinfo - BasicAliasAnalysis() : NoAA(&ID) {} + BasicAliasAnalysis() : NoAA(ID) {} virtual AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size) { @@ -259,8 +259,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(const void *ID) { + if (ID == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/CFGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFGPrinter.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/CFGPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/CFGPrinter.cpp Fri Aug 6 13:33:48 2010 @@ -25,7 +25,7 @@ namespace { struct CFGViewer : public FunctionPass { static char ID; // Pass identifcation, replacement for typeid - CFGViewer() : FunctionPass(&ID) {} + CFGViewer() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { F.viewCFG(); @@ -46,7 +46,7 @@ namespace { struct CFGOnlyViewer : public FunctionPass { static char ID; // Pass identifcation, replacement for typeid - CFGOnlyViewer() : FunctionPass(&ID) {} + CFGOnlyViewer() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { F.viewCFGOnly(); @@ -68,8 +68,8 @@ namespace { struct CFGPrinter : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGPrinter() : FunctionPass(&ID) {} - explicit CFGPrinter(void *pid) : FunctionPass(pid) {} + CFGPrinter() : FunctionPass(ID) {} + explicit CFGPrinter(char &pid) : FunctionPass(pid) {} virtual bool runOnFunction(Function &F) { std::string Filename = "cfg." + F.getNameStr() + ".dot"; @@ -101,8 +101,8 @@ namespace { struct CFGOnlyPrinter : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGOnlyPrinter() : FunctionPass(&ID) {} - explicit CFGOnlyPrinter(void *pid) : FunctionPass(pid) {} + CFGOnlyPrinter() : FunctionPass(ID) {} + explicit CFGOnlyPrinter(char &pid) : FunctionPass(pid) {} virtual bool runOnFunction(Function &F) { std::string Filename = "cfg." + F.getNameStr() + ".dot"; errs() << "Writing '" << Filename << "'..."; Modified: llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/DbgInfoPrinter.cpp Fri Aug 6 13:33:48 2010 @@ -40,7 +40,7 @@ void printVariableDeclaration(const Value *V); public: static char ID; // Pass identification - PrintDbgInfo() : FunctionPass(&ID), Out(outs()) {} + PrintDbgInfo() : FunctionPass(ID), Out(outs()) {} virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/lib/Analysis/DomPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DomPrinter.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DomPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/DomPrinter.cpp Fri Aug 6 13:33:48 2010 @@ -86,27 +86,27 @@ struct DomViewer : public DOTGraphTraitsViewer { static char ID; - DomViewer() : DOTGraphTraitsViewer("dom", &ID){} + DomViewer() : DOTGraphTraitsViewer("dom", ID){} }; struct DomOnlyViewer : public DOTGraphTraitsViewer { static char ID; - DomOnlyViewer() : DOTGraphTraitsViewer("domonly", &ID){} + DomOnlyViewer() : DOTGraphTraitsViewer("domonly", ID){} }; struct PostDomViewer : public DOTGraphTraitsViewer { static char ID; PostDomViewer() : - DOTGraphTraitsViewer("postdom", &ID){} + DOTGraphTraitsViewer("postdom", ID){} }; struct PostDomOnlyViewer : public DOTGraphTraitsViewer { static char ID; PostDomOnlyViewer() : - DOTGraphTraitsViewer("postdomonly", &ID){} + DOTGraphTraitsViewer("postdomonly", ID){} }; } // end anonymous namespace @@ -133,27 +133,27 @@ struct DomPrinter : public DOTGraphTraitsPrinter { static char ID; - DomPrinter() : DOTGraphTraitsPrinter("dom", &ID) {} + DomPrinter() : DOTGraphTraitsPrinter("dom", ID) {} }; struct DomOnlyPrinter : public DOTGraphTraitsPrinter { static char ID; - DomOnlyPrinter() : DOTGraphTraitsPrinter("domonly", &ID) {} + DomOnlyPrinter() : DOTGraphTraitsPrinter("domonly", ID) {} }; struct PostDomPrinter : public DOTGraphTraitsPrinter { static char ID; PostDomPrinter() : - DOTGraphTraitsPrinter("postdom", &ID) {} + DOTGraphTraitsPrinter("postdom", ID) {} }; struct PostDomOnlyPrinter : public DOTGraphTraitsPrinter { static char ID; PostDomOnlyPrinter() : - DOTGraphTraitsPrinter("postdomonly", &ID) {} + DOTGraphTraitsPrinter("postdomonly", ID) {} }; } // end anonymous namespace Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Fri Aug 6 13:33:48 2010 @@ -42,7 +42,7 @@ public: static char ID; // Class identification, replacement for typeinfo - BasicCallGraph() : ModulePass(&ID), Root(0), + BasicCallGraph() : ModulePass(ID), Root(0), ExternalCallingNode(0), CallsExternalNode(0) {} // runOnModule - Compute the call graph for the specified module. @@ -86,8 +86,8 @@ /// an analysis interface through multiple inheritance. If needed, it should /// override this to adjust the this pointer as needed for the specified pass /// info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&CallGraph::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &CallGraph::ID) return (CallGraph*)this; return this; } Modified: llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp Fri Aug 6 13:33:48 2010 @@ -45,7 +45,7 @@ public: static char ID; explicit CGPassManager(int Depth) - : ModulePass(&ID), PMDataManager(Depth) { } + : ModulePass(ID), PMDataManager(Depth) { } /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. @@ -582,9 +582,9 @@ public: static char ID; - PrintCallGraphPass() : CallGraphSCCPass(&ID), Out(dbgs()) {} + PrintCallGraphPass() : CallGraphSCCPass(ID), Out(dbgs()) {} PrintCallGraphPass(const std::string &B, raw_ostream &o) - : CallGraphSCCPass(&ID), Banner(B), Out(o) {} + : CallGraphSCCPass(ID), Banner(B), Out(o) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp Fri Aug 6 13:33:48 2010 @@ -88,7 +88,7 @@ public: static char ID; - GlobalsModRef() : ModulePass(&ID) {} + GlobalsModRef() : ModulePass(ID) {} bool runOnModule(Module &M) { InitializeAliasAnalysis(this); // set up super class @@ -150,8 +150,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/IVUsers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IVUsers.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IVUsers.cpp (original) +++ llvm/trunk/lib/Analysis/IVUsers.cpp Fri Aug 6 13:33:48 2010 @@ -140,7 +140,7 @@ } IVUsers::IVUsers() - : LoopPass(&ID) { + : LoopPass(ID) { } void IVUsers::getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/lib/Analysis/InstCount.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstCount.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/InstCount.cpp (original) +++ llvm/trunk/lib/Analysis/InstCount.cpp Fri Aug 6 13:33:48 2010 @@ -51,7 +51,7 @@ } public: static char ID; // Pass identification, replacement for typeid - InstCount() : FunctionPass(&ID) {} + InstCount() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Analysis/IntervalPartition.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IntervalPartition.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IntervalPartition.cpp (original) +++ llvm/trunk/lib/Analysis/IntervalPartition.cpp Fri Aug 6 13:33:48 2010 @@ -91,7 +91,7 @@ // distinguish it from a copy constructor. Always pass in false for now. // IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) - : FunctionPass(&ID) { + : FunctionPass(ID) { assert(IP.getRootInterval() && "Cannot operate on empty IntervalPartitions!"); // Pass false to intervals_begin because we take ownership of it's memory Modified: llvm/trunk/lib/Analysis/Lint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Lint.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/Lint.cpp (original) +++ llvm/trunk/lib/Analysis/Lint.cpp Fri Aug 6 13:33:48 2010 @@ -108,7 +108,7 @@ raw_string_ostream MessagesStr; static char ID; // Pass identification, replacement for typeid - Lint() : FunctionPass(&ID), MessagesStr(Messages) {} + Lint() : FunctionPass(ID), MessagesStr(Messages) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Analysis/LiveValues.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LiveValues.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LiveValues.cpp (original) +++ llvm/trunk/lib/Analysis/LiveValues.cpp Fri Aug 6 13:33:48 2010 @@ -25,7 +25,7 @@ INITIALIZE_PASS(LiveValues, "live-values", "Value Liveness Analysis", false, true); -LiveValues::LiveValues() : FunctionPass(&ID) {} +LiveValues::LiveValues() : FunctionPass(ID) {} void LiveValues::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Analysis/LoopPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopPass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LoopPass.cpp (original) +++ llvm/trunk/lib/Analysis/LoopPass.cpp Fri Aug 6 13:33:48 2010 @@ -30,9 +30,9 @@ public: static char ID; - PrintLoopPass() : LoopPass(&ID), Out(dbgs()) {} + PrintLoopPass() : LoopPass(ID), Out(dbgs()) {} PrintLoopPass(const std::string &B, raw_ostream &o) - : LoopPass(&ID), Banner(B), Out(o) {} + : LoopPass(ID), Banner(B), Out(o) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -59,7 +59,7 @@ char LPPassManager::ID = 0; LPPassManager::LPPassManager(int Depth) - : FunctionPass(&ID), PMDataManager(Depth) { + : FunctionPass(ID), PMDataManager(Depth) { skipThisLoop = false; redoThisLoop = false; LI = NULL; Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Fri Aug 6 13:33:48 2010 @@ -50,7 +50,7 @@ "Memory Dependence Analysis", false, true); MemoryDependenceAnalysis::MemoryDependenceAnalysis() -: FunctionPass(&ID), PredCache(0) { +: FunctionPass(ID), PredCache(0) { } MemoryDependenceAnalysis::~MemoryDependenceAnalysis() { } Modified: llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/ModuleDebugInfoPrinter.cpp Fri Aug 6 13:33:48 2010 @@ -30,7 +30,7 @@ DebugInfoFinder Finder; public: static char ID; // Pass identification, replacement for typeid - ModuleDebugInfoPrinter() : ModulePass(&ID) {} + ModuleDebugInfoPrinter() : ModulePass(ID) {} virtual bool runOnModule(Module &M); Modified: llvm/trunk/lib/Analysis/PointerTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/PointerTracking.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/PointerTracking.cpp (original) +++ llvm/trunk/lib/Analysis/PointerTracking.cpp Fri Aug 6 13:33:48 2010 @@ -28,7 +28,7 @@ using namespace llvm; char PointerTracking::ID = 0; -PointerTracking::PointerTracking() : FunctionPass(&ID) {} +PointerTracking::PointerTracking() : FunctionPass(ID) {} bool PointerTracking::runOnFunction(Function &F) { predCache.clear(); Modified: llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileEstimatorPass.cpp Fri Aug 6 13:33:48 2010 @@ -39,7 +39,7 @@ public: static char ID; // Class identification, replacement for typeinfo explicit ProfileEstimatorPass(const double execcount = 0) - : FunctionPass(&ID), ExecCount(execcount) { + : FunctionPass(ID), ExecCount(execcount) { if (execcount == 0) ExecCount = LoopWeight; } @@ -59,8 +59,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&ProfileInfo::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &ProfileInfo::ID) return (ProfileInfo*)this; return this; } @@ -78,7 +78,7 @@ static RegisterAnalysisGroup Y(X); namespace llvm { - const PassInfo *ProfileEstimatorPassID = &X; + char &ProfileEstimatorPassID = ProfileEstimatorPass::ID; FunctionPass *createProfileEstimatorPass() { return new ProfileEstimatorPass(); Modified: llvm/trunk/lib/Analysis/ProfileInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfo.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileInfo.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileInfo.cpp Fri Aug 6 13:33:48 2010 @@ -1076,14 +1076,14 @@ namespace { struct NoProfileInfo : public ImmutablePass, public ProfileInfo { static char ID; // Class identification, replacement for typeinfo - NoProfileInfo() : ImmutablePass(&ID) {} + NoProfileInfo() : ImmutablePass(ID) {} /// getAdjustedAnalysisPointer - This method is used when a pass implements /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&ProfileInfo::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &ProfileInfo::ID) return (ProfileInfo*)this; return this; } Modified: llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp Fri Aug 6 13:33:48 2010 @@ -45,7 +45,7 @@ public: static char ID; // Class identification, replacement for typeinfo explicit LoaderPass(const std::string &filename = "") - : ModulePass(&ID), Filename(filename) { + : ModulePass(ID), Filename(filename) { if (filename.empty()) Filename = ProfileInfoFilename; } @@ -67,8 +67,8 @@ /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&ProfileInfo::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &ProfileInfo::ID) return (ProfileInfo*)this; return this; } @@ -84,7 +84,7 @@ static RegisterAnalysisGroup Y(X); -const PassInfo *llvm::ProfileLoaderPassID = &X; +char &llvm::ProfileLoaderPassID = LoaderPass::ID; ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); } Modified: llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp (original) +++ llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp Fri Aug 6 13:33:48 2010 @@ -59,10 +59,10 @@ public: static char ID; // Class identification, replacement for typeinfo - explicit ProfileVerifierPassT () : FunctionPass(&ID) { + explicit ProfileVerifierPassT () : FunctionPass(ID) { DisableAssertions = ProfileVerifierDisableAssertions; } - explicit ProfileVerifierPassT (bool da) : FunctionPass(&ID), + explicit ProfileVerifierPassT (bool da) : FunctionPass(ID), DisableAssertions(da) { } Modified: llvm/trunk/lib/Analysis/RegionInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionInfo.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/RegionInfo.cpp (original) +++ llvm/trunk/lib/Analysis/RegionInfo.cpp Fri Aug 6 13:33:48 2010 @@ -589,7 +589,7 @@ TopLevelRegion = 0; } -RegionInfo::RegionInfo() : FunctionPass(&ID) { +RegionInfo::RegionInfo() : FunctionPass(ID) { TopLevelRegion = 0; } Modified: llvm/trunk/lib/Analysis/RegionPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionPrinter.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/RegionPrinter.cpp (original) +++ llvm/trunk/lib/Analysis/RegionPrinter.cpp Fri Aug 6 13:33:48 2010 @@ -121,7 +121,7 @@ struct RegionViewer : public DOTGraphTraitsViewer { static char ID; - RegionViewer() : DOTGraphTraitsViewer("reg", &ID){} + RegionViewer() : DOTGraphTraitsViewer("reg", ID){} }; char RegionViewer::ID = 0; @@ -131,7 +131,7 @@ struct RegionOnlyViewer : public DOTGraphTraitsViewer { static char ID; - RegionOnlyViewer() : DOTGraphTraitsViewer("regonly", &ID){} + RegionOnlyViewer() : DOTGraphTraitsViewer("regonly", ID){} }; char RegionOnlyViewer::ID = 0; @@ -143,7 +143,7 @@ : public DOTGraphTraitsPrinter { static char ID; RegionPrinter() : - DOTGraphTraitsPrinter("reg", &ID) {} + DOTGraphTraitsPrinter("reg", ID) {} }; } //end anonymous namespace @@ -157,7 +157,7 @@ : public DOTGraphTraitsPrinter { static char ID; RegionOnlyPrinter() : - DOTGraphTraitsPrinter("reg", &ID) {} + DOTGraphTraitsPrinter("reg", ID) {} }; } Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri Aug 6 13:33:48 2010 @@ -5742,7 +5742,7 @@ //===----------------------------------------------------------------------===// ScalarEvolution::ScalarEvolution() - : FunctionPass(&ID), FirstUnknown(0) { + : FunctionPass(ID), FirstUnknown(0) { } bool ScalarEvolution::runOnFunction(Function &F) { Modified: llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp Fri Aug 6 13:33:48 2010 @@ -34,14 +34,14 @@ public: static char ID; // Class identification, replacement for typeinfo - ScalarEvolutionAliasAnalysis() : FunctionPass(&ID), SE(0) {} + ScalarEvolutionAliasAnalysis() : FunctionPass(ID), SE(0) {} /// getAdjustedAnalysisPointer - This method is used when a pass implements /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(AnalysisID PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/TypeBasedAliasAnalysis.cpp Fri Aug 6 13:33:48 2010 @@ -82,14 +82,14 @@ public AliasAnalysis { public: static char ID; // Class identification, replacement for typeinfo - TypeBasedAliasAnalysis() : ImmutablePass(&ID) {} + TypeBasedAliasAnalysis() : ImmutablePass(ID) {} /// getAdjustedAnalysisPointer - This method is used when a pass implements /// an analysis interface through multiple inheritance. If needed, it /// should override this to adjust the this pointer as needed for the /// specified pass info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *PI) { - if (PI->isPassID(&AliasAnalysis::ID)) + virtual void *getAdjustedAnalysisPointer(const void *PI) { + if (PI == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp Fri Aug 6 13:33:48 2010 @@ -21,7 +21,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit WriteBitcodePass(raw_ostream &o) - : ModulePass(&ID), OS(o) {} + : ModulePass(ID), OS(o) {} const char *getPassName() const { return "Bitcode Writer"; } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Aug 6 13:33:48 2010 @@ -91,7 +91,7 @@ AsmPrinter::AsmPrinter(TargetMachine &tm, MCStreamer &Streamer) - : MachineFunctionPass(&ID), + : MachineFunctionPass(ID), TM(tm), MAI(tm.getMCAsmInfo()), OutContext(Streamer.getContext()), OutStreamer(Streamer), Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original) +++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Fri Aug 6 13:33:48 2010 @@ -65,7 +65,7 @@ public: static char ID; explicit BranchFolderPass(bool defaultEnableTailMerge) - : MachineFunctionPass(&ID), BranchFolder(defaultEnableTailMerge) {} + : MachineFunctionPass(ID), BranchFolder(defaultEnableTailMerge) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Control Flow Optimizer"; } Modified: llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp (original) +++ llvm/trunk/lib/CodeGen/CodePlacementOpt.cpp Fri Aug 6 13:33:48 2010 @@ -36,7 +36,7 @@ public: static char ID; - CodePlacementOpt() : MachineFunctionPass(&ID) {} + CodePlacementOpt() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { Modified: llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp (original) +++ llvm/trunk/lib/CodeGen/DeadMachineInstructionElim.cpp Fri Aug 6 13:33:48 2010 @@ -36,7 +36,7 @@ public: static char ID; // Pass identification, replacement for typeid - DeadMachineInstructionElim() : MachineFunctionPass(&ID) {} + DeadMachineInstructionElim() : MachineFunctionPass(ID) {} private: bool isDead(const MachineInstr *MI) const; Modified: llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp (original) +++ llvm/trunk/lib/CodeGen/DwarfEHPrepare.cpp Fri Aug 6 13:33:48 2010 @@ -160,7 +160,7 @@ public: static char ID; // Pass identification, replacement for typeid. DwarfEHPrepare(const TargetMachine *tm, bool fast) : - FunctionPass(&ID), TM(tm), TLI(TM->getTargetLowering()), + FunctionPass(ID), TM(tm), TLI(TM->getTargetLowering()), CompileFast(fast), ExceptionValueIntrinsic(0), SelectorIntrinsic(0), URoR(0), EHCatchAllValue(0), RewindFunction(0) {} Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Fri Aug 6 13:33:48 2010 @@ -63,7 +63,7 @@ //===----------------------------------------------------------------------===// ELFWriter::ELFWriter(raw_ostream &o, TargetMachine &tm) - : MachineFunctionPass(&ID), O(o), TM(tm), + : MachineFunctionPass(ID), O(o), TM(tm), OutContext(*new MCContext(*TM.getMCAsmInfo())), TLOF(TM.getTargetLowering()->getObjFileLowering()), is64Bit(TM.getTargetData()->getPointerSizeInBits() == 64), Modified: llvm/trunk/lib/CodeGen/GCMetadata.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCMetadata.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/GCMetadata.cpp (original) +++ llvm/trunk/lib/CodeGen/GCMetadata.cpp Fri Aug 6 13:33:48 2010 @@ -30,8 +30,8 @@ raw_ostream &OS; public: - Printer() : FunctionPass(&ID), OS(errs()) {} - explicit Printer(raw_ostream &OS) : FunctionPass(&ID), OS(OS) {} + Printer() : FunctionPass(ID), OS(errs()) {} + explicit Printer(raw_ostream &OS) : FunctionPass(ID), OS(OS) {} const char *getPassName() const; @@ -70,7 +70,7 @@ char GCModuleInfo::ID = 0; GCModuleInfo::GCModuleInfo() - : ImmutablePass(&ID) {} + : ImmutablePass(ID) {} GCModuleInfo::~GCModuleInfo() { clear(); @@ -189,7 +189,7 @@ return new Deleter(); } -Deleter::Deleter() : FunctionPass(&ID) {} +Deleter::Deleter() : FunctionPass(ID) {} const char *Deleter::getPassName() const { return "Delete Garbage Collector Information"; Modified: llvm/trunk/lib/CodeGen/GCStrategy.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCStrategy.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/GCStrategy.cpp (original) +++ llvm/trunk/lib/CodeGen/GCStrategy.cpp Fri Aug 6 13:33:48 2010 @@ -130,7 +130,7 @@ char LowerIntrinsics::ID = 0; LowerIntrinsics::LowerIntrinsics() - : FunctionPass(&ID) {} + : FunctionPass(ID) {} const char *LowerIntrinsics::getPassName() const { return "Lower Garbage Collection Instructions"; @@ -318,7 +318,7 @@ char MachineCodeAnalysis::ID = 0; MachineCodeAnalysis::MachineCodeAnalysis() - : MachineFunctionPass(&ID) {} + : MachineFunctionPass(ID) {} const char *MachineCodeAnalysis::getPassName() const { return "Analyze Machine Code For Garbage Collection"; Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IfConversion.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/IfConversion.cpp (original) +++ llvm/trunk/lib/CodeGen/IfConversion.cpp Fri Aug 6 13:33:48 2010 @@ -154,7 +154,7 @@ int FnNum; public: static char ID; - IfConverter() : MachineFunctionPass(&ID), FnNum(-1) {} + IfConverter() : MachineFunctionPass(ID), FnNum(-1) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "If Converter"; } Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original) +++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Fri Aug 6 13:33:48 2010 @@ -36,7 +36,7 @@ public: static char ID; // Pass identification, replacement for typeid - LowerSubregsInstructionPass() : MachineFunctionPass(&ID) {} + LowerSubregsInstructionPass() : MachineFunctionPass(ID) {} const char *getPassName() const { return "Subregister lowering instruction pass"; Modified: llvm/trunk/lib/CodeGen/MachineCSE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCSE.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineCSE.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineCSE.cpp Fri Aug 6 13:33:48 2010 @@ -41,7 +41,7 @@ MachineRegisterInfo *MRI; public: static char ID; // Pass identification - MachineCSE() : MachineFunctionPass(&ID), LookAheadLimit(5), CurrVN(0) {} + MachineCSE() : MachineFunctionPass(ID), LookAheadLimit(5), CurrVN(0) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/MachineDominators.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineDominators.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineDominators.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineDominators.cpp Fri Aug 6 13:33:48 2010 @@ -27,7 +27,7 @@ static RegisterPass E("machinedomtree", "MachineDominator Tree Construction", true); -const PassInfo *const llvm::MachineDominatorsID = &E; +char &llvm::MachineDominatorsID = MachineDominatorTree::ID; void MachineDominatorTree::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -41,7 +41,7 @@ } MachineDominatorTree::MachineDominatorTree() - : MachineFunctionPass(&ID) { + : MachineFunctionPass(ID) { DT = new DominatorTreeBase(false); } Modified: llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp Fri Aug 6 13:33:48 2010 @@ -20,14 +20,14 @@ // a default constructor. static PassInfo X("Machine Function Analysis", "machine-function-analysis", - intptr_t(&MachineFunctionAnalysis::ID), 0, + &MachineFunctionAnalysis::ID, 0, /*CFGOnly=*/false, /*is_analysis=*/true); char MachineFunctionAnalysis::ID = 0; MachineFunctionAnalysis::MachineFunctionAnalysis(const TargetMachine &tm, CodeGenOpt::Level OL) : - FunctionPass(&ID), TM(tm), OptLevel(OL), MF(0) { + FunctionPass(ID), TM(tm), OptLevel(OL), MF(0) { } MachineFunctionAnalysis::~MachineFunctionAnalysis() { Modified: llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunctionPrinterPass.cpp Fri Aug 6 13:33:48 2010 @@ -29,7 +29,7 @@ const std::string Banner; MachineFunctionPrinterPass(raw_ostream &os, const std::string &banner) - : MachineFunctionPass(&ID), OS(os), Banner(banner) {} + : MachineFunctionPass(ID), OS(os), Banner(banner) {} const char *getPassName() const { return "MachineFunction Printer"; } Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Fri Aug 6 13:33:48 2010 @@ -74,10 +74,10 @@ public: static char ID; // Pass identification, replacement for typeid MachineLICM() : - MachineFunctionPass(&ID), PreRegAlloc(true) {} + MachineFunctionPass(ID), PreRegAlloc(true) {} explicit MachineLICM(bool PreRA) : - MachineFunctionPass(&ID), PreRegAlloc(PreRA) {} + MachineFunctionPass(ID), PreRegAlloc(PreRA) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLoopInfo.cpp Fri Aug 6 13:33:48 2010 @@ -33,7 +33,7 @@ static RegisterPass X("machine-loops", "Machine Natural Loop Construction", true); -const PassInfo *const llvm::MachineLoopInfoID = &X; +char &llvm::MachineLoopInfoID = MachineLoopInfo::ID; bool MachineLoopInfo::runOnMachineFunction(MachineFunction &) { releaseMemory(); Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Fri Aug 6 13:33:48 2010 @@ -254,7 +254,7 @@ //===----------------------------------------------------------------------===// MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI) -: ImmutablePass(&ID), Context(MAI), +: ImmutablePass(ID), Context(MAI), ObjFileMMI(0), CurCallSite(0), CallsEHReturn(0), CallsUnwindInit(0), DbgInfoAvailable(false){ // Always emit some info, by default "no personality" info. @@ -264,7 +264,7 @@ } MachineModuleInfo::MachineModuleInfo() -: ImmutablePass(&ID), Context(*(MCAsmInfo*)0) { +: ImmutablePass(ID), Context(*(MCAsmInfo*)0) { assert(0 && "This MachineModuleInfo constructor should never be called, MMI " "should always be explicitly constructed by LLVMTargetMachine"); abort(); Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineSink.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineSink.cpp Fri Aug 6 13:33:48 2010 @@ -44,7 +44,7 @@ public: static char ID; // Pass identification - MachineSinking() : MachineFunctionPass(&ID) {} + MachineSinking() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Fri Aug 6 13:33:48 2010 @@ -195,7 +195,7 @@ static char ID; // Pass ID, replacement for typeid MachineVerifierPass() - : MachineFunctionPass(&ID) {} + : MachineFunctionPass(ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/CodeGen/OptimizeCmps.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizeCmps.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/OptimizeCmps.cpp (original) +++ llvm/trunk/lib/CodeGen/OptimizeCmps.cpp Fri Aug 6 13:33:48 2010 @@ -46,7 +46,7 @@ public: static char ID; // Pass identification - OptimizeCmps() : MachineFunctionPass(&ID) {} + OptimizeCmps() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/OptimizeExts.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizeExts.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/OptimizeExts.cpp (original) +++ llvm/trunk/lib/CodeGen/OptimizeExts.cpp Fri Aug 6 13:33:48 2010 @@ -43,7 +43,7 @@ public: static char ID; // Pass identification - OptimizeExts() : MachineFunctionPass(&ID) {} + OptimizeExts() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/OptimizePHIs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizePHIs.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/OptimizePHIs.cpp (original) +++ llvm/trunk/lib/CodeGen/OptimizePHIs.cpp Fri Aug 6 13:33:48 2010 @@ -33,7 +33,7 @@ public: static char ID; // Pass identification - OptimizePHIs() : MachineFunctionPass(&ID) {} + OptimizePHIs() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Fri Aug 6 13:33:48 2010 @@ -40,7 +40,7 @@ static RegisterPass X("phi-node-elimination", "Eliminate PHI nodes for register allocation"); -const PassInfo *const llvm::PHIEliminationID = &X; +char &llvm::PHIEliminationID = PHIElimination::ID; void llvm::PHIElimination::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); Modified: llvm/trunk/lib/CodeGen/PHIElimination.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.h (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.h Fri Aug 6 13:33:48 2010 @@ -25,7 +25,7 @@ public: static char ID; // Pass identification, replacement for typeid - PHIElimination() : MachineFunctionPass(&ID) {} + PHIElimination() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original) +++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Fri Aug 6 13:33:48 2010 @@ -85,7 +85,7 @@ public: static char ID; PostRAScheduler(CodeGenOpt::Level ol) : - MachineFunctionPass(&ID), OptLevel(ol) {} + MachineFunctionPass(ID), OptLevel(ol) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); Modified: llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp (original) +++ llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp Fri Aug 6 13:33:48 2010 @@ -92,7 +92,7 @@ public: static char ID; PreAllocSplitting() - : MachineFunctionPass(&ID) {} + : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); @@ -206,7 +206,7 @@ static RegisterPass X("pre-alloc-splitting", "Pre-Register Allocation Live Interval Splitting"); -const PassInfo *const llvm::PreAllocSplittingID = &X; +char &llvm::PreAllocSplittingID = PreAllocSplitting::ID; /// findSpillPoint - Find a gap as far away from the given MI that's suitable /// for spilling the current live interval. The index must be before any Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.h (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.h Fri Aug 6 13:33:48 2010 @@ -36,7 +36,7 @@ class PEI : public MachineFunctionPass { public: static char ID; - PEI() : MachineFunctionPass(&ID) {} + PEI() : MachineFunctionPass(ID) {} const char *getPassName() const { return "Prolog/Epilog Insertion & Frame Finalization"; Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Fri Aug 6 13:33:48 2010 @@ -47,7 +47,7 @@ class RAFast : public MachineFunctionPass { public: static char ID; - RAFast() : MachineFunctionPass(&ID), StackSlotForVirtReg(-1), + RAFast() : MachineFunctionPass(ID), StackSlotForVirtReg(-1), isBulkSpilling(false) {} private: const TargetMachine *TM; Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Fri Aug 6 13:33:48 2010 @@ -90,7 +90,7 @@ struct RALinScan : public MachineFunctionPass { static char ID; - RALinScan() : MachineFunctionPass(&ID) { + RALinScan() : MachineFunctionPass(ID) { // Initialize the queue to record recently-used registers. if (NumRecentlyUsedRegs > 0) RecentRegs.resize(NumRecentlyUsedRegs, 0); Modified: llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp Fri Aug 6 13:33:48 2010 @@ -84,7 +84,7 @@ static char ID; /// Construct a PBQP register allocator. - PBQPRegAlloc() : MachineFunctionPass(&ID) {} + PBQPRegAlloc() : MachineFunctionPass(ID) {} /// Return the pass name. virtual const char* getPassName() const { Modified: llvm/trunk/lib/CodeGen/RenderMachineFunction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RenderMachineFunction.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RenderMachineFunction.h (original) +++ llvm/trunk/lib/CodeGen/RenderMachineFunction.h Fri Aug 6 13:33:48 2010 @@ -198,7 +198,7 @@ public: static char ID; - RenderMachineFunction() : MachineFunctionPass(&ID) {} + RenderMachineFunction() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Aug 6 13:33:48 2010 @@ -171,7 +171,7 @@ //===----------------------------------------------------------------------===// SelectionDAGISel::SelectionDAGISel(const TargetMachine &tm, CodeGenOpt::Level OL) : - MachineFunctionPass(&ID), TM(tm), TLI(*tm.getTargetLowering()), + MachineFunctionPass(ID), TM(tm), TLI(*tm.getTargetLowering()), FuncInfo(new FunctionLoweringInfo(TLI)), CurDAG(new SelectionDAG(tm)), SDB(new SelectionDAGBuilder(*CurDAG, *FuncInfo, OL)), Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Fri Aug 6 13:33:48 2010 @@ -65,7 +65,7 @@ // Declare that we implement the RegisterCoalescer interface static RegisterAnalysisGroup V(X); -const PassInfo *const llvm::SimpleRegisterCoalescingID = &X; +char &llvm::SimpleRegisterCoalescingID = SimpleRegisterCoalescing::ID; void SimpleRegisterCoalescing::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h Fri Aug 6 13:33:48 2010 @@ -64,7 +64,7 @@ public: static char ID; // Pass identifcation, replacement for typeid - SimpleRegisterCoalescing() : MachineFunctionPass(&ID) {} + SimpleRegisterCoalescing() : MachineFunctionPass(ID) {} struct InstrSlots { enum { Modified: llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp (original) +++ llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp Fri Aug 6 13:33:48 2010 @@ -58,7 +58,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit SjLjEHPass(const TargetLowering *tli = NULL) - : FunctionPass(&ID), TLI(tli) { } + : FunctionPass(ID), TLI(tli) { } bool doInitialization(Module &M); bool runOnFunction(Function &F); Modified: llvm/trunk/lib/CodeGen/Splitter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/Splitter.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/Splitter.h (original) +++ llvm/trunk/lib/CodeGen/Splitter.h Fri Aug 6 13:33:48 2010 @@ -36,7 +36,7 @@ public: static char ID; - LoopSplitter() : MachineFunctionPass(&ID) {} + LoopSplitter() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &au) const; Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackProtector.cpp (original) +++ llvm/trunk/lib/CodeGen/StackProtector.cpp Fri Aug 6 13:33:48 2010 @@ -62,9 +62,9 @@ bool RequiresStackProtector() const; public: static char ID; // Pass identification, replacement for typeid. - StackProtector() : FunctionPass(&ID), TLI(0) {} + StackProtector() : FunctionPass(ID), TLI(0) {} StackProtector(const TargetLowering *tli) - : FunctionPass(&ID), TLI(tli) {} + : FunctionPass(ID), TLI(tli) {} virtual bool runOnFunction(Function &Fn); }; Modified: llvm/trunk/lib/CodeGen/StackSlotColoring.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackSlotColoring.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackSlotColoring.cpp (original) +++ llvm/trunk/lib/CodeGen/StackSlotColoring.cpp Fri Aug 6 13:33:48 2010 @@ -95,9 +95,9 @@ public: static char ID; // Pass identification StackSlotColoring() : - MachineFunctionPass(&ID), ColorWithRegs(false), NextColor(-1) {} + MachineFunctionPass(ID), ColorWithRegs(false), NextColor(-1) {} StackSlotColoring(bool RegColor) : - MachineFunctionPass(&ID), ColorWithRegs(RegColor), NextColor(-1) {} + MachineFunctionPass(ID), ColorWithRegs(RegColor), NextColor(-1) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Fri Aug 6 13:33:48 2010 @@ -39,7 +39,7 @@ namespace { struct StrongPHIElimination : public MachineFunctionPass { static char ID; // Pass identification, replacement for typeid - StrongPHIElimination() : MachineFunctionPass(&ID) {} + StrongPHIElimination() : MachineFunctionPass(ID) {} // Waiting stores, for each MBB, the set of copies that need to // be inserted into that MBB @@ -154,7 +154,7 @@ X("strong-phi-node-elimination", "Eliminate PHI nodes for register allocation, intelligently"); -const PassInfo *const llvm::StrongPHIEliminationID = &X; +char &llvm::StrongPHIEliminationID = StrongPHIElimination::ID; /// computeDFS - Computes the DFS-in and DFS-out numbers of the dominator tree /// of the given MachineFunction. These numbers are then used in other parts Modified: llvm/trunk/lib/CodeGen/TailDuplication.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TailDuplication.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TailDuplication.cpp (original) +++ llvm/trunk/lib/CodeGen/TailDuplication.cpp Fri Aug 6 13:33:48 2010 @@ -69,7 +69,7 @@ public: static char ID; explicit TailDuplicatePass(bool PreRA) : - MachineFunctionPass(&ID), PreRegAlloc(PreRA) {} + MachineFunctionPass(ID), PreRegAlloc(PreRA) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Tail Duplication"; } Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Fri Aug 6 13:33:48 2010 @@ -138,7 +138,7 @@ public: static char ID; // Pass identification, replacement for typeid - TwoAddressInstructionPass() : MachineFunctionPass(&ID) {} + TwoAddressInstructionPass() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); @@ -162,7 +162,7 @@ static RegisterPass X("twoaddressinstruction", "Two-Address instruction pass"); -const PassInfo *const llvm::TwoAddressInstructionPassID = &X; +char &llvm::TwoAddressInstructionPassID = TwoAddressInstructionPass::ID; /// Sink3AddrInstruction - A two-address instruction has been converted to a /// three-address instruction to avoid clobbering a register. Try to sink it Modified: llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp (original) +++ llvm/trunk/lib/CodeGen/UnreachableBlockElim.cpp Fri Aug 6 13:33:48 2010 @@ -43,7 +43,7 @@ virtual bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - UnreachableBlockElim() : FunctionPass(&ID) {} + UnreachableBlockElim() : FunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); @@ -100,7 +100,7 @@ MachineModuleInfo *MMI; public: static char ID; // Pass identification, replacement for typeid - UnreachableMachineBlockElim() : MachineFunctionPass(&ID) {} + UnreachableMachineBlockElim() : MachineFunctionPass(ID) {} }; } char UnreachableMachineBlockElim::ID = 0; @@ -109,7 +109,7 @@ Y("unreachable-mbb-elimination", "Remove unreachable machine basic blocks"); -const PassInfo *const llvm::UnreachableMachineBlockElimID = &Y; +char &llvm::UnreachableMachineBlockElimID = UnreachableMachineBlockElim::ID; void UnreachableMachineBlockElim::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); Modified: llvm/trunk/lib/CodeGen/VirtRegMap.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/VirtRegMap.h (original) +++ llvm/trunk/lib/CodeGen/VirtRegMap.h Fri Aug 6 13:33:48 2010 @@ -139,7 +139,7 @@ public: static char ID; - VirtRegMap() : MachineFunctionPass(&ID), Virt2PhysMap(NO_PHYS_REG), + VirtRegMap() : MachineFunctionPass(ID), Virt2PhysMap(NO_PHYS_REG), Virt2StackSlotMap(NO_STACK_SLOT), Virt2ReMatIdMap(NO_STACK_SLOT), Virt2SplitMap(0), Virt2SplitKillMap(SlotIndex()), ReMatMap(NULL), Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Fri Aug 6 13:33:48 2010 @@ -65,7 +65,7 @@ static char ID; public: ARMCodeEmitter(TargetMachine &tm, JITCodeEmitter &mce) - : MachineFunctionPass(&ID), JTI(0), + : MachineFunctionPass(ID), JTI(0), II((const ARMInstrInfo *)tm.getInstrInfo()), TD(tm.getTargetData()), TM(tm), MCE(mce), MCPEs(0), MJTEs(0), Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Fri Aug 6 13:33:48 2010 @@ -173,7 +173,7 @@ bool isThumb2; public: static char ID; - ARMConstantIslands() : MachineFunctionPass(&ID) {} + ARMConstantIslands() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp Fri Aug 6 13:33:48 2010 @@ -26,7 +26,7 @@ class ARMExpandPseudo : public MachineFunctionPass { public: static char ID; - ARMExpandPseudo() : MachineFunctionPass(&ID) {} + ARMExpandPseudo() : MachineFunctionPass(ID) {} const TargetInstrInfo *TII; const TargetRegisterInfo *TRI; Modified: llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMGlobalMerge.cpp Fri Aug 6 13:33:48 2010 @@ -78,7 +78,7 @@ public: static char ID; // Pass identification, replacement for typeid. explicit ARMGlobalMerge(const TargetLowering *tli) - : FunctionPass(&ID), TLI(tli) {} + : FunctionPass(ID), TLI(tli) {} virtual bool doInitialization(Module &M); virtual bool runOnFunction(Function& F); Modified: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Fri Aug 6 13:33:48 2010 @@ -57,7 +57,7 @@ namespace { struct ARMLoadStoreOpt : public MachineFunctionPass { static char ID; - ARMLoadStoreOpt() : MachineFunctionPass(&ID) {} + ARMLoadStoreOpt() : MachineFunctionPass(ID) {} const TargetInstrInfo *TII; const TargetRegisterInfo *TRI; @@ -1268,7 +1268,7 @@ namespace { struct ARMPreAllocLoadStoreOpt : public MachineFunctionPass{ static char ID; - ARMPreAllocLoadStoreOpt() : MachineFunctionPass(&ID) {} + ARMPreAllocLoadStoreOpt() : MachineFunctionPass(ID) {} const TargetData *TD; const TargetInstrInfo *TII; Modified: llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp (original) +++ llvm/trunk/lib/Target/ARM/NEONMoveFix.cpp Fri Aug 6 13:33:48 2010 @@ -24,7 +24,7 @@ namespace { struct NEONMoveFixPass : public MachineFunctionPass { static char ID; - NEONMoveFixPass() : MachineFunctionPass(&ID) {} + NEONMoveFixPass() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); Modified: llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/NEONPreAllocPass.cpp Fri Aug 6 13:33:48 2010 @@ -23,7 +23,7 @@ public: static char ID; - NEONPreAllocPass() : MachineFunctionPass(&ID) {} + NEONPreAllocPass() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); Modified: llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp Fri Aug 6 13:33:48 2010 @@ -27,7 +27,7 @@ public: static char ID; - Thumb2ITBlockPass() : MachineFunctionPass(&ID) {} + Thumb2ITBlockPass() : MachineFunctionPass(ID) {} const Thumb2InstrInfo *TII; const TargetRegisterInfo *TRI; Modified: llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb2SizeReduction.cpp Fri Aug 6 13:33:48 2010 @@ -173,7 +173,7 @@ char Thumb2SizeReduce::ID = 0; } -Thumb2SizeReduce::Thumb2SizeReduce() : MachineFunctionPass(&ID) { +Thumb2SizeReduce::Thumb2SizeReduce() : MachineFunctionPass(ID) { for (unsigned i = 0, e = array_lengthof(ReduceTable); i != e; ++i) { unsigned FromOpc = ReduceTable[i].WideOpc; if (!ReduceOpcodeMap.insert(std::make_pair(FromOpc, i)).second) Modified: llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaBranchSelector.cpp Fri Aug 6 13:33:48 2010 @@ -22,7 +22,7 @@ namespace { struct AlphaBSel : public MachineFunctionPass { static char ID; - AlphaBSel() : MachineFunctionPass(&ID) {} + AlphaBSel() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); Modified: llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp Fri Aug 6 13:33:48 2010 @@ -34,7 +34,7 @@ public: static char ID; - AlphaCodeEmitter(JITCodeEmitter &mce) : MachineFunctionPass(&ID), + AlphaCodeEmitter(JITCodeEmitter &mce) : MachineFunctionPass(ID), MCE(mce) {} /// getBinaryCodeForInstr - This function, generated by the Modified: llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaLLRP.cpp Fri Aug 6 13:33:48 2010 @@ -39,7 +39,7 @@ static char ID; AlphaLLRPPass(AlphaTargetMachine &tm) - : MachineFunctionPass(&ID), TM(tm) { } + : MachineFunctionPass(ID), TM(tm) { } virtual const char *getPassName() const { return "Alpha NOP inserter"; Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Fri Aug 6 13:33:48 2010 @@ -73,7 +73,7 @@ public: static char ID; CBackendNameAllUsedStructsAndMergeFunctions() - : ModulePass(&ID) {} + : ModulePass(ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); } @@ -110,7 +110,7 @@ public: static char ID; explicit CWriter(formatted_raw_ostream &o) - : FunctionPass(&ID), Out(o), IL(0), Mang(0), LI(0), + : FunctionPass(ID), Out(o), IL(0), Mang(0), LI(0), TheModule(0), TAsm(0), TCtx(0), TD(0), OpaqueCounter(0), NextAnonValueNumber(0) { FPCounter = 0; Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Fri Aug 6 13:33:48 2010 @@ -104,7 +104,7 @@ public: static char ID; explicit CppWriter(formatted_raw_ostream &o) : - ModulePass(&ID), Out(o), uniqueNum(0), is_inline(false), indent_level(0){} + ModulePass(ID), Out(o), uniqueNum(0), is_inline(false), indent_level(0){} virtual const char *getPassName() const { return "C++ backend"; } Modified: llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp (original) +++ llvm/trunk/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp Fri Aug 6 13:33:48 2010 @@ -32,7 +32,7 @@ static char ID; Filler(TargetMachine &tm) - : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { } + : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { } virtual const char *getPassName() const { return "MBlaze Delay Slot Filler"; Modified: llvm/trunk/lib/Target/MSIL/MSILWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/MSILWriter.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSIL/MSILWriter.h (original) +++ llvm/trunk/lib/Target/MSIL/MSILWriter.h Fri Aug 6 13:33:48 2010 @@ -40,7 +40,7 @@ static char ID; MSILModule(const std::set*& _UsedTypes, const TargetData*& _TD) - : ModulePass(&ID), UsedTypes(_UsedTypes), TD(_TD) {} + : ModulePass(ID), UsedTypes(_UsedTypes), TD(_TD) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); @@ -86,7 +86,7 @@ DenseMap AnonValueNumbers; unsigned NextAnonValueNumber; - MSILWriter(formatted_raw_ostream &o) : FunctionPass(&ID), Out(o), + MSILWriter(formatted_raw_ostream &o) : FunctionPass(ID), Out(o), NextAnonValueNumber(0) { UniqID = 0; } Modified: llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp (original) +++ llvm/trunk/lib/Target/MSP430/MSP430BranchSelector.cpp Fri Aug 6 13:33:48 2010 @@ -30,7 +30,7 @@ namespace { struct MSP430BSel : public MachineFunctionPass { static char ID; - MSP430BSel() : MachineFunctionPass(&ID) {} + MSP430BSel() : MachineFunctionPass(ID) {} /// BlockSizes - The sizes of the basic blocks in the function. std::vector BlockSizes; Modified: llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsDelaySlotFiller.cpp Fri Aug 6 13:33:48 2010 @@ -32,7 +32,7 @@ static char ID; Filler(TargetMachine &tm) - : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { } + : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { } virtual const char *getPassName() const { return "Mips Delay Slot Filler"; Modified: llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16MemSelOpt.cpp Fri Aug 6 13:33:48 2010 @@ -38,7 +38,7 @@ namespace { struct MemSelOpt : public MachineFunctionPass { static char ID; - MemSelOpt() : MachineFunctionPass(&ID) {} + MemSelOpt() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreservedID(MachineLoopInfoID); Modified: llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h Fri Aug 6 13:33:48 2010 @@ -35,7 +35,7 @@ class PIC16Cloner : public ModulePass { public: static char ID; // Class identification - PIC16Cloner() : ModulePass(&ID) {} + PIC16Cloner() : ModulePass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Overlay.h Fri Aug 6 13:33:48 2010 @@ -39,7 +39,7 @@ unsigned IndirectCallColor; public: static char ID; // Class identification - PIC16Overlay() : ModulePass(&ID) { + PIC16Overlay() : ModulePass(ID) { OverlayStr = "Overlay="; InterruptDepth = PIC16OVERLAY::StartInterruptColor; IndirectCallColor = PIC16OVERLAY::StartIndirectCallColor; Modified: llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp Fri Aug 6 13:33:48 2010 @@ -31,7 +31,7 @@ namespace { struct PPCBSel : public MachineFunctionPass { static char ID; - PPCBSel() : MachineFunctionPass(&ID) {} + PPCBSel() : MachineFunctionPass(ID) {} /// BlockSizes - The sizes of the basic blocks in the function. std::vector BlockSizes; Modified: llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp Fri Aug 6 13:33:48 2010 @@ -45,7 +45,7 @@ public: PPCCodeEmitter(TargetMachine &tm, JITCodeEmitter &mce) - : MachineFunctionPass(&ID), TM(tm), MCE(mce) {} + : MachineFunctionPass(ID), TM(tm), MCE(mce) {} /// getBinaryCodeForInstr - This function, generated by the /// CodeEmitterGenerator using TableGen, produces the binary encoding for Modified: llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp (original) +++ llvm/trunk/lib/Target/Sparc/DelaySlotFiller.cpp Fri Aug 6 13:33:48 2010 @@ -32,7 +32,7 @@ static char ID; Filler(TargetMachine &tm) - : MachineFunctionPass(&ID), TM(tm), TII(tm.getInstrInfo()) { } + : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { } virtual const char *getPassName() const { return "SPARC Delay Slot Filler"; Modified: llvm/trunk/lib/Target/Sparc/FPMover.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/FPMover.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/FPMover.cpp (original) +++ llvm/trunk/lib/Target/Sparc/FPMover.cpp Fri Aug 6 13:33:48 2010 @@ -36,7 +36,7 @@ static char ID; explicit FPMover(TargetMachine &tm) - : MachineFunctionPass(&ID), TM(tm) { } + : MachineFunctionPass(ID), TM(tm) { } virtual const char *getPassName() const { return "Sparc Double-FP Move Fixer"; Modified: llvm/trunk/lib/Target/TargetData.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetData.cpp (original) +++ llvm/trunk/lib/Target/TargetData.cpp Fri Aug 6 13:33:48 2010 @@ -226,13 +226,13 @@ /// /// @note This has to exist, because this is a pass, but it should never be /// used. -TargetData::TargetData() : ImmutablePass(&ID) { +TargetData::TargetData() : ImmutablePass(ID) { report_fatal_error("Bad TargetData ctor used. " "Tool did not specify a TargetData to use?"); } TargetData::TargetData(const Module *M) - : ImmutablePass(&ID) { + : ImmutablePass(ID) { init(M->getDataLayout()); } Modified: llvm/trunk/lib/Target/X86/SSEDomainFix.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/SSEDomainFix.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/SSEDomainFix.cpp (original) +++ llvm/trunk/lib/Target/X86/SSEDomainFix.cpp Fri Aug 6 13:33:48 2010 @@ -115,7 +115,7 @@ unsigned Distance; public: - SSEDomainFixPass() : MachineFunctionPass(&ID) {} + SSEDomainFixPass() : MachineFunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Fri Aug 6 13:33:48 2010 @@ -53,12 +53,12 @@ public: static char ID; explicit Emitter(X86TargetMachine &tm, CodeEmitter &mce) - : MachineFunctionPass(&ID), II(0), TD(0), TM(tm), + : MachineFunctionPass(ID), II(0), TD(0), TM(tm), MCE(mce), PICBaseOffset(0), Is64BitMode(false), IsPIC(TM.getRelocationModel() == Reloc::PIC_) {} Emitter(X86TargetMachine &tm, CodeEmitter &mce, const X86InstrInfo &ii, const TargetData &td, bool is64) - : MachineFunctionPass(&ID), II(&ii), TD(&td), TM(tm), + : MachineFunctionPass(ID), II(&ii), TD(&td), TM(tm), MCE(mce), PICBaseOffset(0), Is64BitMode(is64), IsPIC(TM.getRelocationModel() == Reloc::PIC_) {} Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Fri Aug 6 13:33:48 2010 @@ -50,7 +50,7 @@ namespace { struct FPS : public MachineFunctionPass { static char ID; - FPS() : MachineFunctionPass(&ID) { + FPS() : MachineFunctionPass(ID) { // This is really only to keep valgrind quiet. // The logic in isLive() is too much for it. memset(Stack, 0, sizeof(Stack)); Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Fri Aug 6 13:33:48 2010 @@ -3029,7 +3029,7 @@ /// global base register for x86-32. struct CGBR : public MachineFunctionPass { static char ID; - CGBR() : MachineFunctionPass(&ID) {} + CGBR() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF) { const X86TargetMachine *TM = Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Fri Aug 6 13:33:48 2010 @@ -1557,7 +1557,7 @@ namespace { struct MSAH : public MachineFunctionPass { static char ID; - MSAH() : MachineFunctionPass(&ID) {} + MSAH() : MachineFunctionPass(ID) {} virtual bool runOnMachineFunction(MachineFunction &MF) { const X86TargetMachine *TM = Modified: llvm/trunk/lib/Transforms/Hello/Hello.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Hello/Hello.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Hello/Hello.cpp (original) +++ llvm/trunk/lib/Transforms/Hello/Hello.cpp Fri Aug 6 13:33:48 2010 @@ -25,7 +25,7 @@ // Hello - The first implementation, without getAnalysisUsage. struct Hello : public FunctionPass { static char ID; // Pass identification, replacement for typeid - Hello() : FunctionPass(&ID) {} + Hello() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { ++HelloCounter; @@ -43,7 +43,7 @@ // Hello2 - The second implementation with getAnalysisUsage implemented. struct Hello2 : public FunctionPass { static char ID; // Pass identification, replacement for typeid - Hello2() : FunctionPass(&ID) {} + Hello2() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { ++HelloCounter; Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Fri Aug 6 13:33:48 2010 @@ -67,7 +67,7 @@ virtual bool runOnSCC(CallGraphSCC &SCC); static char ID; // Pass identification, replacement for typeid explicit ArgPromotion(unsigned maxElements = 3) - : CallGraphSCCPass(&ID), maxElements(maxElements) {} + : CallGraphSCCPass(ID), maxElements(maxElements) {} /// A vector used to hold the indices of a single GEP instruction typedef std::vector IndicesVector; Modified: llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp Fri Aug 6 13:33:48 2010 @@ -31,7 +31,7 @@ namespace { struct ConstantMerge : public ModulePass { static char ID; // Pass identification, replacement for typeid - ConstantMerge() : ModulePass(&ID) {} + ConstantMerge() : ModulePass(ID) {} // run - For this pass, process all of the globals in the module, // eliminating duplicate constants. Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Fri Aug 6 13:33:48 2010 @@ -122,11 +122,11 @@ protected: // DAH uses this to specify a different ID. - explicit DAE(void *ID) : ModulePass(ID) {} + explicit DAE(char &ID) : ModulePass(ID) {} public: static char ID; // Pass identification, replacement for typeid - DAE() : ModulePass(&ID) {} + DAE() : ModulePass(ID) {} bool runOnModule(Module &M); @@ -159,7 +159,7 @@ /// by bugpoint. struct DAH : public DAE { static char ID; - DAH() : DAE(&ID) {} + DAH() : DAE(ID) {} virtual bool ShouldHackArguments() const { return true; } }; Modified: llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadTypeElimination.cpp Fri Aug 6 13:33:48 2010 @@ -26,7 +26,7 @@ namespace { struct DTE : public ModulePass { static char ID; // Pass identification, replacement for typeid - DTE() : ModulePass(&ID) {} + DTE() : ModulePass(ID) {} // doPassInitialization - For this pass, it removes global symbol table // entries for primitive types. These are never used for linking in GCC and Modified: llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp Fri Aug 6 13:33:48 2010 @@ -35,7 +35,7 @@ /// explicit GVExtractorPass(std::vector& GVs, bool deleteS = true, bool relinkCallees = false) - : ModulePass(&ID), Named(GVs), deleteStuff(deleteS), + : ModulePass(ID), Named(GVs), deleteStuff(deleteS), reLink(relinkCallees) {} bool runOnModule(Module &M) { Modified: llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp Fri Aug 6 13:33:48 2010 @@ -41,7 +41,7 @@ namespace { struct FunctionAttrs : public CallGraphSCCPass { static char ID; // Pass identification, replacement for typeid - FunctionAttrs() : CallGraphSCCPass(&ID) {} + FunctionAttrs() : CallGraphSCCPass(ID) {} // runOnSCC - Analyze the SCC, performing the transformation if possible. bool runOnSCC(CallGraphSCC &SCC); Modified: llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp Fri Aug 6 13:33:48 2010 @@ -31,7 +31,7 @@ namespace { struct GlobalDCE : public ModulePass { static char ID; // Pass identification, replacement for typeid - GlobalDCE() : ModulePass(&ID) {} + GlobalDCE() : ModulePass(ID) {} // run - Do the GlobalDCE pass on the specified module, optionally updating // the specified callgraph to reflect the changes. Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Fri Aug 6 13:33:48 2010 @@ -59,7 +59,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { } static char ID; // Pass identification, replacement for typeid - GlobalOpt() : ModulePass(&ID) {} + GlobalOpt() : ModulePass(ID) {} bool runOnModule(Module &M); Modified: llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp Fri Aug 6 13:33:48 2010 @@ -35,7 +35,7 @@ /// struct IPCP : public ModulePass { static char ID; // Pass identification, replacement for typeid - IPCP() : ModulePass(&ID) {} + IPCP() : ModulePass(ID) {} bool runOnModule(Module &M); private: Modified: llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp Fri Aug 6 13:33:48 2010 @@ -36,7 +36,7 @@ InlineCostAnalyzer CA; public: // Use extremely low threshold. - AlwaysInliner() : Inliner(&ID, -2000000000) {} + AlwaysInliner() : Inliner(ID, -2000000000) {} static char ID; // Pass identification, replacement for typeid InlineCost getInlineCost(CallSite CS) { return CA.getInlineCost(CS, NeverInline); Modified: llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp Fri Aug 6 13:33:48 2010 @@ -33,8 +33,8 @@ SmallPtrSet NeverInline; InlineCostAnalyzer CA; public: - SimpleInliner() : Inliner(&ID) {} - SimpleInliner(int Threshold) : Inliner(&ID, Threshold) {} + SimpleInliner() : Inliner(ID) {} + SimpleInliner(int Threshold) : Inliner(ID, Threshold) {} static char ID; // Pass identification, replacement for typeid InlineCost getInlineCost(CallSite CS) { return CA.getInlineCost(CS, NeverInline); Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Fri Aug 6 13:33:48 2010 @@ -48,10 +48,10 @@ // Threshold to use when optsize is specified (and there is no -inline-limit). const int OptSizeThreshold = 75; -Inliner::Inliner(void *ID) +Inliner::Inliner(char &ID) : CallGraphSCCPass(ID), InlineThreshold(InlineLimit) {} -Inliner::Inliner(void *ID, int Threshold) +Inliner::Inliner(char &ID, int Threshold) : CallGraphSCCPass(ID), InlineThreshold(Threshold) {} /// getAnalysisUsage - For this class, we declare that we require and preserve Modified: llvm/trunk/lib/Transforms/IPO/Internalize.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Internalize.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Internalize.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Internalize.cpp Fri Aug 6 13:33:48 2010 @@ -67,7 +67,7 @@ "Internalize Global Symbols", false, false); InternalizePass::InternalizePass(bool AllButMain) - : ModulePass(&ID), AllButMain(AllButMain){ + : ModulePass(ID), AllButMain(AllButMain){ if (!APIFile.empty()) // If a filename is specified, use it. LoadFile(APIFile.c_str()); if (!APIList.empty()) // If a list is specified, use it as well. @@ -75,7 +75,7 @@ } InternalizePass::InternalizePass(const std::vector&exportList) - : ModulePass(&ID), AllButMain(false){ + : ModulePass(ID), AllButMain(false){ for(std::vector::const_iterator itr = exportList.begin(); itr != exportList.end(); itr++) { ExternalNames.insert(*itr); Modified: llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/LoopExtractor.cpp Fri Aug 6 13:33:48 2010 @@ -37,7 +37,7 @@ unsigned NumLoops; explicit LoopExtractor(unsigned numLoops = ~0) - : LoopPass(&ID), NumLoops(numLoops) {} + : LoopPass(ID), NumLoops(numLoops) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -147,7 +147,7 @@ std::vector > BlocksToNotExtractByName; public: static char ID; // Pass identification, replacement for typeid - BlockExtractorPass() : ModulePass(&ID) { + BlockExtractorPass() : ModulePass(ID) { if (!BlockFile.empty()) LoadFile(BlockFile.c_str()); } Modified: llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp Fri Aug 6 13:33:48 2010 @@ -109,7 +109,7 @@ bool IsTransformableFunction(StringRef Name); public: static char ID; // Pass identification, replacement for typeid - LowerSetJmp() : ModulePass(&ID) {} + LowerSetJmp() : ModulePass(ID) {} void visitCallInst(CallInst& CI); void visitInvokeInst(InvokeInst& II); Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Fri Aug 6 13:33:48 2010 @@ -75,7 +75,7 @@ /// struct MergeFunctions : public ModulePass { static char ID; // Pass identification, replacement for typeid - MergeFunctions() : ModulePass(&ID) {} + MergeFunctions() : ModulePass(ID) {} bool runOnModule(Module &M); }; Modified: llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp Fri Aug 6 13:33:48 2010 @@ -30,7 +30,7 @@ struct PartialInliner : public ModulePass { virtual void getAnalysisUsage(AnalysisUsage &AU) const { } static char ID; // Pass identification, replacement for typeid - PartialInliner() : ModulePass(&ID) {} + PartialInliner() : ModulePass(ID) {} bool runOnModule(Module& M); Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Fri Aug 6 13:33:48 2010 @@ -50,7 +50,7 @@ int scanDistribution(Function&, int, std::map&); public : static char ID; // Pass identification, replacement for typeid - PartSpec() : ModulePass(&ID) {} + PartSpec() : ModulePass(ID) {} bool runOnModule(Module &M); }; } Modified: llvm/trunk/lib/Transforms/IPO/PruneEH.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PruneEH.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PruneEH.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PruneEH.cpp Fri Aug 6 13:33:48 2010 @@ -37,7 +37,7 @@ namespace { struct PruneEH : public CallGraphSCCPass { static char ID; // Pass identification, replacement for typeid - PruneEH() : CallGraphSCCPass(&ID) {} + PruneEH() : CallGraphSCCPass(ID) {} // runOnSCC - Analyze the SCC, performing the transformation if possible. bool runOnSCC(CallGraphSCC &SCC); Modified: llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StripDeadPrototypes.cpp Fri Aug 6 13:33:48 2010 @@ -29,7 +29,7 @@ class StripDeadPrototypesPass : public ModulePass { public: static char ID; // Pass identification, replacement for typeid - StripDeadPrototypesPass() : ModulePass(&ID) { } + StripDeadPrototypesPass() : ModulePass(ID) { } virtual bool runOnModule(Module &M); }; Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Fri Aug 6 13:33:48 2010 @@ -39,7 +39,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripSymbols(bool ODI = false) - : ModulePass(&ID), OnlyDebugInfo(ODI) {} + : ModulePass(ID), OnlyDebugInfo(ODI) {} virtual bool runOnModule(Module &M); @@ -52,7 +52,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripNonDebugSymbols() - : ModulePass(&ID) {} + : ModulePass(ID) {} virtual bool runOnModule(Module &M); @@ -65,7 +65,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripDebugDeclare() - : ModulePass(&ID) {} + : ModulePass(ID) {} virtual bool runOnModule(Module &M); @@ -78,7 +78,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit StripDeadDebugInfo() - : ModulePass(&ID) {} + : ModulePass(ID) {} virtual bool runOnModule(Module &M); Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Fri Aug 6 13:33:48 2010 @@ -50,7 +50,7 @@ virtual bool runOnSCC(CallGraphSCC &SCC); static char ID; // Pass identification, replacement for typeid - SRETPromotion() : CallGraphSCCPass(&ID) {} + SRETPromotion() : CallGraphSCCPass(ID) {} private: CallGraphNode *PromoteReturn(CallGraphNode *CGN); Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombine.h?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/InstCombine/InstCombine.h (original) +++ llvm/trunk/lib/Transforms/InstCombine/InstCombine.h Fri Aug 6 13:33:48 2010 @@ -81,7 +81,7 @@ BuilderTy *Builder; static char ID; // Pass identification, replacement for typeid - InstCombiner() : FunctionPass(&ID), TD(0), Builder(0) {} + InstCombiner() : FunctionPass(ID), TD(0), Builder(0) {} public: virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/EdgeProfiling.cpp Fri Aug 6 13:33:48 2010 @@ -34,7 +34,7 @@ bool runOnModule(Module &M); public: static char ID; // Pass identification, replacement for typeid - EdgeProfiler() : ModulePass(&ID) {} + EdgeProfiler() : ModulePass(ID) {} virtual const char *getPassName() const { return "Edge Profiler"; Modified: llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp Fri Aug 6 13:33:48 2010 @@ -36,7 +36,7 @@ bool runOnModule(Module &M); public: static char ID; // Pass identification, replacement for typeid - OptimalEdgeProfiler() : ModulePass(&ID) {} + OptimalEdgeProfiler() : ModulePass(ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(ProfileEstimatorPassID); Modified: llvm/trunk/lib/Transforms/Scalar/ABCD.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ABCD.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ABCD.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ABCD.cpp Fri Aug 6 13:33:48 2010 @@ -49,7 +49,7 @@ class ABCD : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid. - ABCD() : FunctionPass(&ID) {} + ABCD() : FunctionPass(ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); Modified: llvm/trunk/lib/Transforms/Scalar/ADCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ADCE.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ADCE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ADCE.cpp Fri Aug 6 13:33:48 2010 @@ -33,7 +33,7 @@ namespace { struct ADCE : public FunctionPass { static char ID; // Pass identification, replacement for typeid - ADCE() : FunctionPass(&ID) {} + ADCE() : FunctionPass(ID) {} virtual bool runOnFunction(Function& F); Modified: llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/BasicBlockPlacement.cpp Fri Aug 6 13:33:48 2010 @@ -41,7 +41,7 @@ namespace { struct BlockPlacement : public FunctionPass { static char ID; // Pass identification, replacement for typeid - BlockPlacement() : FunctionPass(&ID) {} + BlockPlacement() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Fri Aug 6 13:33:48 2010 @@ -54,7 +54,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit CodeGenPrepare(const TargetLowering *tli = 0) - : FunctionPass(&ID), TLI(tli) {} + : FunctionPass(ID), TLI(tli) {} bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { Modified: llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ConstantProp.cpp Fri Aug 6 13:33:48 2010 @@ -34,7 +34,7 @@ namespace { struct ConstantPropagation : public FunctionPass { static char ID; // Pass identification, replacement for typeid - ConstantPropagation() : FunctionPass(&ID) {} + ConstantPropagation() : FunctionPass(ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/DCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DCE.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DCE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DCE.cpp Fri Aug 6 13:33:48 2010 @@ -35,7 +35,7 @@ // struct DeadInstElimination : public BasicBlockPass { static char ID; // Pass identification, replacement for typeid - DeadInstElimination() : BasicBlockPass(&ID) {} + DeadInstElimination() : BasicBlockPass(ID) {} virtual bool runOnBasicBlock(BasicBlock &BB) { bool Changed = false; for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); ) { @@ -70,7 +70,7 @@ // struct DCE : public FunctionPass { static char ID; // Pass identification, replacement for typeid - DCE() : FunctionPass(&ID) {} + DCE() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Fri Aug 6 13:33:48 2010 @@ -40,7 +40,7 @@ TargetData *TD; static char ID; // Pass identification, replacement for typeid - DSE() : FunctionPass(&ID) {} + DSE() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { bool Changed = false; Modified: llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GEPSplitter.cpp Fri Aug 6 13:33:48 2010 @@ -27,7 +27,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const; public: static char ID; // Pass identification, replacement for typeid - explicit GEPSplitter() : FunctionPass(&ID) {} + explicit GEPSplitter() : FunctionPass(ID) {} }; } Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri Aug 6 13:33:48 2010 @@ -665,7 +665,7 @@ public: static char ID; // Pass identification, replacement for typeid explicit GVN(bool noloads = false) - : FunctionPass(&ID), NoLoads(noloads), MD(0) { } + : FunctionPass(ID), NoLoads(noloads), MD(0) { } private: bool NoLoads; Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Fri Aug 6 13:33:48 2010 @@ -77,7 +77,7 @@ public: static char ID; // Pass identification, replacement for typeid - IndVarSimplify() : LoopPass(&ID) {} + IndVarSimplify() : LoopPass(ID) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM); Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Fri Aug 6 13:33:48 2010 @@ -79,7 +79,7 @@ #endif public: static char ID; // Pass identification - JumpThreading() : FunctionPass(&ID) {} + JumpThreading() : FunctionPass(ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Fri Aug 6 13:33:48 2010 @@ -66,7 +66,7 @@ namespace { struct LICM : public LoopPass { static char ID; // Pass identification, replacement for typeid - LICM() : LoopPass(&ID) {} + LICM() : LoopPass(ID) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM); Modified: llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp Fri Aug 6 13:33:48 2010 @@ -28,7 +28,7 @@ class LoopDeletion : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopDeletion() : LoopPass(&ID) {} + LoopDeletion() : LoopPass(ID) {} // Possibly eliminate loop L if it is dead. bool runOnLoop(Loop* L, LPPassManager& LPM); Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Fri Aug 6 13:33:48 2010 @@ -74,7 +74,7 @@ class LoopIndexSplit : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopIndexSplit() : LoopPass(&ID) {} + LoopIndexSplit() : LoopPass(ID) {} // Index split Loop L. Return true if loop is split. bool runOnLoop(Loop *L, LPPassManager &LPM); Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Fri Aug 6 13:33:48 2010 @@ -35,7 +35,7 @@ class LoopRotate : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopRotate() : LoopPass(&ID) {} + LoopRotate() : LoopPass(ID) {} // Rotate Loop L as many times as possible. Return true if // loop is rotated at least once. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Fri Aug 6 13:33:48 2010 @@ -3751,7 +3751,7 @@ } LoopStrengthReduce::LoopStrengthReduce(const TargetLowering *tli) - : LoopPass(&ID), TLI(tli) {} + : LoopPass(ID), TLI(tli) {} void LoopStrengthReduce::getAnalysisUsage(AnalysisUsage &AU) const { // We split critical edges, so we change the CFG. However, we do update Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnrollPass.cpp Fri Aug 6 13:33:48 2010 @@ -43,7 +43,7 @@ class LoopUnroll : public LoopPass { public: static char ID; // Pass ID, replacement for typeid - LoopUnroll() : LoopPass(&ID) {} + LoopUnroll() : LoopPass(ID) {} /// A magic value for use with the Threshold parameter to indicate /// that the loop unroll should be performed regardless of how much Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Fri Aug 6 13:33:48 2010 @@ -92,7 +92,7 @@ public: static char ID; // Pass ID, replacement for typeid explicit LoopUnswitch(bool Os = false) : - LoopPass(&ID), OptimizeForSize(Os), redoLoop(false), + LoopPass(ID), OptimizeForSize(Os), redoLoop(false), currentLoop(NULL), DF(NULL), DT(NULL), loopHeader(NULL), loopPreheader(NULL) {} Modified: llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LowerAtomic.cpp Fri Aug 6 13:33:48 2010 @@ -138,7 +138,7 @@ struct LowerAtomic : public BasicBlockPass { static char ID; - LowerAtomic() : BasicBlockPass(&ID) {} + LowerAtomic() : BasicBlockPass(ID) {} bool runOnBasicBlock(BasicBlock &BB) { bool Changed = false; for (BasicBlock::iterator DI = BB.begin(), DE = BB.end(); DI != DE; ) { Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Fri Aug 6 13:33:48 2010 @@ -304,7 +304,7 @@ bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - MemCpyOpt() : FunctionPass(&ID) {} + MemCpyOpt() : FunctionPass(ID) {} private: // This transformation requires dominator postdominator info Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Fri Aug 6 13:33:48 2010 @@ -77,7 +77,7 @@ bool MadeChange; public: static char ID; // Pass identification, replacement for typeid - Reassociate() : FunctionPass(&ID) {} + Reassociate() : FunctionPass(ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Reg2Mem.cpp Fri Aug 6 13:33:48 2010 @@ -36,7 +36,7 @@ namespace { struct RegToMem : public FunctionPass { static char ID; // Pass identification, replacement for typeid - RegToMem() : FunctionPass(&ID) {} + RegToMem() : FunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(BreakCriticalEdgesID); @@ -124,7 +124,7 @@ // createDemoteRegisterToMemory - Provide an entry point to create this pass. // -const PassInfo *const llvm::DemoteRegisterToMemoryID = &X; +char &llvm::DemoteRegisterToMemoryID = RegToMem::ID; FunctionPass *llvm::createDemoteRegisterToMemoryPass() { return new RegToMem(); } Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Fri Aug 6 13:33:48 2010 @@ -1586,7 +1586,7 @@ /// struct SCCP : public FunctionPass { static char ID; // Pass identification, replacement for typeid - SCCP() : FunctionPass(&ID) {} + SCCP() : FunctionPass(ID) {} // runOnFunction - Run the Sparse Conditional Constant Propagation // algorithm, and return true if the function was modified. @@ -1702,7 +1702,7 @@ /// struct IPSCCP : public ModulePass { static char ID; - IPSCCP() : ModulePass(&ID) {} + IPSCCP() : ModulePass(ID) {} bool runOnModule(Module &M); }; } // end anonymous namespace Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Fri Aug 6 13:33:48 2010 @@ -51,7 +51,7 @@ namespace { struct SROA : public FunctionPass { static char ID; // Pass identification, replacement for typeid - explicit SROA(signed T = -1) : FunctionPass(&ID) { + explicit SROA(signed T = -1) : FunctionPass(ID) { if (T == -1) SRThreshold = 128; else Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp Fri Aug 6 13:33:48 2010 @@ -42,7 +42,7 @@ namespace { struct CFGSimplifyPass : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGSimplifyPass() : FunctionPass(&ID) {} + CFGSimplifyPass() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); }; Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp Fri Aug 6 13:33:48 2010 @@ -32,7 +32,7 @@ const TargetData *TD; public: static char ID; // Pass identification - SimplifyHalfPowrLibCalls() : FunctionPass(&ID) {} + SimplifyHalfPowrLibCalls() : FunctionPass(ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Fri Aug 6 13:33:48 2010 @@ -1237,7 +1237,7 @@ bool Modified; // This is only used by doInitialization. public: static char ID; // Pass identification - SimplifyLibCalls() : FunctionPass(&ID), StrCpy(false), StrCpyChk(true) {} + SimplifyLibCalls() : FunctionPass(ID), StrCpy(false), StrCpyChk(true) {} void InitOptimizations(); bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/Sink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Sink.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Sink.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Sink.cpp Fri Aug 6 13:33:48 2010 @@ -35,7 +35,7 @@ public: static char ID; // Pass identification - Sinking() : FunctionPass(&ID) {} + Sinking() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp Fri Aug 6 13:33:48 2010 @@ -49,7 +49,7 @@ bool runOnFunction(Function &F); public: static char ID; // Pass identification, replacement for typeid - TailDup() : FunctionPass(&ID) {} + TailDup() : FunctionPass(ID) {} private: inline bool shouldEliminateUnconditionalBranch(TerminatorInst *, unsigned); Modified: llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp Fri Aug 6 13:33:48 2010 @@ -72,7 +72,7 @@ namespace { struct TailCallElim : public FunctionPass { static char ID; // Pass identification, replacement for typeid - TailCallElim() : FunctionPass(&ID) {} + TailCallElim() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Fri Aug 6 13:33:48 2010 @@ -36,7 +36,7 @@ namespace { struct BreakCriticalEdges : public FunctionPass { static char ID; // Pass identification, replacement for typeid - BreakCriticalEdges() : FunctionPass(&ID) {} + BreakCriticalEdges() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); @@ -57,7 +57,7 @@ X("break-crit-edges", "Break critical edges in CFG"); // Publically exposed interface to pass... -const PassInfo *const llvm::BreakCriticalEdgesID = &X; +char &llvm::BreakCriticalEdgesID = BreakCriticalEdges::ID; FunctionPass *llvm::createBreakCriticalEdgesPass() { return new BreakCriticalEdges(); } Modified: llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InstructionNamer.cpp Fri Aug 6 13:33:48 2010 @@ -23,7 +23,7 @@ namespace { struct InstNamer : public FunctionPass { static char ID; // Pass identification, replacement for typeid - InstNamer() : FunctionPass(&ID) {} + InstNamer() : FunctionPass(ID) {} void getAnalysisUsage(AnalysisUsage &Info) const { Info.setPreservesAll(); @@ -53,7 +53,7 @@ } -const PassInfo *const llvm::InstructionNamerID = &X; +char &llvm::InstructionNamerID = InstNamer::ID; //===----------------------------------------------------------------------===// // // InstructionNamer - Give any unnamed non-void instructions "tmp" names. Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LCSSA.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Fri Aug 6 13:33:48 2010 @@ -47,7 +47,7 @@ namespace { struct LCSSA : public LoopPass { static char ID; // Pass identification, replacement for typeid - LCSSA() : LoopPass(&ID) {} + LCSSA() : LoopPass(ID) {} // Cached analysis information for the current function. DominatorTree *DT; @@ -93,7 +93,7 @@ static RegisterPass X("lcssa", "Loop-Closed SSA Form Pass"); Pass *llvm::createLCSSAPass() { return new LCSSA(); } -const PassInfo *const llvm::LCSSAID = &X; +char &llvm::LCSSAID = LCSSA::ID; /// BlockDominatesAnExit - Return true if the specified block dominates at least Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Fri Aug 6 13:33:48 2010 @@ -65,7 +65,7 @@ namespace { struct LoopSimplify : public LoopPass { static char ID; // Pass identification, replacement for typeid - LoopSimplify() : LoopPass(&ID) {} + LoopSimplify() : LoopPass(ID) {} // AA - If we have an alias analysis object to update, this is it, otherwise // this is null. @@ -110,7 +110,7 @@ X("loopsimplify", "Canonicalize natural loops", true); // Publically exposed interface to pass... -const PassInfo *const llvm::LoopSimplifyID = &X; +char &llvm::LoopSimplifyID = LoopSimplify::ID; Pass *llvm::createLoopSimplifyPass() { return new LoopSimplify(); } /// runOnLoop - Run down all loops in the CFG (recursively, but we could do Modified: llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp Fri Aug 6 13:33:48 2010 @@ -78,7 +78,7 @@ static char ID; // Pass identification, replacement for typeid explicit LowerInvoke(const TargetLowering *tli = NULL, bool useExpensiveEHSupport = ExpensiveEHSupport) - : FunctionPass(&ID), useExpensiveEHSupport(useExpensiveEHSupport), + : FunctionPass(ID), useExpensiveEHSupport(useExpensiveEHSupport), TLI(tli) { } bool doInitialization(Module &M); bool runOnFunction(Function &F); @@ -103,7 +103,7 @@ static RegisterPass X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); -const PassInfo *const llvm::LowerInvokePassID = &X; +char &llvm::LowerInvokePassID = LowerInvoke::ID; // Public Interface To the LowerInvoke pass. FunctionPass *llvm::createLowerInvokePass(const TargetLowering *TLI) { Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Fri Aug 6 13:33:48 2010 @@ -34,7 +34,7 @@ class LowerSwitch : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid - LowerSwitch() : FunctionPass(&ID) {} + LowerSwitch() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F); @@ -85,7 +85,7 @@ X("lowerswitch", "Lower SwitchInst's to branches"); // Publically exposed interface to pass... -const PassInfo *const llvm::LowerSwitchID = &X; +char &llvm::LowerSwitchID = LowerSwitch::ID; // createLowerSwitchPass - Interface to this file... FunctionPass *llvm::createLowerSwitchPass() { return new LowerSwitch(); Modified: llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp Fri Aug 6 13:33:48 2010 @@ -27,7 +27,7 @@ namespace { struct PromotePass : public FunctionPass { static char ID; // Pass identification, replacement for typeid - PromotePass() : FunctionPass(&ID) {} + PromotePass() : FunctionPass(ID) {} // runOnFunction - To run this pass, first we calculate the alloca // instructions that are safe for promotion, then we promote each one. @@ -82,7 +82,7 @@ } // Publically exposed interface to pass... -const PassInfo *const llvm::PromoteMemoryToRegisterID = &X; +char &llvm::PromoteMemoryToRegisterID = PromotePass::ID; // createPromoteMemoryToRegister - Provide an entry point to create this pass. // FunctionPass *llvm::createPromoteMemoryToRegisterPass() { Modified: llvm/trunk/lib/Transforms/Utils/SSI.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SSI.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/SSI.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/SSI.cpp Fri Aug 6 13:33:48 2010 @@ -399,7 +399,7 @@ namespace { struct SSIEverything : public FunctionPass { static char ID; // Pass identification, replacement for typeid - SSIEverything() : FunctionPass(&ID) {} + SSIEverything() : FunctionPass(ID) {} bool runOnFunction(Function &F); Modified: llvm/trunk/lib/VMCore/Pass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Pass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Pass.cpp (original) +++ llvm/trunk/lib/VMCore/Pass.cpp Fri Aug 6 13:33:48 2010 @@ -36,14 +36,7 @@ // Pass Implementation // -Pass::Pass(PassKind K, intptr_t pid) : Resolver(0), PassID(pid), Kind(K) { - assert(pid && "pid cannot be 0"); -} - -Pass::Pass(PassKind K, const void *pid) - : Resolver(0), PassID((intptr_t)pid), Kind(K) { - assert(pid && "pid cannot be 0"); -} +Pass::Pass(PassKind K, char &pid) : Resolver(0), PassID(&pid), Kind(K) { } // Force out-of-line virtual method. Pass::~Pass() { @@ -62,8 +55,8 @@ return PMT_ModulePassManager; } -bool Pass::mustPreserveAnalysisID(const PassInfo *AnalysisID) const { - return Resolver->getAnalysisIfAvailable(AnalysisID, true) != 0; +bool Pass::mustPreserveAnalysisID(char &AID) const { + return Resolver->getAnalysisIfAvailable(&AID, true) != 0; } // dumpPassStructure - Implement the -debug-passes=Structure option @@ -76,7 +69,9 @@ /// Registration templates, but can be overloaded directly. /// const char *Pass::getPassName() const { - if (const PassInfo *PI = getPassInfo()) + AnalysisID AID = getPassID(); + const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(AID); + if (PI) return PI->getPassName(); return "Unnamed pass: implement Pass::getPassName()"; } @@ -102,7 +97,7 @@ // By default, don't do anything. } -void *Pass::getAdjustedAnalysisPointer(const PassInfo *) { +void *Pass::getAdjustedAnalysisPointer(AnalysisID AID) { return this; } @@ -234,13 +229,7 @@ return PMT_BasicBlockPassManager; } -// getPassInfo - Return the PassInfo data structure that corresponds to this -// pass... -const PassInfo *Pass::getPassInfo() const { - return lookupPassInfo(PassID); -} - -const PassInfo *Pass::lookupPassInfo(intptr_t TI) { +const PassInfo *Pass::lookupPassInfo(const void *TI) { return PassRegistry::getPassRegistry()->getPassInfo(TI); } @@ -262,8 +251,8 @@ // RegisterAGBase implementation // -RegisterAGBase::RegisterAGBase(const char *Name, intptr_t InterfaceID, - intptr_t PassID, bool isDefault) +RegisterAGBase::RegisterAGBase(const char *Name, const void *InterfaceID, + const void *PassID, bool isDefault) : PassInfo(Name, InterfaceID) { PassRegistry::getPassRegistry()->registerAnalysisGroup(InterfaceID, PassID, *this, isDefault); @@ -306,7 +295,7 @@ void passEnumerate(const PassInfo *P) { if (P->isCFGOnlyPass()) - CFGOnlyList.push_back(P); + CFGOnlyList.push_back(P->getTypeInfo()); } }; } @@ -326,15 +315,25 @@ GetCFGOnlyPasses(Preserved).enumeratePasses(); } -AnalysisUsage &AnalysisUsage::addRequiredID(AnalysisID ID) { - assert(ID && "Pass class not registered!"); - Required.push_back(ID); +AnalysisUsage &AnalysisUsage::addPreserved(StringRef Arg) { + const PassInfo *PI = Pass::lookupPassInfo(Arg); + // If the pass exists, preserve it. Otherwise silently do nothing. + if (PI) Preserved.push_back(PI->getTypeInfo()); return *this; } -AnalysisUsage &AnalysisUsage::addRequiredTransitiveID(AnalysisID ID) { - assert(ID && "Pass class not registered!"); +AnalysisUsage &AnalysisUsage::addRequiredID(const void *ID) { Required.push_back(ID); - RequiredTransitive.push_back(ID); + return *this; +} + +AnalysisUsage &AnalysisUsage::addRequiredID(char &ID) { + Required.push_back(&ID); + return *this; +} + +AnalysisUsage &AnalysisUsage::addRequiredTransitiveID(char &ID) { + Required.push_back(&ID); + RequiredTransitive.push_back(&ID); return *this; } Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Fri Aug 6 13:33:48 2010 @@ -82,15 +82,17 @@ /// This is a helper to determine whether to print IR before or /// after a pass. -static bool ShouldPrintBeforeOrAfterPass(Pass *P, +static bool ShouldPrintBeforeOrAfterPass(const void *PassID, PassOptionList &PassesToPrint) { - for (unsigned i = 0, ie = PassesToPrint.size(); i < ie; ++i) { - const llvm::PassInfo *PassInf = PassesToPrint[i]; - if (PassInf && P->getPassInfo()) - if (PassInf->getPassArgument() == - P->getPassInfo()->getPassArgument()) { - return true; - } + if (const llvm::PassInfo *PI = + PassRegistry::getPassRegistry()->getPassInfo(PassID)) { + for (unsigned i = 0, ie = PassesToPrint.size(); i < ie; ++i) { + const llvm::PassInfo *PassInf = PassesToPrint[i]; + if (PassInf) + if (PassInf->getPassArgument() == PI->getPassArgument()) { + return true; + } + } } return false; } @@ -98,14 +100,14 @@ /// This is a utility to check whether a pass should have IR dumped /// before it. -static bool ShouldPrintBeforePass(Pass *P) { - return PrintBeforeAll || ShouldPrintBeforeOrAfterPass(P, PrintBefore); +static bool ShouldPrintBeforePass(const void *PassID) { + return PrintBeforeAll || ShouldPrintBeforeOrAfterPass(PassID, PrintBefore); } /// This is a utility to check whether a pass should have IR dumped /// after it. -static bool ShouldPrintAfterPass(Pass *P) { - return PrintAfterAll || ShouldPrintBeforeOrAfterPass(P, PrintAfter); +static bool ShouldPrintAfterPass(const void *PassID) { + return PrintAfterAll || ShouldPrintBeforeOrAfterPass(PassID, PrintAfter); } } // End of llvm namespace @@ -163,7 +165,7 @@ public: static char ID; explicit BBPassManager(int Depth) - : PMDataManager(Depth), FunctionPass(&ID) {} + : PMDataManager(Depth), FunctionPass(ID) {} /// Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the function, and if so, return true. @@ -224,7 +226,7 @@ public: static char ID; explicit FunctionPassManagerImpl(int Depth) : - Pass(PT_PassManager, &ID), PMDataManager(Depth), + Pass(PT_PassManager, ID), PMDataManager(Depth), PMTopLevelManager(TLM_Function), wasRun(false) { } /// add - Add a pass to the queue of passes to run. This passes ownership of @@ -298,7 +300,7 @@ public: static char ID; explicit MPPassManager(int Depth) : - Pass(PT_PassManager, &ID), PMDataManager(Depth) { } + Pass(PT_PassManager, ID), PMDataManager(Depth) { } // Delete on the fly managers. virtual ~MPPassManager() { @@ -332,7 +334,7 @@ /// Return function pass corresponding to PassInfo PI, that is /// required by module pass MP. Instantiate analysis pass, by using /// its runOnFunction() for function F. - virtual Pass* getOnTheFlyPass(Pass *MP, const PassInfo *PI, Function &F); + virtual Pass* getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F); virtual const char *getPassName() const { return "Module Pass Manager"; @@ -383,7 +385,7 @@ public: static char ID; explicit PassManagerImpl(int Depth) : - Pass(PT_PassManager, &ID), PMDataManager(Depth), + Pass(PT_PassManager, ID), PMDataManager(Depth), PMTopLevelManager(TLM_Pass) { } /// add - Add a pass to the queue of passes to run. This passes ownership of @@ -568,8 +570,9 @@ // If P is an analysis pass and it is available then do not // generate the analysis again. Stale analysis info should not be // available at this point. - if (P->getPassInfo() && - P->getPassInfo()->isAnalysis() && findAnalysisPass(P->getPassInfo())) { + const PassInfo *PI = + PassRegistry::getPassRegistry()->getPassInfo(P->getPassID()); + if (PI && PI->isAnalysis() && findAnalysisPass(P->getPassID())) { delete P; return; } @@ -586,7 +589,8 @@ Pass *AnalysisPass = findAnalysisPass(*I); if (!AnalysisPass) { - AnalysisPass = (*I)->createPass(); + const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(*I); + AnalysisPass = PI->createPass(); if (P->getPotentialPassManagerType () == AnalysisPass->getPotentialPassManagerType()) // Schedule analysis pass that is managed by the same pass manager. @@ -632,16 +636,21 @@ for (SmallVector::iterator I = ImmutablePasses.begin(), E = ImmutablePasses.end(); P == NULL && I != E; ++I) { - const PassInfo *PI = (*I)->getPassInfo(); + AnalysisID PI = (*I)->getPassID(); if (PI == AID) P = *I; // If Pass not found then check the interfaces implemented by Immutable Pass if (!P) { + const PassInfo *PassInf = + PassRegistry::getPassRegistry()->getPassInfo(PI); const std::vector &ImmPI = - PI->getInterfacesImplemented(); - if (std::find(ImmPI.begin(), ImmPI.end(), AID) != ImmPI.end()) - P = *I; + PassInf->getInterfacesImplemented(); + for (std::vector::const_iterator II = ImmPI.begin(), + EE = ImmPI.end(); II != EE; ++II) { + if ((*II)->getTypeInfo() == AID) + P = *I; + } } } @@ -724,16 +733,19 @@ /// Augement AvailableAnalysis by adding analysis made available by pass P. void PMDataManager::recordAvailableAnalysis(Pass *P) { - const PassInfo *PI = P->getPassInfo(); - if (PI == 0) return; + AnalysisID PI = P->getPassID(); AvailableAnalysis[PI] = P; + + assert(AvailableAnalysis.size()); //This pass is the current implementation of all of the interfaces it //implements as well. - const std::vector &II = PI->getInterfacesImplemented(); + const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(PI); + if (PInf == 0) return; + const std::vector &II = PInf->getInterfacesImplemented(); for (unsigned i = 0, e = II.size(); i != e; ++i) - AvailableAnalysis[II[i]] = P; + AvailableAnalysis[II[i]->getTypeInfo()] = P; } // Return true if P preserves high level analysis used by other @@ -749,7 +761,7 @@ Pass *P1 = *I; if (P1->getAsImmutablePass() == 0 && std::find(PreservedSet.begin(), PreservedSet.end(), - P1->getPassInfo()) == + P1->getPassID()) == PreservedSet.end()) return false; } @@ -799,7 +811,7 @@ AvailableAnalysis.erase(Info); } } - + // Check inherited analysis also. If P is not preserving analysis // provided by parent manager then remove it here. for (unsigned Index = 0; Index < PMT_Last; ++Index) { @@ -861,16 +873,17 @@ P->releaseMemory(); } - if (const PassInfo *PI = P->getPassInfo()) { + AnalysisID PI = P->getPassID(); + if (const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(PI)) { // Remove the pass itself (if it is not already removed). AvailableAnalysis.erase(PI); // Remove all interfaces this pass implements, for which it is also // listed as the available implementation. - const std::vector &II = PI->getInterfacesImplemented(); + const std::vector &II = PInf->getInterfacesImplemented(); for (unsigned i = 0, e = II.size(); i != e; ++i) { std::map::iterator Pos = - AvailableAnalysis.find(II[i]); + AvailableAnalysis.find(II[i]->getTypeInfo()); if (Pos != AvailableAnalysis.end() && Pos->second == P) AvailableAnalysis.erase(Pos); } @@ -941,7 +954,8 @@ for (SmallVector::iterator I = ReqAnalysisNotAvailable.begin(), E = ReqAnalysisNotAvailable.end() ;I != E; ++I) { - Pass *AnalysisPass = (*I)->createPass(); + const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(*I); + Pass *AnalysisPass = PI->createPass(); this->addLowerLevelRequiredPass(P, AnalysisPass); } @@ -1044,7 +1058,8 @@ if (PMDataManager *PMD = (*I)->getAsPMDataManager()) PMD->dumpPassArguments(); else - if (const PassInfo *PI = (*I)->getPassInfo()) + if (const PassInfo *PI = + PassRegistry::getPassRegistry()->getPassInfo((*I)->getPassID())) if (!PI->isAnalysisGroup()) dbgs() << " -" << PI->getPassArgument(); } @@ -1116,7 +1131,8 @@ dbgs() << (void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:"; for (unsigned i = 0; i != Set.size(); ++i) { if (i) dbgs() << ','; - dbgs() << ' ' << Set[i]->getPassName(); + const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(Set[i]); + dbgs() << ' ' << PInf->getPassName(); } dbgs() << '\n'; } @@ -1147,7 +1163,7 @@ llvm_unreachable("Unable to schedule pass"); } -Pass *PMDataManager::getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F) { +Pass *PMDataManager::getOnTheFlyPass(Pass *P, AnalysisID PI, Function &F) { assert(0 && "Unable to find on the fly pass"); return NULL; } @@ -1166,7 +1182,7 @@ return PM.findAnalysisPass(ID, dir); } -Pass *AnalysisResolver::findImplPass(Pass *P, const PassInfo *AnalysisPI, +Pass *AnalysisResolver::findImplPass(Pass *P, AnalysisID AnalysisPI, Function &F) { return PM.getOnTheFlyPass(P, AnalysisPI, F); } @@ -1288,15 +1304,16 @@ /// This implies that all passes MUST be allocated with 'new'. void FunctionPassManager::add(Pass *P) { // If this is a not a function pass, don't add a printer for it. + const void *PassID = P->getPassID(); if (P->getPassKind() == PT_Function) - if (ShouldPrintBeforePass(P)) + if (ShouldPrintBeforePass(PassID)) addImpl(P->createPrinterPass(dbgs(), std::string("*** IR Dump Before ") + P->getPassName() + " ***")); addImpl(P); if (P->getPassKind() == PT_Function) - if (ShouldPrintAfterPass(P)) + if (ShouldPrintAfterPass(PassID)) addImpl(P->createPrinterPass(dbgs(), std::string("*** IR Dump After ") + P->getPassName() + " ***")); } @@ -1561,7 +1578,7 @@ /// Return function pass corresponding to PassInfo PI, that is /// required by module pass MP. Instantiate analysis pass, by using /// its runOnFunction() for function F. -Pass* MPPassManager::getOnTheFlyPass(Pass *MP, const PassInfo *PI, Function &F){ +Pass* MPPassManager::getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F){ FunctionPassManagerImpl *FPP = OnTheFlyManagers[MP]; assert(FPP && "Unable to find on the fly pass"); @@ -1614,13 +1631,14 @@ /// will be destroyed as well, so there is no need to delete the pass. This /// implies that all passes MUST be allocated with 'new'. void PassManager::add(Pass *P) { - if (ShouldPrintBeforePass(P)) + const void* PassID = P->getPassID(); + if (ShouldPrintBeforePass(PassID)) addImpl(P->createPrinterPass(dbgs(), std::string("*** IR Dump Before ") + P->getPassName() + " ***")); addImpl(P); - if (ShouldPrintAfterPass(P)) + if (ShouldPrintAfterPass(PassID)) addImpl(P->createPrinterPass(dbgs(), std::string("*** IR Dump After ") + P->getPassName() + " ***")); } Modified: llvm/trunk/lib/VMCore/PassRegistry.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassRegistry.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassRegistry.cpp (original) +++ llvm/trunk/lib/VMCore/PassRegistry.cpp Fri Aug 6 13:33:48 2010 @@ -60,7 +60,7 @@ } -const PassInfo *PassRegistry::getPassInfo(intptr_t TI) const { +const PassInfo *PassRegistry::getPassInfo(const void *TI) const { sys::SmartScopedLock Guard(Lock); MapType::const_iterator I = PassInfoMap.find(TI); return I != PassInfoMap.end() ? I->second : 0; @@ -108,8 +108,8 @@ /// Analysis Group Mechanisms. -void PassRegistry::registerAnalysisGroup(intptr_t InterfaceID, - intptr_t PassID, +void PassRegistry::registerAnalysisGroup(const void *InterfaceID, + const void *PassID, PassInfo& Registeree, bool isDefault) { PassInfo *InterfaceInfo = const_cast(getPassInfo(InterfaceID)); Modified: llvm/trunk/lib/VMCore/PrintModulePass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PrintModulePass.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PrintModulePass.cpp (original) +++ llvm/trunk/lib/VMCore/PrintModulePass.cpp Fri Aug 6 13:33:48 2010 @@ -28,10 +28,10 @@ bool DeleteStream; // Delete the ostream in our dtor? public: static char ID; - PrintModulePass() : ModulePass(&ID), Out(&dbgs()), + PrintModulePass() : ModulePass(ID), Out(&dbgs()), DeleteStream(false) {} PrintModulePass(const std::string &B, raw_ostream *o, bool DS) - : ModulePass(&ID), Banner(B), Out(o), DeleteStream(DS) {} + : ModulePass(ID), Banner(B), Out(o), DeleteStream(DS) {} ~PrintModulePass() { if (DeleteStream) delete Out; @@ -53,10 +53,10 @@ bool DeleteStream; // Delete the ostream in our dtor? public: static char ID; - PrintFunctionPass() : FunctionPass(&ID), Banner(""), Out(&dbgs()), + PrintFunctionPass() : FunctionPass(ID), Banner(""), Out(&dbgs()), DeleteStream(false) {} PrintFunctionPass(const std::string &B, raw_ostream *o, bool DS) - : FunctionPass(&ID), Banner(B), Out(o), DeleteStream(DS) {} + : FunctionPass(ID), Banner(B), Out(o), DeleteStream(DS) {} inline ~PrintFunctionPass() { if (DeleteStream) delete Out; Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Fri Aug 6 13:33:48 2010 @@ -72,7 +72,7 @@ struct PreVerifier : public FunctionPass { static char ID; // Pass ID, replacement for typeid - PreVerifier() : FunctionPass(&ID) { } + PreVerifier() : FunctionPass(ID) { } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -104,7 +104,7 @@ char PreVerifier::ID = 0; static RegisterPass PreVer("preverify", "Preliminary module verification"); -static const PassInfo *const PreVerifyID = &PreVer; +char &PreVerifyID = PreVerifier::ID; namespace { class TypeSet : public AbstractTypeUser { @@ -182,20 +182,20 @@ SmallPtrSet MDNodes; Verifier() - : FunctionPass(&ID), + : FunctionPass(ID), Broken(false), RealPass(true), action(AbortProcessAction), Mod(0), Context(0), DT(0), MessagesStr(Messages) {} explicit Verifier(VerifierFailureAction ctn) - : FunctionPass(&ID), + : FunctionPass(ID), Broken(false), RealPass(true), action(ctn), Mod(0), Context(0), DT(0), MessagesStr(Messages) {} explicit Verifier(bool AB) - : FunctionPass(&ID), + : FunctionPass(ID), Broken(false), RealPass(true), action( AB ? AbortProcessAction : PrintMessageAction), Mod(0), Context(0), DT(0), MessagesStr(Messages) {} explicit Verifier(DominatorTree &dt) - : FunctionPass(&ID), + : FunctionPass(ID), Broken(false), RealPass(false), action(PrintMessageAction), Mod(0), Context(0), DT(&dt), MessagesStr(Messages) {} Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original) +++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Fri Aug 6 13:33:48 2010 @@ -100,7 +100,8 @@ } static const PassInfo *getPI(Pass *P) { - const PassInfo *PI = P->getPassInfo(); + const void *ID = P->getPassID(); + const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID); delete P; return PI; } Modified: llvm/trunk/tools/bugpoint/TestPasses.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/TestPasses.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/TestPasses.cpp (original) +++ llvm/trunk/tools/bugpoint/TestPasses.cpp Fri Aug 6 13:33:48 2010 @@ -27,7 +27,7 @@ class CrashOnCalls : public BasicBlockPass { public: static char ID; // Pass ID, replacement for typeid - CrashOnCalls() : BasicBlockPass(&ID) {} + CrashOnCalls() : BasicBlockPass(ID) {} private: virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -54,7 +54,7 @@ class DeleteCalls : public BasicBlockPass { public: static char ID; // Pass ID, replacement for typeid - DeleteCalls() : BasicBlockPass(&ID) {} + DeleteCalls() : BasicBlockPass(ID) {} private: bool runOnBasicBlock(BasicBlock &BB) { for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/bugpoint.cpp (original) +++ llvm/trunk/tools/bugpoint/bugpoint.cpp Fri Aug 6 13:33:48 2010 @@ -90,7 +90,8 @@ AddToDriver(BugDriver &_D) : D(_D) {} virtual void add(Pass *P) { - const PassInfo *PI = P->getPassInfo(); + const void *ID = P->getPassID(); + const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID); D.addPasses(&PI, &PI + 1); } }; Modified: llvm/trunk/tools/llvm-prof/llvm-prof.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-prof/llvm-prof.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/tools/llvm-prof/llvm-prof.cpp (original) +++ llvm/trunk/tools/llvm-prof/llvm-prof.cpp Fri Aug 6 13:33:48 2010 @@ -128,7 +128,7 @@ public: static char ID; // Class identification, replacement for typeinfo. explicit ProfileInfoPrinterPass(ProfileInfoLoader &_PIL) - : ModulePass(&ID), PIL(_PIL) {} + : ModulePass(ID), PIL(_PIL) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/tools/opt/AnalysisWrappers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/AnalysisWrappers.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/tools/opt/AnalysisWrappers.cpp (original) +++ llvm/trunk/tools/opt/AnalysisWrappers.cpp Fri Aug 6 13:33:48 2010 @@ -31,7 +31,7 @@ /// or handle in alias analyses. struct ExternalFunctionsPassedConstants : public ModulePass { static char ID; // Pass ID, replacement for typeid - ExternalFunctionsPassedConstants() : ModulePass(&ID) {} + ExternalFunctionsPassedConstants() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { if (!I->isDeclaration()) continue; @@ -74,7 +74,7 @@ struct CallGraphPrinter : public ModulePass { static char ID; // Pass ID, replacement for typeid - CallGraphPrinter() : ModulePass(&ID) {} + CallGraphPrinter() : ModulePass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/tools/opt/GraphPrinters.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/GraphPrinters.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/tools/opt/GraphPrinters.cpp (original) +++ llvm/trunk/tools/opt/GraphPrinters.cpp Fri Aug 6 13:33:48 2010 @@ -65,7 +65,7 @@ namespace { struct CallGraphPrinter : public ModulePass { static char ID; // Pass ID, replacement for typeid - CallGraphPrinter() : ModulePass(&ID) {} + CallGraphPrinter() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { WriteGraphToFile(llvm::errs(), "callgraph", &getAnalysis()); @@ -93,7 +93,7 @@ class DomInfoPrinter : public FunctionPass { public: static char ID; // Pass identification, replacement for typeid - DomInfoPrinter() : FunctionPass(&ID) {} + DomInfoPrinter() : FunctionPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); Modified: llvm/trunk/tools/opt/PrintSCC.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/PrintSCC.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/tools/opt/PrintSCC.cpp (original) +++ llvm/trunk/tools/opt/PrintSCC.cpp Fri Aug 6 13:33:48 2010 @@ -36,7 +36,7 @@ namespace { struct CFGSCC : public FunctionPass { static char ID; // Pass identification, replacement for typeid - CFGSCC() : FunctionPass(&ID) {} + CFGSCC() : FunctionPass(ID) {} bool runOnFunction(Function& func); void print(raw_ostream &O, const Module* = 0) const { } @@ -48,7 +48,7 @@ struct CallGraphSCC : public ModulePass { static char ID; // Pass identification, replacement for typeid - CallGraphSCC() : ModulePass(&ID) {} + CallGraphSCC() : ModulePass(ID) {} // run - Print out SCCs in the call graph for the specified module. bool runOnModule(Module &M); Modified: llvm/trunk/tools/opt/opt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/tools/opt/opt.cpp (original) +++ llvm/trunk/tools/opt/opt.cpp Fri Aug 6 13:33:48 2010 @@ -139,7 +139,7 @@ static char ID; const PassInfo *PassToPrint; CallGraphSCCPassPrinter(const PassInfo *PI) : - CallGraphSCCPass(&ID), PassToPrint(PI) {} + CallGraphSCCPass(ID), PassToPrint(PI) {} virtual bool runOnSCC(CallGraphSCC &SCC) { if (!Quiet) { @@ -148,7 +148,8 @@ for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) { Function *F = (*I)->getFunction(); if (F) - getAnalysisID(PassToPrint).print(outs(), F->getParent()); + getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), + F->getParent()); } } // Get and print pass... @@ -158,7 +159,7 @@ virtual const char *getPassName() const { return "'Pass' Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint); + AU.addRequiredID(PassToPrint->getTypeInfo()); AU.setPreservesAll(); } }; @@ -168,13 +169,13 @@ struct ModulePassPrinter : public ModulePass { static char ID; const PassInfo *PassToPrint; - ModulePassPrinter(const PassInfo *PI) : ModulePass(&ID), + ModulePassPrinter(const PassInfo *PI) : ModulePass(ID), PassToPrint(PI) {} virtual bool runOnModule(Module &M) { if (!Quiet) { outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; - getAnalysisID(PassToPrint).print(outs(), &M); + getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), &M); } // Get and print pass... @@ -184,7 +185,7 @@ virtual const char *getPassName() const { return "'Pass' Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint); + AU.addRequiredID(PassToPrint->getTypeInfo()); AU.setPreservesAll(); } }; @@ -193,7 +194,7 @@ struct FunctionPassPrinter : public FunctionPass { const PassInfo *PassToPrint; static char ID; - FunctionPassPrinter(const PassInfo *PI) : FunctionPass(&ID), + FunctionPassPrinter(const PassInfo *PI) : FunctionPass(ID), PassToPrint(PI) {} virtual bool runOnFunction(Function &F) { @@ -202,14 +203,15 @@ << "' for function '" << F.getName() << "':\n"; } // Get and print pass... - getAnalysisID(PassToPrint).print(outs(), F.getParent()); + getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), + F.getParent()); return false; } virtual const char *getPassName() const { return "FunctionPass Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint); + AU.addRequiredID(PassToPrint->getTypeInfo()); AU.setPreservesAll(); } }; @@ -220,12 +222,12 @@ static char ID; const PassInfo *PassToPrint; LoopPassPrinter(const PassInfo *PI) : - LoopPass(&ID), PassToPrint(PI) {} + LoopPass(ID), PassToPrint(PI) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM) { if (!Quiet) { outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; - getAnalysisID(PassToPrint).print(outs(), + getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), L->getHeader()->getParent()->getParent()); } // Get and print pass... @@ -235,7 +237,7 @@ virtual const char *getPassName() const { return "'Pass' Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint); + AU.addRequiredID(PassToPrint->getTypeInfo()); AU.setPreservesAll(); } }; @@ -246,7 +248,7 @@ const PassInfo *PassToPrint; static char ID; BasicBlockPassPrinter(const PassInfo *PI) - : BasicBlockPass(&ID), PassToPrint(PI) {} + : BasicBlockPass(ID), PassToPrint(PI) {} virtual bool runOnBasicBlock(BasicBlock &BB) { if (!Quiet) { @@ -255,14 +257,15 @@ } // Get and print pass... - getAnalysisID(PassToPrint).print(outs(), BB.getParent()->getParent()); + getAnalysisID(PassToPrint->getTypeInfo()).print(outs(), + BB.getParent()->getParent()); return false; } virtual const char *getPassName() const { return "BasicBlockPass Printer"; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredID(PassToPrint); + AU.addRequiredID(PassToPrint->getTypeInfo()); AU.setPreservesAll(); } }; Modified: llvm/trunk/unittests/VMCore/PassManagerTest.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/VMCore/PassManagerTest.cpp?rev=110460&r1=110459&r2=110460&view=diff ============================================================================== --- llvm/trunk/unittests/VMCore/PassManagerTest.cpp (original) +++ llvm/trunk/unittests/VMCore/PassManagerTest.cpp Fri Aug 6 13:33:48 2010 @@ -40,7 +40,7 @@ public: static char run; static char ID; - ModuleNDNM() : ModulePass(&ID) {} + ModuleNDNM() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { run++; return false; @@ -56,7 +56,7 @@ public: static char run; static char ID; - ModuleNDM() : ModulePass(&ID) {} + ModuleNDM() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { run++; return true; @@ -70,7 +70,7 @@ public: static char run; static char ID; - ModuleNDM2() : ModulePass(&ID) {} + ModuleNDM2() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { run++; return true; @@ -83,7 +83,7 @@ public: static char run; static char ID; - ModuleDNM() : ModulePass(&ID) {} + ModuleDNM() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { EXPECT_TRUE(getAnalysisIfAvailable()); run++; @@ -119,7 +119,7 @@ EXPECT_TRUE(finalized); EXPECT_EQ(run, runc); } - PassTestBase() : P(&ID), allocated(0) { + PassTestBase() : P(ID), allocated(0) { initialized = false; finalized = false; runc = 0; @@ -253,7 +253,7 @@ struct OnTheFlyTest: public ModulePass { public: static char ID; - OnTheFlyTest() : ModulePass(&ID) {} + OnTheFlyTest() : ModulePass(ID) {} virtual bool runOnModule(Module &M) { EXPECT_TRUE(getAnalysisIfAvailable()); for (Module::iterator I=M.begin(),E=M.end(); I != E; ++I) { From stoklund at 2pi.dk Fri Aug 6 13:46:59 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Fri, 06 Aug 2010 18:46:59 -0000 Subject: [llvm-commits] [llvm] r110463 - in /llvm/trunk: include/llvm/CodeGen/LiveInterval.h lib/CodeGen/LiveInterval.cpp lib/CodeGen/SplitKit.cpp Message-ID: <20100806184659.660BB2A6C12C@llvm.org> Author: stoklund Date: Fri Aug 6 13:46:59 2010 New Revision: 110463 URL: http://llvm.org/viewvc/llvm-project?rev=110463&view=rev Log: Add LiveInterval::RenumberValues - Garbage collection for VNInfos. After heavy editing of a live interval, it is much easier to simply renumber the live values instead of trying to keep track of the unused ones. Modified: llvm/trunk/include/llvm/CodeGen/LiveInterval.h llvm/trunk/lib/CodeGen/LiveInterval.cpp llvm/trunk/lib/CodeGen/SplitKit.cpp Modified: llvm/trunk/include/llvm/CodeGen/LiveInterval.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveInterval.h?rev=110463&r1=110462&r2=110463&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveInterval.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveInterval.h Fri Aug 6 13:46:59 2010 @@ -336,6 +336,10 @@ return VNI; } + /// RenumberValues - Renumber all values in order of appearance and remove + /// unused values. + void RenumberValues(); + /// isOnlyLROfValNo - Return true if the specified live range is the only /// one defined by the its val#. bool isOnlyLROfValNo(const LiveRange *LR) { Modified: llvm/trunk/lib/CodeGen/LiveInterval.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveInterval.cpp?rev=110463&r1=110462&r2=110463&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveInterval.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveInterval.cpp Fri Aug 6 13:46:59 2010 @@ -180,6 +180,21 @@ } } +/// RenumberValues - Renumber all values in order of appearance and delete the +/// remaining unused values. +void LiveInterval::RenumberValues() { + SmallPtrSet Seen; + valnos.clear(); + for (const_iterator I = begin(), E = end(); I != E; ++I) { + VNInfo *VNI = I->valno; + if (!Seen.insert(VNI)) + continue; + assert(!VNI->isUnused() && "Unused valno used by live range"); + VNI->id = (unsigned)valnos.size(); + valnos.push_back(VNI); + } +} + /// extendIntervalEndTo - This method is used when we want to extend the range /// specified by I to end at the specified endpoint. To do this, we should /// merge and eliminate all ranges that this will overlap with. The iterator is Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=110463&r1=110462&r2=110463&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SplitKit.cpp (original) +++ llvm/trunk/lib/CodeGen/SplitKit.cpp Fri Aug 6 13:46:59 2010 @@ -553,8 +553,10 @@ } // dupli_ goes in last, after rewriting. - if (dupli_) + if (dupli_) { + dupli_->RenumberValues(); intervals_.push_back(dupli_); + } // FIXME: *Calculate spill weights, allocation hints, and register classes for // firstInterval.. From stoklund at 2pi.dk Fri Aug 6 13:47:06 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Fri, 06 Aug 2010 18:47:06 -0000 Subject: [llvm-commits] [llvm] r110464 - /llvm/trunk/lib/CodeGen/InlineSpiller.cpp Message-ID: <20100806184706.E1A5D2A6C12C@llvm.org> Author: stoklund Date: Fri Aug 6 13:47:06 2010 New Revision: 110464 URL: http://llvm.org/viewvc/llvm-project?rev=110464&view=rev Log: Keep the MachiuneFunctionPass pointer around. It is useful for verification. Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/InlineSpiller.cpp?rev=110464&r1=110463&r2=110464&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/InlineSpiller.cpp (original) +++ llvm/trunk/lib/CodeGen/InlineSpiller.cpp Fri Aug 6 13:47:06 2010 @@ -30,6 +30,7 @@ namespace { class InlineSpiller : public Spiller { + MachineFunctionPass &pass_; MachineFunction &mf_; LiveIntervals &lis_; MachineLoopInfo &loops_; @@ -61,7 +62,8 @@ InlineSpiller(MachineFunctionPass &pass, MachineFunction &mf, VirtRegMap &vrm) - : mf_(mf), + : pass_(pass), + mf_(mf), lis_(pass.getAnalysis()), loops_(pass.getAnalysis()), vrm_(vrm), From grosbach at apple.com Fri Aug 6 13:57:24 2010 From: grosbach at apple.com (Jim Grosbach) Date: Fri, 06 Aug 2010 18:57:24 -0000 Subject: [llvm-commits] [llvm] r110465 - in /llvm/trunk/lib/Target/Blackfin: BlackfinRegisterInfo.cpp BlackfinRegisterInfo.h Message-ID: <20100806185724.51A7D2A6C12C@llvm.org> Author: grosbach Date: Fri Aug 6 13:57:24 2010 New Revision: 110465 URL: http://llvm.org/viewvc/llvm-project?rev=110465&view=rev Log: Remove empty processFunctionBeforeFrameFinalized(). The default implementation of the function is equivalent, so no need to provide the target-specific version until/unless it needs to do something. Modified: llvm/trunk/lib/Target/Blackfin/BlackfinRegisterInfo.cpp llvm/trunk/lib/Target/Blackfin/BlackfinRegisterInfo.h Modified: llvm/trunk/lib/Target/Blackfin/BlackfinRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/BlackfinRegisterInfo.cpp?rev=110465&r1=110464&r2=110465&view=diff ============================================================================== --- llvm/trunk/lib/Target/Blackfin/BlackfinRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/Blackfin/BlackfinRegisterInfo.cpp Fri Aug 6 13:57:24 2010 @@ -344,10 +344,6 @@ } } -void BlackfinRegisterInfo:: -processFunctionBeforeFrameFinalized(MachineFunction &MF) const { -} - // Emit a prologue that sets up a stack frame. // On function entry, R0-R2 and P0 may hold arguments. // R3, P1, and P2 may be used as scratch registers Modified: llvm/trunk/lib/Target/Blackfin/BlackfinRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/BlackfinRegisterInfo.h?rev=110465&r1=110464&r2=110465&view=diff ============================================================================== --- llvm/trunk/lib/Target/Blackfin/BlackfinRegisterInfo.h (original) +++ llvm/trunk/lib/Target/Blackfin/BlackfinRegisterInfo.h Fri Aug 6 13:57:24 2010 @@ -58,8 +58,6 @@ void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, RegScavenger *RS) const; - void processFunctionBeforeFrameFinalized(MachineFunction &MF) const; - void emitPrologue(MachineFunction &MF) const; void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; From grosbach at apple.com Fri Aug 6 13:59:07 2010 From: grosbach at apple.com (Jim Grosbach) Date: Fri, 06 Aug 2010 18:59:07 -0000 Subject: [llvm-commits] [llvm] r110466 - /llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Message-ID: <20100806185907.AE5402A6C12C@llvm.org> Author: grosbach Date: Fri Aug 6 13:59:07 2010 New Revision: 110466 URL: http://llvm.org/viewvc/llvm-project?rev=110466&view=rev Log: Cleanup comment wording Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=110466&r1=110465&r2=110466&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original) +++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Fri Aug 6 13:59:07 2010 @@ -73,10 +73,10 @@ calculateCalleeSavedRegisters(Fn); // Determine placement of CSR spill/restore code: - // - with shrink wrapping, place spills and restores to tightly + // - With shrink wrapping, place spills and restores to tightly // enclose regions in the Machine CFG of the function where - // they are used. Without shrink wrapping - // - default (no shrink wrapping), place all spills in the + // they are used. + // - Without shink wrapping (default), place all spills in the // entry block, all restores in return blocks. placeCSRSpillsAndRestores(Fn); From stuart at apple.com Fri Aug 6 14:02:25 2010 From: stuart at apple.com (Stuart Hastings) Date: Fri, 06 Aug 2010 19:02:25 -0000 Subject: [llvm-commits] [llvm] r110467 - /llvm/trunk/test/FrontendObjC++/2010-08-06-X.Y-syntax.mm Message-ID: <20100806190225.220A02A6C12C@llvm.org> Author: stuart Date: Fri Aug 6 14:02:24 2010 New Revision: 110467 URL: http://llvm.org/viewvc/llvm-project?rev=110467&view=rev Log: Test case for r110459. Radar 8264751. Test case by Fariborz Jahanian! Added: llvm/trunk/test/FrontendObjC++/2010-08-06-X.Y-syntax.mm Added: llvm/trunk/test/FrontendObjC++/2010-08-06-X.Y-syntax.mm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC%2B%2B/2010-08-06-X.Y-syntax.mm?rev=110467&view=auto ============================================================================== --- llvm/trunk/test/FrontendObjC++/2010-08-06-X.Y-syntax.mm (added) +++ llvm/trunk/test/FrontendObjC++/2010-08-06-X.Y-syntax.mm Fri Aug 6 14:02:24 2010 @@ -0,0 +1,16 @@ +// RUN: %llvmgcc %s -S -emit-llvm +struct TFENode { + TFENode(const TFENode& inNode); +}; + + at interface TIconViewController +- (const TFENode&) target; + at end + +void sortAllChildrenForNode(const TFENode&node); + + at implementation TIconViewController +- (void) setArrangeBy { + sortAllChildrenForNode(self.target); +} + at end From bruno.cardoso at gmail.com Fri Aug 6 15:03:27 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Fri, 06 Aug 2010 20:03:27 -0000 Subject: [llvm-commits] [llvm] r110468 - in /llvm/trunk/lib/Target/X86: X86InstrFragmentsSIMD.td X86InstrSSE.td Message-ID: <20100806200327.E3FC72A6C12C@llvm.org> Author: bruno Date: Fri Aug 6 15:03:27 2010 New Revision: 110468 URL: http://llvm.org/viewvc/llvm-project?rev=110468&view=rev Log: Patterns to match AVX 256-bit permutation intrinsics Modified: llvm/trunk/lib/Target/X86/X86InstrFragmentsSIMD.td llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrFragmentsSIMD.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFragmentsSIMD.td?rev=110468&r1=110467&r2=110468&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFragmentsSIMD.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFragmentsSIMD.td Fri Aug 6 15:03:27 2010 @@ -216,6 +216,8 @@ def memopv32i8 : PatFrag<(ops node:$ptr), (v32i8 (memop node:$ptr))>; def memopv8f32 : PatFrag<(ops node:$ptr), (v8f32 (memop node:$ptr))>; def memopv4f64 : PatFrag<(ops node:$ptr), (v4f64 (memop node:$ptr))>; +def memopv4i64 : PatFrag<(ops node:$ptr), (v4i64 (memop node:$ptr))>; +def memopv8i32 : PatFrag<(ops node:$ptr), (v8i32 (memop node:$ptr))>; // SSSE3 uses MMX registers for some instructions. They aren't aligned on a // 16-byte boundary. Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=110468&r1=110467&r2=110468&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Fri Aug 6 15:03:27 2010 @@ -5359,29 +5359,44 @@ // Permute Floating-Point Values multiclass avx_permil opc_rm, bits<8> opc_rmi, string OpcodeStr, - RegisterClass RC, X86MemOperand x86memop> { + RegisterClass RC, X86MemOperand x86memop_f, + X86MemOperand x86memop_i, PatFrag f_frag, PatFrag i_frag, + Intrinsic IntVar, Intrinsic IntImm> { def rr : AVX8I, VEX_4V; + [(set RC:$dst, (IntVar RC:$src1, RC:$src2))]>, VEX_4V; def rm : AVX8I, VEX_4V; + [(set RC:$dst, (IntVar RC:$src1, (i_frag addr:$src2)))]>, VEX_4V; + def ri : AVXAIi8, VEX; + [(set RC:$dst, (IntImm RC:$src1, imm:$src2))]>, VEX; def mi : AVXAIi8, VEX; + [(set RC:$dst, (IntImm (f_frag addr:$src1), imm:$src2))]>, VEX; } -defm VPERMILPS : avx_permil<0x0C, 0x04, "vpermilps", VR128, f128mem>; -defm VPERMILPSY : avx_permil<0x0C, 0x04, "vpermilps", VR256, f256mem>; -defm VPERMILPD : avx_permil<0x0D, 0x05, "vpermilpd", VR128, f128mem>; -defm VPERMILPDY : avx_permil<0x0D, 0x05, "vpermilpd", VR256, f256mem>; +defm VPERMILPS : avx_permil<0x0C, 0x04, "vpermilps", VR128, f128mem, i128mem, + memopv4f32, memopv4i32, + int_x86_avx_vpermilvar_ps, + int_x86_avx_vpermil_ps>; +defm VPERMILPSY : avx_permil<0x0C, 0x04, "vpermilps", VR256, f256mem, i256mem, + memopv8f32, memopv8i32, + int_x86_avx_vpermilvar_ps_256, + int_x86_avx_vpermil_ps_256>; +defm VPERMILPD : avx_permil<0x0D, 0x05, "vpermilpd", VR128, f128mem, i128mem, + memopv2f64, memopv2i64, + int_x86_avx_vpermilvar_pd, + int_x86_avx_vpermil_pd>; +defm VPERMILPDY : avx_permil<0x0D, 0x05, "vpermilpd", VR256, f256mem, i256mem, + memopv4f64, memopv4i64, + int_x86_avx_vpermilvar_pd_256, + int_x86_avx_vpermil_pd_256>; def VPERM2F128rr : AVXAIi8<0x06, MRMSrcReg, (outs VR256:$dst), (ins VR256:$src1, VR256:$src2, i8imm:$src3), @@ -5401,3 +5416,21 @@ Requires<[HasAVX]>; } // isAsmParserOnly + +def : Pat<(int_x86_avx_vperm2f128_ps_256 VR256:$src1, VR256:$src2, imm:$src3), + (VPERM2F128rr VR256:$src1, VR256:$src2, imm:$src3)>; +def : Pat<(int_x86_avx_vperm2f128_pd_256 VR256:$src1, VR256:$src2, imm:$src3), + (VPERM2F128rr VR256:$src1, VR256:$src2, imm:$src3)>; +def : Pat<(int_x86_avx_vperm2f128_si_256 VR256:$src1, VR256:$src2, imm:$src3), + (VPERM2F128rr VR256:$src1, VR256:$src2, imm:$src3)>; + +def : Pat<(int_x86_avx_vperm2f128_ps_256 + VR256:$src1, (memopv8f32 addr:$src2), imm:$src3), + (VPERM2F128rm VR256:$src1, addr:$src2, imm:$src3)>; +def : Pat<(int_x86_avx_vperm2f128_pd_256 + VR256:$src1, (memopv4f64 addr:$src2), imm:$src3), + (VPERM2F128rm VR256:$src1, addr:$src2, imm:$src3)>; +def : Pat<(int_x86_avx_vperm2f128_si_256 + VR256:$src1, (memopv8i32 addr:$src2), imm:$src3), + (VPERM2F128rm VR256:$src1, addr:$src2, imm:$src3)>; + From espindola at google.com Fri Aug 6 15:53:20 2010 From: espindola at google.com (Rafael Espindola) Date: Fri, 6 Aug 2010 16:53:20 -0400 Subject: [llvm-commits] [llvm] r110333 - in /llvm/trunk/tools/bugpoint: BugDriver.cpp BugDriver.h OptimizerDriver.cpp bugpoint.cpp In-Reply-To: References: <20100805152538.50CAA2A6C12C@llvm.org> <2BD86A28-D6D6-49EC-945A-BA3428636A00@apple.com> Message-ID: Owen asked me to make the passes hidden. The attached patch is a bit convoluted, but gets the job done. It also includes some cleanups like not using a pair of a pair :-) Cheers, -- Rafael ?vila de Esp?ndola -------------- next part -------------- A non-text attachment was scrubbed... Name: move.patch Type: text/x-patch Size: 15959 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100806/617160bf/attachment.bin From clattner at apple.com Fri Aug 6 16:24:03 2010 From: clattner at apple.com (Chris Lattner) Date: Fri, 6 Aug 2010 14:24:03 -0700 Subject: [llvm-commits] [llvm] r110423 - in /llvm/trunk: include/llvm/CodeGen/Passes.h include/llvm/Target/TargetInstrInfo.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/OptimizeCmps.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h In-Reply-To: <20100806013249.25D8E2A6C12C@llvm.org> References: <20100806013249.25D8E2A6C12C@llvm.org> Message-ID: On Aug 5, 2010, at 6:32 PM, Bill Wendling wrote: > Author: void > Date: Thu Aug 5 20:32:48 2010 > New Revision: 110423 > > URL: http://llvm.org/viewvc/llvm-project?rev=110423&view=rev > Log: > Add the Optimize Compares pass (disabled by default). Why do we need an entire new pass to do this? Isn't this just a form of CSE? Why doesn't it go in the MachineCSE pass? -Chris > > This pass tries to remove comparison instructions when possible. For instance, > if you have this code: > > sub r1, 1 > cmp r1, 0 > bz L1 > > and "sub" either sets the same flag as the "cmp" instruction or could be > converted to set the same flag, then we can eliminate the "cmp" instruction all > together. This is a important for ARM where the ALU instructions could set the > CPSR flag, but need a special suffix ('s') to do so. > > Added: > llvm/trunk/lib/CodeGen/OptimizeCmps.cpp > Modified: > llvm/trunk/include/llvm/CodeGen/Passes.h > llvm/trunk/include/llvm/Target/TargetInstrInfo.h > llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp > llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp > llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h > > Modified: llvm/trunk/include/llvm/CodeGen/Passes.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=110423&r1=110422&r2=110423&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) > +++ llvm/trunk/include/llvm/CodeGen/Passes.h Thu Aug 5 20:32:48 2010 > @@ -180,6 +180,10 @@ > /// to take advantage of opportunities created during DAG legalization. > FunctionPass *createOptimizePHIsPass(); > > + /// createOptimizeCmpsPass - This pass performs redundant comparison removal > + /// optimization. > + FunctionPass *createOptimizeCmpsPass(); > + > /// createStackSlotColoringPass - This pass performs stack slot coloring. > FunctionPass *createStackSlotColoringPass(bool); > > > Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=110423&r1=110422&r2=110423&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) > +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Thu Aug 5 20:32:48 2010 > @@ -576,6 +576,21 @@ > /// register allocation. > virtual ScheduleHazardRecognizer* > CreateTargetPostRAHazardRecognizer(const InstrItineraryData&) const = 0; > + > + /// isCompareInstr - If the machine instruction is a comparison instruction, > + /// then return true. Also return the source register in SrcReg and the value > + /// it compares against in CmpValue. > + virtual bool isCompareInstr(const MachineInstr *MI, > + unsigned &SrcReg, int &CmpValue) const { > + return false; > + } > + > + /// convertToSetZeroFlag - Convert the instruction to set the zero flag so > + /// that we can remove a "comparison with zero". > + virtual bool convertToSetZeroFlag(MachineInstr *Instr, > + MachineInstr *CmpInstr) const { > + return false; > + } > }; > > /// TargetInstrInfoImpl - This is the default implementation of > > Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=110423&r1=110422&r2=110423&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) > +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Thu Aug 5 20:32:48 2010 > @@ -354,6 +354,7 @@ > printAndVerify(PM, "After codegen DCE pass"); > > PM.add(createOptimizeExtsPass()); > + PM.add(createOptimizeCmpsPass()); > if (!DisableMachineLICM) > PM.add(createMachineLICMPass()); > PM.add(createMachineCSEPass()); > > Added: llvm/trunk/lib/CodeGen/OptimizeCmps.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizeCmps.cpp?rev=110423&view=auto > ============================================================================== > --- llvm/trunk/lib/CodeGen/OptimizeCmps.cpp (added) > +++ llvm/trunk/lib/CodeGen/OptimizeCmps.cpp Thu Aug 5 20:32:48 2010 > @@ -0,0 +1,112 @@ > +//===-- OptimizeCmps.cpp - Optimize comparison instrs ---------------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open Source > +// License. See LICENSE.TXT for details. > +// > +//===----------------------------------------------------------------------===// > +// > +// This pass performs optimization of comparison instructions. For instance, in > +// this code: > +// > +// sub r1, 1 > +// cmp r1, 0 > +// bz L1 > +// > +// If the "sub" instruction all ready sets (or could be modified to set) the > +// same flag that the "cmp" instruction sets and that "bz" uses, then we can > +// eliminate the "cmp" instruction. > +// > +//===----------------------------------------------------------------------===// > + > +#define DEBUG_TYPE "opt-compares" > +#include "llvm/CodeGen/Passes.h" > +#include "llvm/CodeGen/MachineFunctionPass.h" > +#include "llvm/CodeGen/MachineInstrBuilder.h" > +#include "llvm/CodeGen/MachineRegisterInfo.h" > +#include "llvm/Target/TargetInstrInfo.h" > +#include "llvm/Target/TargetRegisterInfo.h" > +#include "llvm/Support/CommandLine.h" > +#include "llvm/ADT/Statistic.h" > +using namespace llvm; > + > +STATISTIC(NumEliminated, "Number of compares eliminated"); > + > +static cl::opt > +EnableOptCmps("enable-optimize-cmps", cl::init(false), cl::Hidden); > + > +namespace { > + class OptimizeCmps : public MachineFunctionPass { > + const TargetMachine *TM; > + const TargetInstrInfo *TII; > + MachineRegisterInfo *MRI; > + > + bool OptimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB); > + > + public: > + static char ID; // Pass identification > + OptimizeCmps() : MachineFunctionPass(&ID) {} > + > + virtual bool runOnMachineFunction(MachineFunction &MF); > + > + virtual void getAnalysisUsage(AnalysisUsage &AU) const { > + AU.setPreservesCFG(); > + MachineFunctionPass::getAnalysisUsage(AU); > + } > + }; > +} > + > +char OptimizeCmps::ID = 0; > +INITIALIZE_PASS(OptimizeCmps, "opt-cmps", > + "Optimize comparison instrs", false, false); > + > +FunctionPass *llvm::createOptimizeCmpsPass() { return new OptimizeCmps(); } > + > +/// OptimizeCmpInstr - If the instruction is a compare and the previous > +/// instruction it's comparing against all ready sets (or could be modified to > +/// set) the same flag as the compare, then we can remove the comparison and use > +/// the flag from the previous instruction. > +bool OptimizeCmps::OptimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB) { > + // If this instruction is a comparison against zero and isn't comparing a > + // physical register, we can try to optimize it. > + unsigned SrcReg; > + int CmpValue; > + if (!TII->isCompareInstr(MI, SrcReg, CmpValue) || > + TargetRegisterInfo::isPhysicalRegister(SrcReg) || > + CmpValue != 0) > + return false; > + > + MachineRegisterInfo::def_iterator DI = MRI->def_begin(SrcReg); > + if (llvm::next(DI) != MRI->def_end()) > + // Only support one definition. > + return false; > + > + // Attempt to convert the defining instruction to set the "zero" flag. > + if (TII->convertToSetZeroFlag(&*DI, MI)) { > + ++NumEliminated; > + return true; > + } > + > + return false; > +} > + > +bool OptimizeCmps::runOnMachineFunction(MachineFunction &MF) { > + TM = &MF.getTarget(); > + TII = TM->getInstrInfo(); > + MRI = &MF.getRegInfo(); > + > + if (!EnableOptCmps) return false; > + > + bool Changed = false; > + for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) { > + MachineBasicBlock *MBB = &*I; > + for (MachineBasicBlock::iterator > + MII = MBB->begin(), ME = MBB->end(); MII != ME; ) { > + MachineInstr *MI = &*MII++; > + Changed |= OptimizeCmpInstr(MI, MBB); > + } > + } > + > + return Changed; > +} > > Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=110423&r1=110422&r2=110423&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) > +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Aug 5 20:32:48 2010 > @@ -1353,3 +1353,59 @@ > Offset = (isSub) ? -Offset : Offset; > return Offset == 0; > } > + > +bool ARMBaseInstrInfo:: > +isCompareInstr(const MachineInstr *MI, unsigned &SrcReg, int &CmpValue) const { > + switch (MI->getOpcode()) { > + default: break; > + case ARM::t2CMPri: > + case ARM::t2CMPzri: > + SrcReg = MI->getOperand(0).getReg(); > + CmpValue = MI->getOperand(1).getImm(); > + return true; > + } > + > + return false; > +} > + > +/// convertToSetZeroFlag - Convert the instruction to set the "zero" flag so > +/// that we can remove a "comparison with zero". > +bool ARMBaseInstrInfo:: > +convertToSetZeroFlag(MachineInstr *MI, MachineInstr *CmpInstr) const { > + // Conservatively refuse to convert an instruction which isn't in the same BB > + // as the comparison. > + if (MI->getParent() != CmpInstr->getParent()) > + return false; > + > + // Check that CPSR isn't set between the comparison instruction and the one we > + // want to change. > + MachineBasicBlock::const_iterator I = CmpInstr, E = MI; > + --I; > + for (; I != E; --I) { > + const MachineInstr &Instr = *I; > + > + for (unsigned IO = 0, EO = Instr.getNumOperands(); IO != EO; ++IO) { > + const MachineOperand &MO = Instr.getOperand(IO); > + if (!MO.isDef() || !MO.isReg()) continue; > + > + // This instruction modifies CPSR before the one we want to change. We > + // can't do this transformation. > + if (MO.getReg() == ARM::CPSR) > + return false; > + } > + } > + > + // Set the "zero" bit in CPSR. > + switch (MI->getOpcode()) { > + default: break; > + case ARM::t2SUBri: { > + MI->RemoveOperand(5); > + MachineInstrBuilder MB(MI); > + MB.addReg(ARM::CPSR, RegState::Define | RegState::Implicit); > + CmpInstr->eraseFromParent(); > + return true; > + } > + } > + > + return false; > +} > > Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=110423&r1=110422&r2=110423&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original) > +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Thu Aug 5 20:32:48 2010 > @@ -336,6 +336,17 @@ > unsigned NumInstrs) const { > return NumInstrs && NumInstrs == 1; > } > + > + /// isCompareInstr - If the machine instruction is a comparison instruction, > + /// then return true. Also return the source register in SrcReg and the value > + /// it compares against in CmpValue. > + virtual bool isCompareInstr(const MachineInstr *MI, unsigned &SrcReg, > + int &CmpValue) const; > + > + /// convertToSetZeroFlag - Convert the instruction to set the zero flag so > + /// that we can remove a "comparison with zero". > + virtual bool convertToSetZeroFlag(MachineInstr *Instr, > + MachineInstr *CmpInstr) const; > }; > > static inline > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From daniel at zuster.org Fri Aug 6 16:24:05 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Fri, 06 Aug 2010 21:24:05 -0000 Subject: [llvm-commits] [llvm] r110475 - /llvm/trunk/include/llvm/MC/MCStreamer.h Message-ID: <20100806212405.6A0142A6C12C@llvm.org> Author: ddunbar Date: Fri Aug 6 16:24:05 2010 New Revision: 110475 URL: http://llvm.org/viewvc/llvm-project?rev=110475&view=rev Log: MC: Add default value for AddrSpace argument to EmitValue. Modified: llvm/trunk/include/llvm/MC/MCStreamer.h Modified: llvm/trunk/include/llvm/MC/MCStreamer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=110475&r1=110474&r2=110475&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCStreamer.h (original) +++ llvm/trunk/include/llvm/MC/MCStreamer.h Fri Aug 6 16:24:05 2010 @@ -217,12 +217,13 @@ /// @param Size - The size of the integer (in bytes) to emit. This must /// match a native machine width. virtual void EmitValue(const MCExpr *Value, unsigned Size, - unsigned AddrSpace) = 0; + unsigned AddrSpace = 0) = 0; /// EmitIntValue - Special case of EmitValue that avoids the client having /// to pass in a MCExpr for constant integers. - virtual void EmitIntValue(uint64_t Value, unsigned Size,unsigned AddrSpace); - + virtual void EmitIntValue(uint64_t Value, unsigned Size, + unsigned AddrSpace = 0); + /// EmitSymbolValue - Special case of EmitValue that avoids the client /// having to pass in a MCExpr for MCSymbols. virtual void EmitSymbolValue(const MCSymbol *Sym, unsigned Size, From grosbach at apple.com Fri Aug 6 16:31:35 2010 From: grosbach at apple.com (Jim Grosbach) Date: Fri, 06 Aug 2010 21:31:35 -0000 Subject: [llvm-commits] [llvm] r110476 - /llvm/trunk/include/llvm/CodeGen/Passes.h Message-ID: <20100806213135.6F1FB2A6C12C@llvm.org> Author: grosbach Date: Fri Aug 6 16:31:35 2010 New Revision: 110476 URL: http://llvm.org/viewvc/llvm-project?rev=110476&view=rev Log: tidy up Modified: llvm/trunk/include/llvm/CodeGen/Passes.h Modified: llvm/trunk/include/llvm/CodeGen/Passes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=110476&r1=110475&r2=110476&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) +++ llvm/trunk/include/llvm/CodeGen/Passes.h Fri Aug 6 16:31:35 2010 @@ -30,23 +30,23 @@ /// createUnreachableBlockEliminationPass - The LLVM code generator does not /// work well with unreachable basic blocks (what live ranges make sense for a /// block that cannot be reached?). As such, a code generator should either - /// not instruction select unreachable blocks, or it can run this pass as it's + /// not instruction select unreachable blocks, or run this pass as its /// last LLVM modifying pass to clean up blocks that are not reachable from /// the entry block. FunctionPass *createUnreachableBlockEliminationPass(); /// MachineFunctionPrinter pass - This pass prints out the machine function to - /// the given stream, as a debugging tool. + /// the given stream as a debugging tool. MachineFunctionPass * createMachineFunctionPrinterPass(raw_ostream &OS, const std::string &Banner =""); /// MachineLoopInfo pass - This pass is a loop analysis pass. - /// + /// extern char &MachineLoopInfoID; /// MachineDominators pass - This pass is a machine dominators analysis pass. - /// + /// extern char &MachineDominatorsID; /// PHIElimination pass - This pass eliminates machine instruction PHI nodes @@ -55,7 +55,7 @@ /// these register allocator like this: AU.addRequiredID(PHIEliminationID); /// extern char &PHIEliminationID; - + /// StrongPHIElimination pass - This pass eliminates machine instruction PHI /// nodes by inserting copy instructions. This destroys SSA information, but /// is the desired input for some register allocators. This pass is @@ -114,7 +114,7 @@ /// and eliminates abstract frame references. /// FunctionPass *createPrologEpilogCodeInserter(); - + /// LowerSubregs Pass - This pass lowers subregs to register-register copies /// which yields suboptimal, but correct code if the register allocator /// cannot coalesce all subreg operations during allocation. @@ -145,27 +145,27 @@ /// IntrinsicLowering Pass - Performs target-independent LLVM IR /// transformations for highly portable strategies. FunctionPass *createGCLoweringPass(); - + /// MachineCodeAnalysis Pass - Target-independent pass to mark safe points in /// machine code. Must be added very late during code generation, just prior /// to output, and importantly after all CFG transformations (such as branch /// folding). FunctionPass *createGCMachineCodeAnalysisPass(); - + /// Deleter Pass - Releases GC metadata. - /// + /// FunctionPass *createGCInfoDeleter(); - + /// Creates a pass to print GC metadata. - /// + /// FunctionPass *createGCInfoPrinter(raw_ostream &OS); - + /// createMachineCSEPass - This pass performs global CSE on machine /// instructions. FunctionPass *createMachineCSEPass(); /// createMachineLICMPass - This pass performs LICM on machine instructions. - /// + /// FunctionPass *createMachineLICMPass(bool PreRegAlloc = true); /// createMachineSinkingPass - This pass performs sinking on machine From bigcheesegs at gmail.com Fri Aug 6 16:37:45 2010 From: bigcheesegs at gmail.com (Michael J. Spencer) Date: Fri, 06 Aug 2010 21:37:45 -0000 Subject: [llvm-commits] [llvm] r110477 - /llvm/trunk/tools/llc/llc.cpp Message-ID: <20100806213745.630922A6C12C@llvm.org> Author: mspencer Date: Fri Aug 6 16:37:45 2010 New Revision: 110477 URL: http://llvm.org/viewvc/llvm-project?rev=110477&view=rev Log: llc: Clarify -mc-relax-all description. Modified: llvm/trunk/tools/llc/llc.cpp Modified: llvm/trunk/tools/llc/llc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=110477&r1=110476&r2=110477&view=diff ============================================================================== --- llvm/trunk/tools/llc/llc.cpp (original) +++ llvm/trunk/tools/llc/llc.cpp Fri Aug 6 16:37:45 2010 @@ -77,7 +77,9 @@ cl::value_desc("a1,+a2,-a3,...")); static cl::opt -RelaxAll("mc-relax-all", cl::desc("Relax all fixups")); +RelaxAll("mc-relax-all", + cl::desc("When used with filetype=obj, " + "relax all fixups in the emited object file")); cl::opt FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile), From gohman at apple.com Fri Aug 6 16:48:07 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 06 Aug 2010 21:48:07 -0000 Subject: [llvm-commits] [llvm] r110478 - in /llvm/trunk: include/llvm/Transforms/Scalar.h lib/Transforms/Utils/LowerInvoke.cpp lib/Transforms/Utils/LowerSwitch.cpp lib/Transforms/Utils/Mem2Reg.cpp lib/Transforms/Utils/UnifyFunctionExitNodes.cpp Message-ID: <20100806214807.21B5A2A6C12C@llvm.org> Author: djg Date: Fri Aug 6 16:48:06 2010 New Revision: 110478 URL: http://llvm.org/viewvc/llvm-project?rev=110478&view=rev Log: Eliminate PromoteMemoryToRegisterID; just use addPreserved("mem2reg") instead, as an example of what this looks like. Modified: llvm/trunk/include/llvm/Transforms/Scalar.h llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp llvm/trunk/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp Modified: llvm/trunk/include/llvm/Transforms/Scalar.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar.h?rev=110478&r1=110477&r2=110478&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Scalar.h (original) +++ llvm/trunk/include/llvm/Transforms/Scalar.h Fri Aug 6 16:48:06 2010 @@ -149,7 +149,6 @@ // ret i32 %Y // FunctionPass *createPromoteMemoryToRegisterPass(); -extern char &PromoteMemoryToRegisterID; //===----------------------------------------------------------------------===// // Modified: llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp?rev=110478&r1=110477&r2=110478&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp Fri Aug 6 16:48:06 2010 @@ -85,7 +85,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { // This is a cluster of orthogonal Transforms - AU.addPreservedID(PromoteMemoryToRegisterID); + AU.addPreserved("mem2reg"); AU.addPreservedID(LowerSwitchID); } Modified: llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp?rev=110478&r1=110477&r2=110478&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerSwitch.cpp Fri Aug 6 16:48:06 2010 @@ -41,7 +41,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { // This is a cluster of orthogonal Transforms AU.addPreserved(); - AU.addPreservedID(PromoteMemoryToRegisterID); + AU.addPreserved("mem2reg"); AU.addPreservedID(LowerInvokePassID); } Modified: llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp?rev=110478&r1=110477&r2=110478&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp Fri Aug 6 16:48:06 2010 @@ -81,8 +81,6 @@ return Changed; } -// Publically exposed interface to pass... -char &llvm::PromoteMemoryToRegisterID = PromotePass::ID; // createPromoteMemoryToRegister - Provide an entry point to create this pass. // FunctionPass *llvm::createPromoteMemoryToRegisterPass() { Modified: llvm/trunk/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp?rev=110478&r1=110477&r2=110478&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp Fri Aug 6 16:48:06 2010 @@ -35,7 +35,7 @@ // We preserve the non-critical-edgeness property AU.addPreservedID(BreakCriticalEdgesID); // This is a cluster of orthogonal Transforms - AU.addPreservedID(PromoteMemoryToRegisterID); + AU.addPreserved("mem2reg"); AU.addPreservedID(LowerSwitchID); } From grosbach at apple.com Fri Aug 6 16:58:01 2010 From: grosbach at apple.com (Jim Grosbach) Date: Fri, 06 Aug 2010 21:58:01 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r110479 - in /llvm-gcc-4.2/trunk/gcc: ChangeLog.apple config/arm/arm.c Message-ID: <20100806215802.2D25D2A6C12C@llvm.org> Author: grosbach Date: Fri Aug 6 16:58:01 2010 New Revision: 110479 URL: http://llvm.org/viewvc/llvm-project?rev=110479&view=rev Log: ARM default to thumb mode when required Modified: llvm-gcc-4.2/trunk/gcc/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/config/arm/arm.c Modified: llvm-gcc-4.2/trunk/gcc/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ChangeLog.apple?rev=110479&r1=110478&r2=110479&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/ChangeLog.apple Fri Aug 6 16:58:01 2010 @@ -1,3 +1,7 @@ +2010-08-06 Jim Grosbach + + * config/arm/arm.c(arm_override_options): v7m only has thumb mode. + 2010-08-04 Bob Wilson Radar 7982386 @@ -6,7 +10,7 @@ * timevar.c: Update path to ppc_intrinsics.h. * Makefile.in (USER_H): Add ppc_intrinsics.h. * config.gcc: Revert previous change for ppc_intrinsics.h. - + 2010-07-29 Bob Wilson Radar 7982386 Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.c?rev=110479&r1=110478&r2=110479&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/arm.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.c Fri Aug 6 16:58:01 2010 @@ -1448,6 +1448,14 @@ else targetm.rtx_costs = all_cores[(int)arm_tune].rtx_costs; + /* LLVM LOCAL begin */ + /* v7m processors don't have ARM mode, so default to thumb mode. + Explicitly only set for default so we can error if the user + sets -marm or -mno-thumb. */ + if ((insn_flags & FL_FOR_ARCH7M) == FL_FOR_ARCH7M && thumb_option < 0) + thumb_option = 1; + /* LLVM LOCAL end */ + /* Make sure that the processor choice does not conflict with any of the other command line choices. */ /* APPLE LOCAL begin v7 support. Merge from mainline */ From bruno.cardoso at gmail.com Fri Aug 6 17:10:01 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Fri, 06 Aug 2010 22:10:01 -0000 Subject: [llvm-commits] [llvm] r110480 - in /llvm/trunk: include/llvm/IntrinsicsX86.td lib/Target/X86/X86InstrSSE.td Message-ID: <20100806221001.841CF2A6C12C@llvm.org> Author: bruno Date: Fri Aug 6 17:10:01 2010 New Revision: 110480 URL: http://llvm.org/viewvc/llvm-project?rev=110480&view=rev Log: Patterns to match AVX 256-bit vzero intrinsics Modified: llvm/trunk/include/llvm/IntrinsicsX86.td llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/include/llvm/IntrinsicsX86.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=110480&r1=110479&r2=110480&view=diff ============================================================================== --- llvm/trunk/include/llvm/IntrinsicsX86.td (original) +++ llvm/trunk/include/llvm/IntrinsicsX86.td Fri Aug 6 17:10:01 2010 @@ -1272,9 +1272,9 @@ // Vector zero let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_avx_vzeroall : GCCBuiltin<"__builtin_ia32_vzeroall">, - Intrinsic<[], [], [IntrNoMem]>; + Intrinsic<[], [], []>; def int_x86_avx_vzeroupper : GCCBuiltin<"__builtin_ia32_vzeroupper">, - Intrinsic<[], [], [IntrNoMem]>; + Intrinsic<[], [], []>; } // Vector load with broadcast Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=110480&r1=110479&r2=110480&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Fri Aug 6 17:10:01 2010 @@ -5408,12 +5408,12 @@ []>, VEX_4V; // Zero All YMM registers -def VZEROALL : I<0x77, RawFrm, (outs), (ins), "vzeroall", []>, VEX, VEX_L, - Requires<[HasAVX]>; +def VZEROALL : I<0x77, RawFrm, (outs), (ins), "vzeroall", + [(int_x86_avx_vzeroall)]>, VEX, VEX_L, Requires<[HasAVX]>; // Zero Upper bits of YMM registers -def VZEROUPPER : I<0x77, RawFrm, (outs), (ins), "vzeroupper", []>, VEX, - Requires<[HasAVX]>; +def VZEROUPPER : I<0x77, RawFrm, (outs), (ins), "vzeroupper", + [(int_x86_avx_vzeroupper)]>, VEX, Requires<[HasAVX]>; } // isAsmParserOnly From stoklund at 2pi.dk Fri Aug 6 17:17:33 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Fri, 06 Aug 2010 22:17:33 -0000 Subject: [llvm-commits] [llvm] r110481 - in /llvm/trunk/lib/CodeGen: InlineSpiller.cpp SplitKit.cpp SplitKit.h Message-ID: <20100806221733.5C2662A6C12C@llvm.org> Author: stoklund Date: Fri Aug 6 17:17:33 2010 New Revision: 110481 URL: http://llvm.org/viewvc/llvm-project?rev=110481&view=rev Log: Lazily defer duplicating the live interval we are splitting until we know it is necessary. Sometimes, live range splitting doesn't shrink the current interval, but simply changes some instructions to use a new interval. That makes the original more suitable for spilling. In this case, we don't need to duplicate the original. Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp llvm/trunk/lib/CodeGen/SplitKit.cpp llvm/trunk/lib/CodeGen/SplitKit.h Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/InlineSpiller.cpp?rev=110481&r1=110480&r2=110481&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/InlineSpiller.cpp (original) +++ llvm/trunk/lib/CodeGen/InlineSpiller.cpp Fri Aug 6 17:17:33 2010 @@ -113,9 +113,10 @@ splitAnalysis_.analyze(li_); if (const MachineLoop *loop = splitAnalysis_.getBestSplitLoop()) { - SplitEditor(splitAnalysis_, lis_, vrm_, *newIntervals_) - .splitAroundLoop(loop); - return true; + // We can split, but li_ may be left intact with fewer uses. + if (SplitEditor(splitAnalysis_, lis_, vrm_, *newIntervals_) + .splitAroundLoop(loop)) + return true; } return false; } Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=110481&r1=110480&r2=110481&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SplitKit.cpp (original) +++ llvm/trunk/lib/CodeGen/SplitKit.cpp Fri Aug 6 17:17:33 2010 @@ -289,22 +289,18 @@ : sa_(sa), lis_(lis), vrm_(vrm), mri_(vrm.getMachineFunction().getRegInfo()), tii_(*vrm.getMachineFunction().getTarget().getInstrInfo()), + curli_(sa_.getCurLI()), dupli_(0), openli_(0), intervals_(intervals), firstInterval(intervals_.size()) { - const LiveInterval *curli = sa_.getCurLI(); - assert(curli && "SplitEditor created from empty SplitAnalysis"); + assert(curli_ && "SplitEditor created from empty SplitAnalysis"); + + // Make sure curli_ is assigned a stack slot, so all our intervals get the + // same slot as curli_. + if (vrm_.getStackSlot(curli_->reg) == VirtRegMap::NO_STACK_SLOT) + vrm_.assignVirt2StackSlot(curli_->reg); - // Make sure curli is assigned a stack slot, so all our intervals get the - // same slot as curli. - if (vrm_.getStackSlot(curli->reg) == VirtRegMap::NO_STACK_SLOT) - vrm_.assignVirt2StackSlot(curli->reg); - - // Create an interval for dupli that is a copy of curli. - dupli_ = createInterval(); - dupli_->Copy(*curli, &mri_, lis_.getVNInfoAllocator()); - DEBUG(dbgs() << "SplitEditor DupLI: " << *dupli_ << '\n'); } LiveInterval *SplitEditor::createInterval() { @@ -316,10 +312,20 @@ return &Intv; } -VNInfo *SplitEditor::mapValue(VNInfo *dupliVNI) { - VNInfo *&VNI = valueMap_[dupliVNI]; +LiveInterval *SplitEditor::getDupLI() { + if (!dupli_) { + // Create an interval for dupli that is a copy of curli. + dupli_ = createInterval(); + dupli_->Copy(*curli_, &mri_, lis_.getVNInfoAllocator()); + DEBUG(dbgs() << "SplitEditor DupLI: " << *dupli_ << '\n'); + } + return dupli_; +} + +VNInfo *SplitEditor::mapValue(const VNInfo *curliVNI) { + VNInfo *&VNI = valueMap_[curliVNI]; if (!VNI) - VNI = openli_->createValueCopy(dupliVNI, lis_.getVNInfoAllocator()); + VNI = openli_->createValueCopy(curliVNI, lis_.getVNInfoAllocator()); return VNI; } @@ -330,9 +336,8 @@ VNInfo *SplitEditor::insertCopy(LiveInterval &LI, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) { - unsigned curli = sa_.getCurLI()->reg; MachineInstr *MI = BuildMI(MBB, I, DebugLoc(), tii_.get(TargetOpcode::COPY), - LI.reg).addReg(curli); + LI.reg).addReg(curli_->reg); SlotIndex DefIdx = lis_.InsertMachineInstrInMaps(MI).getDefIndex(); return LI.getNextValue(DefIdx, MI, true, lis_.getVNInfoAllocator()); } @@ -352,9 +357,9 @@ assert(openli_ && "openIntv not called before enterIntvAtEnd"); SlotIndex EndA = lis_.getMBBEndIdx(&A); - VNInfo *DupVNIA = dupli_->getVNInfoAt(EndA.getPrevIndex()); - if (!DupVNIA) { - DEBUG(dbgs() << " ignoring enterIntvAtEnd, dupli not live out of BB#" + VNInfo *CurVNIA = curli_->getVNInfoAt(EndA.getPrevIndex()); + if (!CurVNIA) { + DEBUG(dbgs() << " ignoring enterIntvAtEnd, curli not live out of BB#" << A.getNumber() << ".\n"); return; } @@ -370,9 +375,9 @@ // Now look at the start of B. SlotIndex StartB = lis_.getMBBStartIdx(&B); SlotIndex EndB = lis_.getMBBEndIdx(&B); - LiveRange *DupB = dupli_->getLiveRangeContaining(StartB); - if (!DupB) { - DEBUG(dbgs() << " enterIntvAtEnd: dupli not live in to BB#" + const LiveRange *CurB = curli_->getLiveRangeContaining(StartB); + if (!CurB) { + DEBUG(dbgs() << " enterIntvAtEnd: curli not live in to BB#" << B.getNumber() << ".\n"); return; } @@ -384,9 +389,9 @@ lis_.getVNInfoAllocator()); VNIB->setIsPHIDef(true); // Add a minimal range for the new value. - openli_->addRange(LiveRange(VNIB->def, std::min(EndB, DupB->end), VNIB)); + openli_->addRange(LiveRange(VNIB->def, std::min(EndB, CurB->end), VNIB)); - VNInfo *&mapVNI = valueMap_[DupB->valno]; + VNInfo *&mapVNI = valueMap_[CurB->valno]; if (mapVNI) { // Multiple copies - must create PHI value. abort(); @@ -408,8 +413,8 @@ void SplitEditor::useIntv(SlotIndex Start, SlotIndex End) { assert(openli_ && "openIntv not called before useIntv"); - // Map the dupli values from the interval into openli_ - LiveInterval::const_iterator B = dupli_->begin(), E = dupli_->end(); + // Map the curli values from the interval into openli_ + LiveInterval::const_iterator B = curli_->begin(), E = curli_->end(); LiveInterval::const_iterator I = std::lower_bound(B, E, Start); if (I != B) { @@ -435,27 +440,31 @@ assert(openli_ && "openIntv not called before leaveIntvAtTop"); SlotIndex Start = lis_.getMBBStartIdx(&MBB); - LiveRange *DupLR = dupli_->getLiveRangeContaining(Start); + const LiveRange *CurLR = curli_->getLiveRangeContaining(Start); - // Is dupli even live-in to MBB? - if (!DupLR) { + // Is curli even live-in to MBB? + if (!CurLR) { DEBUG(dbgs() << " leaveIntvAtTop at " << Start << ": not live\n"); return; } - // Is dupli defined by PHI at the beginning of MBB? - bool isPHIDef = DupLR->valno->isPHIDef() && - DupLR->valno->def.getBaseIndex() == Start; + // Is curli defined by PHI at the beginning of MBB? + bool isPHIDef = CurLR->valno->isPHIDef() && + CurLR->valno->def.getBaseIndex() == Start; - // If MBB is using a value of dupli that was defined outside the openli range, + // If MBB is using a value of curli that was defined outside the openli range, // we don't want to copy it back here. - if (!isPHIDef && !openli_->liveAt(DupLR->valno->def)) { + if (!isPHIDef && !openli_->liveAt(CurLR->valno->def)) { DEBUG(dbgs() << " leaveIntvAtTop at " << Start << ": using external value\n"); liveThrough_ = true; return; } + // We are going to insert a back copy, so we must have a dupli_. + LiveRange *DupLR = getDupLI()->getLiveRangeContaining(Start); + assert(DupLR && "dupli not live into black, but curli is?"); + // Insert the COPY instruction. MachineInstr *MI = BuildMI(MBB, MBB.begin(), DebugLoc(), tii_.get(TargetOpcode::COPY), dupli_->reg) @@ -501,8 +510,6 @@ assert(openli_ && "openIntv not called before closeIntv"); DEBUG(dbgs() << " closeIntv cleaning up\n"); - - DEBUG(dbgs() << " dup " << *dupli_ << '\n'); DEBUG(dbgs() << " open " << *openli_ << '\n'); if (liveThrough_) { @@ -510,6 +517,7 @@ } else { // live out with copies inserted, or killed by region. Either way we need to // remove the overlapping region from dupli. + getDupLI(); for (LiveInterval::iterator I = openli_->begin(), E = openli_->end(); I != E; ++I) { dupli_->removeRange(I->start, I->end); @@ -567,7 +575,7 @@ // Loop Splitting //===----------------------------------------------------------------------===// -void SplitEditor::splitAroundLoop(const MachineLoop *Loop) { +bool SplitEditor::splitAroundLoop(const MachineLoop *Loop) { SplitAnalysis::LoopBlocks Blocks; sa_.getLoopBlocks(Loop, Blocks); @@ -601,5 +609,6 @@ // Done. closeIntv(); rewrite(); + return dupli_; } Modified: llvm/trunk/lib/CodeGen/SplitKit.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.h?rev=110481&r1=110480&r2=110481&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SplitKit.h (original) +++ llvm/trunk/lib/CodeGen/SplitKit.h Fri Aug 6 17:17:33 2010 @@ -121,8 +121,7 @@ /// SplitEditor - Edit machine code and LiveIntervals for live range /// splitting. /// -/// - Create a SplitEditor from a SplitAnalysis. This will create a new -/// LiveInterval, dupli, that is identical to SA.curli. +/// - Create a SplitEditor from a SplitAnalysis. /// - Start a new live interval with openIntv. /// - Mark the places where the new interval is entered using enterIntv* /// - Mark the ranges where the new interval is used with useIntv* @@ -137,8 +136,12 @@ MachineRegisterInfo &mri_; const TargetInstrInfo &tii_; - /// dupli_ - Created as a copy of sa_.curli_, ranges are carved out as new - /// intervals get added through openIntv / closeIntv. + /// curli_ - The immutable interval we are currently splitting. + const LiveInterval *const curli_; + + /// dupli_ - Created as a copy of curli_, ranges are carved out as new + /// intervals get added through openIntv / closeIntv. This is used to avoid + /// editing curli_. LiveInterval *dupli_; /// Currently open LiveInterval. @@ -148,13 +151,16 @@ /// register class and spill slot as curli. LiveInterval *createInterval(); - /// valueMap_ - Map values in dupli to values in openIntv. These are direct 1-1 - /// mappings, and do not include values created by inserted copies. - DenseMap valueMap_; - - /// mapValue - Return the openIntv value that corresponds to the given dupli - /// value. - VNInfo *mapValue(VNInfo *dupliVNI); + /// getDupLI - Ensure dupli is created and return it. + LiveInterval *getDupLI(); + + /// valueMap_ - Map values in dupli to values in openIntv. These are direct 1-1 + /// mappings, and do not include values created by inserted copies. + DenseMap valueMap_; + + /// mapValue - Return the openIntv value that corresponds to the given curli + /// value. + VNInfo *mapValue(const VNInfo *curliVNI); /// A dupli value is live through openIntv. bool liveThrough_; @@ -178,8 +184,8 @@ SplitEditor(SplitAnalysis &SA, LiveIntervals&, VirtRegMap&, std::vector &newIntervals); - /// getAnalysis - Get the corresponding analysis. - SplitAnalysis &getAnalysis() { return sa_; } + /// getAnalysis - Get the corresponding analysis. + SplitAnalysis &getAnalysis() { return sa_; } /// Create a new virtual register and live interval. void openIntv(); @@ -210,8 +216,9 @@ // ===--- High level methods ---=== /// splitAroundLoop - Split curli into a separate live interval inside - /// the loop. - void splitAroundLoop(const MachineLoop*); + /// the loop. Return true if curli has been completely replaced, false if + /// curli is still intact, and needs to be spilled or split further. + bool splitAroundLoop(const MachineLoop*); }; From gohman at apple.com Fri Aug 6 17:47:59 2010 From: gohman at apple.com (Dan Gohman) Date: Fri, 06 Aug 2010 22:47:59 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r110484 - /llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp Message-ID: <20100806224759.2D2212A6C12C@llvm.org> Author: djg Date: Fri Aug 6 17:47:59 2010 New Revision: 110484 URL: http://llvm.org/viewvc/llvm-project?rev=110484&view=rev Log: Add createPromoteMemoryToRegisterPass to llvm-linker-hack.cpp, now that mem2reg isn't pulled in implicitly through PromoteMemoryToRegisterPassID. Modified: llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp?rev=110484&r1=110483&r2=110484&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp Fri Aug 6 17:47:59 2010 @@ -89,6 +89,7 @@ llvm::createLoopDeletionPass(); llvm::createFunctionAttrsPass(); llvm::createPrintModulePass(0); + llvm::createPromoteMemoryToRegisterPass(); llvm::Type::getInt8Ty(llvm::getGlobalContext()); From grosbach at apple.com Fri Aug 6 17:50:53 2010 From: grosbach at apple.com (Jim Grosbach) Date: Fri, 6 Aug 2010 15:50:53 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r110484 - /llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp In-Reply-To: <20100806224759.2D2212A6C12C@llvm.org> References: <20100806224759.2D2212A6C12C@llvm.org> Message-ID: <3C99EBCD-17ED-4F39-9EB1-E4075E15D666@apple.com> Aha! So that's why that started happening. Thanks, Dan. -j On Aug 6, 2010, at 3:47 PM, Dan Gohman wrote: > Author: djg > Date: Fri Aug 6 17:47:59 2010 > New Revision: 110484 > > URL: http://llvm.org/viewvc/llvm-project?rev=110484&view=rev > Log: > Add createPromoteMemoryToRegisterPass to llvm-linker-hack.cpp, now > that mem2reg isn't pulled in implicitly through > PromoteMemoryToRegisterPassID. > > Modified: > llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp > > Modified: llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp?rev=110484&r1=110483&r2=110484&view=diff > ============================================================================== > --- llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp (original) > +++ llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp Fri Aug 6 17:47:59 2010 > @@ -89,6 +89,7 @@ > llvm::createLoopDeletionPass(); > llvm::createFunctionAttrsPass(); > llvm::createPrintModulePass(0); > + llvm::createPromoteMemoryToRegisterPass(); > > llvm::Type::getInt8Ty(llvm::getGlobalContext()); > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From rafael.espindola at gmail.com Fri Aug 6 18:03:52 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Fri, 06 Aug 2010 23:03:52 -0000 Subject: [llvm-commits] [llvm] r110485 - in /llvm/trunk/include/llvm: PassSupport.h Support/CommandLine.h Support/PassNameParser.h Message-ID: <20100806230352.724B32A6C12C@llvm.org> Author: rafael Date: Fri Aug 6 18:03:52 2010 New Revision: 110485 URL: http://llvm.org/viewvc/llvm-project?rev=110485&view=rev Log: Some cleanup. Use a class (OptionInfo) instead of a pair of a pair and remove some default values that are not used. Modified: llvm/trunk/include/llvm/PassSupport.h llvm/trunk/include/llvm/Support/CommandLine.h llvm/trunk/include/llvm/Support/PassNameParser.h Modified: llvm/trunk/include/llvm/PassSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=110485&r1=110484&r2=110485&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassSupport.h (original) +++ llvm/trunk/include/llvm/PassSupport.h Fri Aug 6 18:03:52 2010 @@ -53,8 +53,7 @@ /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. PassInfo(const char *name, const char *arg, const void *pi, - NormalCtor_t normal = 0, - bool isCFGOnly = false, bool is_analysis = false) + NormalCtor_t normal, bool isCFGOnly, bool is_analysis) : PassName(name), PassArgument(arg), PassID(pi), IsCFGOnlyPass(isCFGOnly), IsAnalysis(is_analysis), IsAnalysisGroup(false), NormalCtor(normal) { Modified: llvm/trunk/include/llvm/Support/CommandLine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=110485&r1=110484&r2=110485&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/CommandLine.h (original) +++ llvm/trunk/include/llvm/Support/CommandLine.h Fri Aug 6 18:03:52 2010 @@ -443,16 +443,23 @@ template class parser : public generic_parser_base { protected: - SmallVector >, 8> Values; + class OptionInfo { + public: + OptionInfo(const char *name, DataType v, const char *helpStr) : + Name(name), V(v), HelpStr(helpStr) {} + const char *Name; + DataType V; + const char *HelpStr; + }; + SmallVector Values; public: typedef DataType parser_data_type; // Implement virtual functions needed by generic_parser_base unsigned getNumOptions() const { return unsigned(Values.size()); } - const char *getOption(unsigned N) const { return Values[N].first; } + const char *getOption(unsigned N) const { return Values[N].Name; } const char *getDescription(unsigned N) const { - return Values[N].second.second; + return Values[N].HelpStr; } // parse - Return true on error. @@ -465,8 +472,8 @@ for (unsigned i = 0, e = static_cast(Values.size()); i != e; ++i) - if (Values[i].first == ArgVal) { - V = Values[i].second.first; + if (Values[i].Name == ArgVal) { + V = Values[i].V; return false; } @@ -478,8 +485,8 @@ template void addLiteralOption(const char *Name, const DT &V, const char *HelpStr) { assert(findOption(Name) == Values.size() && "Option already exists!"); - Values.push_back(std::make_pair(Name, - std::make_pair(static_cast(V),HelpStr))); + OptionInfo X(Name, static_cast(V), HelpStr); + Values.push_back(X); MarkOptionsChanged(); } Modified: llvm/trunk/include/llvm/Support/PassNameParser.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PassNameParser.h?rev=110485&r1=110484&r2=110485&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/PassNameParser.h (original) +++ llvm/trunk/include/llvm/Support/PassNameParser.h Fri Aug 6 18:03:52 2010 @@ -78,10 +78,9 @@ virtual void passEnumerate(const PassInfo *P) { passRegistered(P); } // ValLessThan - Provide a sorting comparator for Values elements... - typedef std::pair > ValType; + typedef PassNameParser::OptionInfo ValType; static bool ValLessThan(const ValType &VT1, const ValType &VT2) { - return std::string(VT1.first) < std::string(VT2.first); + return std::string(VT1.Name) < std::string(VT2.Name); } // printOptionInfo - Print out information about this option. Override the From resistor at mac.com Fri Aug 6 19:20:00 2010 From: resistor at mac.com (Owen Anderson) Date: Sat, 07 Aug 2010 00:20:00 -0000 Subject: [llvm-commits] [llvm] r110488 - /llvm/trunk/include/llvm/Instructions.h Message-ID: <20100807002000.0F8D12A6C12C@llvm.org> Author: resistor Date: Fri Aug 6 19:19:59 2010 New Revision: 110488 URL: http://llvm.org/viewvc/llvm-project?rev=110488&view=rev Log: Add a predicate to determine if a call is an inline asm statement. Modified: llvm/trunk/include/llvm/Instructions.h Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=110488&r1=110487&r2=110488&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Fri Aug 6 19:19:59 2010 @@ -1052,6 +1052,11 @@ void setCalledFunction(Value* Fn) { Op<-1>() = Fn; } + + /// isInlineAsm - Check if this call is an inline asm statement. + bool isInlineAsm() const { + return isa(Op<-1>()); + } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const CallInst *) { return true; } From resistor at mac.com Fri Aug 6 19:20:35 2010 From: resistor at mac.com (Owen Anderson) Date: Sat, 07 Aug 2010 00:20:35 -0000 Subject: [llvm-commits] [llvm] r110489 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <20100807002035.A46DD2A6C12C@llvm.org> Author: resistor Date: Fri Aug 6 19:20:35 2010 New Revision: 110489 URL: http://llvm.org/viewvc/llvm-project?rev=110489&view=rev Log: Don't attempt the PRE inline asm calls, since we don't value number them yet. Fixes PR7835. Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=110489&r1=110488&r2=110489&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri Aug 6 19:20:35 2010 @@ -2111,6 +2111,11 @@ CurInst->mayReadFromMemory() || CurInst->mayHaveSideEffects() || isa(CurInst)) continue; + + // We don't currently value number ANY inline asm calls. + if (CallInst *CallI = dyn_cast(CurInst)) + if (CallI->isInlineAsm()) + continue; uint32_t ValNo = VN.lookup(CurInst); From dalej at apple.com Fri Aug 6 19:33:42 2010 From: dalej at apple.com (Dale Johannesen) Date: Sat, 07 Aug 2010 00:33:42 -0000 Subject: [llvm-commits] [llvm] r110491 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/CodeGen/X86/2010-08-06-cmpsd.ll Message-ID: <20100807003342.457022A6C12C@llvm.org> Author: johannes Date: Fri Aug 6 19:33:42 2010 New Revision: 110491 URL: http://llvm.org/viewvc/llvm-project?rev=110491&view=rev Log: Use sdmem and sse_load_f64 (etc.) for the vector form of CMPSD (etc.) Matching a 128-bit memory operand is wrong, the instruction uses only 64 bits (same as ADDSD etc.) 8193553. Added: llvm/trunk/test/CodeGen/X86/2010-08-06-cmpsd.ll Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=110491&r1=110490&r2=110491&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Fri Aug 6 19:33:42 2010 @@ -1163,31 +1163,36 @@ "cmpsd\t{$src2, $src, $dst|$dst, $src, $src2}">, XD; } -multiclass sse12_cmp_scalar_int { +multiclass sse12_cmp_scalar_int { def rr : SIi8<0xC2, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src, SSECC:$cc), asm, [(set VR128:$dst, (Int VR128:$src1, VR128:$src, imm:$cc))]>; def rm : SIi8<0xC2, MRMSrcMem, (outs VR128:$dst), - (ins VR128:$src1, f32mem:$src, SSECC:$cc), asm, + (ins VR128:$src1, memopr:$src, SSECC:$cc), asm, [(set VR128:$dst, (Int VR128:$src1, - (load addr:$src), imm:$cc))]>; + mem_cpat:$src, imm:$cc))]>; } // Aliases to match intrinsics which expect XMM operand(s). + let isAsmParserOnly = 1 in { - defm Int_VCMPSS : sse12_cmp_scalar_int, XS, VEX_4V; - defm Int_VCMPSD : sse12_cmp_scalar_int, XD, VEX_4V; } let Constraints = "$src1 = $dst" in { - defm Int_CMPSS : sse12_cmp_scalar_int, XS; - defm Int_CMPSD : sse12_cmp_scalar_int, XD; } Added: llvm/trunk/test/CodeGen/X86/2010-08-06-cmpsd.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-08-06-cmpsd.ll?rev=110491&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2010-08-06-cmpsd.ll (added) +++ llvm/trunk/test/CodeGen/X86/2010-08-06-cmpsd.ll Fri Aug 6 19:33:42 2010 @@ -0,0 +1,27 @@ +; RUN: llc < %s -mtriple=x86_64-applecl-darwin11 | FileCheck %s +; 8193553 + +define void @__math_kernel_Vectorized_wrapper(<4 x double> addrspace(1)* %a, <4 x double> addrspace(1)* %b, i64 addrspace(1)* %c, i64 addrspace(1)* %d) nounwind { +entry.i: ; preds = %entry.i, %loop +; CHECK: math_kernel_Vectorized_wrapper +; CHECK-NOT: cmpordsd (%rsi), + %0 = alloca i8 + %1 = alloca i8 + %2 = alloca i8 + %tmp213.i = load <4 x double> addrspace(1)* %a ; <<4 x double>> [#uses=4] + %extract25.i = extractelement <4 x double> %tmp213.i, i32 1 ; [#uses=1] + %tmp723.i = load <4 x double> addrspace(1)* %b ; <<4 x double>> [#uses=4] + %extract29.i = extractelement <4 x double> %tmp723.i, i32 1 ; [#uses=1] + %tmp2.i26 = insertelement <2 x double> undef, double %extract25.i, i32 0 ; <<2 x double>> [#uses=1] + %tmp5.i27 = insertelement <2 x double> undef, double %extract29.i, i32 1 ; <<2 x double>> [#uses=1] + %cmpsd.i.i28 = call <2 x double> @llvm.x86.sse2.cmp.sd(<2 x double> %tmp2.i26, <2 x double> %tmp5.i27, i8 7) nounwind ; <<2 x double>> [#uses=1] + %3 = bitcast <2 x double> %cmpsd.i.i28 to <4 x i32> ; <<4 x i32>> [#uses=1] + %tmp12.i29 = extractelement <4 x i32> %3, i32 0 ; [#uses=1] + %and.i30 = and i32 %tmp12.i29, 1 ; [#uses=1] + %conv937.i36 = zext i32 %and.i30 to i64 ; [#uses=1] + store i64 %conv937.i36, i64 addrspace(1)* %d + ret void +; CHECK: ret +} + +declare <2 x double> @llvm.x86.sse2.cmp.sd(<2 x double>, <2 x double>, i8) nounwind readnone From gohman at apple.com Fri Aug 6 19:34:52 2010 From: gohman at apple.com (Dan Gohman) Date: Sat, 07 Aug 2010 00:34:52 -0000 Subject: [llvm-commits] [llvm] r110492 - /llvm/trunk/include/llvm/PassAnalysisSupport.h Message-ID: <20100807003452.9B0F22A6C12C@llvm.org> Author: djg Date: Fri Aug 6 19:34:52 2010 New Revision: 110492 URL: http://llvm.org/viewvc/llvm-project?rev=110492&view=rev Log: Make AnalysisImpls private. Modified: llvm/trunk/include/llvm/PassAnalysisSupport.h Modified: llvm/trunk/include/llvm/PassAnalysisSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassAnalysisSupport.h?rev=110492&r1=110491&r2=110492&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassAnalysisSupport.h (original) +++ llvm/trunk/include/llvm/PassAnalysisSupport.h Fri Aug 6 19:34:52 2010 @@ -156,11 +156,11 @@ // getAnalysisIfAvailable - Return analysis result or null if it doesn't exist Pass *getAnalysisIfAvailable(AnalysisID ID, bool Direction) const; +private: // AnalysisImpls - This keeps track of which passes implements the interfaces // that are required by the current pass (to implement getAnalysis()). std::vector > AnalysisImpls; -private: // PassManager that is used to resolve analysis info PMDataManager &PM; }; From resistor at mac.com Fri Aug 6 19:42:06 2010 From: resistor at mac.com (Owen Anderson) Date: Sat, 07 Aug 2010 00:42:06 -0000 Subject: [llvm-commits] [llvm] r110493 - in /llvm/trunk: include/llvm/Support/ConstantRange.h lib/Support/ConstantRange.cpp Message-ID: <20100807004206.A2BF82A6C12C@llvm.org> Author: resistor Date: Fri Aug 6 19:42:06 2010 New Revision: 110493 URL: http://llvm.org/viewvc/llvm-project?rev=110493&view=rev Log: Add a convenience constructor. Modified: llvm/trunk/include/llvm/Support/ConstantRange.h llvm/trunk/lib/Support/ConstantRange.cpp Modified: llvm/trunk/include/llvm/Support/ConstantRange.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ConstantRange.h?rev=110493&r1=110492&r2=110493&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/ConstantRange.h (original) +++ llvm/trunk/include/llvm/Support/ConstantRange.h Fri Aug 6 19:42:06 2010 @@ -37,6 +37,8 @@ namespace llvm { +class ConstantInt; + /// ConstantRange - This class represents an range of values. /// class ConstantRange { @@ -52,6 +54,7 @@ /// Initialize a range to hold the single specified value. /// ConstantRange(const APInt &Value); + ConstantRange(const ConstantInt *Value); /// @brief Initialize a range of values explicitly. This will assert out if /// Lower==Upper and Lower != Min or Max value for its type. It will also Modified: llvm/trunk/lib/Support/ConstantRange.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ConstantRange.cpp?rev=110493&r1=110492&r2=110493&view=diff ============================================================================== --- llvm/trunk/lib/Support/ConstantRange.cpp (original) +++ llvm/trunk/lib/Support/ConstantRange.cpp Fri Aug 6 19:42:06 2010 @@ -21,6 +21,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Constants.h" #include "llvm/Support/ConstantRange.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" @@ -39,6 +40,8 @@ /// Initialize a range to hold the single specified value. /// ConstantRange::ConstantRange(const APInt & V) : Lower(V), Upper(V + 1) {} +ConstantRange::ConstantRange(const ConstantInt *V) + : Lower(V->getValue()), Upper(V->getValue() + 1) {} ConstantRange::ConstantRange(const APInt &L, const APInt &U) : Lower(L), Upper(U) { From gohman at apple.com Fri Aug 6 19:43:21 2010 From: gohman at apple.com (Dan Gohman) Date: Sat, 07 Aug 2010 00:43:21 -0000 Subject: [llvm-commits] [llvm] r110494 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h include/llvm/PassManager.h include/llvm/PassSupport.h lib/CodeGen/ELFWriter.h lib/VMCore/Core.cpp lib/VMCore/Pass.cpp lib/VMCore/PassManager.cpp Message-ID: <20100807004321.18AE12A6C12C@llvm.org> Author: djg Date: Fri Aug 6 19:43:20 2010 New Revision: 110494 URL: http://llvm.org/viewvc/llvm-project?rev=110494&view=rev Log: Tidy some #includes and forward-declarations, and move the C binding code out of PassManager.cpp and into Core.cpp with the rest of the C binding code. Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h llvm/trunk/include/llvm/PassManager.h llvm/trunk/include/llvm/PassSupport.h llvm/trunk/lib/CodeGen/ELFWriter.h llvm/trunk/lib/VMCore/Core.cpp llvm/trunk/lib/VMCore/Pass.cpp llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=110494&r1=110493&r2=110494&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original) +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Fri Aug 6 19:43:20 2010 @@ -54,6 +54,7 @@ class Mangler; class TargetLoweringObjectFile; class TargetData; + class TargetMachine; class Twine; class Type; Modified: llvm/trunk/include/llvm/PassManager.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManager.h?rev=110494&r1=110493&r2=110494&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassManager.h (original) +++ llvm/trunk/include/llvm/PassManager.h Fri Aug 6 19:43:20 2010 @@ -22,7 +22,6 @@ namespace llvm { class Pass; -class ModulePass; class Module; class PassManagerImpl; Modified: llvm/trunk/include/llvm/PassSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=110494&r1=110493&r2=110494&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassSupport.h (original) +++ llvm/trunk/include/llvm/PassSupport.h Fri Aug 6 19:43:20 2010 @@ -26,8 +26,6 @@ namespace llvm { -class TargetMachine; - //===--------------------------------------------------------------------------- /// PassInfo class - An instance of this class exists for every pass known by /// the system, and can be obtained from a live Pass by calling its Modified: llvm/trunk/lib/CodeGen/ELFWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.h?rev=110494&r1=110493&r2=110494&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ELFWriter.h (original) +++ llvm/trunk/lib/CodeGen/ELFWriter.h Fri Aug 6 19:43:20 2010 @@ -39,6 +39,7 @@ class raw_ostream; class SectionKind; class MCContext; + class TargetMachine; typedef std::vector::iterator ELFSymIter; typedef std::vector::iterator ELFSectionIter; Modified: llvm/trunk/lib/VMCore/Core.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=110494&r1=110493&r2=110494&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Core.cpp (original) +++ llvm/trunk/lib/VMCore/Core.cpp Fri Aug 6 19:43:20 2010 @@ -22,6 +22,7 @@ #include "llvm/TypeSymbolTable.h" #include "llvm/InlineAsm.h" #include "llvm/IntrinsicInst.h" +#include "llvm/PassManager.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" @@ -2231,3 +2232,39 @@ void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf) { delete unwrap(MemBuf); } + + +/*===-- Pass Manager ------------------------------------------------------===*/ + +LLVMPassManagerRef LLVMCreatePassManager() { + return wrap(new PassManager()); +} + +LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M) { + return wrap(new FunctionPassManager(unwrap(M))); +} + +LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef P) { + return LLVMCreateFunctionPassManagerForModule( + reinterpret_cast(P)); +} + +LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M) { + return unwrap(PM)->run(*unwrap(M)); +} + +LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM) { + return unwrap(FPM)->doInitialization(); +} + +LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F) { + return unwrap(FPM)->run(*unwrap(F)); +} + +LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM) { + return unwrap(FPM)->doFinalization(); +} + +void LLVMDisposePassManager(LLVMPassManagerRef PM) { + delete unwrap(PM); +} Modified: llvm/trunk/lib/VMCore/Pass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Pass.cpp?rev=110494&r1=110493&r2=110494&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Pass.cpp (original) +++ llvm/trunk/lib/VMCore/Pass.cpp Fri Aug 6 19:43:20 2010 @@ -17,19 +17,14 @@ #include "llvm/PassManager.h" #include "llvm/PassRegistry.h" #include "llvm/Module.h" -#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringMap.h" #include "llvm/Assembly/PrintModulePass.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/PassNameParser.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Atomic.h" #include "llvm/System/Mutex.h" #include "llvm/System/Threading.h" -#include -#include -#include using namespace llvm; //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=110494&r1=110493&r2=110494&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Fri Aug 6 19:43:20 2010 @@ -25,7 +25,6 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/System/Mutex.h" #include "llvm/System/Threading.h" -#include "llvm-c/Core.h" #include #include #include @@ -1814,38 +1813,3 @@ } PassManagerBase::~PassManagerBase() {} - -/*===-- C Bindings --------------------------------------------------------===*/ - -LLVMPassManagerRef LLVMCreatePassManager() { - return wrap(new PassManager()); -} - -LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M) { - return wrap(new FunctionPassManager(unwrap(M))); -} - -LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef P) { - return LLVMCreateFunctionPassManagerForModule( - reinterpret_cast(P)); -} - -LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M) { - return unwrap(PM)->run(*unwrap(M)); -} - -LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM) { - return unwrap(FPM)->doInitialization(); -} - -LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F) { - return unwrap(FPM)->run(*unwrap(F)); -} - -LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM) { - return unwrap(FPM)->doFinalization(); -} - -void LLVMDisposePassManager(LLVMPassManagerRef PM) { - delete unwrap(PM); -} From gohman at apple.com Fri Aug 6 19:53:01 2010 From: gohman at apple.com (Dan Gohman) Date: Sat, 07 Aug 2010 00:53:01 -0000 Subject: [llvm-commits] [llvm] r110495 - in /llvm/trunk/include/llvm: Analysis/LoopPass.h PassManagers.h Message-ID: <20100807005301.D07C62A6C12C@llvm.org> Author: djg Date: Fri Aug 6 19:53:01 2010 New Revision: 110495 URL: http://llvm.org/viewvc/llvm-project?rev=110495&view=rev Log: Tidy up PMStack. Add a bunch of consts, use std::vector instead of std::deque, since this is a stack and only supports push/pop on one end, and remove an unimplemented declaration. Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h llvm/trunk/include/llvm/PassManagers.h Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopPass.h?rev=110495&r1=110494&r2=110495&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopPass.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopPass.h Fri Aug 6 19:53:01 2010 @@ -19,6 +19,7 @@ #include "llvm/Pass.h" #include "llvm/PassManagers.h" #include "llvm/Function.h" +#include namespace llvm { Modified: llvm/trunk/include/llvm/PassManagers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=110495&r1=110494&r2=110495&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassManagers.h (original) +++ llvm/trunk/include/llvm/PassManagers.h Fri Aug 6 19:53:01 2010 @@ -18,7 +18,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/DenseMap.h" -#include +#include #include //===----------------------------------------------------------------------===// @@ -138,30 +138,28 @@ //===----------------------------------------------------------------------===// // PMStack // -/// PMStack +/// PMStack - This class implements a stack data structure of PMDataManager +/// pointers. +/// /// Top level pass managers (see PassManager.cpp) maintain active Pass Managers /// using PMStack. Each Pass implements assignPassManager() to connect itself /// with appropriate manager. assignPassManager() walks PMStack to find /// suitable manager. -/// -/// PMStack is just a wrapper around standard deque that overrides pop() and -/// push() methods. class PMStack { public: - typedef std::deque::reverse_iterator iterator; - iterator begin() { return S.rbegin(); } - iterator end() { return S.rend(); } - - void handleLastUserOverflow(); + typedef std::vector::const_reverse_iterator iterator; + iterator begin() const { return S.rbegin(); } + iterator end() const { return S.rend(); } void pop(); - inline PMDataManager *top() { return S.back(); } + PMDataManager *top() const { return S.back(); } void push(PMDataManager *PM); - inline bool empty() { return S.empty(); } + bool empty() const { return S.empty(); } + + void dump() const; - void dump(); private: - std::deque S; + std::vector S; }; From gohman at apple.com Fri Aug 6 20:04:15 2010 From: gohman at apple.com (Dan Gohman) Date: Sat, 07 Aug 2010 01:04:15 -0000 Subject: [llvm-commits] [llvm] r110496 - /llvm/trunk/lib/VMCore/PassManager.cpp Message-ID: <20100807010415.EE6232A6C12C@llvm.org> Author: djg Date: Fri Aug 6 20:04:15 2010 New Revision: 110496 URL: http://llvm.org/viewvc/llvm-project?rev=110496&view=rev Log: Oops, check in this file too. Modified: llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=110496&r1=110495&r2=110496&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Fri Aug 6 20:04:15 2010 @@ -1707,8 +1707,8 @@ } // Dump content of the pass manager stack. -void PMStack::dump() { - for (std::deque::iterator I = S.begin(), +void PMStack::dump() const { + for (std::vector::const_iterator I = S.begin(), E = S.end(); I != E; ++I) printf("%s ", (*I)->getAsPass()->getPassName()); From evan.cheng at apple.com Fri Aug 6 20:10:23 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 6 Aug 2010 18:10:23 -0700 Subject: [llvm-commits] [llvm] r110423 - in /llvm/trunk: include/llvm/CodeGen/Passes.h include/llvm/Target/TargetInstrInfo.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/OptimizeCmps.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h In-Reply-To: References: <20100806013249.25D8E2A6C12C@llvm.org> Message-ID: <0A7EB62A-044E-4166-B340-EEDA7CC5A25B@apple.com> On Aug 6, 2010, at 2:24 PM, Chris Lattner wrote: > > On Aug 5, 2010, at 6:32 PM, Bill Wendling wrote: > >> Author: void >> Date: Thu Aug 5 20:32:48 2010 >> New Revision: 110423 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=110423&view=rev >> Log: >> Add the Optimize Compares pass (disabled by default). > > Why do we need an entire new pass to do this? Isn't this just a form of CSE? Why doesn't it go in the MachineCSE pass? I didn't think of it. That's an interesting idea. Evan > > -Chris > > >> >> This pass tries to remove comparison instructions when possible. For instance, >> if you have this code: >> >> sub r1, 1 >> cmp r1, 0 >> bz L1 >> >> and "sub" either sets the same flag as the "cmp" instruction or could be >> converted to set the same flag, then we can eliminate the "cmp" instruction all >> together. This is a important for ARM where the ALU instructions could set the >> CPSR flag, but need a special suffix ('s') to do so. >> >> Added: >> llvm/trunk/lib/CodeGen/OptimizeCmps.cpp >> Modified: >> llvm/trunk/include/llvm/CodeGen/Passes.h >> llvm/trunk/include/llvm/Target/TargetInstrInfo.h >> llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp >> llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp >> llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h >> >> Modified: llvm/trunk/include/llvm/CodeGen/Passes.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=110423&r1=110422&r2=110423&view=diff >> ============================================================================== >> --- llvm/trunk/include/llvm/CodeGen/Passes.h (original) >> +++ llvm/trunk/include/llvm/CodeGen/Passes.h Thu Aug 5 20:32:48 2010 >> @@ -180,6 +180,10 @@ >> /// to take advantage of opportunities created during DAG legalization. >> FunctionPass *createOptimizePHIsPass(); >> >> + /// createOptimizeCmpsPass - This pass performs redundant comparison removal >> + /// optimization. >> + FunctionPass *createOptimizeCmpsPass(); >> + >> /// createStackSlotColoringPass - This pass performs stack slot coloring. >> FunctionPass *createStackSlotColoringPass(bool); >> >> >> Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=110423&r1=110422&r2=110423&view=diff >> ============================================================================== >> --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) >> +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Thu Aug 5 20:32:48 2010 >> @@ -576,6 +576,21 @@ >> /// register allocation. >> virtual ScheduleHazardRecognizer* >> CreateTargetPostRAHazardRecognizer(const InstrItineraryData&) const = 0; >> + >> + /// isCompareInstr - If the machine instruction is a comparison instruction, >> + /// then return true. Also return the source register in SrcReg and the value >> + /// it compares against in CmpValue. >> + virtual bool isCompareInstr(const MachineInstr *MI, >> + unsigned &SrcReg, int &CmpValue) const { >> + return false; >> + } >> + >> + /// convertToSetZeroFlag - Convert the instruction to set the zero flag so >> + /// that we can remove a "comparison with zero". >> + virtual bool convertToSetZeroFlag(MachineInstr *Instr, >> + MachineInstr *CmpInstr) const { >> + return false; >> + } >> }; >> >> /// TargetInstrInfoImpl - This is the default implementation of >> >> Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=110423&r1=110422&r2=110423&view=diff >> ============================================================================== >> --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) >> +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Thu Aug 5 20:32:48 2010 >> @@ -354,6 +354,7 @@ >> printAndVerify(PM, "After codegen DCE pass"); >> >> PM.add(createOptimizeExtsPass()); >> + PM.add(createOptimizeCmpsPass()); >> if (!DisableMachineLICM) >> PM.add(createMachineLICMPass()); >> PM.add(createMachineCSEPass()); >> >> Added: llvm/trunk/lib/CodeGen/OptimizeCmps.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/OptimizeCmps.cpp?rev=110423&view=auto >> ============================================================================== >> --- llvm/trunk/lib/CodeGen/OptimizeCmps.cpp (added) >> +++ llvm/trunk/lib/CodeGen/OptimizeCmps.cpp Thu Aug 5 20:32:48 2010 >> @@ -0,0 +1,112 @@ >> +//===-- OptimizeCmps.cpp - Optimize comparison instrs ---------------------===// >> +// >> +// The LLVM Compiler Infrastructure >> +// >> +// This file is distributed under the University of Illinois Open Source >> +// License. See LICENSE.TXT for details. >> +// >> +//===----------------------------------------------------------------------===// >> +// >> +// This pass performs optimization of comparison instructions. For instance, in >> +// this code: >> +// >> +// sub r1, 1 >> +// cmp r1, 0 >> +// bz L1 >> +// >> +// If the "sub" instruction all ready sets (or could be modified to set) the >> +// same flag that the "cmp" instruction sets and that "bz" uses, then we can >> +// eliminate the "cmp" instruction. >> +// >> +//===----------------------------------------------------------------------===// >> + >> +#define DEBUG_TYPE "opt-compares" >> +#include "llvm/CodeGen/Passes.h" >> +#include "llvm/CodeGen/MachineFunctionPass.h" >> +#include "llvm/CodeGen/MachineInstrBuilder.h" >> +#include "llvm/CodeGen/MachineRegisterInfo.h" >> +#include "llvm/Target/TargetInstrInfo.h" >> +#include "llvm/Target/TargetRegisterInfo.h" >> +#include "llvm/Support/CommandLine.h" >> +#include "llvm/ADT/Statistic.h" >> +using namespace llvm; >> + >> +STATISTIC(NumEliminated, "Number of compares eliminated"); >> + >> +static cl::opt >> +EnableOptCmps("enable-optimize-cmps", cl::init(false), cl::Hidden); >> + >> +namespace { >> + class OptimizeCmps : public MachineFunctionPass { >> + const TargetMachine *TM; >> + const TargetInstrInfo *TII; >> + MachineRegisterInfo *MRI; >> + >> + bool OptimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB); >> + >> + public: >> + static char ID; // Pass identification >> + OptimizeCmps() : MachineFunctionPass(&ID) {} >> + >> + virtual bool runOnMachineFunction(MachineFunction &MF); >> + >> + virtual void getAnalysisUsage(AnalysisUsage &AU) const { >> + AU.setPreservesCFG(); >> + MachineFunctionPass::getAnalysisUsage(AU); >> + } >> + }; >> +} >> + >> +char OptimizeCmps::ID = 0; >> +INITIALIZE_PASS(OptimizeCmps, "opt-cmps", >> + "Optimize comparison instrs", false, false); >> + >> +FunctionPass *llvm::createOptimizeCmpsPass() { return new OptimizeCmps(); } >> + >> +/// OptimizeCmpInstr - If the instruction is a compare and the previous >> +/// instruction it's comparing against all ready sets (or could be modified to >> +/// set) the same flag as the compare, then we can remove the comparison and use >> +/// the flag from the previous instruction. >> +bool OptimizeCmps::OptimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB) { >> + // If this instruction is a comparison against zero and isn't comparing a >> + // physical register, we can try to optimize it. >> + unsigned SrcReg; >> + int CmpValue; >> + if (!TII->isCompareInstr(MI, SrcReg, CmpValue) || >> + TargetRegisterInfo::isPhysicalRegister(SrcReg) || >> + CmpValue != 0) >> + return false; >> + >> + MachineRegisterInfo::def_iterator DI = MRI->def_begin(SrcReg); >> + if (llvm::next(DI) != MRI->def_end()) >> + // Only support one definition. >> + return false; >> + >> + // Attempt to convert the defining instruction to set the "zero" flag. >> + if (TII->convertToSetZeroFlag(&*DI, MI)) { >> + ++NumEliminated; >> + return true; >> + } >> + >> + return false; >> +} >> + >> +bool OptimizeCmps::runOnMachineFunction(MachineFunction &MF) { >> + TM = &MF.getTarget(); >> + TII = TM->getInstrInfo(); >> + MRI = &MF.getRegInfo(); >> + >> + if (!EnableOptCmps) return false; >> + >> + bool Changed = false; >> + for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) { >> + MachineBasicBlock *MBB = &*I; >> + for (MachineBasicBlock::iterator >> + MII = MBB->begin(), ME = MBB->end(); MII != ME; ) { >> + MachineInstr *MI = &*MII++; >> + Changed |= OptimizeCmpInstr(MI, MBB); >> + } >> + } >> + >> + return Changed; >> +} >> >> Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=110423&r1=110422&r2=110423&view=diff >> ============================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) >> +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Aug 5 20:32:48 2010 >> @@ -1353,3 +1353,59 @@ >> Offset = (isSub) ? -Offset : Offset; >> return Offset == 0; >> } >> + >> +bool ARMBaseInstrInfo:: >> +isCompareInstr(const MachineInstr *MI, unsigned &SrcReg, int &CmpValue) const { >> + switch (MI->getOpcode()) { >> + default: break; >> + case ARM::t2CMPri: >> + case ARM::t2CMPzri: >> + SrcReg = MI->getOperand(0).getReg(); >> + CmpValue = MI->getOperand(1).getImm(); >> + return true; >> + } >> + >> + return false; >> +} >> + >> +/// convertToSetZeroFlag - Convert the instruction to set the "zero" flag so >> +/// that we can remove a "comparison with zero". >> +bool ARMBaseInstrInfo:: >> +convertToSetZeroFlag(MachineInstr *MI, MachineInstr *CmpInstr) const { >> + // Conservatively refuse to convert an instruction which isn't in the same BB >> + // as the comparison. >> + if (MI->getParent() != CmpInstr->getParent()) >> + return false; >> + >> + // Check that CPSR isn't set between the comparison instruction and the one we >> + // want to change. >> + MachineBasicBlock::const_iterator I = CmpInstr, E = MI; >> + --I; >> + for (; I != E; --I) { >> + const MachineInstr &Instr = *I; >> + >> + for (unsigned IO = 0, EO = Instr.getNumOperands(); IO != EO; ++IO) { >> + const MachineOperand &MO = Instr.getOperand(IO); >> + if (!MO.isDef() || !MO.isReg()) continue; >> + >> + // This instruction modifies CPSR before the one we want to change. We >> + // can't do this transformation. >> + if (MO.getReg() == ARM::CPSR) >> + return false; >> + } >> + } >> + >> + // Set the "zero" bit in CPSR. >> + switch (MI->getOpcode()) { >> + default: break; >> + case ARM::t2SUBri: { >> + MI->RemoveOperand(5); >> + MachineInstrBuilder MB(MI); >> + MB.addReg(ARM::CPSR, RegState::Define | RegState::Implicit); >> + CmpInstr->eraseFromParent(); >> + return true; >> + } >> + } >> + >> + return false; >> +} >> >> Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=110423&r1=110422&r2=110423&view=diff >> ============================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original) >> +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Thu Aug 5 20:32:48 2010 >> @@ -336,6 +336,17 @@ >> unsigned NumInstrs) const { >> return NumInstrs && NumInstrs == 1; >> } >> + >> + /// isCompareInstr - If the machine instruction is a comparison instruction, >> + /// then return true. Also return the source register in SrcReg and the value >> + /// it compares against in CmpValue. >> + virtual bool isCompareInstr(const MachineInstr *MI, unsigned &SrcReg, >> + int &CmpValue) const; >> + >> + /// convertToSetZeroFlag - Convert the instruction to set the zero flag so >> + /// that we can remove a "comparison with zero". >> + virtual bool convertToSetZeroFlag(MachineInstr *Instr, >> + MachineInstr *CmpInstr) const; >> }; >> >> static inline >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Fri Aug 6 20:17:47 2010 From: gohman at apple.com (Dan Gohman) Date: Sat, 07 Aug 2010 01:17:47 -0000 Subject: [llvm-commits] [llvm] r110498 - /llvm/trunk/include/llvm/Support/ConstantRange.h Message-ID: <20100807011747.BFC982A6C12C@llvm.org> Author: djg Date: Fri Aug 6 20:17:47 2010 New Revision: 110498 URL: http://llvm.org/viewvc/llvm-project?rev=110498&view=rev Log: Delete this explicit assignment operator; it's equivalent to the implicit one. Modified: llvm/trunk/include/llvm/Support/ConstantRange.h Modified: llvm/trunk/include/llvm/Support/ConstantRange.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ConstantRange.h?rev=110498&r1=110497&r2=110498&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/ConstantRange.h (original) +++ llvm/trunk/include/llvm/Support/ConstantRange.h Fri Aug 6 20:17:47 2010 @@ -142,12 +142,6 @@ /// APInt getSignedMin() const; - /// operator= - Copy one ConstantRange over another. - void operator=(const ConstantRange &CR) { - Lower = CR.Lower; - Upper = CR.Upper; - } - /// operator== - Return true if this range is equal to another range. /// bool operator==(const ConstantRange &CR) const { From gohman at apple.com Fri Aug 6 20:18:18 2010 From: gohman at apple.com (Dan Gohman) Date: Sat, 07 Aug 2010 01:18:18 -0000 Subject: [llvm-commits] [llvm] r110499 - in /llvm/trunk: include/llvm/Pass.h include/llvm/PassAnalysisSupport.h include/llvm/PassManagers.h lib/VMCore/PassManager.cpp Message-ID: <20100807011818.61D422A6C12C@llvm.org> Author: djg Date: Fri Aug 6 20:18:18 2010 New Revision: 110499 URL: http://llvm.org/viewvc/llvm-project?rev=110499&view=rev Log: More #include cleanups. Modified: llvm/trunk/include/llvm/Pass.h llvm/trunk/include/llvm/PassAnalysisSupport.h llvm/trunk/include/llvm/PassManagers.h llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/include/llvm/Pass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Pass.h?rev=110499&r1=110498&r2=110499&view=diff ============================================================================== --- llvm/trunk/include/llvm/Pass.h (original) +++ llvm/trunk/include/llvm/Pass.h Fri Aug 6 20:18:18 2010 @@ -29,11 +29,7 @@ #ifndef LLVM_PASS_H #define LLVM_PASS_H -#include "llvm/System/DataTypes.h" - #include -#include -#include namespace llvm { Modified: llvm/trunk/include/llvm/PassAnalysisSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassAnalysisSupport.h?rev=110499&r1=110498&r2=110499&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassAnalysisSupport.h (original) +++ llvm/trunk/include/llvm/PassAnalysisSupport.h Fri Aug 6 20:18:18 2010 @@ -19,7 +19,6 @@ #ifndef LLVM_PASS_ANALYSIS_SUPPORT_H #define LLVM_PASS_ANALYSIS_SUPPORT_H -#include "llvm/Pass.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include Modified: llvm/trunk/include/llvm/PassManagers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=110499&r1=110498&r2=110499&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassManagers.h (original) +++ llvm/trunk/include/llvm/PassManagers.h Fri Aug 6 20:18:18 2010 @@ -14,7 +14,7 @@ #ifndef LLVM_PASSMANAGERS_H #define LLVM_PASSMANAGERS_H -#include "llvm/PassManager.h" +#include "llvm/Pass.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/DenseMap.h" @@ -96,6 +96,7 @@ class StringRef; class Value; class Timer; + class PMDataManager; /// FunctionPassManager and PassManager, two top level managers, serve /// as the public interface of pass manager infrastructure. Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=110499&r1=110498&r2=110499&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Fri Aug 6 20:18:18 2010 @@ -13,6 +13,7 @@ #include "llvm/PassManagers.h" +#include "llvm/PassManager.h" #include "llvm/Assembly/PrintModulePass.h" #include "llvm/Assembly/Writer.h" #include "llvm/Support/CommandLine.h" From gohman at apple.com Fri Aug 6 20:25:32 2010 From: gohman at apple.com (Dan Gohman) Date: Sat, 07 Aug 2010 01:25:32 -0000 Subject: [llvm-commits] [llvm] r110500 - in /llvm/trunk/include/llvm: Analysis/LoopPass.h CallGraphSCCPass.h Pass.h Message-ID: <20100807012532.B13C02A6C12C@llvm.org> Author: djg Date: Fri Aug 6 20:25:32 2010 New Revision: 110500 URL: http://llvm.org/viewvc/llvm-project?rev=110500&view=rev Log: Remove assignPassManager's default arguments. It's really confusing to have different arguments for the same virtual function at different levels of the class hierarchy. Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h llvm/trunk/include/llvm/CallGraphSCCPass.h llvm/trunk/include/llvm/Pass.h Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopPass.h?rev=110500&r1=110499&r2=110500&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopPass.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopPass.h Fri Aug 6 20:25:32 2010 @@ -58,7 +58,7 @@ /// Assign pass manager to manage this pass virtual void assignPassManager(PMStack &PMS, - PassManagerType PMT = PMT_LoopPassManager); + PassManagerType PMT); /// Return what kind of Pass Manager can manage this pass. virtual PassManagerType getPotentialPassManagerType() const { Modified: llvm/trunk/include/llvm/CallGraphSCCPass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CallGraphSCCPass.h?rev=110500&r1=110499&r2=110500&view=diff ============================================================================== --- llvm/trunk/include/llvm/CallGraphSCCPass.h (original) +++ llvm/trunk/include/llvm/CallGraphSCCPass.h Fri Aug 6 20:25:32 2010 @@ -63,7 +63,7 @@ /// Assign pass manager to manager this pass virtual void assignPassManager(PMStack &PMS, - PassManagerType PMT =PMT_CallGraphPassManager); + PassManagerType PMT); /// Return what kind of Pass Manager can manage this pass. virtual PassManagerType getPotentialPassManagerType() const { Modified: llvm/trunk/include/llvm/Pass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Pass.h?rev=110500&r1=110499&r2=110500&view=diff ============================================================================== --- llvm/trunk/include/llvm/Pass.h (original) +++ llvm/trunk/include/llvm/Pass.h Fri Aug 6 20:25:32 2010 @@ -119,7 +119,7 @@ /// Each pass is responsible for assigning a pass manager to itself. /// PMS is the stack of available pass manager. virtual void assignPassManager(PMStack &, - PassManagerType = PMT_Unknown) {} + PassManagerType) {} /// Check if available pass managers are suitable for this pass or not. virtual void preparePassManager(PMStack &); @@ -225,7 +225,7 @@ virtual bool runOnModule(Module &M) = 0; virtual void assignPassManager(PMStack &PMS, - PassManagerType T = PMT_ModulePassManager); + PassManagerType T); /// Return what kind of Pass Manager can manage this pass. virtual PassManagerType getPotentialPassManagerType() const; @@ -307,7 +307,7 @@ bool run(Function &F); virtual void assignPassManager(PMStack &PMS, - PassManagerType T = PMT_FunctionPassManager); + PassManagerType T); /// Return what kind of Pass Manager can manage this pass. virtual PassManagerType getPotentialPassManagerType() const; @@ -364,7 +364,7 @@ bool runOnFunction(Function &F); virtual void assignPassManager(PMStack &PMS, - PassManagerType T = PMT_BasicBlockPassManager); + PassManagerType T); /// Return what kind of Pass Manager can manage this pass. virtual PassManagerType getPotentialPassManagerType() const; From nicholas at mxc.ca Fri Aug 6 23:53:32 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Fri, 06 Aug 2010 21:53:32 -0700 Subject: [llvm-commits] [llvm] r110477 - /llvm/trunk/tools/llc/llc.cpp In-Reply-To: <20100806213745.630922A6C12C@llvm.org> References: <20100806213745.630922A6C12C@llvm.org> Message-ID: <4C5CE6CC.2050107@mxc.ca> Michael J. Spencer wrote: > Author: mspencer > Date: Fri Aug 6 16:37:45 2010 > New Revision: 110477 > > URL: http://llvm.org/viewvc/llvm-project?rev=110477&view=rev > Log: > llc: Clarify -mc-relax-all description. > > Modified: > llvm/trunk/tools/llc/llc.cpp > > Modified: llvm/trunk/tools/llc/llc.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=110477&r1=110476&r2=110477&view=diff > ============================================================================== > --- llvm/trunk/tools/llc/llc.cpp (original) > +++ llvm/trunk/tools/llc/llc.cpp Fri Aug 6 16:37:45 2010 > @@ -77,7 +77,9 @@ > cl::value_desc("a1,+a2,-a3,...")); > > static cl::opt > -RelaxAll("mc-relax-all", cl::desc("Relax all fixups")); > +RelaxAll("mc-relax-all", > + cl::desc("When used with filetype=obj, " > + "relax all fixups in the emited object file")); typo: emited -> emitted > > cl::opt > FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile), > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From nicholas at mxc.ca Fri Aug 6 23:53:25 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Fri, 06 Aug 2010 21:53:25 -0700 Subject: [llvm-commits] [llvm] r110493 - in /llvm/trunk: include/llvm/Support/ConstantRange.h lib/Support/ConstantRange.cpp In-Reply-To: <20100807004206.A2BF82A6C12C@llvm.org> References: <20100807004206.A2BF82A6C12C@llvm.org> Message-ID: <4C5CE6C5.6030601@mxc.ca> Owen Anderson wrote: > Author: resistor > Date: Fri Aug 6 19:42:06 2010 > New Revision: 110493 > > URL: http://llvm.org/viewvc/llvm-project?rev=110493&view=rev > Log: > Add a convenience constructor. I'm highly suspicious of this. Does Support depend on VMCore elsewhere? > > Modified: > llvm/trunk/include/llvm/Support/ConstantRange.h > llvm/trunk/lib/Support/ConstantRange.cpp > > Modified: llvm/trunk/include/llvm/Support/ConstantRange.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ConstantRange.h?rev=110493&r1=110492&r2=110493&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Support/ConstantRange.h (original) > +++ llvm/trunk/include/llvm/Support/ConstantRange.h Fri Aug 6 19:42:06 2010 > @@ -37,6 +37,8 @@ > > namespace llvm { > > +class ConstantInt; > + > /// ConstantRange - This class represents an range of values. > /// > class ConstantRange { > @@ -52,6 +54,7 @@ > /// Initialize a range to hold the single specified value. > /// > ConstantRange(const APInt&Value); > + ConstantRange(const ConstantInt *Value); > > /// @brief Initialize a range of values explicitly. This will assert out if > /// Lower==Upper and Lower != Min or Max value for its type. It will also > > Modified: llvm/trunk/lib/Support/ConstantRange.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ConstantRange.cpp?rev=110493&r1=110492&r2=110493&view=diff > ============================================================================== > --- llvm/trunk/lib/Support/ConstantRange.cpp (original) > +++ llvm/trunk/lib/Support/ConstantRange.cpp Fri Aug 6 19:42:06 2010 > @@ -21,6 +21,7 @@ > // > //===----------------------------------------------------------------------===// > > +#include "llvm/Constants.h" > #include "llvm/Support/ConstantRange.h" > #include "llvm/Support/Debug.h" > #include "llvm/Support/raw_ostream.h" > @@ -39,6 +40,8 @@ > /// Initialize a range to hold the single specified value. > /// > ConstantRange::ConstantRange(const APInt& V) : Lower(V), Upper(V + 1) {} > +ConstantRange::ConstantRange(const ConstantInt *V) > + : Lower(V->getValue()), Upper(V->getValue() + 1) {} > > ConstantRange::ConstantRange(const APInt&L, const APInt&U) : > Lower(L), Upper(U) { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From bob.wilson at apple.com Sat Aug 7 00:14:16 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Sat, 07 Aug 2010 05:14:16 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r110501 - in /llvm-gcc-4.2/trunk: ChangeLog.apple Makefile.in build_gcc Message-ID: <20100807051416.B58AE2A6C12C@llvm.org> Author: bwilson Date: Sat Aug 7 00:14:16 2010 New Revision: 110501 URL: http://llvm.org/viewvc/llvm-project?rev=110501&view=rev Log: Radar 8283838: Merge fix for from gcc-4.2 Modified: llvm-gcc-4.2/trunk/ChangeLog.apple llvm-gcc-4.2/trunk/Makefile.in llvm-gcc-4.2/trunk/build_gcc Modified: llvm-gcc-4.2/trunk/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/ChangeLog.apple?rev=110501&r1=110500&r2=110501&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/ChangeLog.apple Sat Aug 7 00:14:16 2010 @@ -1,3 +1,9 @@ +2010-08-06 Bob Wilson + + Radar 8277973 + * Makefile.in (FLAGS_FOR_TARGET): Add $(SYSROOT_CFLAGS_FOR_TARGET). + * build_gcc: Configure for powerpc using --with-build-sysroot. + 2010-07-29 Bob Wilson Radar 7982386 Modified: llvm-gcc-4.2/trunk/Makefile.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/Makefile.in?rev=110501&r1=110500&r2=110501&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/Makefile.in (original) +++ llvm-gcc-4.2/trunk/Makefile.in Sat Aug 7 00:14:16 2010 @@ -308,7 +308,8 @@ # Programs producing files for the TARGET machine # ----------------------------------------------- -FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ +# APPLE LOCAL 8277973 Add sysroot flag here. +FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ $(SYSROOT_CFLAGS_FOR_TARGET) AR_FOR_TARGET=@AR_FOR_TARGET@ AS_FOR_TARGET=@AS_FOR_TARGET@ Modified: llvm-gcc-4.2/trunk/build_gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build_gcc?rev=110501&r1=110500&r2=110501&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/build_gcc (original) +++ llvm-gcc-4.2/trunk/build_gcc Sat Aug 7 00:14:16 2010 @@ -118,6 +118,10 @@ NON_ARM_CONFIGFLAGS="--with-gxx-include-dir=/usr/include/c++/$LIBSTDCXX_VERSION" # LLVM LOCAL end +# Build against the MacOSX10.5 SDK for PowerPC. +PPC_SYSROOT=/Developer/SDKs/MacOSX10.5.sdk +PPC_CONFIGFLAGS="$NON_ARM_CONFIGFLAGS --with-build-sysroot=\"$PPC_SYSROOT\"" + DARWIN_VERS=`uname -r | sed 's/\..*//'` echo DARWIN_VERS = $DARWIN_VERS @@ -359,6 +363,8 @@ AS_FOR_TARGET=$DIR/bin/${t}-apple-darwin$DARWIN_VERS-as \ LD_FOR_TARGET=$DIR/bin/${t}-apple-darwin$DARWIN_VERS-ld \ $SRC_DIR/configure $T_CONFIGFLAGS $ARM_CONFIGFLAGS || exit 1 + elif [ $t = 'powerpc' ] ; then + $SRC_DIR/configure $T_CONFIGFLAGS $PPC_CONFIGFLAGS || exit 1 else $SRC_DIR/configure $T_CONFIGFLAGS $NON_ARM_CONFIGFLAGS || exit 1 fi @@ -420,6 +426,8 @@ --target=$t-apple-darwin$DARWIN_VERS" if [ $t = 'arm' ] && [ $h != 'arm' ] ; then T_CONFIGFLAGS="$T_CONFIGFLAGS $ARM_CONFIGFLAGS" + elif [ $t = 'powerpc' ] && [ $h != 'powerpc' ] ; then + T_CONFIGFLAGS="$T_CONFIGFLAGS $PPC_CONFIGFLAGS" else T_CONFIGFLAGS="$T_CONFIGFLAGS $NON_ARM_CONFIGFLAGS" fi From nicholas at mxc.ca Sat Aug 7 00:25:29 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Sat, 07 Aug 2010 05:25:29 -0000 Subject: [llvm-commits] [llvm] r110502 - /llvm/trunk/include/llvm/ADT/FoldingSet.h Message-ID: <20100807052529.BE6D92A6C12C@llvm.org> Author: nicholas Date: Sat Aug 7 00:25:29 2010 New Revision: 110502 URL: http://llvm.org/viewvc/llvm-project?rev=110502&view=rev Log: Fix typo. Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=110502&r1=110501&r2=110502&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/FoldingSet.h (original) +++ llvm/trunk/include/llvm/ADT/FoldingSet.h Sat Aug 7 00:25:29 2010 @@ -198,7 +198,7 @@ /// to "profile" (in the FoldingSet parlance) an object of a given type. /// The default behavior is to invoke a 'Profile' method on an object, but /// through template specialization the behavior can be tailored for specific -/// types. Combined with the FoldingSetNodeWrapper classs, one can add objects +/// types. Combined with the FoldingSetNodeWrapper class, one can add objects /// to FoldingSets that were not originally designed to have that behavior. /// template struct FoldingSetTrait { From clattner at apple.com Sat Aug 7 00:27:29 2010 From: clattner at apple.com (Chris Lattner) Date: Fri, 6 Aug 2010 22:27:29 -0700 Subject: [llvm-commits] [llvm] r110423 - in /llvm/trunk: include/llvm/CodeGen/Passes.h include/llvm/Target/TargetInstrInfo.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/OptimizeCmps.cpp lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h In-Reply-To: <0A7EB62A-044E-4166-B340-EEDA7CC5A25B@apple.com> References: <20100806013249.25D8E2A6C12C@llvm.org> <0A7EB62A-044E-4166-B340-EEDA7CC5A25B@apple.com> Message-ID: On Aug 6, 2010, at 6:10 PM, Evan Cheng wrote: > > On Aug 6, 2010, at 2:24 PM, Chris Lattner wrote: > >> >> On Aug 5, 2010, at 6:32 PM, Bill Wendling wrote: >> >>> Author: void >>> Date: Thu Aug 5 20:32:48 2010 >>> New Revision: 110423 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=110423&view=rev >>> Log: >>> Add the Optimize Compares pass (disabled by default). >> >> Why do we need an entire new pass to do this? Isn't this just a form of CSE? Why doesn't it go in the MachineCSE pass? > > I didn't think of it. That's an interesting idea. Ultimately it is never clear of course, but it is really nice to have fewer relatively-coarse grained passes than tons of fine grained ones. -Chris From clattner at apple.com Sat Aug 7 00:29:50 2010 From: clattner at apple.com (Chris Lattner) Date: Fri, 6 Aug 2010 22:29:50 -0700 Subject: [llvm-commits] [llvm] r110493 - in /llvm/trunk: include/llvm/Support/ConstantRange.h lib/Support/ConstantRange.cpp In-Reply-To: <4C5CE6C5.6030601@mxc.ca> References: <20100807004206.A2BF82A6C12C@llvm.org> <4C5CE6C5.6030601@mxc.ca> Message-ID: <53222179-C042-4211-853E-8E157AA23DDF@apple.com> On Aug 6, 2010, at 9:53 PM, Nick Lewycky wrote: > Owen Anderson wrote: >> Author: resistor >> Date: Fri Aug 6 19:42:06 2010 >> New Revision: 110493 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=110493&view=rev >> Log: >> Add a convenience constructor. > > I'm highly suspicious of this. Does Support depend on VMCore elsewhere? No... except for ConstantRange.cpp. It looks like it already has the layering violation. Owen, can you clean up this backwards dependency while you're in there? -Chris From clattner at apple.com Sat Aug 7 00:30:39 2010 From: clattner at apple.com (Chris Lattner) Date: Fri, 6 Aug 2010 22:30:39 -0700 Subject: [llvm-commits] [llvm] r110493 - in /llvm/trunk: include/llvm/Support/ConstantRange.h lib/Support/ConstantRange.cpp In-Reply-To: <20100807004206.A2BF82A6C12C@llvm.org> References: <20100807004206.A2BF82A6C12C@llvm.org> Message-ID: <3B9A37DE-F291-46C6-84C2-2716C1D808E2@apple.com> On Aug 6, 2010, at 5:42 PM, Owen Anderson wrote: > Author: resistor > Date: Fri Aug 6 19:42:06 2010 > New Revision: 110493 > > URL: http://llvm.org/viewvc/llvm-project?rev=110493&view=rev > Log: > Add a convenience constructor. ... > +++ llvm/trunk/lib/Support/ConstantRange.cpp Fri Aug 6 19:42:06 2010 > @@ -21,6 +21,7 @@ > // > //===----------------------------------------------------------------------===// > > +#include "llvm/Constants.h" > #include "llvm/Support/ConstantRange.h" This should be removed, but even if it were to stay, it is not the right #include order. Always include the .cpp file's corresponding header first. -Chris From resistor at mac.com Sat Aug 7 00:47:46 2010 From: resistor at mac.com (Owen Anderson) Date: Sat, 07 Aug 2010 05:47:46 -0000 Subject: [llvm-commits] [llvm] r110504 - in /llvm/trunk: include/llvm/Support/ConstantRange.h lib/Support/ConstantRange.cpp unittests/Support/ConstantRangeTest.cpp Message-ID: <20100807054746.CE6292A6C12C@llvm.org> Author: resistor Date: Sat Aug 7 00:47:46 2010 New Revision: 110504 URL: http://llvm.org/viewvc/llvm-project?rev=110504&view=rev Log: Add an inverse() method to ConstantRange. Modified: llvm/trunk/include/llvm/Support/ConstantRange.h llvm/trunk/lib/Support/ConstantRange.cpp llvm/trunk/unittests/Support/ConstantRangeTest.cpp Modified: llvm/trunk/include/llvm/Support/ConstantRange.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ConstantRange.h?rev=110504&r1=110503&r2=110504&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/ConstantRange.h (original) +++ llvm/trunk/include/llvm/Support/ConstantRange.h Sat Aug 7 00:47:46 2010 @@ -232,6 +232,9 @@ /// from a logical right shift of a value in this range by the Amount value. ConstantRange lshr(const ConstantRange &Amount) const; + /// inverse - Return a new range that is the logical not of the current set. + ConstantRange inverse() const; + /// print - Print out the bounds to a stream... /// void print(raw_ostream &OS) const; Modified: llvm/trunk/lib/Support/ConstantRange.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ConstantRange.cpp?rev=110504&r1=110503&r2=110504&view=diff ============================================================================== --- llvm/trunk/lib/Support/ConstantRange.cpp (original) +++ llvm/trunk/lib/Support/ConstantRange.cpp Sat Aug 7 00:47:46 2010 @@ -655,6 +655,17 @@ return ConstantRange(min, max); } +ConstantRange ConstantRange::inverse() const { + if (isFullSet()) { + return ConstantRange(APInt::getNullValue(Lower.getBitWidth()), + APInt::getNullValue(Lower.getBitWidth())); + } else if (isEmptySet()) { + return ConstantRange(APInt::getAllOnesValue(Lower.getBitWidth()), + APInt::getAllOnesValue(Lower.getBitWidth())); + } + return ConstantRange(Upper, Lower); +} + /// print - Print out the bounds to a stream... /// void ConstantRange::print(raw_ostream &OS) const { Modified: llvm/trunk/unittests/Support/ConstantRangeTest.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ConstantRangeTest.cpp?rev=110504&r1=110503&r2=110504&view=diff ============================================================================== --- llvm/trunk/unittests/Support/ConstantRangeTest.cpp (original) +++ llvm/trunk/unittests/Support/ConstantRangeTest.cpp Sat Aug 7 00:47:46 2010 @@ -33,6 +33,7 @@ TEST_F(ConstantRangeTest, Basics) { EXPECT_TRUE(Full.isFullSet()); EXPECT_FALSE(Full.isEmptySet()); + EXPECT_TRUE(Full.inverse().isEmptySet()); EXPECT_FALSE(Full.isWrappedSet()); EXPECT_TRUE(Full.contains(APInt(16, 0x0))); EXPECT_TRUE(Full.contains(APInt(16, 0x9))); @@ -42,6 +43,7 @@ EXPECT_FALSE(Empty.isFullSet()); EXPECT_TRUE(Empty.isEmptySet()); + EXPECT_TRUE(Empty.inverse().isFullSet()); EXPECT_FALSE(Empty.isWrappedSet()); EXPECT_FALSE(Empty.contains(APInt(16, 0x0))); EXPECT_FALSE(Empty.contains(APInt(16, 0x9))); @@ -57,6 +59,7 @@ EXPECT_TRUE(One.contains(APInt(16, 0xa))); EXPECT_FALSE(One.contains(APInt(16, 0xaa9))); EXPECT_FALSE(One.contains(APInt(16, 0xaaa))); + EXPECT_FALSE(One.inverse().contains(APInt(16, 0xa))); EXPECT_FALSE(Some.isFullSet()); EXPECT_FALSE(Some.isEmptySet()); From resistor at mac.com Sat Aug 7 01:01:13 2010 From: resistor at mac.com (Owen Anderson) Date: Sat, 07 Aug 2010 06:01:13 -0000 Subject: [llvm-commits] [llvm] r110505 - in /llvm/trunk: include/llvm/Support/ConstantRange.h lib/Support/ConstantRange.cpp Message-ID: <20100807060113.DF4FE2A6C12C@llvm.org> Author: resistor Date: Sat Aug 7 01:01:13 2010 New Revision: 110505 URL: http://llvm.org/viewvc/llvm-project?rev=110505&view=rev Log: Remove layering violation. Modified: llvm/trunk/include/llvm/Support/ConstantRange.h llvm/trunk/lib/Support/ConstantRange.cpp Modified: llvm/trunk/include/llvm/Support/ConstantRange.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ConstantRange.h?rev=110505&r1=110504&r2=110505&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/ConstantRange.h (original) +++ llvm/trunk/include/llvm/Support/ConstantRange.h Sat Aug 7 01:01:13 2010 @@ -37,8 +37,6 @@ namespace llvm { -class ConstantInt; - /// ConstantRange - This class represents an range of values. /// class ConstantRange { @@ -54,7 +52,6 @@ /// Initialize a range to hold the single specified value. /// ConstantRange(const APInt &Value); - ConstantRange(const ConstantInt *Value); /// @brief Initialize a range of values explicitly. This will assert out if /// Lower==Upper and Lower != Min or Max value for its type. It will also Modified: llvm/trunk/lib/Support/ConstantRange.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ConstantRange.cpp?rev=110505&r1=110504&r2=110505&view=diff ============================================================================== --- llvm/trunk/lib/Support/ConstantRange.cpp (original) +++ llvm/trunk/lib/Support/ConstantRange.cpp Sat Aug 7 01:01:13 2010 @@ -40,8 +40,6 @@ /// Initialize a range to hold the single specified value. /// ConstantRange::ConstantRange(const APInt & V) : Lower(V), Upper(V + 1) {} -ConstantRange::ConstantRange(const ConstantInt *V) - : Lower(V->getValue()), Upper(V->getValue() + 1) {} ConstantRange::ConstantRange(const APInt &L, const APInt &U) : Lower(L), Upper(U) { From benny.kra at googlemail.com Sat Aug 7 06:45:42 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Sat, 07 Aug 2010 11:45:42 -0000 Subject: [llvm-commits] [llvm] r110512 - /llvm/trunk/include/llvm/Support/PassNameParser.h Message-ID: <20100807114542.9FAB62A6C12C@llvm.org> Author: d0k Date: Sat Aug 7 06:45:42 2010 New Revision: 110512 URL: http://llvm.org/viewvc/llvm-project?rev=110512&view=rev Log: Shrink PassNameParser's binary size with array_pod_sort. Modified: llvm/trunk/include/llvm/Support/PassNameParser.h Modified: llvm/trunk/include/llvm/Support/PassNameParser.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PassNameParser.h?rev=110512&r1=110511&r2=110512&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/PassNameParser.h (original) +++ llvm/trunk/include/llvm/Support/PassNameParser.h Sat Aug 7 06:45:42 2010 @@ -23,11 +23,11 @@ #ifndef LLVM_SUPPORT_PASS_NAME_PARSER_H #define LLVM_SUPPORT_PASS_NAME_PARSER_H +#include "llvm/Pass.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/Pass.h" -#include #include namespace llvm { @@ -42,8 +42,7 @@ public: PassNameParser() : Opt(0) {} virtual ~PassNameParser(); - - + void initialize(cl::Option &O) { Opt = &O; cl::parser::initialize(O); @@ -77,19 +76,21 @@ } virtual void passEnumerate(const PassInfo *P) { passRegistered(P); } - // ValLessThan - Provide a sorting comparator for Values elements... - typedef PassNameParser::OptionInfo ValType; - static bool ValLessThan(const ValType &VT1, const ValType &VT2) { - return std::string(VT1.Name) < std::string(VT2.Name); - } - // printOptionInfo - Print out information about this option. Override the // default implementation to sort the table before we print... virtual void printOptionInfo(const cl::Option &O, size_t GlobalWidth) const { PassNameParser *PNP = const_cast(this); - std::sort(PNP->Values.begin(), PNP->Values.end(), ValLessThan); + array_pod_sort(PNP->Values.begin(), PNP->Values.end(), ValLessThan); cl::parser::printOptionInfo(O, GlobalWidth); } + +private: + // ValLessThan - Provide a sorting comparator for Values elements... + static int ValLessThan(const void *VT1, const void *VT2) { + typedef PassNameParser::OptionInfo ValType; + return std::strcmp(static_cast(VT1)->Name, + static_cast(VT2)->Name); + } }; ///===----------------------------------------------------------------------===// From benny.kra at googlemail.com Sat Aug 7 07:37:01 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Sat, 07 Aug 2010 12:37:01 -0000 Subject: [llvm-commits] [llvm] r110516 - /llvm/trunk/lib/Support/Timer.cpp Message-ID: <20100807123701.0F8482A6C12C@llvm.org> Author: d0k Date: Sat Aug 7 07:37:00 2010 New Revision: 110516 URL: http://llvm.org/viewvc/llvm-project?rev=110516&view=rev Log: Kill rarely used std::sort. Modified: llvm/trunk/lib/Support/Timer.cpp Modified: llvm/trunk/lib/Support/Timer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Timer.cpp?rev=110516&r1=110515&r2=110516&view=diff ============================================================================== --- llvm/trunk/lib/Support/Timer.cpp (original) +++ llvm/trunk/lib/Support/Timer.cpp Sat Aug 7 07:37:00 2010 @@ -20,6 +20,7 @@ #include "llvm/System/Mutex.h" #include "llvm/System/Process.h" #include "llvm/ADT/OwningPtr.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringMap.h" using namespace llvm; @@ -315,8 +316,8 @@ void TimerGroup::PrintQueuedTimers(raw_ostream &OS) { // Sort the timers in descending order by amount of time taken. - std::sort(TimersToPrint.begin(), TimersToPrint.end()); - + array_pod_sort(TimersToPrint.begin(), TimersToPrint.end()); + TimeRecord Total; for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i) Total += TimersToPrint[i].first; From benny.kra at googlemail.com Sat Aug 7 08:07:57 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Sat, 07 Aug 2010 13:07:57 -0000 Subject: [llvm-commits] [llvm] r110517 - /llvm/trunk/include/llvm/Support/Timer.h Message-ID: <20100807130757.C18032A6C12C@llvm.org> Author: d0k Date: Sat Aug 7 08:07:57 2010 New Revision: 110517 URL: http://llvm.org/viewvc/llvm-project?rev=110517&view=rev Log: A reference to the Timer's name is safe, it outlives the contents of the vector. Modified: llvm/trunk/include/llvm/Support/Timer.h Modified: llvm/trunk/include/llvm/Support/Timer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Timer.h?rev=110517&r1=110516&r2=110517&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Timer.h (original) +++ llvm/trunk/include/llvm/Support/Timer.h Sat Aug 7 08:07:57 2010 @@ -18,7 +18,6 @@ #include "llvm/System/DataTypes.h" #include "llvm/ADT/StringRef.h" #include -#include #include #include @@ -165,7 +164,7 @@ class TimerGroup { std::string Name; Timer *FirstTimer; // First timer in the group. - std::vector > TimersToPrint; + std::vector > TimersToPrint; TimerGroup **Prev, *Next; // Doubly linked list of TimerGroup's. TimerGroup(const TimerGroup &TG); // DO NOT IMPLEMENT From benny.kra at googlemail.com Sat Aug 7 08:27:41 2010 From: benny.kra at googlemail.com (Benjamin Kramer) Date: Sat, 07 Aug 2010 13:27:41 -0000 Subject: [llvm-commits] [llvm] r110518 - in /llvm/trunk: include/llvm/Support/Timer.h lib/Support/Timer.cpp Message-ID: <20100807132741.91B142A6C12C@llvm.org> Author: d0k Date: Sat Aug 7 08:27:41 2010 New Revision: 110518 URL: http://llvm.org/viewvc/llvm-project?rev=110518&view=rev Log: Roll back my last two commits, valgrind complains. Modified: llvm/trunk/include/llvm/Support/Timer.h llvm/trunk/lib/Support/Timer.cpp Modified: llvm/trunk/include/llvm/Support/Timer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Timer.h?rev=110518&r1=110517&r2=110518&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Timer.h (original) +++ llvm/trunk/include/llvm/Support/Timer.h Sat Aug 7 08:27:41 2010 @@ -18,6 +18,7 @@ #include "llvm/System/DataTypes.h" #include "llvm/ADT/StringRef.h" #include +#include #include #include @@ -164,7 +165,7 @@ class TimerGroup { std::string Name; Timer *FirstTimer; // First timer in the group. - std::vector > TimersToPrint; + std::vector > TimersToPrint; TimerGroup **Prev, *Next; // Doubly linked list of TimerGroup's. TimerGroup(const TimerGroup &TG); // DO NOT IMPLEMENT Modified: llvm/trunk/lib/Support/Timer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Timer.cpp?rev=110518&r1=110517&r2=110518&view=diff ============================================================================== --- llvm/trunk/lib/Support/Timer.cpp (original) +++ llvm/trunk/lib/Support/Timer.cpp Sat Aug 7 08:27:41 2010 @@ -20,7 +20,6 @@ #include "llvm/System/Mutex.h" #include "llvm/System/Process.h" #include "llvm/ADT/OwningPtr.h" -#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringMap.h" using namespace llvm; @@ -316,8 +315,8 @@ void TimerGroup::PrintQueuedTimers(raw_ostream &OS) { // Sort the timers in descending order by amount of time taken. - array_pod_sort(TimersToPrint.begin(), TimersToPrint.end()); - + std::sort(TimersToPrint.begin(), TimersToPrint.end()); + TimeRecord Total; for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i) Total += TimersToPrint[i].first; From rafael.espindola at gmail.com Sat Aug 7 16:48:09 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Sat, 07 Aug 2010 21:48:09 -0000 Subject: [llvm-commits] [llvm] r110520 - in /llvm/trunk: test/BugPoint/crash-narrowfunctiontest.ll test/BugPoint/remove_arguments_test.ll tools/Makefile tools/bugpoint-passes/ tools/bugpoint-passes/TestPasses.cpp tools/bugpoint/TestPasses.cpp Message-ID: <20100807214809.6CD772A6C12C@llvm.org> Author: rafael Date: Sat Aug 7 16:48:09 2010 New Revision: 110520 URL: http://llvm.org/viewvc/llvm-project?rev=110520&view=rev Log: Move the bugpoint test passes to a plugin in preparation for having bugpoint use opt. Added: llvm/trunk/tools/bugpoint-passes/ llvm/trunk/tools/bugpoint-passes/TestPasses.cpp - copied, changed from r110518, llvm/trunk/tools/bugpoint/TestPasses.cpp Removed: llvm/trunk/tools/bugpoint/TestPasses.cpp Modified: llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll llvm/trunk/test/BugPoint/remove_arguments_test.ll llvm/trunk/tools/Makefile Modified: llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll?rev=110520&r1=110519&r2=110520&view=diff ============================================================================== --- llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll (original) +++ llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll Sat Aug 7 16:48:09 2010 @@ -1,6 +1,7 @@ ; Test that bugpoint can narrow down the testcase to the important function +; FIXME: This likely fails on windows ; -; RUN: bugpoint %s -output-prefix %t -bugpoint-crashcalls -silence-passes > /dev/null +; RUN: bugpoint -load %llvmlibsdir/BugpointPasses.so %s -output-prefix %t -bugpoint-crashcalls -silence-passes > /dev/null define i32 @foo() { ret i32 1 } Modified: llvm/trunk/test/BugPoint/remove_arguments_test.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/BugPoint/remove_arguments_test.ll?rev=110520&r1=110519&r2=110520&view=diff ============================================================================== --- llvm/trunk/test/BugPoint/remove_arguments_test.ll (original) +++ llvm/trunk/test/BugPoint/remove_arguments_test.ll Sat Aug 7 16:48:09 2010 @@ -1,4 +1,5 @@ -; RUN: bugpoint %s -output-prefix %t -bugpoint-crashcalls -silence-passes +; FIXME: This likely fails on windows +; RUN: bugpoint -load %llvmlibsdir/BugpointPasses.so %s -output-prefix %t -bugpoint-crashcalls -silence-passes ; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s ; Test to make sure that arguments are removed from the function if they are Modified: llvm/trunk/tools/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/Makefile?rev=110520&r1=110519&r2=110520&view=diff ============================================================================== --- llvm/trunk/tools/Makefile (original) +++ llvm/trunk/tools/Makefile Sat Aug 7 16:48:09 2010 @@ -20,7 +20,7 @@ llc llvm-ranlib llvm-ar llvm-nm \ llvm-ld llvm-prof llvm-link \ lli llvm-extract llvm-mc \ - bugpoint llvm-bcanalyzer llvm-stub \ + bugpoint bugpoint-passes llvm-bcanalyzer llvm-stub \ llvmc # Let users override the set of tools to build from the command line. Copied: llvm/trunk/tools/bugpoint-passes/TestPasses.cpp (from r110518, llvm/trunk/tools/bugpoint/TestPasses.cpp) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint-passes/TestPasses.cpp?p2=llvm/trunk/tools/bugpoint-passes/TestPasses.cpp&p1=llvm/trunk/tools/bugpoint/TestPasses.cpp&r1=110518&r2=110520&rev=110520&view=diff ============================================================================== (empty) Removed: llvm/trunk/tools/bugpoint/TestPasses.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/TestPasses.cpp?rev=110519&view=auto ============================================================================== --- llvm/trunk/tools/bugpoint/TestPasses.cpp (original) +++ llvm/trunk/tools/bugpoint/TestPasses.cpp (removed) @@ -1,75 +0,0 @@ -//===- TestPasses.cpp - "buggy" passes used to test bugpoint --------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains "buggy" passes that are used to test bugpoint, to check -// that it is narrowing down testcases correctly. -// -//===----------------------------------------------------------------------===// - -#include "llvm/BasicBlock.h" -#include "llvm/Constant.h" -#include "llvm/Instructions.h" -#include "llvm/Pass.h" -#include "llvm/Type.h" -#include "llvm/Support/InstVisitor.h" - -using namespace llvm; - -namespace { - /// CrashOnCalls - This pass is used to test bugpoint. It intentionally - /// crashes on any call instructions. - class CrashOnCalls : public BasicBlockPass { - public: - static char ID; // Pass ID, replacement for typeid - CrashOnCalls() : BasicBlockPass(ID) {} - private: - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); - } - - bool runOnBasicBlock(BasicBlock &BB) { - for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) - if (isa(*I)) - abort(); - - return false; - } - }; - - char CrashOnCalls::ID = 0; - RegisterPass - X("bugpoint-crashcalls", - "BugPoint Test Pass - Intentionally crash on CallInsts"); -} - -namespace { - /// DeleteCalls - This pass is used to test bugpoint. It intentionally - /// deletes some call instructions, "misoptimizing" the program. - class DeleteCalls : public BasicBlockPass { - public: - static char ID; // Pass ID, replacement for typeid - DeleteCalls() : BasicBlockPass(ID) {} - private: - bool runOnBasicBlock(BasicBlock &BB) { - for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) - if (CallInst *CI = dyn_cast(I)) { - if (!CI->use_empty()) - CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); - CI->getParent()->getInstList().erase(CI); - break; - } - return false; - } - }; - - char DeleteCalls::ID = 0; - RegisterPass - Y("bugpoint-deletecalls", - "BugPoint Test Pass - Intentionally 'misoptimize' CallInsts"); -} From rafael.espindola at gmail.com Sat Aug 7 16:53:04 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Sat, 07 Aug 2010 21:53:04 -0000 Subject: [llvm-commits] [llvm] r110521 - /llvm/trunk/tools/bugpoint-passes/Makefile Message-ID: <20100807215304.BFEE12A6C12C@llvm.org> Author: rafael Date: Sat Aug 7 16:53:04 2010 New Revision: 110521 URL: http://llvm.org/viewvc/llvm-project?rev=110521&view=rev Log: Add missing file. Added: llvm/trunk/tools/bugpoint-passes/Makefile Added: llvm/trunk/tools/bugpoint-passes/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint-passes/Makefile?rev=110521&view=auto ============================================================================== --- llvm/trunk/tools/bugpoint-passes/Makefile (added) +++ llvm/trunk/tools/bugpoint-passes/Makefile Sat Aug 7 16:53:04 2010 @@ -0,0 +1,23 @@ +##===- tools/bugpoint-passes/Makefile -- -------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LEVEL = ../.. +LIBRARYNAME = BugpointPasses +LOADABLE_MODULE = 1 +USEDLIBS = + +# If we don't need RTTI or EH, there's no reason to export anything +# from this plugin. +ifneq ($(REQUIRES_RTTI), 1) +ifneq ($(REQUIRES_EH), 1) +EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/bugpoint.exports +endif +endif + +include $(LEVEL)/Makefile.common From rafael.espindola at gmail.com Sat Aug 7 16:58:45 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Sat, 07 Aug 2010 21:58:45 -0000 Subject: [llvm-commits] [llvm] r110522 - /llvm/trunk/tools/bugpoint-passes/bugpoint.exports Message-ID: <20100807215845.138202A6C12C@llvm.org> Author: rafael Date: Sat Aug 7 16:58:44 2010 New Revision: 110522 URL: http://llvm.org/viewvc/llvm-project?rev=110522&view=rev Log: Another missing file :-( Added: llvm/trunk/tools/bugpoint-passes/bugpoint.exports Added: llvm/trunk/tools/bugpoint-passes/bugpoint.exports URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint-passes/bugpoint.exports?rev=110522&view=auto ============================================================================== (empty) From nlewycky at google.com Sat Aug 7 17:19:09 2010 From: nlewycky at google.com (Nick Lewycky) Date: Sat, 7 Aug 2010 15:19:09 -0700 Subject: [llvm-commits] PATCH: make JIT work when linked -static Message-ID: The JIT currently goes out of its way to make sure it can find symbols in the local program. While that's a polite thing to check for novice users, it blocks the ability to use the JIT with symbol searching off and adding mappings for all symbols explicitly. Is there some other reason that the JIT needs no -static? Otherwise, I'd like to apply the attached patch to remove it. Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100807/397da48e/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: jit-static.patch Type: text/x-patch Size: 855 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100807/397da48e/attachment.bin From rafael.espindola at gmail.com Sat Aug 7 18:03:21 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Sat, 07 Aug 2010 23:03:21 -0000 Subject: [llvm-commits] [llvm] r110524 - in /llvm/trunk/tools/bugpoint: BugDriver.cpp BugDriver.h OptimizerDriver.cpp bugpoint.cpp Message-ID: <20100807230321.9AE842A6C12C@llvm.org> Author: rafael Date: Sat Aug 7 18:03:21 2010 New Revision: 110524 URL: http://llvm.org/viewvc/llvm-project?rev=110524&view=rev Log: Run opt instead of bugpoint itself. Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp llvm/trunk/tools/bugpoint/BugDriver.h llvm/trunk/tools/bugpoint/OptimizerDriver.cpp llvm/trunk/tools/bugpoint/bugpoint.cpp Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.cpp?rev=110524&r1=110523&r2=110524&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/BugDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/BugDriver.cpp Sat Aug 7 18:03:21 2010 @@ -66,12 +66,12 @@ return Result; } -BugDriver::BugDriver(const char *toolname, bool as_child, bool find_bugs, +BugDriver::BugDriver(const char *toolname, bool find_bugs, unsigned timeout, unsigned memlimit, bool use_valgrind, LLVMContext& ctxt) : Context(ctxt), ToolName(toolname), ReferenceOutputFile(OutputFile), Program(0), Interpreter(0), SafeInterpreter(0), gcc(0), - run_as_child(as_child), run_find_bugs(find_bugs), Timeout(timeout), + run_find_bugs(find_bugs), Timeout(timeout), MemoryLimit(memlimit), UseValgrind(use_valgrind) {} BugDriver::~BugDriver() { @@ -119,15 +119,13 @@ Program = ParseInputFile(Filenames[0], Context); if (Program == 0) return true; - if (!run_as_child) - outs() << "Read input file : '" << Filenames[0] << "'\n"; + outs() << "Read input file : '" << Filenames[0] << "'\n"; for (unsigned i = 1, e = Filenames.size(); i != e; ++i) { std::auto_ptr M(ParseInputFile(Filenames[i], Context)); if (M.get() == 0) return true; - if (!run_as_child) - outs() << "Linking in input file: '" << Filenames[i] << "'\n"; + outs() << "Linking in input file: '" << Filenames[i] << "'\n"; std::string ErrorMessage; if (Linker::LinkModules(Program, M.get(), &ErrorMessage)) { errs() << ToolName << ": error linking in '" << Filenames[i] << "': " @@ -136,8 +134,7 @@ } } - if (!run_as_child) - outs() << "*** All input ok\n"; + outs() << "*** All input ok\n"; // All input files read successfully! return false; @@ -149,14 +146,6 @@ /// variables are set up from command line arguments. /// bool BugDriver::run(std::string &ErrMsg) { - // The first thing to do is determine if we're running as a child. If we are, - // then what to do is very narrow. This form of invocation is only called - // from the runPasses method to actually run those passes in a child process. - if (run_as_child) { - // Execute the passes - return runPassesAsChild(PassesToRun); - } - if (run_find_bugs) { // Rearrange the passes and apply them to the program. Repeat this process // until the user kills the program or we find a bug. Modified: llvm/trunk/tools/bugpoint/BugDriver.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.h?rev=110524&r1=110523&r2=110524&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/BugDriver.h (original) +++ llvm/trunk/tools/bugpoint/BugDriver.h Sat Aug 7 18:03:21 2010 @@ -51,7 +51,6 @@ AbstractInterpreter *Interpreter; // How to run the program AbstractInterpreter *SafeInterpreter; // To generate reference output, etc. GCC *gcc; - bool run_as_child; bool run_find_bugs; unsigned Timeout; unsigned MemoryLimit; @@ -62,7 +61,7 @@ friend class ReduceMisCodegenFunctions; public: - BugDriver(const char *toolname, bool as_child, bool find_bugs, + BugDriver(const char *toolname, bool find_bugs, unsigned timeout, unsigned memlimit, bool use_valgrind, LLVMContext& ctxt); ~BugDriver(); @@ -290,9 +289,6 @@ return runPasses(M, PassesToRun, Filename, DeleteOutput); } - /// runAsChild - The actual "runPasses" guts that runs in a child process. - int runPassesAsChild(const std::vector &PassesToRun); - /// initializeExecutionEnvironment - This method is used to set up the /// environment for executing LLVM programs. /// Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=110524&r1=110523&r2=110524&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Sat Aug 7 18:03:21 2010 @@ -27,6 +27,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Path.h" #include "llvm/System/Program.h" @@ -85,37 +86,6 @@ outs() << getPassesString(PassesToRun) << "\n"; } -int BugDriver::runPassesAsChild(const std::vector &Passes) { - std::string ErrInfo; - raw_fd_ostream OutFile(ChildOutput.c_str(), ErrInfo, - raw_fd_ostream::F_Binary); - if (!ErrInfo.empty()) { - errs() << "Error opening bitcode file: " << ChildOutput << "\n"; - return 1; - } - - PassManager PM; - // Make sure that the appropriate target data is always used... - PM.add(new TargetData(Program)); - - for (unsigned i = 0, e = Passes.size(); i != e; ++i) { - if (Passes[i]->getNormalCtor()) - PM.add(Passes[i]->getNormalCtor()()); - else - errs() << "Cannot create pass yet: " << Passes[i]->getPassName() << "\n"; - } - // Check that the module is well formed on completion of optimization - PM.add(createVerifierPass()); - - // Write bitcode out to disk as the last step... - PM.add(createBitcodeWriterPass(OutFile)); - - // Run all queued passes. - PM.run(*Program); - - return 0; -} - cl::opt SilencePasses("silence-passes", cl::desc("Suppress output of running passes (both stdout and stderr)")); /// runPasses - Run the specified passes on Program, outputting a bitcode file @@ -164,17 +134,25 @@ // setup the child process' arguments SmallVector Args; - sys::Path tool = sys::Program::FindProgramByName(ToolName); + std::string Opt; + llvm::StringRef TN(ToolName); + if (TN.find('/') == llvm::StringRef::npos) { + Opt = "opt"; + } else { + std::pair P = TN.rsplit('/'); + Opt = P.first.str() + "/" + "opt"; + } + + sys::Path tool = sys::Program::FindProgramByName(Opt); if (UseValgrind) { Args.push_back("valgrind"); Args.push_back("--error-exitcode=1"); Args.push_back("-q"); Args.push_back(tool.c_str()); } else - Args.push_back(ToolName); + Args.push_back(Opt.c_str()); - Args.push_back("-as-child"); - Args.push_back("-child-output"); + Args.push_back("-o"); Args.push_back(OutputFilename.c_str()); std::vector pass_args; for (unsigned i = 0, e = PluginLoader::getNumPlugins(); i != e; ++i) { @@ -192,6 +170,12 @@ Args.push_back(*ExtraArgs); Args.push_back(0); + DEBUG(errs() << "\nAbout to run:\t"; + for (unsigned i = 0, e = Args.size()-1; i != e; ++i) + errs() << " " << Args[i]; + errs() << "\n"; + ); + sys::Path prog; if (UseValgrind) prog = sys::Program::FindProgramByName("valgrind"); Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=110524&r1=110523&r2=110524&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/bugpoint.cpp (original) +++ llvm/trunk/tools/bugpoint/bugpoint.cpp Sat Aug 7 18:03:21 2010 @@ -29,13 +29,6 @@ #include "llvm/LinkAllVMCore.h" using namespace llvm; -// AsChild - Specifies that this invocation of bugpoint is being generated -// from a parent process. It is not intended to be used by users so the -// option is hidden. -static cl::opt -AsChild("as-child", cl::desc("Run bugpoint as child process"), - cl::ReallyHidden); - static cl::opt FindBugs("find-bugs", cl::desc("Run many different optimization sequences " "on program to find bugs"), cl::init(false)); @@ -124,7 +117,7 @@ MemoryLimit = 100; } - BugDriver D(argv[0], AsChild, FindBugs, TimeoutValue, MemoryLimit, + BugDriver D(argv[0], FindBugs, TimeoutValue, MemoryLimit, UseValgrind, Context); if (D.addSources(InputFilenames)) return 1; From echristo at apple.com Sat Aug 7 19:00:34 2010 From: echristo at apple.com (Eric Christopher) Date: Sun, 08 Aug 2010 00:00:34 -0000 Subject: [llvm-commits] [llvm] r110527 - /llvm/trunk/lib/Support/PrettyStackTrace.cpp Message-ID: <20100808000034.66A9B2A6C12C@llvm.org> Author: echristo Date: Sat Aug 7 19:00:34 2010 New Revision: 110527 URL: http://llvm.org/viewvc/llvm-project?rev=110527&view=rev Log: Fix a couple of warnings. Modified: llvm/trunk/lib/Support/PrettyStackTrace.cpp Modified: llvm/trunk/lib/Support/PrettyStackTrace.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/PrettyStackTrace.cpp?rev=110527&r1=110526&r2=110527&view=diff ============================================================================== --- llvm/trunk/lib/Support/PrettyStackTrace.cpp (original) +++ llvm/trunk/lib/Support/PrettyStackTrace.cpp Sat Aug 7 19:00:34 2010 @@ -72,7 +72,7 @@ /// CrashHandler - This callback is run if a fatal signal is delivered to the /// process, it prints the pretty stack trace. -static void CrashHandler(void *Cookie) { +static void CrashHandler(void *) { #ifndef __APPLE__ // On non-apple systems, just emit the crash stack trace to stderr. PrintCurStackTrace(errs()); @@ -89,7 +89,8 @@ #ifndef HAVE_CRASHREPORTERCLIENT_H __crashreporter_info__ = strdup(std::string(TmpStr.str()).c_str()); #else - CRSetCrashLogMessage(std::string(TmpStr.str()).c_str()); + // Cast to void to avoid warning. + (void)CRSetCrashLogMessage(std::string(TmpStr.str()).c_str()); #endif errs() << TmpStr.str(); } From jyasskin at gmail.com Sat Aug 7 19:48:43 2010 From: jyasskin at gmail.com (Jeffrey Yasskin) Date: Sat, 7 Aug 2010 17:48:43 -0700 Subject: [llvm-commits] [llvm] r110520 - in /llvm/trunk: test/BugPoint/crash-narrowfunctiontest.ll test/BugPoint/remove_arguments_test.ll tools/Makefile tools/bugpoint-passes/ tools/bugpoint-passes/TestPasses.cpp tools/bugpoint/TestPasses.cpp In-Reply-To: <20100807214809.6CD772A6C12C@llvm.org> References: <20100807214809.6CD772A6C12C@llvm.org> Message-ID: OSX uses .dylib, not .so, for shared libraries. Could you make the extension conditional on the platform? On Sat, Aug 7, 2010 at 2:48 PM, Rafael Espindola wrote: > Author: rafael > Date: Sat Aug ?7 16:48:09 2010 > New Revision: 110520 > > URL: http://llvm.org/viewvc/llvm-project?rev=110520&view=rev > Log: > Move the bugpoint test passes to a plugin in preparation for having bugpoint > use opt. > > Added: > ? ?llvm/trunk/tools/bugpoint-passes/ > ? ?llvm/trunk/tools/bugpoint-passes/TestPasses.cpp > ? ? ?- copied, changed from r110518, llvm/trunk/tools/bugpoint/TestPasses.cpp > Removed: > ? ?llvm/trunk/tools/bugpoint/TestPasses.cpp > Modified: > ? ?llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll > ? ?llvm/trunk/test/BugPoint/remove_arguments_test.ll > ? ?llvm/trunk/tools/Makefile > > Modified: llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll?rev=110520&r1=110519&r2=110520&view=diff > ============================================================================== > --- llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll (original) > +++ llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll Sat Aug ?7 16:48:09 2010 > @@ -1,6 +1,7 @@ > ?; Test that bugpoint can narrow down the testcase to the important function > +; FIXME: This likely fails on windows > ?; > -; RUN: bugpoint %s -output-prefix %t -bugpoint-crashcalls -silence-passes > /dev/null > +; RUN: bugpoint -load %llvmlibsdir/BugpointPasses.so %s -output-prefix %t -bugpoint-crashcalls -silence-passes > /dev/null > > ?define i32 @foo() { ret i32 1 } > > > Modified: llvm/trunk/test/BugPoint/remove_arguments_test.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/BugPoint/remove_arguments_test.ll?rev=110520&r1=110519&r2=110520&view=diff > ============================================================================== > --- llvm/trunk/test/BugPoint/remove_arguments_test.ll (original) > +++ llvm/trunk/test/BugPoint/remove_arguments_test.ll Sat Aug ?7 16:48:09 2010 > @@ -1,4 +1,5 @@ > -; RUN: bugpoint %s -output-prefix %t -bugpoint-crashcalls -silence-passes > +; FIXME: This likely fails on windows > +; RUN: bugpoint -load %llvmlibsdir/BugpointPasses.so %s -output-prefix %t -bugpoint-crashcalls -silence-passes > ?; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s > > ?; Test to make sure that arguments are removed from the function if they are > > Modified: llvm/trunk/tools/Makefile > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/Makefile?rev=110520&r1=110519&r2=110520&view=diff > ============================================================================== > --- llvm/trunk/tools/Makefile (original) > +++ llvm/trunk/tools/Makefile Sat Aug ?7 16:48:09 2010 > @@ -20,7 +20,7 @@ > ? ? ? ? ? ? ? ? ?llc llvm-ranlib llvm-ar llvm-nm \ > ? ? ? ? ? ? ? ? ?llvm-ld llvm-prof llvm-link \ > ? ? ? ? ? ? ? ? ?lli llvm-extract llvm-mc \ > - ? ? ? ? ? ? ? ? bugpoint llvm-bcanalyzer llvm-stub \ > + ? ? ? ? ? ? ? ? bugpoint bugpoint-passes llvm-bcanalyzer llvm-stub \ > ? ? ? ? ? ? ? ? ?llvmc > > ?# Let users override the set of tools to build from the command line. > > Copied: llvm/trunk/tools/bugpoint-passes/TestPasses.cpp (from r110518, llvm/trunk/tools/bugpoint/TestPasses.cpp) > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint-passes/TestPasses.cpp?p2=llvm/trunk/tools/bugpoint-passes/TestPasses.cpp&p1=llvm/trunk/tools/bugpoint/TestPasses.cpp&r1=110518&r2=110520&rev=110520&view=diff > ============================================================================== > ? ?(empty) > > Removed: llvm/trunk/tools/bugpoint/TestPasses.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/TestPasses.cpp?rev=110519&view=auto > ============================================================================== > --- llvm/trunk/tools/bugpoint/TestPasses.cpp (original) > +++ llvm/trunk/tools/bugpoint/TestPasses.cpp (removed) > @@ -1,75 +0,0 @@ > -//===- TestPasses.cpp - "buggy" passes used to test bugpoint --------------===// > -// > -// ? ? ? ? ? ? ? ? ? ? The LLVM Compiler Infrastructure > -// > -// This file is distributed under the University of Illinois Open Source > -// License. See LICENSE.TXT for details. > -// > -//===----------------------------------------------------------------------===// > -// > -// This file contains "buggy" passes that are used to test bugpoint, to check > -// that it is narrowing down testcases correctly. > -// > -//===----------------------------------------------------------------------===// > - > -#include "llvm/BasicBlock.h" > -#include "llvm/Constant.h" > -#include "llvm/Instructions.h" > -#include "llvm/Pass.h" > -#include "llvm/Type.h" > -#include "llvm/Support/InstVisitor.h" > - > -using namespace llvm; > - > -namespace { > - ?/// CrashOnCalls - This pass is used to test bugpoint. ?It intentionally > - ?/// crashes on any call instructions. > - ?class CrashOnCalls : public BasicBlockPass { > - ?public: > - ? ?static char ID; // Pass ID, replacement for typeid > - ? ?CrashOnCalls() : BasicBlockPass(ID) {} > - ?private: > - ? ?virtual void getAnalysisUsage(AnalysisUsage &AU) const { > - ? ? ?AU.setPreservesAll(); > - ? ?} > - > - ? ?bool runOnBasicBlock(BasicBlock &BB) { > - ? ? ?for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) > - ? ? ? ?if (isa(*I)) > - ? ? ? ? ?abort(); > - > - ? ? ?return false; > - ? ?} > - ?}; > - > - ?char CrashOnCalls::ID = 0; > - ?RegisterPass > - ?X("bugpoint-crashcalls", > - ? ?"BugPoint Test Pass - Intentionally crash on CallInsts"); > -} > - > -namespace { > - ?/// DeleteCalls - This pass is used to test bugpoint. ?It intentionally > - ?/// deletes some call instructions, "misoptimizing" the program. > - ?class DeleteCalls : public BasicBlockPass { > - ?public: > - ? ?static char ID; // Pass ID, replacement for typeid > - ? ?DeleteCalls() : BasicBlockPass(ID) {} > - ?private: > - ? ?bool runOnBasicBlock(BasicBlock &BB) { > - ? ? ?for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) > - ? ? ? ?if (CallInst *CI = dyn_cast(I)) { > - ? ? ? ? ?if (!CI->use_empty()) > - ? ? ? ? ? ?CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); > - ? ? ? ? ?CI->getParent()->getInstList().erase(CI); > - ? ? ? ? ?break; > - ? ? ? ?} > - ? ? ?return false; > - ? ?} > - ?}; > - > - ?char DeleteCalls::ID = 0; > - ?RegisterPass > - ?Y("bugpoint-deletecalls", > - ? ?"BugPoint Test Pass - Intentionally 'misoptimize' CallInsts"); > -} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From rafael.espindola at gmail.com Sat Aug 7 19:50:57 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Sun, 08 Aug 2010 00:50:57 -0000 Subject: [llvm-commits] [llvm] r110528 - in /llvm/trunk/tools: CMakeLists.txt bugpoint-passes/CMakeLists.txt bugpoint/CMakeLists.txt Message-ID: <20100808005057.508EB2A6C12C@llvm.org> Author: rafael Date: Sat Aug 7 19:50:57 2010 New Revision: 110528 URL: http://llvm.org/viewvc/llvm-project?rev=110528&view=rev Log: Try to fix cmake build. Added: llvm/trunk/tools/bugpoint-passes/CMakeLists.txt Modified: llvm/trunk/tools/CMakeLists.txt llvm/trunk/tools/bugpoint/CMakeLists.txt Modified: llvm/trunk/tools/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/CMakeLists.txt?rev=110528&r1=110527&r2=110528&view=diff ============================================================================== --- llvm/trunk/tools/CMakeLists.txt (original) +++ llvm/trunk/tools/CMakeLists.txt Sat Aug 7 19:50:57 2010 @@ -29,6 +29,7 @@ add_subdirectory(llvm-extract) add_subdirectory(bugpoint) +add_subdirectory(bugpoint-passes) add_subdirectory(llvm-bcanalyzer) add_subdirectory(llvm-stub) add_subdirectory(edis) Added: llvm/trunk/tools/bugpoint-passes/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint-passes/CMakeLists.txt?rev=110528&view=auto ============================================================================== --- llvm/trunk/tools/bugpoint-passes/CMakeLists.txt (added) +++ llvm/trunk/tools/bugpoint-passes/CMakeLists.txt Sat Aug 7 19:50:57 2010 @@ -0,0 +1,3 @@ +add_llvm_loadable_module( BugpointPasses + TestPasses.cpp + ) Modified: llvm/trunk/tools/bugpoint/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CMakeLists.txt?rev=110528&r1=110527&r2=110528&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/CMakeLists.txt (original) +++ llvm/trunk/tools/bugpoint/CMakeLists.txt Sat Aug 7 19:50:57 2010 @@ -9,7 +9,6 @@ FindBugs.cpp Miscompilation.cpp OptimizerDriver.cpp - TestPasses.cpp ToolRunner.cpp bugpoint.cpp ) From rafael.espindola at gmail.com Sat Aug 7 19:55:59 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Sun, 08 Aug 2010 00:55:59 -0000 Subject: [llvm-commits] [llvm] r110529 - in /llvm/trunk/test/BugPoint: crash-narrowfunctiontest.ll remove_arguments_test.ll Message-ID: <20100808005559.66A592A6C12C@llvm.org> Author: rafael Date: Sat Aug 7 19:55:59 2010 New Revision: 110529 URL: http://llvm.org/viewvc/llvm-project?rev=110529&view=rev Log: Use %shlibext instead of .so Modified: llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll llvm/trunk/test/BugPoint/remove_arguments_test.ll Modified: llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll?rev=110529&r1=110528&r2=110529&view=diff ============================================================================== --- llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll (original) +++ llvm/trunk/test/BugPoint/crash-narrowfunctiontest.ll Sat Aug 7 19:55:59 2010 @@ -1,7 +1,7 @@ ; Test that bugpoint can narrow down the testcase to the important function ; FIXME: This likely fails on windows ; -; RUN: bugpoint -load %llvmlibsdir/BugpointPasses.so %s -output-prefix %t -bugpoint-crashcalls -silence-passes > /dev/null +; RUN: bugpoint -load %llvmlibsdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -silence-passes > /dev/null define i32 @foo() { ret i32 1 } Modified: llvm/trunk/test/BugPoint/remove_arguments_test.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/BugPoint/remove_arguments_test.ll?rev=110529&r1=110528&r2=110529&view=diff ============================================================================== --- llvm/trunk/test/BugPoint/remove_arguments_test.ll (original) +++ llvm/trunk/test/BugPoint/remove_arguments_test.ll Sat Aug 7 19:55:59 2010 @@ -1,5 +1,5 @@ ; FIXME: This likely fails on windows -; RUN: bugpoint -load %llvmlibsdir/BugpointPasses.so %s -output-prefix %t -bugpoint-crashcalls -silence-passes +; RUN: bugpoint -load %llvmlibsdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -silence-passes ; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s ; Test to make sure that arguments are removed from the function if they are From isanbard at gmail.com Sat Aug 7 20:49:35 2010 From: isanbard at gmail.com (Bill Wendling) Date: Sun, 08 Aug 2010 01:49:35 -0000 Subject: [llvm-commits] [llvm] r110531 - in /llvm/trunk: include/llvm/Target/Target.td include/llvm/Target/TargetInstrDesc.h utils/TableGen/CodeGenInstruction.cpp utils/TableGen/CodeGenInstruction.h utils/TableGen/InstrInfoEmitter.cpp Message-ID: <20100808014935.443BC2A6C12C@llvm.org> Author: void Date: Sat Aug 7 20:49:35 2010 New Revision: 110531 URL: http://llvm.org/viewvc/llvm-project?rev=110531&view=rev Log: Add back in r109901, which adds a Compare flag to the target instructions. It's useful after all. Modified: llvm/trunk/include/llvm/Target/Target.td llvm/trunk/include/llvm/Target/TargetInstrDesc.h llvm/trunk/utils/TableGen/CodeGenInstruction.cpp llvm/trunk/utils/TableGen/CodeGenInstruction.h llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Modified: llvm/trunk/include/llvm/Target/Target.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/Target.td?rev=110531&r1=110530&r2=110531&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/Target.td (original) +++ llvm/trunk/include/llvm/Target/Target.td Sat Aug 7 20:49:35 2010 @@ -198,6 +198,7 @@ bit isReturn = 0; // Is this instruction a return instruction? bit isBranch = 0; // Is this instruction a branch instruction? bit isIndirectBranch = 0; // Is this instruction an indirect branch? + bit isCompare = 0; // Is this instruction a comparison instruction? bit isBarrier = 0; // Can control flow fall through this instruction? bit isCall = 0; // Is this instruction a call instruction? bit canFoldAsLoad = 0; // Can this be folded as a simple memory operand? Modified: llvm/trunk/include/llvm/Target/TargetInstrDesc.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrDesc.h?rev=110531&r1=110530&r2=110531&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrDesc.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrDesc.h Sat Aug 7 20:49:35 2010 @@ -105,6 +105,7 @@ IndirectBranch, Predicable, NotDuplicable, + Compare, DelaySlot, FoldableAsLoad, MayLoad, @@ -315,7 +316,7 @@ bool isIndirectBranch() const { return Flags & (1 << TID::IndirectBranch); } - + /// isConditionalBranch - Return true if this is a branch which may fall /// through to the next instruction or may transfer control flow to some other /// block. The TargetInstrInfo::AnalyzeBranch method can be used to get more @@ -340,6 +341,11 @@ return Flags & (1 << TID::Predicable); } + /// isCompare - Return true if this instruction is a comparison. + bool isCompare() const { + return Flags & (1 << TID::Compare); + } + /// isNotDuplicable - Return true if this instruction cannot be safely /// duplicated. For example, if the instruction has a unique labels attached /// to it, duplicating it would cause multiple definition errors. Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.cpp?rev=110531&r1=110530&r2=110531&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenInstruction.cpp (original) +++ llvm/trunk/utils/TableGen/CodeGenInstruction.cpp Sat Aug 7 20:49:35 2010 @@ -102,6 +102,7 @@ isReturn = R->getValueAsBit("isReturn"); isBranch = R->getValueAsBit("isBranch"); isIndirectBranch = R->getValueAsBit("isIndirectBranch"); + isCompare = R->getValueAsBit("isCompare"); isBarrier = R->getValueAsBit("isBarrier"); isCall = R->getValueAsBit("isCall"); canFoldAsLoad = R->getValueAsBit("canFoldAsLoad"); Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.h?rev=110531&r1=110530&r2=110531&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenInstruction.h (original) +++ llvm/trunk/utils/TableGen/CodeGenInstruction.h Sat Aug 7 20:49:35 2010 @@ -123,6 +123,7 @@ bool isReturn; bool isBranch; bool isIndirectBranch; + bool isCompare; bool isBarrier; bool isCall; bool canFoldAsLoad; Modified: llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp?rev=110531&r1=110530&r2=110531&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/InstrInfoEmitter.cpp Sat Aug 7 20:49:35 2010 @@ -270,6 +270,7 @@ if (Inst.isReturn) OS << "|(1< Author: echristo Date: Sat Aug 7 21:44:17 2010 New Revision: 110532 URL: http://llvm.org/viewvc/llvm-project?rev=110532&view=rev Log: Fix PR7809 by creating a header for just llvm variables that can be included in exported interfaces. Update a couple of exported interfaces. Added: llvm/trunk/include/llvm/Config/llvm-config.h.in Modified: llvm/trunk/autoconf/configure.ac llvm/trunk/include/llvm-c/Target.h llvm/trunk/include/llvm/Target/TargetSelect.h Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=110532&r1=110531&r2=110532&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Sat Aug 7 21:44:17 2010 @@ -1580,7 +1580,7 @@ dnl you MUST also update Makefile.rules so that the variable FilesToConfig dnl contains the same list of files as AC_CONFIG_HEADERS below. This ensures the dnl files can be updated automatically when their *.in sources change. -AC_CONFIG_HEADERS([include/llvm/Config/config.h]) +AC_CONFIG_HEADERS([include/llvm/Config/config.h include/llvm/Config/llvm-config.h]) AC_CONFIG_FILES([include/llvm/Config/Targets.def]) AC_CONFIG_FILES([include/llvm/Config/AsmPrinters.def]) AC_CONFIG_FILES([include/llvm/Config/AsmParsers.def]) Modified: llvm/trunk/include/llvm-c/Target.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Target.h?rev=110532&r1=110531&r2=110532&view=diff ============================================================================== --- llvm/trunk/include/llvm-c/Target.h (original) +++ llvm/trunk/include/llvm-c/Target.h Sat Aug 7 21:44:17 2010 @@ -1,26 +1,26 @@ -/*===-- llvm-c/Target.h - Target Lib C Iface --------------------*- C++ -*-===*\ -|* *| -|* The LLVM Compiler Infrastructure *| -|* *| -|* This file is distributed under the University of Illinois Open Source *| -|* License. See LICENSE.TXT for details. *| -|* *| -|*===----------------------------------------------------------------------===*| -|* *| -|* This header declares the C interface to libLLVMTarget.a, which *| -|* implements target information. *| -|* *| -|* Many exotic languages can interoperate with C code but have a harder time *| -|* with C++ due to name mangling. So in addition to C, this interface enables *| -|* tools written in such languages. *| -|* *| -\*===----------------------------------------------------------------------===*/ +/*===-- llvm-c/Target.h - Target Lib C Iface --------------------*- C++ -*-===*/ +/* */ +/* The LLVM Compiler Infrastructure */ +/* */ +/* This file is distributed under the University of Illinois Open Source */ +/* License. See LICENSE.TXT for details. */ +/* */ +/*===----------------------------------------------------------------------===*/ +/* */ +/* This header declares the C interface to libLLVMTarget.a, which */ +/* implements target information. */ +/* */ +/* Many exotic languages can interoperate with C code but have a harder time */ +/* with C++ due to name mangling. So in addition to C, this interface enables */ +/* tools written in such languages. */ +/* */ +/*===----------------------------------------------------------------------===*/ #ifndef LLVM_C_TARGET_H #define LLVM_C_TARGET_H #include "llvm-c/Core.h" -#include "llvm/Config/config.h" +#include "llvm/Config/llvm-config.h" #ifdef __cplusplus extern "C" { Added: llvm/trunk/include/llvm/Config/llvm-config.h.in URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/llvm-config.h.in?rev=110532&view=auto ============================================================================== --- llvm/trunk/include/llvm/Config/llvm-config.h.in (added) +++ llvm/trunk/include/llvm/Config/llvm-config.h.in Sat Aug 7 21:44:17 2010 @@ -0,0 +1,84 @@ +/*===-- llvm/config/llvm-config.h - llvm configure variable -------*- C -*-===*/ +/* */ +/* The LLVM Compiler Infrastructure */ +/* */ +/* This file is distributed under the University of Illinois Open Source */ +/* License. See LICENSE.TXT for details. */ +/* */ +/*===----------------------------------------------------------------------===*/ + +/* This file enumerates all of the llvm variables from configure so that + they can be in exported headers and won't override package specific + directives. This is a C file so we can include it in the llvm-c headers. */ + +/* Installation directory for binary executables */ +#undef LLVM_BINDIR + +/* Time at which LLVM was configured */ +#undef LLVM_CONFIGTIME + +/* Installation directory for data files */ +#undef LLVM_DATADIR + +/* Installation directory for documentation */ +#undef LLVM_DOCSDIR + +/* Installation directory for config files */ +#undef LLVM_ETCDIR + +/* Host triple we were built on */ +#undef LLVM_HOSTTRIPLE + +/* Installation directory for include files */ +#undef LLVM_INCLUDEDIR + +/* Installation directory for .info files */ +#undef LLVM_INFODIR + +/* Installation directory for libraries */ +#undef LLVM_LIBDIR + +/* Installation directory for man pages */ +#undef LLVM_MANDIR + +/* Build multithreading support into LLVM */ +#undef LLVM_MULTITHREADED + +/* LLVM architecture name for the native architecture, if available */ +#undef LLVM_NATIVE_ARCH + +/* Short LLVM architecture name for the native architecture, if available */ +#undef LLVM_NATIVE_ARCHNAME + +/* Define if this is Unixish platform */ +#undef LLVM_ON_UNIX + +/* Define if this is Win32ish platform */ +#undef LLVM_ON_WIN32 + +/* Define to path to circo program if found or 'echo circo' otherwise */ +#undef LLVM_PATH_CIRCO + +/* Define to path to dot program if found or 'echo dot' otherwise */ +#undef LLVM_PATH_DOT + +/* Define to path to dotty program if found or 'echo dotty' otherwise */ +#undef LLVM_PATH_DOTTY + +/* Define to path to fdp program if found or 'echo fdp' otherwise */ +#undef LLVM_PATH_FDP + +/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */ +#undef LLVM_PATH_GRAPHVIZ + +/* Define to path to gv program if found or 'echo gv' otherwise */ +#undef LLVM_PATH_GV + +/* Define to path to neato program if found or 'echo neato' otherwise */ +#undef LLVM_PATH_NEATO + +/* Define to path to twopi program if found or 'echo twopi' otherwise */ +#undef LLVM_PATH_TWOPI + +/* Installation prefix directory */ +#undef LLVM_PREFIX Modified: llvm/trunk/include/llvm/Target/TargetSelect.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetSelect.h?rev=110532&r1=110531&r2=110532&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetSelect.h (original) +++ llvm/trunk/include/llvm/Target/TargetSelect.h Sat Aug 7 21:44:17 2010 @@ -16,7 +16,7 @@ #ifndef LLVM_TARGET_TARGETSELECT_H #define LLVM_TARGET_TARGETSELECT_H -#include "llvm/Config/config.h" +#include "llvm/Config/llvm-config.h" extern "C" { // Declare all of the target-initialization functions that are available. From echristo at apple.com Sat Aug 7 21:44:25 2010 From: echristo at apple.com (Eric Christopher) Date: Sun, 08 Aug 2010 02:44:25 -0000 Subject: [llvm-commits] [llvm] r110533 - /llvm/trunk/configure Message-ID: <20100808024425.E80A92A6C12C@llvm.org> Author: echristo Date: Sat Aug 7 21:44:25 2010 New Revision: 110533 URL: http://llvm.org/viewvc/llvm-project?rev=110533&view=rev Log: Regenerate. Modified: llvm/trunk/configure Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=110533&r1=110532&r2=110533&view=diff ============================================================================== --- llvm/trunk/configure (original) +++ llvm/trunk/configure Sat Aug 7 21:44:25 2010 @@ -20825,7 +20825,7 @@ -ac_config_headers="$ac_config_headers include/llvm/Config/config.h" +ac_config_headers="$ac_config_headers include/llvm/Config/config.h include/llvm/Config/llvm-config.h" ac_config_files="$ac_config_files include/llvm/Config/Targets.def" @@ -21456,6 +21456,7 @@ do case $ac_config_target in "include/llvm/Config/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/Config/config.h" ;; + "include/llvm/Config/llvm-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/Config/llvm-config.h" ;; "include/llvm/Config/Targets.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/Targets.def" ;; "include/llvm/Config/AsmPrinters.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/AsmPrinters.def" ;; "include/llvm/Config/AsmParsers.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/AsmParsers.def" ;; From rafael.espindola at gmail.com Sat Aug 7 22:55:08 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Sun, 08 Aug 2010 03:55:08 -0000 Subject: [llvm-commits] [llvm] r110534 - in /llvm/trunk/tools/bugpoint: BugDriver.cpp BugDriver.h CrashDebugger.cpp ExtractFunction.cpp FindBugs.cpp Miscompilation.cpp OptimizerDriver.cpp bugpoint.cpp Message-ID: <20100808035508.A25172A6C12C@llvm.org> Author: rafael Date: Sat Aug 7 22:55:08 2010 New Revision: 110534 URL: http://llvm.org/viewvc/llvm-project?rev=110534&view=rev Log: Most of bugpoint now only needs to know the pass names. Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp llvm/trunk/tools/bugpoint/BugDriver.h llvm/trunk/tools/bugpoint/CrashDebugger.cpp llvm/trunk/tools/bugpoint/ExtractFunction.cpp llvm/trunk/tools/bugpoint/FindBugs.cpp llvm/trunk/tools/bugpoint/Miscompilation.cpp llvm/trunk/tools/bugpoint/OptimizerDriver.cpp llvm/trunk/tools/bugpoint/bugpoint.cpp Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.cpp?rev=110534&r1=110533&r2=110534&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/BugDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/BugDriver.cpp Sat Aug 7 22:55:08 2010 @@ -56,12 +56,12 @@ /// getPassesString - Turn a list of passes into a string which indicates the /// command line options that must be passed to add the passes. /// -std::string llvm::getPassesString(const std::vector &Passes) { +std::string llvm::getPassesString(const std::vector &Passes) { std::string Result; for (unsigned i = 0, e = Passes.size(); i != e; ++i) { if (i) Result += " "; Result += "-"; - Result += Passes[i]->getPassArgument(); + Result += Passes[i]; } return Result; } Modified: llvm/trunk/tools/bugpoint/BugDriver.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.h?rev=110534&r1=110533&r2=110534&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/BugDriver.h (original) +++ llvm/trunk/tools/bugpoint/BugDriver.h Sat Aug 7 22:55:08 2010 @@ -47,7 +47,7 @@ const char *ToolName; // argv[0] of bugpoint std::string ReferenceOutputFile; // Name of `good' output file Module *Program; // The raw program, linked together - std::vector PassesToRun; + std::vector PassesToRun; AbstractInterpreter *Interpreter; // How to run the program AbstractInterpreter *SafeInterpreter; // To generate reference output, etc. GCC *gcc; @@ -74,12 +74,11 @@ // command line arguments into instance variables of BugDriver. // bool addSources(const std::vector &FileNames); - template - void addPasses(It I, It E) { PassesToRun.insert(PassesToRun.end(), I, E); } - void setPassesToRun(const std::vector &PTR) { + void addPass(std::string p) { PassesToRun.push_back(p); } + void setPassesToRun(const std::vector &PTR) { PassesToRun = PTR; } - const std::vector &getPassesToRun() const { + const std::vector &getPassesToRun() const { return PassesToRun; } @@ -243,7 +242,7 @@ /// failure. If AutoDebugCrashes is set to true, then bugpoint will /// automatically attempt to track down a crashing pass if one exists, and /// this method will never return null. - Module *runPassesOn(Module *M, const std::vector &Passes, + Module *runPassesOn(Module *M, const std::vector &Passes, bool AutoDebugCrashes = false, unsigned NumExtraArgs = 0, const char * const *ExtraArgs = NULL); @@ -257,7 +256,7 @@ /// to pass to the child bugpoint instance. /// bool runPasses(Module *Program, - const std::vector &PassesToRun, + const std::vector &PassesToRun, std::string &OutputFilename, bool DeleteOutput = false, bool Quiet = false, unsigned NumExtraArgs = 0, const char * const *ExtraArgs = NULL) const; @@ -269,7 +268,7 @@ /// If the passes did not compile correctly, output the command required to /// recreate the failure. This returns true if a compiler error is found. /// - bool runManyPasses(const std::vector &AllPasses, + bool runManyPasses(const std::vector &AllPasses, std::string &ErrMsg); /// writeProgramToFile - This writes the current "Program" to the named @@ -283,7 +282,7 @@ /// input (true = crashed). /// bool runPasses(Module *M, - const std::vector &PassesToRun, + const std::vector &PassesToRun, bool DeleteOutput = true) const { std::string Filename; return runPasses(M, PassesToRun, Filename, DeleteOutput); @@ -305,7 +304,7 @@ /// getPassesString - Turn a list of passes into a string which indicates the /// command line options that must be passed to add the passes. /// -std::string getPassesString(const std::vector &Passes); +std::string getPassesString(const std::vector &Passes); /// PrintFunctionList - prints out list of problematic functions /// Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CrashDebugger.cpp?rev=110534&r1=110533&r2=110534&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original) +++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Sat Aug 7 22:55:08 2010 @@ -43,7 +43,7 @@ } namespace llvm { - class ReducePassList : public ListReducer { + class ReducePassList : public ListReducer { BugDriver &BD; public: ReducePassList(BugDriver &bd) : BD(bd) {} @@ -52,15 +52,15 @@ // running the "Kept" passes fail when run on the output of the "removed" // passes. If we return true, we update the current module of bugpoint. // - virtual TestResult doTest(std::vector &Removed, - std::vector &Kept, + virtual TestResult doTest(std::vector &Removed, + std::vector &Kept, std::string &Error); }; } ReducePassList::TestResult -ReducePassList::doTest(std::vector &Prefix, - std::vector &Suffix, +ReducePassList::doTest(std::vector &Prefix, + std::vector &Suffix, std::string &Error) { sys::Path PrefixOutput; Module *OrigProgram = 0; Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=110534&r1=110533&r2=110534&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original) +++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Sat Aug 7 22:55:08 2010 @@ -99,13 +99,6 @@ return Result; } -static const PassInfo *getPI(Pass *P) { - const void *ID = P->getPassID(); - const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID); - delete P; - return PI; -} - /// performFinalCleanups - This method clones the current Program and performs /// a series of cleanups intended to get rid of extra cruft on the module /// before handing it to the user. @@ -115,15 +108,15 @@ for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) I->setLinkage(GlobalValue::ExternalLinkage); - std::vector CleanupPasses; - CleanupPasses.push_back(getPI(createGlobalDCEPass())); + std::vector CleanupPasses; + CleanupPasses.push_back("globaldce"); if (MayModifySemantics) - CleanupPasses.push_back(getPI(createDeadArgHackingPass())); + CleanupPasses.push_back("deadarghaX0r"); else - CleanupPasses.push_back(getPI(createDeadArgEliminationPass())); + CleanupPasses.push_back("deadargelim"); - CleanupPasses.push_back(getPI(createDeadTypeEliminationPass())); + CleanupPasses.push_back("deadtypeelim"); Module *New = runPassesOn(M, CleanupPasses); if (New == 0) { @@ -139,8 +132,8 @@ /// function. This returns null if there are no extractable loops in the /// program or if the loop extractor crashes. Module *BugDriver::ExtractLoop(Module *M) { - std::vector LoopExtractPasses; - LoopExtractPasses.push_back(getPI(createSingleLoopExtractorPass())); + std::vector LoopExtractPasses; + LoopExtractPasses.push_back("loop-extract-single"); Module *NewM = runPassesOn(M, LoopExtractPasses); if (NewM == 0) { @@ -354,8 +347,8 @@ std::string uniqueFN = "--extract-blocks-file=" + uniqueFilename.str(); const char *ExtraArg = uniqueFN.c_str(); - std::vector PI; - PI.push_back(getPI(createBlockExtractorPass())); + std::vector PI; + PI.push_back("extract-blocks"); Module *Ret = runPassesOn(M, PI, false, 1, &ExtraArg); uniqueFilename.eraseFromDisk(); // Free disk space Modified: llvm/trunk/tools/bugpoint/FindBugs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/FindBugs.cpp?rev=110534&r1=110533&r2=110534&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/FindBugs.cpp (original) +++ llvm/trunk/tools/bugpoint/FindBugs.cpp Sat Aug 7 22:55:08 2010 @@ -29,7 +29,7 @@ /// If the passes did not compile correctly, output the command required to /// recreate the failure. This returns true if a compiler error is found. /// -bool BugDriver::runManyPasses(const std::vector &AllPasses, +bool BugDriver::runManyPasses(const std::vector &AllPasses, std::string &ErrMsg) { setPassesToRun(AllPasses); outs() << "Starting bug finding procedure...\n\n"; @@ -58,7 +58,7 @@ // outs() << "Running selected passes on program to test for crash: "; for(int i = 0, e = PassesToRun.size(); i != e; i++) { - outs() << "-" << PassesToRun[i]->getPassArgument() << " "; + outs() << "-" << PassesToRun[i] << " "; } std::string Filename; Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=110534&r1=110533&r2=110534&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original) +++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Sat Aug 7 22:55:08 2010 @@ -43,13 +43,13 @@ cl::desc("Don't extract blocks when searching for miscompilations"), cl::init(false)); - class ReduceMiscompilingPasses : public ListReducer { + class ReduceMiscompilingPasses : public ListReducer { BugDriver &BD; public: ReduceMiscompilingPasses(BugDriver &bd) : BD(bd) {} - virtual TestResult doTest(std::vector &Prefix, - std::vector &Suffix, + virtual TestResult doTest(std::vector &Prefix, + std::vector &Suffix, std::string &Error); }; } @@ -58,8 +58,8 @@ /// group, see if they still break the program. /// ReduceMiscompilingPasses::TestResult -ReduceMiscompilingPasses::doTest(std::vector &Prefix, - std::vector &Suffix, +ReduceMiscompilingPasses::doTest(std::vector &Prefix, + std::vector &Suffix, std::string &Error) { // First, run the program with just the Suffix passes. If it is still broken // with JUST the kept passes, discard the prefix passes. Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=110534&r1=110533&r2=110534&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original) +++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Sat Aug 7 22:55:08 2010 @@ -97,7 +97,7 @@ /// or failed. /// bool BugDriver::runPasses(Module *Program, - const std::vector &Passes, + const std::vector &Passes, std::string &OutputFilename, bool DeleteOutput, bool Quiet, unsigned NumExtraArgs, const char * const *ExtraArgs) const { @@ -159,9 +159,9 @@ pass_args.push_back( std::string("-load")); pass_args.push_back( PluginLoader::getPlugin(i)); } - for (std::vector::const_iterator I = Passes.begin(), + for (std::vector::const_iterator I = Passes.begin(), E = Passes.end(); I != E; ++I ) - pass_args.push_back( std::string("-") + (*I)->getPassArgument() ); + pass_args.push_back( std::string("-") + (*I) ); for (std::vector::const_iterator I = pass_args.begin(), E = pass_args.end(); I != E; ++I ) Args.push_back(I->c_str()); @@ -222,7 +222,7 @@ /// module, returning the transformed module on success, or a null pointer on /// failure. Module *BugDriver::runPassesOn(Module *M, - const std::vector &Passes, + const std::vector &Passes, bool AutoDebugCrashes, unsigned