[llvm-commits] CVS: llvm/test/Regression/Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll.bc
Changes in directory llvm/test/Regression/Transforms/LoopSimplify: 2006-08-11-LoopSimplifyLongTime.ll.bc updated: 1.4 -> 1.5 --- Log message: Regenerate for new bytecode file format. --- Diffs of the changes: (+0 -0) 2006-08-11-LoopSimplifyLongTime.ll.bc |0 1 files changed Index: llvm/test/Regression/Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll.bc ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] Bytecode Change
All, I just committed a change to the bytecode format that eliminates the type symbol table header from functions. You'll need to rebuild your llvm-gcc to get nightly testers working again. Reid. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp
Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.302 -> 1.303 --- Log message: For PR411: http://llvm.org/PR411 : Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. --- Diffs of the changes: (+12 -11) Writer.cpp | 23 --- 1 files changed, 12 insertions(+), 11 deletions(-) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.302 llvm/lib/Target/CBackend/Writer.cpp:1.303 --- llvm/lib/Target/CBackend/Writer.cpp:1.302 Sat Dec 30 23:55:36 2006 +++ llvm/lib/Target/CBackend/Writer.cpp Sat Jan 6 01:24:43 2007 @@ -21,6 +21,7 @@ #include "llvm/Pass.h" #include "llvm/PassManager.h" #include "llvm/SymbolTable.h" +#include "llvm/TypeSymbolTable.h" #include "llvm/Intrinsics.h" #include "llvm/IntrinsicInst.h" #include "llvm/InlineAsm.h" @@ -136,7 +137,7 @@ void lowerIntrinsics(Function &F); void printModule(Module *M); -void printModuleTypes(const SymbolTable &ST); +void printModuleTypes(const TypeSymbolTable &ST); void printContainedStructs(const Type *Ty, std::set &); void printFloatingPointConstants(Function &F); void printFunctionSignature(const Function *F, bool Prototype); @@ -263,15 +264,15 @@ // Loop over the module symbol table, removing types from UT that are // already named, and removing names for types that are not used. // - SymbolTable &MST = M.getSymbolTable(); - for (SymbolTable::type_iterator TI = MST.type_begin(), TE = MST.type_end(); + TypeSymbolTable &TST = M.getTypeSymbolTable(); + for (TypeSymbolTable::iterator TI = TST.begin(), TE = TST.end(); TI != TE; ) { -SymbolTable::type_iterator I = TI++; +TypeSymbolTable::iterator I = TI++; // If this is not used, remove it from the symbol table. std::set::iterator UTI = UT.find(I->second); if (UTI == UT.end()) - MST.remove(I); + TST.remove(I); else UT.erase(UTI);// Only keep one name for this type. } @@ -1421,7 +1422,7 @@ // // Loop over the symbol table, emitting all named constants... - printModuleTypes(M.getSymbolTable()); + printModuleTypes(M.getTypeSymbolTable()); // Global variable declarations... if (!M.global_empty()) { @@ -1589,7 +1590,7 @@ /// printSymbolTable - Run through symbol table looking for type names. If a /// type name is found, emit its declaration... /// -void CWriter::printModuleTypes(const SymbolTable &ST) { +void CWriter::printModuleTypes(const TypeSymbolTable &TST) { Out << "/* Helper union for bitcasts */\n"; Out << "typedef union {\n"; Out << " unsigned int Int32;\n"; @@ -1599,8 +1600,8 @@ Out << "} llvmBitCastUnion;\n"; // We are only interested in the type plane of the symbol table. - SymbolTable::type_const_iterator I = ST.type_begin(); - SymbolTable::type_const_iterator End = ST.type_end(); + TypeSymbolTable::const_iterator I = TST.begin(); + TypeSymbolTable::const_iterator End = TST.end(); // If there are no type names, exit early. if (I == End) return; @@ -1618,7 +1619,7 @@ // Now we can print out typedefs... Out << "/* Typedefs */\n"; - for (I = ST.type_begin(); I != End; ++I) { + for (I = TST.begin(); I != End; ++I) { const Type *Ty = cast(I->second); std::string Name = "l_" + Mang->makeNameProper(I->first); Out << "typedef "; @@ -1635,7 +1636,7 @@ // printed in the correct order. // Out << "/* Structure contents */\n"; - for (I = ST.type_begin(); I != End; ++I) + for (I = TST.begin(); I != End; ++I) if (const StructType *STy = dyn_cast(I->second)) // Only print out used types! printContainedStructs(STy, StructPrinted); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/bugpoint/CrashDebugger.cpp
Changes in directory llvm/tools/bugpoint: CrashDebugger.cpp updated: 1.53 -> 1.54 --- Log message: For PR411: http://llvm.org/PR411 : Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. --- Diffs of the changes: (+1 -1) CrashDebugger.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/bugpoint/CrashDebugger.cpp diff -u llvm/tools/bugpoint/CrashDebugger.cpp:1.53 llvm/tools/bugpoint/CrashDebugger.cpp:1.54 --- llvm/tools/bugpoint/CrashDebugger.cpp:1.53 Thu Nov 2 14:25:50 2006 +++ llvm/tools/bugpoint/CrashDebugger.cpp Sat Jan 6 01:24:44 2007 @@ -337,7 +337,7 @@ // module, and that they don't include any deleted blocks. BBs.clear(); for (unsigned i = 0, e = BlockInfo.size(); i != e; ++i) { - SymbolTable &ST = BlockInfo[i].first->getSymbolTable(); + SymbolTable &ST = BlockInfo[i].first->getValueSymbolTable(); SymbolTable::plane_iterator PI = ST.find(Type::LabelTy); if (PI != ST.plane_end() && PI->second.count(BlockInfo[i].second)) BBs.push_back(cast(PI->second[BlockInfo[i].second])); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp
Changes in directory llvm/lib/Linker: LinkModules.cpp updated: 1.124 -> 1.125 --- Log message: For PR411: http://llvm.org/PR411 : Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. --- Diffs of the changes: (+22 -18) LinkModules.cpp | 40 ++-- 1 files changed, 22 insertions(+), 18 deletions(-) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.124 llvm/lib/Linker/LinkModules.cpp:1.125 --- llvm/lib/Linker/LinkModules.cpp:1.124 Fri Dec 15 11:35:32 2006 +++ llvm/lib/Linker/LinkModules.cpp Sat Jan 6 01:24:43 2007 @@ -21,6 +21,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Module.h" #include "llvm/SymbolTable.h" +#include "llvm/TypeSymbolTable.h" #include "llvm/Instructions.h" #include "llvm/Assembly/Writer.h" #include "llvm/Support/Streams.h" @@ -61,7 +62,7 @@ // false - No errors. // static bool ResolveTypes(const Type *DestTy, const Type *SrcTy, - SymbolTable *DestST, const std::string &Name) { + TypeSymbolTable *DestST, const std::string &Name) { if (DestTy == SrcTy) return false; // If already equal, noop // Does the type already exist in the module? @@ -93,7 +94,8 @@ // are compatible. static bool RecursiveResolveTypesI(const PATypeHolder &DestTy, const PATypeHolder &SrcTy, - SymbolTable *DestST, const std::string &Name, + TypeSymbolTable *DestST, + const std::string &Name, std::vector > &Pointers) { const Type *SrcTyT = SrcTy.get(); const Type *DestTyT = DestTy.get(); @@ -164,7 +166,8 @@ static bool RecursiveResolveTypes(const PATypeHolder &DestTy, const PATypeHolder &SrcTy, - SymbolTable *DestST, const std::string &Name){ + TypeSymbolTable *DestST, + const std::string &Name){ std::vector > PointerTypes; return RecursiveResolveTypesI(DestTy, SrcTy, DestST, Name, PointerTypes); } @@ -174,12 +177,12 @@ // types are named in the src module that are not named in the Dst module. // Make sure there are no type name conflicts. static bool LinkTypes(Module *Dest, const Module *Src, std::string *Err) { - SymbolTable *DestST = &Dest->getSymbolTable(); - const SymbolTable *SrcST = &Src->getSymbolTable(); +TypeSymbolTable *DestST = &Dest->getTypeSymbolTable(); + const TypeSymbolTable *SrcST = &Src->getTypeSymbolTable(); // Look for a type plane for Type's... - SymbolTable::type_const_iterator TI = SrcST->type_begin(); - SymbolTable::type_const_iterator TE = SrcST->type_end(); + TypeSymbolTable::const_iterator TI = SrcST->begin(); + TypeSymbolTable::const_iterator TE = SrcST->end(); if (TI == TE) return false; // No named types, do nothing. // Some types cannot be resolved immediately because they depend on other @@ -192,7 +195,7 @@ const Type *RHS = TI->second; // Check to see if this type name is already in the dest module... -Type *Entry = DestST->lookupType(Name); +Type *Entry = DestST->lookup(Name); if (ResolveTypes(Entry, RHS, DestST, Name)) { // They look different, save the types 'till later to resolve. @@ -208,8 +211,8 @@ // Try direct resolution by name... for (unsigned i = 0; i != DelayedTypesToResolve.size(); ++i) { const std::string &Name = DelayedTypesToResolve[i]; - Type *T1 = SrcST->lookupType(Name); - Type *T2 = DestST->lookupType(Name); + Type *T1 = SrcST->lookup(Name); + Type *T2 = DestST->lookup(Name); if (!ResolveTypes(T2, T1, DestST, Name)) { // We are making progress! DelayedTypesToResolve.erase(DelayedTypesToResolve.begin()+i); @@ -223,8 +226,8 @@ // two types: { int* } and { opaque* } for (unsigned i = 0, e = DelayedTypesToResolve.size(); i != e; ++i) { const std::string &Name = DelayedTypesToResolve[i]; -PATypeHolder T1(SrcST->lookupType(Name)); -PATypeHolder T2(DestST->lookupType(Name)); +PATypeHolder T1(SrcST->lookup(Name)); +PATypeHolder T2(DestST->lookup(Name)); if (!RecursiveResolveTypes(T2, T1, DestST, Name)) { // We are making progress! @@ -326,7 +329,7 @@ /// through the trouble to force this back. static void ForceRenaming(GlobalValue *GV, const std::string &Name) { assert(GV->getName() != Name && "Can't force rename to self"); - SymbolTable &ST = GV->getParent()->getSymbolTable(); + SymbolTable &ST = GV->getParent()->getValueSymbolTable(); // If there is a conflict, rename the c
[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Analyzer.cpp Reader.cpp Reader.h
Changes in directory llvm/lib/Bytecode/Reader: Analyzer.cpp updated: 1.26 -> 1.27 Reader.cpp updated: 1.215 -> 1.216 Reader.h updated: 1.40 -> 1.41 --- Log message: For PR411: http://llvm.org/PR411 : Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. --- Diffs of the changes: (+43 -22) Analyzer.cpp | 10 +++--- Reader.cpp | 47 ++- Reader.h |8 ++-- 3 files changed, 43 insertions(+), 22 deletions(-) Index: llvm/lib/Bytecode/Reader/Analyzer.cpp diff -u llvm/lib/Bytecode/Reader/Analyzer.cpp:1.26 llvm/lib/Bytecode/Reader/Analyzer.cpp:1.27 --- llvm/lib/Bytecode/Reader/Analyzer.cpp:1.26 Fri Dec 15 15:46:37 2006 +++ llvm/lib/Bytecode/Reader/Analyzer.cpp Sat Jan 6 01:24:43 2007 @@ -96,11 +96,12 @@ bca.BlockSizes[BytecodeFormat::ModuleBlockID] = theSize; bca.BlockSizes[BytecodeFormat::FunctionBlockID] = 0; bca.BlockSizes[BytecodeFormat::ConstantPoolBlockID] = 0; -bca.BlockSizes[BytecodeFormat::SymbolTableBlockID] = 0; +bca.BlockSizes[BytecodeFormat::ValueSymbolTableBlockID] = 0; bca.BlockSizes[BytecodeFormat::ModuleGlobalInfoBlockID] = 0; bca.BlockSizes[BytecodeFormat::GlobalTypePlaneBlockID] = 0; bca.BlockSizes[BytecodeFormat::InstructionListBlockID] = 0; bca.BlockSizes[BytecodeFormat::CompactionTableBlockID] = 0; +bca.BlockSizes[BytecodeFormat::TypeSymbolTableBlockID] = 0; } virtual void handleFinish() { @@ -636,8 +637,11 @@ print(Out, "Compaction Table Bytes", double(bca.BlockSizes[BytecodeFormat::CompactionTableBlockID]), double(bca.byteSize)); - print(Out, "Symbol Table Bytes", -double(bca.BlockSizes[BytecodeFormat::SymbolTableBlockID]), + print(Out, "Value Symbol Table Bytes", +double(bca.BlockSizes[BytecodeFormat::ValueSymbolTableBlockID]), +double(bca.byteSize)); + print(Out, "Type Symbol Table Bytes", +double(bca.BlockSizes[BytecodeFormat::TypeSymbolTableBlockID]), double(bca.byteSize)); print(Out, "Alignment Bytes", double(bca.numAlignment), double(bca.byteSize)); Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.215 llvm/lib/Bytecode/Reader/Reader.cpp:1.216 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.215 Sat Dec 30 23:44:24 2006 +++ llvm/lib/Bytecode/Reader/Reader.cpp Sat Jan 6 01:24:43 2007 @@ -24,6 +24,7 @@ #include "llvm/InlineAsm.h" #include "llvm/Instructions.h" #include "llvm/SymbolTable.h" +#include "llvm/TypeSymbolTable.h" #include "llvm/Bytecode/Format.h" #include "llvm/Config/alloca.h" #include "llvm/Support/GetElementPtrTypeIterator.h" @@ -1023,13 +1024,27 @@ return BlockNo; } -/// Parse a symbol table. This works for both module level and function +/// Parse a type symbol table. +void BytecodeReader::ParseTypeSymbolTable(TypeSymbolTable *TST) { + // Type Symtab block header: [num entries] + unsigned NumEntries = read_vbr_uint(); + for (unsigned i = 0; i < NumEntries; ++i) { +// Symtab entry: [type slot #][name] +unsigned slot = read_vbr_uint(); +std::string Name = read_str(); +const Type* T = getType(slot); +TST->insert(Name, T); + } +} + +/// Parse a value symbol table. This works for both module level and function /// level symbol tables. For function level symbol tables, the CurrentFunction /// parameter must be non-zero and the ST parameter must correspond to /// CurrentFunction's symbol table. For Module level symbol tables, the /// CurrentFunction argument must be zero. -void BytecodeReader::ParseSymbolTable(Function *CurrentFunction, - SymbolTable *ST) { +void BytecodeReader::ParseValueSymbolTable(Function *CurrentFunction, + SymbolTable *ST) { + if (Handler) Handler->handleSymbolTableBegin(CurrentFunction,ST); // Allow efficient basic block lookup by number. @@ -1039,16 +1054,6 @@ E = CurrentFunction->end(); I != E; ++I) BBMap.push_back(I); - // Symtab block header: [num entries] - unsigned NumEntries = read_vbr_uint(); - for (unsigned i = 0; i < NumEntries; ++i) { -// Symtab entry: [def slot #][name] -unsigned slot = read_vbr_uint(); -std::string Name = read_str(); -const Type* T = getType(slot); -ST->insert(Name, T); - } - while (moreInBlock()) { // Symtab block header: [num entries][type id number] unsigned NumEntries = read_vbr_uint(); @@ -1683,8 +1688,12 @@ break; } -case BytecodeFormat::SymbolTableBlockID: - ParseSymbolTable(F, &F->getSymbolTable()); +case BytecodeFormat::ValueSymbolTableBlockID: + ParseValueSymbolTable(F, &F->getValueSymbolTable()); +
[llvm-commits] CVS: llvm/tools/llvm2cpp/CppWriter.cpp
Changes in directory llvm/tools/llvm2cpp: CppWriter.cpp updated: 1.27 -> 1.28 --- Log message: For PR411: http://llvm.org/PR411 : Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. --- Diffs of the changes: (+9 -8) CppWriter.cpp | 17 + 1 files changed, 9 insertions(+), 8 deletions(-) Index: llvm/tools/llvm2cpp/CppWriter.cpp diff -u llvm/tools/llvm2cpp/CppWriter.cpp:1.27 llvm/tools/llvm2cpp/CppWriter.cpp:1.28 --- llvm/tools/llvm2cpp/CppWriter.cpp:1.27 Sun Dec 31 00:02:26 2006 +++ llvm/tools/llvm2cpp/CppWriter.cpp Sat Jan 6 01:24:44 2007 @@ -20,6 +20,7 @@ #include "llvm/Instructions.h" #include "llvm/Module.h" #include "llvm/SymbolTable.h" +#include "llvm/TypeSymbolTable.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/CommandLine.h" @@ -189,10 +190,10 @@ // Mode::getTypeName function which will return an empty string, not a null // pointer if the name is not found. inline const std::string* -findTypeName(const SymbolTable& ST, const Type* Ty) +findTypeName(const TypeSymbolTable& ST, const Type* Ty) { - SymbolTable::type_const_iterator TI = ST.type_begin(); - SymbolTable::type_const_iterator TE = ST.type_end(); + TypeSymbolTable::const_iterator TI = ST.begin(); + TypeSymbolTable::const_iterator TE = ST.end(); for (;TI != TE; ++TI) if (TI->second == Ty) return &(TI->first); @@ -348,7 +349,7 @@ } // See if the type has a name in the symboltable and build accordingly - const std::string* tName = findTypeName(TheModule->getSymbolTable(), Ty); + const std::string* tName = findTypeName(TheModule->getTypeSymbolTable(), Ty); std::string name; if (tName) name = std::string(prefix) + *tName; @@ -539,7 +540,7 @@ // If the type had a name, make sure we recreate it. const std::string* progTypeName = -findTypeName(TheModule->getSymbolTable(),Ty); +findTypeName(TheModule->getTypeSymbolTable(),Ty); if (progTypeName) Out << "mod->addTypeName(\"" << *progTypeName << "\", " << typeName << ");"; @@ -596,9 +597,9 @@ CppWriter::printTypes(const Module* M) { // Walk the symbol table and print out all its types - const SymbolTable& symtab = M->getSymbolTable(); - for (SymbolTable::type_const_iterator TI = symtab.type_begin(), - TE = symtab.type_end(); TI != TE; ++TI) { + const TypeSymbolTable& symtab = M->getTypeSymbolTable(); + for (TypeSymbolTable::const_iterator TI = symtab.begin(), TE = symtab.end(); + TI != TE; ++TI) { // For primitive types and types already defined, just add a name TypeMap::const_iterator TNI = TypeNames.find(TI->second); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Function.cpp Module.cpp SymbolTable.cpp SymbolTableListTraitsImpl.h TypeSymbolTable.cpp Value.cpp Verifier.cpp
Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.234 -> 1.235 Function.cpp updated: 1.108 -> 1.109 Module.cpp updated: 1.70 -> 1.71 SymbolTable.cpp updated: 1.64 -> 1.65 SymbolTableListTraitsImpl.h updated: 1.7 -> 1.8 TypeSymbolTable.cpp updated: 1.5 -> 1.6 Value.cpp updated: 1.59 -> 1.60 Verifier.cpp updated: 1.181 -> 1.182 --- Log message: For PR411: http://llvm.org/PR411 : Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. --- Diffs of the changes: (+55 -154) AsmWriter.cpp | 28 ++- Function.cpp|4 - Module.cpp | 27 ++ SymbolTable.cpp | 110 SymbolTableListTraitsImpl.h | 12 ++-- TypeSymbolTable.cpp |8 +-- Value.cpp |8 +-- Verifier.cpp| 12 +++- 8 files changed, 55 insertions(+), 154 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.234 llvm/lib/VMCore/AsmWriter.cpp:1.235 --- llvm/lib/VMCore/AsmWriter.cpp:1.234 Fri Jan 5 11:06:19 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Sat Jan 6 01:24:44 2007 @@ -25,6 +25,7 @@ #include "llvm/Instructions.h" #include "llvm/Module.h" #include "llvm/SymbolTable.h" +#include "llvm/TypeSymbolTable.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/CFG.h" @@ -216,9 +217,9 @@ static void fillTypeNameTable(const Module *M, std::map &TypeNames) { if (!M) return; - const SymbolTable &ST = M->getSymbolTable(); - SymbolTable::type_const_iterator TI = ST.type_begin(); - for (; TI != ST.type_end(); ++TI) { + const TypeSymbolTable &ST = M->getTypeSymbolTable(); + TypeSymbolTable::const_iterator TI = ST.begin(); + for (; TI != ST.end(); ++TI) { // As a heuristic, don't insert pointer to primitive types, because // they are used too often to have a single useful name. // @@ -666,7 +667,8 @@ private: void printModule(const Module *M); - void printSymbolTable(const SymbolTable &ST); + void printTypeSymbolTable(const TypeSymbolTable &ST); + void printValueSymbolTable(const SymbolTable &ST); void printConstant(const Constant *CPV); void printGlobal(const GlobalVariable *GV); void printFunction(const Function *F); @@ -818,7 +820,8 @@ } // Loop over the symbol table, emitting all named constants. - printSymbolTable(M->getSymbolTable()); + printTypeSymbolTable(M->getTypeSymbolTable()); + printValueSymbolTable(M->getValueSymbolTable()); for (Module::const_global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I) @@ -873,14 +876,10 @@ Out << "\n"; } - -// printSymbolTable - Run through symbol table looking for constants -// and types. Emit their declarations. -void AssemblyWriter::printSymbolTable(const SymbolTable &ST) { - +void AssemblyWriter::printTypeSymbolTable(const TypeSymbolTable &ST) { // Print the types. - for (SymbolTable::type_const_iterator TI = ST.type_begin(); - TI != ST.type_end(); ++TI) { + for (TypeSymbolTable::const_iterator TI = ST.begin(), TE = ST.end(); + TI != TE; ++TI) { Out << "\t" << getLLVMName(TI->first) << " = type "; // Make sure we print out at least one level of the type structure, so @@ -888,6 +887,11 @@ // printTypeAtLeastOneLevel(TI->second) << "\n"; } +} + +// printSymbolTable - Run through symbol table looking for constants +// and types. Emit their declarations. +void AssemblyWriter::printValueSymbolTable(const SymbolTable &ST) { // Print the constants, in type plane order. for (SymbolTable::plane_const_iterator PI = ST.plane_begin(); Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.108 llvm/lib/VMCore/Function.cpp:1.109 --- llvm/lib/VMCore/Function.cpp:1.108 Sat Dec 30 23:26:44 2006 +++ llvm/lib/VMCore/Function.cppSat Jan 6 01:24:44 2007 @@ -144,8 +144,8 @@ /// required before printing out to a textual form, to ensure that there is no /// ambiguity when parsing. void Function::renameLocalSymbols() { - SymbolTable &LST = getSymbolTable(); // Local Symtab - SymbolTable &GST = getParent()->getSymbolTable();// Global Symtab + SymbolTable &LST = getValueSymbolTable(); // Local Symtab + SymbolTable &GST = getParent()->getValueSymbolTable();// Global Symtab for (SymbolTable::plane_iterator LPI = LST.plane_begin(), E = LST.plane_end(); LPI != E; ++LPI) Index: llvm/lib/VMCore/Module.cpp diff -u llvm/lib/VMCore/Module.cpp:1.70 llvm/lib/VMCore/Module.cpp:1.71 --- llvm/lib/VMCore/Module.cpp:1.70 Sat Dec 30 23:26:44 2006 +++ llvm/lib/VMCore/Module.cpp Sat Jan 6 01:24:44 2007 @@ -19,6 +
[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.y llvmAsmParser.y.cvs
Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.46 -> 1.47 llvmAsmParser.y updated: 1.300 -> 1.301 llvmAsmParser.y.cvs updated: 1.47 -> 1.48 --- Log message: For PR411: http://llvm.org/PR411 : Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. --- Diffs of the changes: (+12 -12) llvmAsmParser.cpp.cvs |8 llvmAsmParser.y |8 llvmAsmParser.y.cvs |8 3 files changed, 12 insertions(+), 12 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.46 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.47 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.46 Fri Jan 5 15:51:07 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvsSat Jan 6 01:24:43 2007 @@ -639,8 +639,8 @@ static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) { SymbolTable &SymTab = -inFunctionScope() ? CurFun.CurrentFunction->getSymbolTable() : -CurModule.CurrentModule->getSymbolTable(); +inFunctionScope() ? CurFun.CurrentFunction->getValueSymbolTable() : +CurModule.CurrentModule->getValueSymbolTable(); return SymTab.lookup(Ty, Name); } @@ -821,7 +821,7 @@ case ValID::NameVal: // Is it a named definition? Name = ID.Name; if (Value *N = CurFun.CurrentFunction-> - getSymbolTable().lookup(Type::LabelTy, Name)) + getValueSymbolTable().lookup(Type::LabelTy, Name)) BB = cast(N); break; } @@ -961,7 +961,7 @@ } assert(inFunctionScope() && "Must be in function scope!"); -SymbolTable &ST = CurFun.CurrentFunction->getSymbolTable(); +SymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable(); if (ST.lookup(V->getType(), Name)) { GenerateError("Redefinition of value '" + Name + "' of type '" + V->getType()->getDescription() + "'!"); Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.300 llvm/lib/AsmParser/llvmAsmParser.y:1.301 --- llvm/lib/AsmParser/llvmAsmParser.y:1.300Fri Jan 5 15:50:38 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Sat Jan 6 01:24:43 2007 @@ -311,8 +311,8 @@ static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) { SymbolTable &SymTab = -inFunctionScope() ? CurFun.CurrentFunction->getSymbolTable() : -CurModule.CurrentModule->getSymbolTable(); +inFunctionScope() ? CurFun.CurrentFunction->getValueSymbolTable() : +CurModule.CurrentModule->getValueSymbolTable(); return SymTab.lookup(Ty, Name); } @@ -493,7 +493,7 @@ case ValID::NameVal: // Is it a named definition? Name = ID.Name; if (Value *N = CurFun.CurrentFunction-> - getSymbolTable().lookup(Type::LabelTy, Name)) + getValueSymbolTable().lookup(Type::LabelTy, Name)) BB = cast(N); break; } @@ -633,7 +633,7 @@ } assert(inFunctionScope() && "Must be in function scope!"); -SymbolTable &ST = CurFun.CurrentFunction->getSymbolTable(); +SymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable(); if (ST.lookup(V->getType(), Name)) { GenerateError("Redefinition of value '" + Name + "' of type '" + V->getType()->getDescription() + "'!"); Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.47 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.48 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.47 Fri Jan 5 15:51:07 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Sat Jan 6 01:24:43 2007 @@ -311,8 +311,8 @@ static Value *lookupInSymbolTable(const Type *Ty, const std::string &Name) { SymbolTable &SymTab = -inFunctionScope() ? CurFun.CurrentFunction->getSymbolTable() : -CurModule.CurrentModule->getSymbolTable(); +inFunctionScope() ? CurFun.CurrentFunction->getValueSymbolTable() : +CurModule.CurrentModule->getValueSymbolTable(); return SymTab.lookup(Ty, Name); } @@ -493,7 +493,7 @@ case ValID::NameVal: // Is it a named definition? Name = ID.Name; if (Value *N = CurFun.CurrentFunction-> - getSymbolTable().lookup(Type::LabelTy, Name)) + getValueSymbolTable().lookup(Type::LabelTy, Name)) BB = cast(N); break; } @@ -633,7 +633,7 @@ } assert(inFunctionScope() && "Must be in function scope!"); -SymbolTable &ST = CurFun.CurrentFunction->getSymbolTable(); +SymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable(); if (ST.lookup(V->getType(), Name)) { GenerateErr
[llvm-commits] CVS: llvm/lib/Bytecode/Writer/SlotCalculator.cpp SlotCalculator.h Writer.cpp WriterInternals.h
Changes in directory llvm/lib/Bytecode/Writer: SlotCalculator.cpp updated: 1.77 -> 1.78 SlotCalculator.h updated: 1.23 -> 1.24 Writer.cpp updated: 1.141 -> 1.142 WriterInternals.h updated: 1.27 -> 1.28 --- Log message: For PR411: http://llvm.org/PR411 : Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. --- Diffs of the changes: (+45 -34) SlotCalculator.cpp | 36 +++- SlotCalculator.h |4 +++- Writer.cpp | 35 --- WriterInternals.h |4 +++- 4 files changed, 45 insertions(+), 34 deletions(-) Index: llvm/lib/Bytecode/Writer/SlotCalculator.cpp diff -u llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.77 llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.78 --- llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.77Sat Dec 30 23:44:24 2006 +++ llvm/lib/Bytecode/Writer/SlotCalculator.cpp Sat Jan 6 01:24:43 2007 @@ -22,6 +22,7 @@ #include "llvm/Instructions.h" #include "llvm/Module.h" #include "llvm/SymbolTable.h" +#include "llvm/TypeSymbolTable.h" #include "llvm/Type.h" #include "llvm/Analysis/ConstantsScanner.h" #include "llvm/ADT/PostOrderIterator.h" @@ -189,13 +190,14 @@ } getOrCreateSlot(I->getType()); } -processSymbolTableConstants(&F->getSymbolTable()); +processSymbolTableConstants(&F->getValueSymbolTable()); } // Insert constants that are named at module level into the slot pool so that // the module symbol table can refer to them... SC_DEBUG("Inserting SymbolTable values:\n"); - processSymbolTable(&TheModule->getSymbolTable()); + processTypeSymbolTable(&TheModule->getTypeSymbolTable()); + processValueSymbolTable(&TheModule->getValueSymbolTable()); // Now that we have collected together all of the information relevant to the // module, compactify the type table if it is particularly big and outputting @@ -233,16 +235,18 @@ SC_DEBUG("end processModule!\n"); } +// processTypeSymbolTable - Insert all of the type sin the specified symbol +// table. +void SlotCalculator::processTypeSymbolTable(const TypeSymbolTable *ST) { + for (TypeSymbolTable::const_iterator TI = ST->begin(), TE = ST->end(); + TI != TE; ++TI ) +getOrCreateSlot(TI->second); +} + // processSymbolTable - Insert all of the values in the specified symbol table // into the values table... // -void SlotCalculator::processSymbolTable(const SymbolTable *ST) { - // Do the types first. - for (SymbolTable::type_const_iterator TI = ST->type_begin(), - TE = ST->type_end(); TI != TE; ++TI ) -getOrCreateSlot(TI->second); - - // Now do the values. +void SlotCalculator::processValueSymbolTable(const SymbolTable *ST) { for (SymbolTable::plane_const_iterator PI = ST->plane_begin(), PE = ST->plane_end(); PI != PE; ++PI) for (SymbolTable::value_const_iterator VI = PI->second.begin(), @@ -251,11 +255,6 @@ } void SlotCalculator::processSymbolTableConstants(const SymbolTable *ST) { - // Do the types first - for (SymbolTable::type_const_iterator TI = ST->type_begin(), - TE = ST->type_end(); TI != TE; ++TI ) -getOrCreateSlot(TI->second); - // Now do the constant values in all planes for (SymbolTable::plane_const_iterator PI = ST->plane_begin(), PE = ST->plane_end(); PI != PE; ++PI) @@ -306,7 +305,7 @@ // symbol table references to constants not in the output. Scan for these // constants now. // -processSymbolTableConstants(&F->getSymbolTable()); +processSymbolTableConstants(&F->getValueSymbolTable()); } SC_DEBUG("Inserting Instructions:\n"); @@ -468,13 +467,8 @@ getOrCreateCompactionTableSlot(I->getOperand(op)); } - // Do the types in the symbol table - const SymbolTable &ST = F->getSymbolTable(); - for (SymbolTable::type_const_iterator TI = ST.type_begin(), - TE = ST.type_end(); TI != TE; ++TI) -getOrCreateCompactionTableSlot(TI->second); - // Now do the constants and global values + const SymbolTable &ST = F->getValueSymbolTable(); for (SymbolTable::plane_const_iterator PI = ST.plane_begin(), PE = ST.plane_end(); PI != PE; ++PI) for (SymbolTable::value_const_iterator VI = PI->second.begin(), Index: llvm/lib/Bytecode/Writer/SlotCalculator.h diff -u llvm/lib/Bytecode/Writer/SlotCalculator.h:1.23 llvm/lib/Bytecode/Writer/SlotCalculator.h:1.24 --- llvm/lib/Bytecode/Writer/SlotCalculator.h:1.23 Wed Jan 25 17:08:15 2006 +++ llvm/lib/Bytecode/Writer/SlotCalculator.h Sat Jan 6 01:24:43 2007 @@ -30,6 +30,7 @@ class Module; class Function; class SymbolTable; +class TypeSymbolTable; class ConstantArray; class SlotCalculator { @@ -168,7 +169,8 @@ // processSymbolTable - Insert all of the values in the specified symbol table // into the valu
[llvm-commits] CVS: llvm/include/llvm/Function.h Module.h SymbolTable.h TypeSymbolTable.h
Changes in directory llvm/include/llvm: Function.h updated: 1.68 -> 1.69 Module.h updated: 1.77 -> 1.78 SymbolTable.h updated: 1.53 -> 1.54 TypeSymbolTable.h updated: 1.4 -> 1.5 --- Log message: For PR411: http://llvm.org/PR411 : Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. --- Diffs of the changes: (+14 -58) Function.h|4 ++-- Module.h | 12 +--- SymbolTable.h | 52 +--- TypeSymbolTable.h |4 ++-- 4 files changed, 14 insertions(+), 58 deletions(-) Index: llvm/include/llvm/Function.h diff -u llvm/include/llvm/Function.h:1.68 llvm/include/llvm/Function.h:1.69 --- llvm/include/llvm/Function.h:1.68 Sat Dec 16 23:15:12 2006 +++ llvm/include/llvm/Function.hSat Jan 6 01:24:43 2007 @@ -163,8 +163,8 @@ /// getSymbolTable() - Return the symbol table... /// - inline SymbolTable &getSymbolTable() { return *SymTab; } - inline const SymbolTable &getSymbolTable() const { return *SymTab; } + inline SymbolTable &getValueSymbolTable() { return *SymTab; } + inline const SymbolTable &getValueSymbolTable() const { return *SymTab; } //======// Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.77 llvm/include/llvm/Module.h:1.78 --- llvm/include/llvm/Module.h:1.77 Sat Dec 16 23:15:12 2006 +++ llvm/include/llvm/Module.h Sat Jan 6 01:24:43 2007 @@ -25,6 +25,7 @@ class GlobalValueRefMap; // Used by ConstantVals.cpp class FunctionType; class SymbolTable; +class TypeSymbolTable; template<> struct ilist_traits : public SymbolTableListTraits { @@ -91,7 +92,8 @@ FunctionListType FunctionList; ///< The Functions in the module LibraryListType LibraryList; ///< The Libraries needed by the module std::string GlobalScopeAsm;///< Inline Asm at global scope. - SymbolTable *SymTab; ///< Symbol Table for the module + SymbolTable *ValSymTab;///< Symbol table for values + TypeSymbolTable *TypeSymTab; ///< Symbol table for types std::string ModuleID; ///< Human readable identifier for the module std::string TargetTriple; ///< Platform target triple Module compiled on std::string DataLayout;///< Target data description @@ -237,9 +239,13 @@ /// Get the Module's list of functions. FunctionListType &getFunctionList() { return FunctionList; } /// Get the symbol table of global variable and function identifiers - const SymbolTable &getSymbolTable() const { return *SymTab; } + const SymbolTable &getValueSymbolTable() const { return *ValSymTab; } /// Get the Module's symbol table of global variable and function identifiers. - SymbolTable&getSymbolTable(){ return *SymTab; } + SymbolTable&getValueSymbolTable() { return *ValSymTab; } + /// Get the symbol table of types + const TypeSymbolTable &getTypeSymbolTable() const { return *TypeSymTab; } + /// Get the Module's symbol table of types + TypeSymbolTable &getTypeSymbolTable() { return *TypeSymTab; } /// @} /// @name Global Variable Iteration Index: llvm/include/llvm/SymbolTable.h diff -u llvm/include/llvm/SymbolTable.h:1.53 llvm/include/llvm/SymbolTable.h:1.54 --- llvm/include/llvm/SymbolTable.h:1.53Wed May 31 15:40:36 2006 +++ llvm/include/llvm/SymbolTable.h Sat Jan 6 01:24:43 2007 @@ -47,16 +47,6 @@ /// @name Types /// @{ public: - - /// @brief A mapping of names to types. - typedef std::map TypeMap; - - /// @brief An iterator over the TypeMap. - typedef TypeMap::iterator type_iterator; - - /// @brief A const_iterator over the TypeMap. - typedef TypeMap::const_iterator type_const_iterator; - /// @brief A mapping of names to values. typedef std::map ValueMap; @@ -96,20 +86,10 @@ /// @brief Lookup a named, typed value. Value *lookup(const Type *Ty, const std::string &name) const; - /// This method finds the type with the given \p name in the - /// type map and returns it. - /// @returns null if the name is not found, otherwise the Type - /// associated with the \p name. - /// @brief Lookup a type by name. - Type* lookupType(const std::string& name) const; - /// @returns true iff the type map and the type plane are both not /// empty. /// @brief Determine if the symbol table is empty - inline bool isEmpty() const { return pmap.empty() && tmap.empty(); } - - /// @brief The number of name/type pairs is returned. - inline unsigned num_types() const { return unsigned(tmap.size()); } + inline bool isEmpty() const { return pmap.empty(); } /// Given a base name, return a string that is either eq
[llvm-commits] CVS: llvm/lib/Transforms/Utils/CloneModule.cpp
Changes in directory llvm/lib/Transforms/Utils: CloneModule.cpp updated: 1.18 -> 1.19 --- Log message: For PR411: http://llvm.org/PR411 : Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. --- Diffs of the changes: (+5 -5) CloneModule.cpp | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/Utils/CloneModule.cpp diff -u llvm/lib/Transforms/Utils/CloneModule.cpp:1.18 llvm/lib/Transforms/Utils/CloneModule.cpp:1.19 --- llvm/lib/Transforms/Utils/CloneModule.cpp:1.18 Wed May 17 13:05:35 2006 +++ llvm/lib/Transforms/Utils/CloneModule.cpp Sat Jan 6 01:24:44 2007 @@ -16,6 +16,7 @@ #include "llvm/Module.h" #include "llvm/DerivedTypes.h" #include "llvm/SymbolTable.h" +#include "llvm/TypeSymbolTable.h" #include "llvm/Constant.h" #include "ValueMapper.h" using namespace llvm; @@ -42,11 +43,10 @@ New->setModuleInlineAsm(M->getModuleInlineAsm()); // Copy all of the type symbol table entries over. - const SymbolTable &SymTab = M->getSymbolTable(); - SymbolTable::type_const_iterator TypeI = SymTab.type_begin(); - SymbolTable::type_const_iterator TypeE = SymTab.type_end(); - for (; TypeI != TypeE; ++TypeI) -New->addTypeName(TypeI->first, TypeI->second); + const TypeSymbolTable &TST = M->getTypeSymbolTable(); + for (TypeSymbolTable::const_iterator TI = TST.begin(), TE = TST.end(); + TI != TE; ++TI) +New->addTypeName(TI->first, TI->second); // Copy all of the dependent libraries over. for (Module::lib_iterator I = M->lib_begin(), E = M->lib_end(); I != E; ++I) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Bytecode/Format.h
Changes in directory llvm/include/llvm/Bytecode: Format.h updated: 1.14 -> 1.15 --- Log message: For PR411: http://llvm.org/PR411 : Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. --- Diffs of the changes: (+3 -2) Format.h |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Bytecode/Format.h diff -u llvm/include/llvm/Bytecode/Format.h:1.14 llvm/include/llvm/Bytecode/Format.h:1.15 --- llvm/include/llvm/Bytecode/Format.h:1.14Mon Nov 13 22:47:22 2006 +++ llvm/include/llvm/Bytecode/Format.h Sat Jan 6 01:24:43 2007 @@ -35,7 +35,7 @@ ModuleBlockID = 1, ///< Module block that contains other blocks. FunctionBlockID= 2, ///< Function block identifier ConstantPoolBlockID= 3, ///< Constant pool identifier -SymbolTableBlockID = 4, ///< Symbol table identifier +ValueSymbolTableBlockID= 4, ///< Value Symbol table identifier ModuleGlobalInfoBlockID= 5, ///< Module global info identifier GlobalTypePlaneBlockID = 6, ///< Global type plan identifier InstructionListBlockID = 7, ///< All instructions in a function @@ -46,8 +46,9 @@ /// instructions to be encoded more efficiently because VBR takes fewer /// bytes with smaller values. /// @brief Value Compaction Table Block -CompactionTableBlockID = 0x08, +CompactionTableBlockID = 8, +TypeSymbolTableBlockID = 9, ///< Value Symbol table identifier // Not a block id, just used to count them NumberOfBlockIDs }; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/IPO/DeadTypeElimination.cpp StripSymbols.cpp
Changes in directory llvm/lib/Transforms/IPO: DeadTypeElimination.cpp updated: 1.58 -> 1.59 StripSymbols.cpp updated: 1.9 -> 1.10 --- Log message: For PR411: http://llvm.org/PR411 : Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. --- Diffs of the changes: (+8 -8) DeadTypeElimination.cpp |9 + StripSymbols.cpp|7 +++ 2 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/lib/Transforms/IPO/DeadTypeElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.58 llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.59 --- llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.58Tue Dec 19 16:09:18 2006 +++ llvm/lib/Transforms/IPO/DeadTypeElimination.cpp Sat Jan 6 01:24:43 2007 @@ -16,7 +16,7 @@ #include "llvm/Transforms/IPO.h" #include "llvm/Analysis/FindUsedTypes.h" #include "llvm/Module.h" -#include "llvm/SymbolTable.h" +#include "llvm/TypeSymbolTable.h" #include "llvm/DerivedTypes.h" #include "llvm/ADT/Statistic.h" using namespace llvm; @@ -69,14 +69,15 @@ bool DTE::runOnModule(Module &M) { bool Changed = false; - SymbolTable &ST = M.getSymbolTable(); + TypeSymbolTable &ST = M.getTypeSymbolTable(); std::set UsedTypes = getAnalysis().getTypes(); // Check the symbol table for superfluous type entries... // // Grab the 'type' plane of the module symbol... - SymbolTable::type_iterator TI = ST.type_begin(); - while ( TI != ST.type_end() ) { + TypeSymbolTable::iterator TI = ST.begin(); + TypeSymbolTable::iterator TE = ST.end(); + while ( TI != TE ) { // If this entry should be unconditionally removed, or if we detect that // the type is not used, remove it. const Type *RHS = TI->second; Index: llvm/lib/Transforms/IPO/StripSymbols.cpp diff -u llvm/lib/Transforms/IPO/StripSymbols.cpp:1.9 llvm/lib/Transforms/IPO/StripSymbols.cpp:1.10 --- llvm/lib/Transforms/IPO/StripSymbols.cpp:1.9Sun Aug 27 17:42:52 2006 +++ llvm/lib/Transforms/IPO/StripSymbols.cppSat Jan 6 01:24:44 2007 @@ -29,6 +29,7 @@ #include "llvm/Module.h" #include "llvm/Pass.h" #include "llvm/SymbolTable.h" +#include "llvm/TypeSymbolTable.h" using namespace llvm; namespace { @@ -83,13 +84,11 @@ for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { if (I->hasInternalLinkage()) I->setName(""); // Internal symbols can't participate in linkage - I->getSymbolTable().strip(); + I->getValueSymbolTable().strip(); } // Remove all names from types. -SymbolTable &SymTab = M.getSymbolTable(); -while (SymTab.type_begin() != SymTab.type_end()) - SymTab.remove(SymTab.type_begin()); +M.getTypeSymbolTable().strip(); } // Strip debug info in the module if it exists. To do this, we remove ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll
Changes in directory llvm/test/Regression/Transforms/LCSSA: 2006-06-03-IncorrectIDFPhis.ll updated: 1.3 -> 1.4 --- Log message: Accomodate new name manglinge done by llvm-upgrade --- Diffs of the changes: (+2 -2) 2006-06-03-IncorrectIDFPhis.ll |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/Regression/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll diff -u llvm/test/Regression/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll:1.3 llvm/test/Regression/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll:1.4 --- llvm/test/Regression/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll:1.3 Wed Jan 3 17:47:29 2007 +++ llvm/test/Regression/Transforms/LCSSA/2006-06-03-IncorrectIDFPhis.ll Sat Jan 6 00:04:04 2007 @@ -1,7 +1,7 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \ -; RUN: grep "%SJE.0.0.u.lcssa = phi .struct.SetJmpMapEntry" && +; RUN: grep "%SJE.0.0.pntr.s1.u1.lcssa = phi .struct.SetJmpMapEntry" && ; RUN: llvm-upgrade < %s | llvm-as | opt -lcssa | llvm-dis | \ -; RUN: grep "%SJE.0.0.u.lcssa1 = phi .struct.SetJmpMapEntry" +; RUN: grep "%SJE.0.0.pntr.s1.u1.lcssa1 = phi .struct.SetJmpMapEntry" %struct.SetJmpMapEntry = type { sbyte*, uint, %struct.SetJmpMapEntry* } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeInternals.h UpgradeParser.y
Changes in directory llvm/tools/llvm-upgrade: UpgradeInternals.h updated: 1.1 -> 1.2 UpgradeParser.y updated: 1.34 -> 1.35 --- Log message: For PR1082: http://llvm.org/PR1082 : Solve several related problems by making variable names more unique and dealing with recursive phi nodes. Unfortunately, this doesn't solve the main issue reported in the PR, but its a step in that direction. --- Diffs of the changes: (+122 -59) UpgradeInternals.h |4 + UpgradeParser.y| 177 +++-- 2 files changed, 122 insertions(+), 59 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeInternals.h diff -u llvm/tools/llvm-upgrade/UpgradeInternals.h:1.1 llvm/tools/llvm-upgrade/UpgradeInternals.h:1.2 --- llvm/tools/llvm-upgrade/UpgradeInternals.h:1.1 Fri Jan 5 11:18:58 2007 +++ llvm/tools/llvm-upgrade/UpgradeInternals.h Sat Jan 6 00:03:09 2007 @@ -106,6 +106,10 @@ return atoi(&((getNewTy().c_str())[1])); // skip the slash } + typedef std::vector UpRefStack; + void getSignedness(unsigned &sNum, unsigned &uNum, UpRefStack& stk) const; + std::string makeUniqueName(const std::string& BaseName) const; + const std::string& getNewTy() const { return newTy; } const TypeInfo* getResultType() const { return resultTy; } const TypeInfo* getElementType() const { return elemTy; } Index: llvm/tools/llvm-upgrade/UpgradeParser.y diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.34 llvm/tools/llvm-upgrade/UpgradeParser.y:1.35 --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.34Fri Jan 5 18:12:05 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y Sat Jan 6 00:03:09 2007 @@ -131,8 +131,8 @@ const TypeInfo* TypeInfo::resolve() const { if (isUnresolved()) { -if (getNewTy()[0] == '%' && isdigit(getNewTy()[1])) { - unsigned ref = atoi(&((getNewTy().c_str())[1])); // skip the % +if (getNewTy()[0] == '%' && isdigit(newTy[1])) { + unsigned ref = atoi(&((newTy.c_str())[1])); // skip the % if (ref < EnumeratedTypes.size()) { return EnumeratedTypes[ref]; } else { @@ -141,7 +141,7 @@ yyerror(msg.c_str()); } } else { - TypeMap::iterator I = NamedTypes.find(getNewTy()); + TypeMap::iterator I = NamedTypes.find(newTy); if (I != NamedTypes.end()) { return I->second; } else { @@ -313,6 +313,110 @@ return 0; } +void TypeInfo::getSignedness(unsigned &sNum, unsigned &uNum, + UpRefStack& stack) const { + switch (oldTy) { +default: +case OpaqueTy: case LabelTy: case VoidTy: case BoolTy: +case FloatTy : case DoubleTy: case UpRefTy: + return; +case SByteTy: case ShortTy: case LongTy: case IntTy: + sNum++; + return; +case UByteTy: case UShortTy: case UIntTy: case ULongTy: + uNum++; + return; +case PointerTy: +case PackedTy: +case ArrayTy: + stack.push_back(this); + elemTy->getSignedness(sNum, uNum, stack); + return; +case StructTy: +case PackedStructTy: { + stack.push_back(this); + for (unsigned i = 0; i < elements->size(); i++) { +(*elements)[i]->getSignedness(sNum, uNum, stack); + } + return; +} +case UnresolvedTy: { + const TypeInfo* Ty = this->resolve(); + // Let's not recurse. + UpRefStack::const_iterator I = stack.begin(), E = stack.end(); + for ( ; I != E && *I != Ty; ++I) +; + if (I == E) +Ty->getSignedness(sNum, uNum, stack); + return; +} + } +} + +std::string AddSuffix(const std::string& Name, const std::string& Suffix) { + if (Name[Name.size()-1] == '"') { +std::string Result = Name; +Result.insert(Result.size()-1, Suffix); +return Result; + } + return Name + Suffix; +} + +std::string TypeInfo::makeUniqueName(const std::string& BaseName) const { + if (BaseName == "\"alloca point\"") +return BaseName; + switch (oldTy) { +default: + break; +case OpaqueTy: case LabelTy: case VoidTy: case BoolTy: case UpRefTy: +case FloatTy : case DoubleTy: case UnresolvedTy: + return BaseName; +case SByteTy: case ShortTy: case LongTy: case IntTy: + return AddSuffix(BaseName, ".s"); +case UByteTy: case UShortTy: case UIntTy: case ULongTy: + return AddSuffix(BaseName, ".u"); + } + + unsigned uNum = 0, sNum = 0; + std::string Suffix; + switch (oldTy) { +case PointerTy: +case PackedTy: +case ArrayTy: { + TypeInfo::UpRefStack stack; + elemTy->resolve()->getSignedness(sNum, uNum, stack); + break; +} +case StructTy: +case PackedStructTy: { + for (unsigned i = 0; i < elements->size(); i++) { +TypeInfo::UpRefStack stack; +(*elements)[i]->resolve()->getSignedness(sNum, uNum, stack); + } + break; +} +default: + assert(0 && "Invalid Type"); + break; + } + + if (sNum == 0 && uNum == 0) +return BaseName; + + switch (oldTy) { +d
[llvm-commits] CVS: llvm/test/Regression/Assembler/2007-01-05-Local-Name-Conflict.ll
Changes in directory llvm/test/Regression/Assembler: 2007-01-05-Local-Name-Conflict.ll updated: 1.1 -> 1.2 --- Log message: Currently, there is no fix for this. --- Diffs of the changes: (+1 -0) 2007-01-05-Local-Name-Conflict.ll |1 + 1 files changed, 1 insertion(+) Index: llvm/test/Regression/Assembler/2007-01-05-Local-Name-Conflict.ll diff -u llvm/test/Regression/Assembler/2007-01-05-Local-Name-Conflict.ll:1.1 llvm/test/Regression/Assembler/2007-01-05-Local-Name-Conflict.ll:1.2 --- llvm/test/Regression/Assembler/2007-01-05-Local-Name-Conflict.ll:1.1 Fri Jan 5 23:15:27 2007 +++ llvm/test/Regression/Assembler/2007-01-05-Local-Name-Conflict.llFri Jan 5 23:16:27 2007 @@ -1,4 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f +; XFAIL: * implementation ; Functions: ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Assembler/2007-01-05-Local-Name-Conflict.ll
Changes in directory llvm/test/Regression/Assembler: 2007-01-05-Local-Name-Conflict.ll added (r1.1) --- Log message: Test case for PR1082: http://llvm.org/PR1082 , an llvm-upgrade bug. --- Diffs of the changes: (+23 -0) 2007-01-05-Local-Name-Conflict.ll | 23 +++ 1 files changed, 23 insertions(+) Index: llvm/test/Regression/Assembler/2007-01-05-Local-Name-Conflict.ll diff -c /dev/null llvm/test/Regression/Assembler/2007-01-05-Local-Name-Conflict.ll:1.1 *** /dev/null Fri Jan 5 23:15:37 2007 --- llvm/test/Regression/Assembler/2007-01-05-Local-Name-Conflict.llFri Jan 5 23:15:27 2007 *** *** 0 --- 1,23 + ; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f + + implementation ; Functions: + + void %interpret() { + entry: + %x = bitcast sbyte 1 to sbyte + %x = bitcast ubyte 1 to ubyte + %x = bitcast short 1 to short + %x = bitcast ushort 1 to ushort + %x = bitcast int1 to int + %x = bitcast uint 1 to uint + %x = bitcast ulong 1 to ulong + %x = inttoptr ulong %x to sbyte* + %tmp = inttoptr ulong %x to float* + %tmp7360 = bitcast ubyte %x to sbyte + %tmp7361 = sub ubyte 0, %tmp7360 + br label %next + + next: ; preds = %cond_false165, %cond_true163 + %index.0 = phi uint [ undef, %entry ], [ %index.0, %next ] + br label %next + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-config/Makefile llvm-config.in.in
Changes in directory llvm/tools/llvm-config: Makefile updated: 1.19 -> 1.20 llvm-config.in.in updated: 1.23 -> 1.24 --- Log message: Add an option for getting the C compiler flags, --cflags. Patch contributed by Chandler Carruth --- Diffs of the changes: (+6 -0) Makefile |2 ++ llvm-config.in.in |4 2 files changed, 6 insertions(+) Index: llvm/tools/llvm-config/Makefile diff -u llvm/tools/llvm-config/Makefile:1.19 llvm/tools/llvm-config/Makefile:1.20 --- llvm/tools/llvm-config/Makefile:1.19Mon Dec 11 18:43:38 2006 +++ llvm/tools/llvm-config/Makefile Fri Jan 5 20:48:03 2007 @@ -20,6 +20,7 @@ ifeq ($(HAVE_PERL),1) # Combine preprocessor flags (except for -I) and CXX flags. +SUB_CFLAGS = ${CPP.BaseFlags} ${C.Flags} SUB_CXXFLAGS = ${CPP.BaseFlags} ${CXX.Flags} # This is blank for now. We need to be careful about adding stuff here: @@ -55,6 +56,7 @@ # Build our final script. $(ToolDir)/llvm-config: llvm-config.in $(FinalLibDeps) $(Echo) "Building llvm-config script." + $(Verb) $(ECHO) 's,@LLVM_CFLAGS@,$(SUB_CFLAGS),' > temp.sed $(Verb) $(ECHO) 's,@LLVM_CXXFLAGS@,$(SUB_CXXFLAGS),' > temp.sed $(Verb) $(ECHO) 's,@LLVM_LDFLAGS@,$(SUB_LDFLAGS),' >> temp.sed $(Verb) $(ECHO) 's,@LLVM_BUILDMODE@,$(BuildMode),' >> temp.sed Index: llvm/tools/llvm-config/llvm-config.in.in diff -u llvm/tools/llvm-config/llvm-config.in.in:1.23 llvm/tools/llvm-config/llvm-config.in.in:1.24 --- llvm/tools/llvm-config/llvm-config.in.in:1.23 Mon Sep 4 00:35:23 2006 +++ llvm/tools/llvm-config/llvm-config.in.inFri Jan 5 20:48:03 2007 @@ -45,6 +45,7 @@ # end autoconf values # begin Makefile values +my $CFLAGS = [EMAIL PROTECTED]@}; my $CXXFLAGS= [EMAIL PROTECTED]@}; my $LDFLAGS = [EMAIL PROTECTED]@}; my $SYSTEM_LIBS = [EMAIL PROTECTED]@}; @@ -107,6 +108,8 @@ $has_opt = 1; print "$INCLUDEDIR\n"; } elsif ($arg eq "--libdir") { $has_opt = 1; print "$LIBDIR\n"; +} elsif ($arg eq "--cflags") { +$has_opt = 1; print "-I$INCLUDEDIR $CFLAGS\n"; } elsif ($arg eq "--cxxflags") { $has_opt = 1; print "-I$INCLUDEDIR $CXXFLAGS\n"; } elsif ($arg eq "--ldflags") { @@ -178,6 +181,7 @@ --bindir Directory containing LLVM executables. --includedir Directory containing LLVM headers. --libdir Directory containing LLVM libraries. + --cflags C compiler flags for files that include LLVM headers. --cxxflags C++ compiler flags for files that include LLVM headers. --ldflags Print Linker flags. --libs Libraries needed to link against LLVM components. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp
>>> + if (getTypeID() == Type::PointerTyID) >>> +return isa(Ty); >>>return false; // Other types have no identity values >>> } >> >> What is Type::canLosslesslyBitCastTo used by now? Can we just >> eliminate it? > > InstCombine. -raise is now the only pass using it. I added a note to PR1072 so that it is removed when -raise is. >> >> >>> +FunctionType::ParameterAttributes >>> +FunctionType::getParamAttrs(unsigned Idx) const { >>> + if (!ParamAttrs) >>> +return ParameterAttributes(0); >>> + if (Idx > ParamAttrs->size()) >>> +return ParameterAttributes(0); >>> + return (*ParamAttrs)[Idx]; >>> +} >> >> Why does this map an out-of-range index onto attr 0? Shouldn't this >> be an assert? > > No, I'm trying to save space. If you don't set any attributes or don't > set them on all the parameters then it isn't an error, you just get > "none Set". In a subsequent patch I made this clear by returning > NoAttributeSet enum (has value 0). > > This saves space by not requiring the ParamAttrs vector to have an > entry > for each parameter and not requiring it to even be allocated if there > aren't any parameter attributes. Ah, cool! Thanks Reid, -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.583 -> 1.584 --- Log message: this final call to canLosslesslyBitCastTo is dead, because ValueRequiresCast is only called on integers. --- Diffs of the changes: (+0 -4) InstructionCombining.cpp |4 1 files changed, 4 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.583 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.584 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.583 Fri Jan 5 20:09:32 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Jan 5 20:11:56 2007 @@ -388,10 +388,6 @@ const Type *Ty, TargetData *TD) { if (V->getType() == Ty || isa(V)) return false; - // If this is a noop cast, it isn't real codegen. - if (V->getType()->canLosslesslyBitCastTo(Ty)) -return false; - // If this is another cast that can be eliminated, it isn't codegen either. if (const CastInst *CI = dyn_cast(V)) if (isEliminableCastPair(CI, opcode, Ty, TD)) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.582 -> 1.583 --- Log message: simplify some more code now that there are not multiple different integer types of the same size --- Diffs of the changes: (+4 -8) InstructionCombining.cpp | 12 1 files changed, 4 insertions(+), 8 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.582 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.583 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.582 Fri Jan 5 19:45:59 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Jan 5 20:09:32 2007 @@ -7211,13 +7211,9 @@ // Check to see if we are changing the return type... if (OldRetTy != FT->getReturnType()) { -if (Callee->isExternal() && -!Caller->use_empty() && -!(OldRetTy->canLosslesslyBitCastTo(FT->getReturnType()) || - (isa(FT->getReturnType()) && - TD->getIntPtrType()->canLosslesslyBitCastTo(OldRetTy))) -) - return false; // Cannot transform this return value... +if (Callee->isExternal() && !Caller->use_empty() && +OldRetTy != FT->getReturnType()) + return false; // Cannot transform this return value. // If the callsite is an invoke instruction, and the return value is used by // a PHI node in a successor, we cannot change the return type of the call @@ -7242,7 +7238,7 @@ const Type *ActTy = (*AI)->getType(); ConstantInt *c = dyn_cast(*AI); //Either we can cast directly, or we can upconvert the argument -bool isConvertible = ActTy->canLosslesslyBitCastTo(ParamTy) || +bool isConvertible = ActTy == ParamTy || (ParamTy->isIntegral() && ActTy->isIntegral() && ParamTy->getPrimitiveSize() >= ActTy->getPrimitiveSize()) || (c && ParamTy->getPrimitiveSize() >= ActTy->getPrimitiveSize() && ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] Patch to provide --cflags option in llvm-config
Hello, This is a patch to provide --cflags option in llvm-config. Based on the mechanism for providing --cxxflags. -Chandler Carruth llvm-config_cflags.patch Description: Binary data ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.581 -> 1.582 --- Log message: eliminate some uses of canLosslesslyBitCastTo, this actually makes the code stronger, by nuking relational pointer comparisons with casts. --- Diffs of the changes: (+14 -15) InstructionCombining.cpp | 29 ++--- 1 files changed, 14 insertions(+), 15 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.581 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.582 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.581 Fri Jan 5 01:36:08 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Jan 5 19:45:59 2007 @@ -5133,25 +5133,22 @@ return NI; // Test to see if the operands of the icmp are casted versions of other - // values. If the cast can be stripped off both arguments, we do so now. - if (CastInst *CI = dyn_cast(Op0)) { -Value *CastOp0 = CI->getOperand(0); -if (CI->isLosslessCast() && I.isEquality() && -(isa(Op1) || isa(Op1))) { + // values. If the ptr->ptr cast can be stripped off both arguments, we do so + // now. + if (BitCastInst *CI = dyn_cast(Op0)) { +if (isa(Op0->getType()) && +(isa(Op1) || isa(Op1))) { // We keep moving the cast from the left operand over to the right // operand, where it can often be eliminated completely. - Op0 = CastOp0; + Op0 = CI->getOperand(0); - // If operand #1 is a cast instruction, see if we can eliminate it as - // well. - if (CastInst *CI2 = dyn_cast(Op1)) { -Value *CI2Op0 = CI2->getOperand(0); -if (CI2Op0->getType()->canLosslesslyBitCastTo(Op0->getType())) - Op1 = CI2Op0; - } + // If operand #1 is a bitcast instruction, it must also be a ptr->ptr cast + // so eliminate it as well. + if (BitCastInst *CI2 = dyn_cast(Op1)) +Op1 = CI2->getOperand(0); // If Op1 is a constant, we can fold the cast into the constant. - if (Op1->getType() != Op0->getType()) + if (Op0->getType() != Op1->getType()) if (Constant *Op1C = dyn_cast(Op1)) { Op1 = ConstantExpr::getBitCast(Op1C, Op0->getType()); } else { @@ -5160,7 +5157,9 @@ } return new ICmpInst(I.getPredicate(), Op0, Op1); } - + } + + if (isa(Op0)) { // Handle the special case of: icmp (cast bool to X), // This comes up when you have code like // int X = A < B; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Changes in directory llvm/lib/Transforms/Scalar: LoopStrengthReduce.cpp updated: 1.103 -> 1.104 --- Log message: no need to worry about int vs uint any more. --- Diffs of the changes: (+1 -2) LoopStrengthReduce.cpp |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.103 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.104 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.103 Sat Dec 30 23:48:39 2006 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Fri Jan 5 19:37:35 2007 @@ -900,8 +900,7 @@ IE = SI->second.IVs.end(); II != IE; ++II) // FIXME: Only handle base == 0 for now. // Only reuse previous IV if it would not require a type conversion. -if (isZero(II->Base) && -II->Base->getType()->canLosslesslyBitCastTo(Ty)) { +if (isZero(II->Base) && II->Base->getType() == Ty) { IV = *II; return Scale; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] PIC Codegen patch for review
Hello, Everyone. Please find patch, which will enable PIC codegen for x86/Linux target (I think it can be easily adopted to any target, which uses GOT-style relocations). It was tested on some small applications from llvm-test and was running fine. I hope to test it on huge apps soon. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. diff -r 744250c38a89 lib/Target/X86/X86ATTAsmPrinter.cpp --- a/lib/Target/X86/X86ATTAsmPrinter.cpp Sat Jan 06 00:23:53 2007 + +++ b/lib/Target/X86/X86ATTAsmPrinter.cpp Thu Jan 04 16:06:56 2007 +0300 @@ -19,6 +19,7 @@ #include "X86MachineFunctionInfo.h" #include "X86TargetMachine.h" #include "X86TargetAsmInfo.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/CallingConv.h" #include "llvm/Module.h" #include "llvm/Support/Mangler.h" @@ -28,6 +29,21 @@ using namespace llvm; using namespace llvm; STATISTIC(EmittedInsts, "Number of machine instrs printed"); + +static std::string computePICLabel(unsigned fnNumber, + const X86Subtarget* Subtarget) +{ + std::string label; + + if (Subtarget->isTargetDarwin()) { +label = "\"L" + utostr_32(fnNumber) + "$pb\""; + } else if (Subtarget->isTargetELF()) { +label = "llvm$" + utostr_32(fnNumber) + "$piclabel"; + } else +assert(0 && "Don't know how to print PIC label!\n"); + + return label; +} /// getSectionForFunction - Return the section that we should emit the /// specified function body into. @@ -193,9 +209,14 @@ void X86ATTAsmPrinter::printOperand(cons if (!isMemOp) O << '$'; O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() << "_" << MO.getJumpTableIndex(); -if (X86PICStyle == PICStyle::Stub && -TM.getRelocationModel() == Reloc::PIC_) - O << "-\"L" << getFunctionNumber() << "$pb\""; + +if (TM.getRelocationModel() == Reloc::PIC_) { + if (Subtarget->isPICStyleStub()) +O << "-\"L" << getFunctionNumber() << "$pb\""; + else if (Subtarget->isPICStyleGOT()) +O << "@GOTOFF"; +} + if (isMemOp && Subtarget->is64Bit() && !NotRIPRel) O << "(%rip)"; return; @@ -205,9 +226,14 @@ void X86ATTAsmPrinter::printOperand(cons if (!isMemOp) O << '$'; O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() << "_" << MO.getConstantPoolIndex(); -if (X86PICStyle == PICStyle::Stub && -TM.getRelocationModel() == Reloc::PIC_) - O << "-\"L" << getFunctionNumber() << "$pb\""; + +if (TM.getRelocationModel() == Reloc::PIC_) { + if (Subtarget->isPICStyleStub()) +O << "-\"L" << getFunctionNumber() << "$pb\""; + if (Subtarget->isPICStyleGOT()) +O << "@GOTOFF"; +} + int Offset = MO.getOffset(); if (Offset > 0) O << "+" << Offset; @@ -231,8 +257,7 @@ void X86ATTAsmPrinter::printOperand(cons X86SharedAsmPrinter::decorateName(Name, GV); -if (X86PICStyle == PICStyle::Stub && -TM.getRelocationModel() != Reloc::Static) { +if (Subtarget->isPICStyleStub()) { // Link-once, External, or Weakly-linked global variables need // non-lazily-resolved stubs if (isExt) { @@ -258,6 +283,9 @@ void X86ATTAsmPrinter::printOperand(cons O << "__imp_"; } O << Name; + + if (Subtarget->isPICStyleGOT() && isCallOp && isa(GV)) +O << "@PLT"; } if (GV->hasExternalWeakLinkage()) @@ -268,32 +296,53 @@ void X86ATTAsmPrinter::printOperand(cons O << "+" << Offset; else if (Offset < 0) O << Offset; - -if (isMemOp && Subtarget->is64Bit()) { - if (isExt && TM.getRelocationModel() != Reloc::Static) -O << "@GOTPCREL(%rip)"; - else if (!NotRIPRel) + +if (isMemOp) { + if (isExt) { +if (Subtarget->isPICStyleGOT()) { + O << "@GOT"; +} else if (Subtarget->is64Bit() && Subtarget->isPICStyleGOTPCRel()) { + O << "@GOTPCREL(%rip)"; +} + } else if (Subtarget->is64Bit() && !NotRIPRel) // Use rip when possible to reduce code size, except when index or // base register are also part of the address. e.g. // foo(%rip)(%rcx,%rax,4) is not legal -O << "(%rip)"; +O << "(%rip)"; + else if (Subtarget->isPICStyleGOT()) +O << "@GOTOFF"; } return; } case MachineOperand::MO_ExternalSymbol: { bool isCallOp = Modifier && !strcmp(Modifier, "call"); -if (isCallOp && -X86PICStyle == PICStyle::Stub && -TM.getRelocationModel() != Reloc::Static) { - std::string Name(TAI->getGlobalPrefix()); - Name += MO.getSymbolName(); +std::string Name(TAI->getGlobalPrefix()); +Name += MO.getSymbolName(); +if (isCallOp && Subtarget->isPICStyleStub()) { FnStubs.insert(Name); O << "L" << Name << "$stub"; return; } if (!isCallOp) O << '$'; -O <<
[llvm-commits] CVS: llvm/lib/Target/X86/README.txt
Changes in directory llvm/lib/Target/X86: README.txt updated: 1.149 -> 1.150 --- Log message: new note --- Diffs of the changes: (+5 -0) README.txt |5 + 1 files changed, 5 insertions(+) Index: llvm/lib/Target/X86/README.txt diff -u llvm/lib/Target/X86/README.txt:1.149 llvm/lib/Target/X86/README.txt:1.150 --- llvm/lib/Target/X86/README.txt:1.149Wed Jan 3 13:12:31 2007 +++ llvm/lib/Target/X86/README.txt Fri Jan 5 19:30:45 2007 @@ -761,3 +761,8 @@ return 0; } +//===-===// + +We should inline lrintf and probably other libc functions. + +//===-===// ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] Fix targets with no target C++ source file
Here is the patch that I installed. - Devang fix_out_cxx_object_file.diff Description: Binary data ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.cpp UpgradeParser.cpp.cvs UpgradeParser.y.cvs
Changes in directory llvm/tools/llvm-upgrade: UpgradeParser.cpp updated: 1.35 -> 1.36 UpgradeParser.cpp.cvs updated: 1.33 -> 1.34 UpgradeParser.y.cvs updated: 1.32 -> 1.33 --- Log message: Regenerate --- Diffs of the changes: (+6 -6) UpgradeParser.cpp |4 ++-- UpgradeParser.cpp.cvs |4 ++-- UpgradeParser.y.cvs |4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp:1.35 llvm/tools/llvm-upgrade/UpgradeParser.cpp:1.36 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp:1.35 Fri Jan 5 11:20:02 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp Fri Jan 5 18:23:53 2007 @@ -3357,7 +3357,7 @@ case 167: #line 1162 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { -*(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; +*(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy(); (yyval.String) = (yyvsp[-6].String); ;} @@ -3366,7 +3366,7 @@ case 168: #line 1167 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { -*(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; +*(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy(); (yyval.String) = (yyvsp[-6].String); ;} Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.33 llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.34 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.33 Fri Jan 5 11:20:02 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Fri Jan 5 18:23:53 2007 @@ -3357,7 +3357,7 @@ case 167: #line 1162 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { -*(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; +*(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy(); (yyval.String) = (yyvsp[-6].String); ;} @@ -3366,7 +3366,7 @@ case 168: #line 1167 "/proj/llvm/llvm-3/tools/llvm-upgrade/UpgradeParser.y" { -*(yyvsp[-6].String) += "(" + *(yyvsp[-5].String) + "," + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; +*(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const).cnst + "," + *(yyvsp[-1].Const).cnst + ")"; delete (yyvsp[-5].String); (yyvsp[-3].Const).destroy(); (yyvsp[-1].Const).destroy(); (yyval.String) = (yyvsp[-6].String); ;} Index: llvm/tools/llvm-upgrade/UpgradeParser.y.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.32 llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.33 --- llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.32Fri Jan 5 11:20:02 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y.cvs Fri Jan 5 18:23:53 2007 @@ -1160,12 +1160,12 @@ $$ = $1; } | ICMP IPredicates '(' ConstVal ',' ConstVal ')' { -*$1 += "(" + *$2 + "," + *$4.cnst + "," + *$6.cnst + ")"; +*$1 += " " + *$2 + " (" + *$4.cnst + "," + *$6.cnst + ")"; delete $2; $4.destroy(); $6.destroy(); $$ = $1; } | FCMP FPredicates '(' ConstVal ',' ConstVal ')' { -*$1 += "(" + *$2 + "," + *$4.cnst + "," + *$6.cnst + ")"; +*$1 += " " + *$2 + " (" + *$4.cnst + "," + *$6.cnst + ")"; delete $2; $4.destroy(); $6.destroy(); $$ = $1; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Assembler/2007-01-05-Cmp-ConstExpr.ll
Changes in directory llvm/test/Regression/Assembler: 2007-01-05-Cmp-ConstExpr.ll added (r1.1) --- Log message: Test Case for PR1080: http://llvm.org/PR1080 . --- Diffs of the changes: (+24 -0) 2007-01-05-Cmp-ConstExpr.ll | 24 1 files changed, 24 insertions(+) Index: llvm/test/Regression/Assembler/2007-01-05-Cmp-ConstExpr.ll diff -c /dev/null llvm/test/Regression/Assembler/2007-01-05-Cmp-ConstExpr.ll:1.1 *** /dev/null Fri Jan 5 18:22:48 2007 --- llvm/test/Regression/Assembler/2007-01-05-Cmp-ConstExpr.ll Fri Jan 5 18:22:38 2007 *** *** 0 --- 1,24 + ; Test Case for PR1080 + ; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f + + %str = internal constant [4 x sbyte] c"-ga\00"; <[4 x sbyte]*> [#uses=5] + + int %main(int %argc, sbyte** %argv) { + entry: + %tmp65 = getelementptr sbyte** %argv, int 1 ; [#uses=1] + %tmp66 = load sbyte** %tmp65; [#uses=3] + br bool icmp ne ( + uint sub ( + uint ptrtoint ( + sbyte* getelementptr ([4 x sbyte]* %str, int 0, long 1) + to uint), + uint ptrtoint ([4 x sbyte]* %str to uint) + ), + uint 1), + label %exit_1, label %exit_2 + + exit_1: + ret int 0; + exit_2: + ret int 1; + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.y
Changes in directory llvm/tools/llvm-upgrade: UpgradeParser.y updated: 1.33 -> 1.34 --- Log message: For PR1080: http://llvm.org/PR1080 : Emit the correct syntax for icmp and fcmp constant expressions. The predicate goes outside the parentheses not inside. This was a change made in the assembler without the corresponding change made in llvm-upgrade. --- Diffs of the changes: (+2 -2) UpgradeParser.y |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.y diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.33 llvm/tools/llvm-upgrade/UpgradeParser.y:1.34 --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.33Fri Jan 5 11:18:58 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y Fri Jan 5 18:12:05 2007 @@ -1160,12 +1160,12 @@ $$ = $1; } | ICMP IPredicates '(' ConstVal ',' ConstVal ')' { -*$1 += "(" + *$2 + "," + *$4.cnst + "," + *$6.cnst + ")"; +*$1 += " " + *$2 + " (" + *$4.cnst + "," + *$6.cnst + ")"; delete $2; $4.destroy(); $6.destroy(); $$ = $1; } | FCMP FPredicates '(' ConstVal ',' ConstVal ')' { -*$1 += "(" + *$2 + "," + *$4.cnst + "," + *$6.cnst + ")"; +*$1 += " " + *$2 + " (" + *$4.cnst + "," + *$6.cnst + ")"; delete $2; $4.destroy(); $6.destroy(); $$ = $1; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.245 -> 1.246 --- Log message: setSetCCIsExpensive is gone. --- Diffs of the changes: (+0 -2) PPCISelLowering.cpp |2 -- 1 files changed, 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.245 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.246 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.245 Fri Dec 15 08:32:57 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Fri Jan 5 17:42:53 2007 @@ -36,8 +36,6 @@ PPCTargetLowering::PPCTargetLowering(PPCTargetMachine &TM) : TargetLowering(TM), PPCSubTarget(*TM.getSubtargetImpl()) { - // Fold away setcc operations if possible. - setSetCCIsExpensive(); setPow2DivIsCheap(); // Use _setjmp/_longjmp instead of setjmp/longjmp. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.453 -> 1.454 --- Log message: Expand fcopysign to the bitwise sequence if select is marked as expensive. --- Diffs of the changes: (+6 -4) LegalizeDAG.cpp | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.453 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.454 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.453 Fri Jan 5 15:31:51 2007 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Jan 5 17:33:44 2007 @@ -2354,11 +2354,13 @@ break; case TargetLowering::Legal: break; case TargetLowering::Expand: { - // If this target supports fabs/fneg natively, do this efficiently. - if (TLI.getOperationAction(ISD::FABS, Tmp1.getValueType()) == - TargetLowering::Legal && + // If this target supports fabs/fneg natively and select is cheap, + // do this efficiently. + if (!TLI.isSelectExpensive() && + TLI.getOperationAction(ISD::FABS, Tmp1.getValueType()) == + TargetLowering::Legal && TLI.getOperationAction(ISD::FNEG, Tmp1.getValueType()) == - TargetLowering::Legal) { + TargetLowering::Legal) { // Get the sign bit of the RHS. MVT::ValueType IVT = Tmp2.getValueType() == MVT::f32 ? MVT::i32 : MVT::i64; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h
Changes in directory llvm/include/llvm/Target: TargetLowering.h updated: 1.95 -> 1.96 --- Log message: - Remove isSetCCExpensive() etc. These are no longer used. - Add isSelectExpensive() etc. It's used to tell codegen that select is expensive for a given target, avoid using it if possible. Currently it's only used to expand FCOPYSIGN. --- Diffs of the changes: (+8 -10) TargetLowering.h | 18 -- 1 files changed, 8 insertions(+), 10 deletions(-) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.95 llvm/include/llvm/Target/TargetLowering.h:1.96 --- llvm/include/llvm/Target/TargetLowering.h:1.95 Sat Dec 30 23:23:18 2006 +++ llvm/include/llvm/Target/TargetLowering.h Fri Jan 5 17:31:08 2007 @@ -89,9 +89,9 @@ /// codegen. bool usesGlobalOffsetTable() const { return UsesGlobalOffsetTable; } - /// isSetCCExpensive - Return true if the setcc operation is expensive for + /// isSelectExpensive - Return true if the select operation is expensive for /// this target. - bool isSetCCExpensive() const { return SetCCIsExpensive; } + bool isSelectExpensive() const { return SelectIsExpensive; } /// isIntDivCheap() - Return true if integer divide is usually cheaper than /// a sequence of several shifts, adds, and multiplies for this target. @@ -608,10 +608,9 @@ StackPointerRegisterToSaveRestore = R; } - /// setSetCCIxExpensive - This is a short term hack for targets that codegen - /// setcc as a conditional branch. This encourages the code generator to fold - /// setcc operations into other operations if possible. - void setSetCCIsExpensive() { SetCCIsExpensive = true; } + /// SelectIsExpensive - Tells the code generator not to expand operations + /// into sequences that use the select operations if possible. + void setSelectIsExpensive() { SelectIsExpensive = true; } /// setIntDivIsCheap - Tells the code generator that integer divide is /// expensive, and if possible, should be replaced by an alternate sequence @@ -890,10 +889,9 @@ OutOfRangeShiftAmount ShiftAmtHandling; - /// SetCCIsExpensive - This is a short term hack for targets that codegen - /// setcc as a conditional branch. This encourages the code generator to fold - /// setcc operations into other operations if possible. - bool SetCCIsExpensive; + /// SelectIsExpensive - Tells the code generator not to expand operations + /// into sequences that use the select operations if possible. + bool SelectIsExpensive; /// IntDivIsCheap - Tells the code generator not to expand integer divides by /// constants into a sequence of muls, adds, and shifts. This is a hack until ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/Pass.cpp PassManager.cpp
Changes in directory llvm/lib/VMCore: Pass.cpp updated: 1.82 -> 1.83 PassManager.cpp updated: 1.111 -> 1.112 --- Log message: 1) Remove old AnalysisResolver. 2) Rename AnalysisResolver_New as AnalysisResolver --- Diffs of the changes: (+9 -16) Pass.cpp|9 + PassManager.cpp | 16 2 files changed, 9 insertions(+), 16 deletions(-) Index: llvm/lib/VMCore/Pass.cpp diff -u llvm/lib/VMCore/Pass.cpp:1.82 llvm/lib/VMCore/Pass.cpp:1.83 --- llvm/lib/VMCore/Pass.cpp:1.82 Fri Jan 5 14:16:23 2007 +++ llvm/lib/VMCore/Pass.cppFri Jan 5 16:47:07 2007 @@ -23,13 +23,6 @@ using namespace llvm; //===--===// -// AnalysisResolver Class Implementation -// - -AnalysisResolver::~AnalysisResolver() { -} - -//===--===// // Pass Implementation // @@ -37,7 +30,7 @@ ModulePass::~ModulePass() { } bool Pass::mustPreserveAnalysisID(const PassInfo *AnalysisID) const { - return Resolver_New->getAnalysisToUpdate(AnalysisID, true) != 0; + return Resolver->getAnalysisToUpdate(AnalysisID, true) != 0; } // dumpPassStructure - Implement the -debug-passes=Structure option Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.111 llvm/lib/VMCore/PassManager.cpp:1.112 --- llvm/lib/VMCore/PassManager.cpp:1.111 Fri Jan 5 14:16:23 2007 +++ llvm/lib/VMCore/PassManager.cpp Fri Jan 5 16:47:07 2007 @@ -463,7 +463,7 @@ // P is a immutable pass and it will be managed by this // top level manager. Set up analysis resolver to connect them. - AnalysisResolver_New *AR = new AnalysisResolver_New(*this); + AnalysisResolver *AR = new AnalysisResolver(*this); P->setResolver(AR); initializeAnalysisImpl(P); addImmutablePass(IP); @@ -571,7 +571,7 @@ // P is a immutable pass and it will be managed by this // top level manager. Set up analysis resolver to connect them. - AnalysisResolver_New *AR = new AnalysisResolver_New(*this); + AnalysisResolver *AR = new AnalysisResolver(*this); P->setResolver(AR); initializeAnalysisImpl(P); addImmutablePass(IP); @@ -873,7 +873,7 @@ // This manager is going to manage pass P. Set up analysis resolver // to connect them. - AnalysisResolver_New *AR = new AnalysisResolver_New(*this); + AnalysisResolver *AR = new AnalysisResolver(*this); P->setResolver(AR); if (ProcessAnalysis) { @@ -956,7 +956,7 @@ Pass *Impl = findAnalysisPass(*I, true); if (Impl == 0) assert(0 && "Analysis used but not available!"); -AnalysisResolver_New *AR = P->getResolver(); +AnalysisResolver *AR = P->getResolver(); AR->addAnalysisImplsPair(*I, Impl); } } @@ -1031,7 +1031,7 @@ //===--===// // NOTE: Is this the right place to define this method ? // getAnalysisToUpdate - Return an analysis result or null if it doesn't exist -Pass *AnalysisResolver_New::getAnalysisToUpdate(AnalysisID ID, bool dir) const { +Pass *AnalysisResolver::getAnalysisToUpdate(AnalysisID ID, bool dir) const { return PM.findAnalysisPass(ID, dir); } @@ -1154,7 +1154,7 @@ FPM->setTopLevelManager(FPM); PMDataManager *PMD = dynamic_cast(FPM); - AnalysisResolver_New *AR = new AnalysisResolver_New(*PMD); + AnalysisResolver *AR = new AnalysisResolver(*PMD); FPM->setResolver(AR); MP = P; @@ -1213,7 +1213,7 @@ // This top level manager is going to manage activeManager. // Set up analysis resolver to connect them. -AnalysisResolver_New *AR = new AnalysisResolver_New(*this); +AnalysisResolver *AR = new AnalysisResolver(*this); activeManager->setResolver(AR); addPassManager(activeManager); @@ -1520,7 +1520,7 @@ // This top level manager is going to manage activeManager. // Set up analysis resolver to connect them. -AnalysisResolver_New *AR = new AnalysisResolver_New(*this); +AnalysisResolver *AR = new AnalysisResolver(*this); activeManager->setResolver(AR); addPassManager(activeManager); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Pass.h PassAnalysisSupport.h
Changes in directory llvm/include/llvm: Pass.h updated: 1.69 -> 1.70 PassAnalysisSupport.h updated: 1.27 -> 1.28 --- Log message: 1) Remove old AnalysisResolver. 2) Rename AnalysisResolver_New as AnalysisResolver --- Diffs of the changes: (+15 -46) Pass.h| 12 ++-- PassAnalysisSupport.h | 49 + 2 files changed, 15 insertions(+), 46 deletions(-) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.69 llvm/include/llvm/Pass.h:1.70 --- llvm/include/llvm/Pass.h:1.69 Fri Jan 5 14:16:23 2007 +++ llvm/include/llvm/Pass.hFri Jan 5 16:47:07 2007 @@ -49,7 +49,7 @@ class BasicBlockPassManager; class FunctionPassManagerT; class ModulePassManager; -class AnalysisResolver_New; +class AnalysisResolver; // AnalysisID - Use the PassInfo to identify a pass... typedef const PassInfo* AnalysisID; @@ -60,7 +60,7 @@ /// constrained passes described below. /// class Pass { - AnalysisResolver_New *Resolver_New; // Used to resolve analysis + AnalysisResolver *Resolver; // Used to resolve analysis const PassInfo *PassInfoCache; // AnalysisImpls - This keeps track of which passes implement the interfaces @@ -71,7 +71,7 @@ void operator=(const Pass&); // DO NOT IMPLEMENT Pass(const Pass &); // DO NOT IMPLEMENT public: - Pass() : Resolver_New(0), PassInfoCache(0) {} + Pass() : Resolver(0), PassInfoCache(0) {} virtual ~Pass() {} // Destructor is virtual so we can be subclassed /// getPassName - Return a nice clean name for a pass. This usually @@ -104,9 +104,9 @@ void print(std::ostream *O, const Module *M) const { if (O) print(*O, M); } void dump() const; // dump - call print(std::cerr, 0); - // Access AnalysisResolver_New - inline void setResolver(AnalysisResolver_New *AR) { Resolver_New = AR; } - inline AnalysisResolver_New *getResolver() { return Resolver_New; } + // Access AnalysisResolver + inline void setResolver(AnalysisResolver *AR) { Resolver = AR; } + inline AnalysisResolver *getResolver() { return Resolver; } /// getAnalysisUsage - This function should be overriden by passes that need /// analysis information to do their job. If a pass specifies that it uses a Index: llvm/include/llvm/PassAnalysisSupport.h diff -u llvm/include/llvm/PassAnalysisSupport.h:1.27 llvm/include/llvm/PassAnalysisSupport.h:1.28 --- llvm/include/llvm/PassAnalysisSupport.h:1.27Fri Jan 5 14:16:23 2007 +++ llvm/include/llvm/PassAnalysisSupport.h Fri Jan 5 16:47:07 2007 @@ -106,12 +106,12 @@ // the pass. // class PMDataManager; -class AnalysisResolver_New { +class AnalysisResolver { private: - AnalysisResolver_New(); // DO NOT IMPLEMENT + AnalysisResolver(); // DO NOT IMPLEMENT public: - AnalysisResolver_New(PMDataManager &P) : PM(P) { } + AnalysisResolver(PMDataManager &P) : PM(P) { } inline PMDataManager &getPMDataManager() { return PM; } @@ -137,7 +137,7 @@ // AnalysisImpls - This keeps track of which passes implements the interfaces // that are required by the current pass (to implement getAnalysis()). - // NOTE : Remove AnalysisImpls from class Pass, when AnalysisResolver_New + // NOTE : Remove AnalysisImpls from class Pass, when AnalysisResolver // replaces AnalysisResolver std::vector > AnalysisImpls; @@ -146,37 +146,6 @@ PMDataManager &PM; }; -//===--===// -// AnalysisResolver - Simple interface implemented by PassManager objects that -// is used to pull analysis information out of them. -// -struct AnalysisResolver { - virtual ~AnalysisResolver(); - virtual Pass *getAnalysisOrNullUp(AnalysisID ID) const = 0; - virtual Pass *getAnalysisOrNullDown(AnalysisID ID) const = 0; - virtual void addPass(ImmutablePass *IP, AnalysisUsage &AU) = 0; - Pass *getAnalysis(AnalysisID ID) const { -Pass *Result = getAnalysisOrNullUp(ID); -assert(Result && "Pass has an incorrect analysis uses set!"); -return Result; - } - - // getAnalysisToUpdate - Return an analysis result or null if it doesn't exist - Pass *getAnalysisToUpdate(AnalysisID ID) const { -return getAnalysisOrNullUp(ID); - } - - // Methods for introspecting into pass manager objects... - virtual unsigned getDepth() const = 0; - virtual unsigned getNumContainedPasses() const = 0; - virtual const Pass *getContainedPass(unsigned N) const = 0; - - virtual void markPassUsed(AnalysisID P, Pass *User) = 0; - - void startPass(Pass *P) {} - void endPass(Pass *P) {} -}; - /// getAnalysisToUpdate() - This function is used by subclasses /// to get to the analysis information that might be around that needs to be /// updated. This is different than getAnalysis in that it can fail (ie the @@ -187,12 +156,12 @@ /// template AnalysisType *Pass::getAnalysisToUpdate() const { - assert(Resolver_New && "Pass not resident in a PassManager object!"); + assert(Resolver &&
[llvm-commits] CVS: llvm/tools/llvm-upgrade/Makefile
Changes in directory llvm/tools/llvm-upgrade: Makefile updated: 1.4 -> 1.5 --- Log message: Fix dependencies. The lexer depends on the grammar for the UpgradeParser.h file so make it depend on the .y file as well. This ensures that in parallel builds the lexer is built after bison runs. --- Diffs of the changes: (+1 -2) Makefile |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/tools/llvm-upgrade/Makefile diff -u llvm/tools/llvm-upgrade/Makefile:1.4 llvm/tools/llvm-upgrade/Makefile:1.5 --- llvm/tools/llvm-upgrade/Makefile:1.4Fri Dec 1 14:36:40 2006 +++ llvm/tools/llvm-upgrade/MakefileFri Jan 5 16:03:42 2007 @@ -29,5 +29,4 @@ valgrind: valgrind ../../Debug/bin/llvm-upgrade -o /dev/null -f $(TESTCASE) -$(PROJ_SRC_DIR)/UpgradeParser.h: $(PROJ_SRC_DIR)/UpgradeParser.y -$(PROJ_SRC_DIR)/UpgradeParser.cpp: $(PROJ_SRC_DIR)/UpgradeParser.y +$(ObjDir)/UpgradeLexer.o: $(PROJ_SRC_DIR)/UpgradeParser.y $(PROJ_SRC_DIR)/UpgradeParser.h ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll
Changes in directory llvm/test/Regression/CodeGen/X86: sse-fcopysign.ll updated: 1.2 -> 1.3 --- Log message: Update test case. --- Diffs of the changes: (+0 -2) sse-fcopysign.ll |2 -- 1 files changed, 2 deletions(-) Index: llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll diff -u llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll:1.2 llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll:1.3 --- llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll:1.2 Fri Jan 5 10:45:06 2007 +++ llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll Fri Jan 5 15:53:15 2007 @@ -1,6 +1,4 @@ ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 && -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | \ -; RUN:grep pslldq | wc -l | grep 1 && ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not getp test define float %test1(float %a, float %b) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Feature/globalredefinition3.ll
Changes in directory llvm/test/Feature: globalredefinition3.ll updated: 1.1 -> 1.2 --- Log message: For PR1077: http://llvm.org/PR1077 : Remove the XFAIL now that global redefinitions are not permitted. --- Diffs of the changes: (+1 -2) globalredefinition3.ll |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/test/Feature/globalredefinition3.ll diff -u llvm/test/Feature/globalredefinition3.ll:1.1 llvm/test/Feature/globalredefinition3.ll:1.2 --- llvm/test/Feature/globalredefinition3.ll:1.1Fri Jan 5 11:25:12 2007 +++ llvm/test/Feature/globalredefinition3.llFri Jan 5 15:51:57 2007 @@ -1,7 +1,6 @@ ; When PR1067 is fixed, this should not be XFAIL any more. ; RUN: llvm-as < %s -o /dev/null -f 2>&1 | \ -; RUN: grep 'Cannot redefine' -; XFAIL: * +; RUN: grep "Redefinition of global variable named 'B'" ; Test forward references and redefinitions of globals ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y
Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.299 -> 1.300 --- Log message: For PR1077: http://llvm.org/PR1077 : Disallow merging of dupliate global variables. It is now illegal to declare or define two global variables of the same name and same type. llvm-gcc3 is dead in 2.0 and llvm-gcc4 doesn't have that problem nor need the hack. --- Diffs of the changes: (+7 -26) llvmAsmParser.y | 33 +++-- 1 files changed, 7 insertions(+), 26 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.299 llvm/lib/AsmParser/llvmAsmParser.y:1.300 --- llvm/lib/AsmParser/llvmAsmParser.y:1.299Fri Jan 5 11:06:19 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Fri Jan 5 15:50:38 2007 @@ -635,8 +635,8 @@ assert(inFunctionScope() && "Must be in function scope!"); SymbolTable &ST = CurFun.CurrentFunction->getSymbolTable(); if (ST.lookup(V->getType(), Name)) { - GenerateError("Redefinition of value named '" + Name + "' in the '" + - V->getType()->getDescription() + "' type plane!"); + GenerateError("Redefinition of value '" + Name + "' of type '" + + V->getType()->getDescription() + "'!"); return; } @@ -687,32 +687,13 @@ } // If this global has a name, check to see if there is already a definition - // of this global in the module. If so, merge as appropriate. Note that - // this is really just a hack around problems in the CFE. :( + // of this global in the module. If so, it is an error. if (!Name.empty()) { // We are a simple redefinition of a value, check to see if it is defined // the same as the old one. -if (GlobalVariable *EGV = -CurModule.CurrentModule->getGlobalVariable(Name, Ty)) { - // We are allowed to redefine a global variable in two circumstances: - // 1. If at least one of the globals is uninitialized or - // 2. If both initializers have the same value. - // - if (!EGV->hasInitializer() || !Initializer || - EGV->getInitializer() == Initializer) { - -// Make sure the existing global version gets the initializer! Make -// sure that it also gets marked const if the new version is. -if (Initializer && !EGV->hasInitializer()) - EGV->setInitializer(Initializer); -if (isConstantGlobal) - EGV->setConstant(true); -EGV->setLinkage(Linkage); -return EGV; - } - +if (CurModule.CurrentModule->getGlobalVariable(Name, Ty)) { GenerateError("Redefinition of global variable named '" + Name + - "' in the '" + Ty->getDescription() + "' type plane!"); + "' of type '" + Ty->getDescription() + "'!"); return 0; } } @@ -767,8 +748,8 @@ if (Existing == T) return true; // Yes, it's equal. // Any other kind of (non-equivalent) redefinition is an error. -GenerateError("Redefinition of type named '" + Name + "' in the '" + - T->getDescription() + "' type plane!"); +GenerateError("Redefinition of type named '" + Name + "' of type '" + + T->getDescription() + "'!"); } return false; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86ISelLowering.h X86InstrSSE.td
Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.312 -> 1.313 X86ISelLowering.h updated: 1.82 -> 1.83 X86InstrSSE.td updated: 1.175 -> 1.176 --- Log message: - FCOPYSIGN custom lowering bug. Clear the sign bit of operand 0 first before or'ing in the sign bit of operand 1. - Tweaking: rather than left shift the sign bit, fp_extend operand 1 first before taking its sign bit if its type is smaller than that of operand 0. --- Diffs of the changes: (+39 -21) X86ISelLowering.cpp | 51 +-- X86ISelLowering.h |6 ++ X86InstrSSE.td |3 --- 3 files changed, 39 insertions(+), 21 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.312 llvm/lib/Target/X86/X86ISelLowering.cpp:1.313 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.312 Fri Jan 5 02:32:24 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Fri Jan 5 15:37:56 2007 @@ -4127,9 +4127,18 @@ } SDOperand X86TargetLowering::LowerFCOPYSIGN(SDOperand Op, SelectionDAG &DAG) { + SDOperand Op0 = Op.getOperand(0); + SDOperand Op1 = Op.getOperand(1); MVT::ValueType VT = Op.getValueType(); - MVT::ValueType SrcVT = Op.getOperand(1).getValueType(); + MVT::ValueType SrcVT = Op1.getValueType(); const Type *SrcTy = MVT::getTypeForValueType(SrcVT); + + // If second operand is smaller, extend it first. + if (MVT::getSizeInBits(SrcVT) < MVT::getSizeInBits(VT)) { +Op1 = DAG.getNode(ISD::FP_EXTEND, VT, Op1); +SrcVT = VT; + } + // First get the sign bit of second operand. std::vector CV; if (SrcVT == MVT::f64) { @@ -4150,8 +4159,8 @@ Ops.push_back(DAG.getEntryNode()); Ops.push_back(CPIdx); Ops.push_back(DAG.getSrcValue(NULL)); - SDOperand Mask = DAG.getNode(X86ISD::LOAD_PACK, Tys, &Ops[0], Ops.size()); - SDOperand SignBit = DAG.getNode(X86ISD::FAND, SrcVT, Op.getOperand(1), Mask); + SDOperand Mask1 = DAG.getNode(X86ISD::LOAD_PACK, Tys, &Ops[0], Ops.size()); + SDOperand SignBit = DAG.getNode(X86ISD::FAND, SrcVT, Op1, Mask1); // Shift sign bit right or left if the two operands have different types. if (MVT::getSizeInBits(SrcVT) > MVT::getSizeInBits(VT)) { @@ -4162,18 +4171,33 @@ SignBit = DAG.getNode(ISD::BIT_CONVERT, MVT::v4f32, SignBit); SignBit = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::f32, SignBit, DAG.getConstant(0, getPointerTy())); - } else if (MVT::getSizeInBits(SrcVT) < MVT::getSizeInBits(VT)) { -// Op0 is MVT::f64, Op1 is MVT::f32. -SignBit = DAG.getNode(ISD::SCALAR_TO_VECTOR, MVT::v4f32, SignBit); -SignBit = DAG.getNode(X86ISD::FSHL, MVT::v4f32, SignBit, - DAG.getConstant(32, MVT::i32)); -SignBit = DAG.getNode(ISD::BIT_CONVERT, MVT::v2f64, SignBit); -SignBit = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::f64, SignBit, - DAG.getConstant(0, getPointerTy())); } - // Or the first operand with the sign bit. - return DAG.getNode(X86ISD::FOR, VT, Op.getOperand(0), SignBit); + // Clear first operand sign bit. + CV.clear(); + if (VT == MVT::f64) { +CV.push_back(ConstantFP::get(SrcTy, BitsToDouble(~(1ULL << 63; +CV.push_back(ConstantFP::get(SrcTy, 0.0)); + } else { +CV.push_back(ConstantFP::get(SrcTy, BitsToFloat(~(1U << 31; +CV.push_back(ConstantFP::get(SrcTy, 0.0)); +CV.push_back(ConstantFP::get(SrcTy, 0.0)); +CV.push_back(ConstantFP::get(SrcTy, 0.0)); + } + CS = ConstantStruct::get(CV); + CPIdx = DAG.getConstantPool(CS, getPointerTy(), 4); + Tys.clear(); + Tys.push_back(VT); + Tys.push_back(MVT::Other); + Ops.clear(); + Ops.push_back(DAG.getEntryNode()); + Ops.push_back(CPIdx); + Ops.push_back(DAG.getSrcValue(NULL)); + SDOperand Mask2 = DAG.getNode(X86ISD::LOAD_PACK, Tys, &Ops[0], Ops.size()); + SDOperand Val = DAG.getNode(X86ISD::FAND, VT, Op0, Mask2); + + // Or the value with the sign bit. + return DAG.getNode(X86ISD::FOR, VT, Val, SignBit); } SDOperand X86TargetLowering::LowerSETCC(SDOperand Op, SelectionDAG &DAG, @@ -5032,7 +5056,6 @@ case X86ISD::FAND: return "X86ISD::FAND"; case X86ISD::FOR:return "X86ISD::FOR"; case X86ISD::FXOR: return "X86ISD::FXOR"; - case X86ISD::FSHL: return "X86ISD::FSHL"; case X86ISD::FSRL: return "X86ISD::FSRL"; case X86ISD::FILD: return "X86ISD::FILD"; case X86ISD::FILD_FLAG: return "X86ISD::FILD_FLAG"; Index: llvm/lib/Target/X86/X86ISelLowering.h diff -u llvm/lib/Target/X86/X86ISelLowering.h:1.82 llvm/lib/Target/X86/X86ISelLowering.h:1.83 --- llvm/lib/Target/X86/X86ISelLowering.h:1.82 Fri Jan 5 01:55:56 2007 +++ llvm/lib/Target/X86/X86ISelLowering.h Fri Jan 5 15:37:56 2007 @@ -43,10 +43,8 @@ /// to X86::XORPS or X86::XORPD. FXOR, - /// FSHL, FSRL - Shift a floating point value (in SSE register) by n bits -
[llvm-commits] CVS: llvm/docs/LangRef.html
Changes in directory llvm/docs: LangRef.html updated: 1.187 -> 1.188 --- Log message: Add an example to the trunc instruction to clarify trunc to bool. Example provided by Baptiste Lepilleur. --- Diffs of the changes: (+2 -1) LangRef.html |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.187 llvm/docs/LangRef.html:1.188 --- llvm/docs/LangRef.html:1.187Thu Jan 4 18:59:10 2007 +++ llvm/docs/LangRef.html Fri Jan 5 15:33:08 2007 @@ -2701,6 +2701,7 @@ %X = trunc i32 257 to i8 ; yields i8:1 %Y = trunc i32 123 to bool ; yields bool:true + %Y = trunc i32 122 to bool ; yields bool:false @@ -4503,7 +4504,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/01/05 00:59:10 $ + Last modified: $Date: 2007/01/05 21:33:08 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.452 -> 1.453 --- Log message: Bug in ExpandFCOPYSIGNToBitwiseOps(). Clear the old sign bit of operand 0 before or'ing in the sign bit of operand 1. --- Diffs of the changes: (+14 -4) LegalizeDAG.cpp | 18 ++ 1 files changed, 14 insertions(+), 4 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.452 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.453 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.452 Thu Jan 4 15:56:39 2007 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Jan 5 15:31:51 2007 @@ -533,15 +533,17 @@ static SDOperand ExpandFCOPYSIGNToBitwiseOps(SDNode *Node, MVT::ValueType NVT, SelectionDAG &DAG, TargetLowering &TLI) { + MVT::ValueType VT = Node->getValueType(0); MVT::ValueType SrcVT = Node->getOperand(1).getValueType(); MVT::ValueType SrcNVT = (SrcVT == MVT::f64) ? MVT::i64 : MVT::i32; + // First get the sign bit of second operand. - SDOperand Mask = (SrcVT == MVT::f64) + SDOperand Mask1 = (SrcVT == MVT::f64) ? DAG.getConstantFP(BitsToDouble(1ULL << 63), SrcVT) : DAG.getConstantFP(BitsToFloat(1U << 31), SrcVT); - Mask = DAG.getNode(ISD::BIT_CONVERT, SrcNVT, Mask); + Mask1 = DAG.getNode(ISD::BIT_CONVERT, SrcNVT, Mask1); SDOperand SignBit= DAG.getNode(ISD::BIT_CONVERT, SrcNVT, Node->getOperand(1)); - SignBit = DAG.getNode(ISD::AND, SrcNVT, SignBit, Mask); + SignBit = DAG.getNode(ISD::AND, SrcNVT, SignBit, Mask1); // Shift right or sign-extend it if the two operands have different types. int SizeDiff = MVT::getSizeInBits(SrcNVT) - MVT::getSizeInBits(NVT); if (SizeDiff > 0) { @@ -550,8 +552,16 @@ SignBit = DAG.getNode(ISD::TRUNCATE, NVT, SignBit); } else if (SizeDiff < 0) SignBit = DAG.getNode(ISD::SIGN_EXTEND, NVT, SignBit); - // Or the first operand with the sign bit. + + // Clear the sign bit of first operand. + SDOperand Mask2 = (VT == MVT::f64) +? DAG.getConstantFP(BitsToDouble(~(1ULL << 63)), VT) +: DAG.getConstantFP(BitsToFloat(~(1U << 31)), VT); + Mask2 = DAG.getNode(ISD::BIT_CONVERT, NVT, Mask2); SDOperand Result = DAG.getNode(ISD::BIT_CONVERT, NVT, Node->getOperand(0)); + Result = DAG.getNode(ISD::AND, NVT, Result, Mask2); + + // Or the value with the sign bit. Result = DAG.getNode(ISD::OR, NVT, Result, SignBit); return Result; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: ScheduleDAG.cpp updated: 1.112 -> 1.113 --- Log message: CopyToReg source operand can be a register as well. e.g. Copy from GlobalBaseReg. --- Diffs of the changes: (+6 -2) ScheduleDAG.cpp |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.112 llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.113 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.112 Thu Dec 7 14:04:42 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Fri Jan 5 14:59:06 2007 @@ -307,7 +307,7 @@ } else if (ConstantSDNode *C = dyn_cast(Op)) { MI->addImmOperand(C->getValue()); - } else if (RegisterSDNode*R = + } else if (RegisterSDNode *R = dyn_cast(Op)) { MI->addRegOperand(R->getReg(), false); } else if (GlobalAddressSDNode *TGA = @@ -457,7 +457,11 @@ case ISD::TokenFactor: break; case ISD::CopyToReg: { - unsigned InReg = getVR(Node->getOperand(2), VRBaseMap); + unsigned InReg; + if (RegisterSDNode *R = dyn_cast(Node->getOperand(2))) +InReg = R->getReg(); + else +InReg = getVR(Node->getOperand(2), VRBaseMap); unsigned DestReg = cast(Node->getOperand(1))->getReg(); if (InReg != DestReg) // Coalesced away the copy? MRI->copyRegToReg(*BB, BB->end(), DestReg, InReg, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManagerT.h
Changes in directory llvm/lib/VMCore: PassManagerT.h (r1.75) removed --- Log message: Remove PassManagerT.h --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/Pass.cpp PassManager.cpp PassManagerT.h
Changes in directory llvm/lib/VMCore: Pass.cpp updated: 1.81 -> 1.82 PassManager.cpp updated: 1.110 -> 1.111 PassManagerT.h updated: 1.74 -> 1.75 --- Log message: Remove old pass manager. --- Diffs of the changes: (+1 -1099) Pass.cpp| 175 -- PassManager.cpp |3 PassManagerT.h | 922 3 files changed, 1 insertion(+), 1099 deletions(-) Index: llvm/lib/VMCore/Pass.cpp diff -u llvm/lib/VMCore/Pass.cpp:1.81 llvm/lib/VMCore/Pass.cpp:1.82 --- llvm/lib/VMCore/Pass.cpp:1.81 Fri Dec 22 16:49:00 2006 +++ llvm/lib/VMCore/Pass.cppFri Jan 5 14:16:23 2007 @@ -14,9 +14,6 @@ //===--===// #include "llvm/PassManager.h" -#ifdef USE_OLD_PASSMANAGER -#include "PassManagerT.h" // PassManagerT implementation -#endif #include "llvm/Module.h" #include "llvm/ModuleProvider.h" #include "llvm/ADT/STLExtras.h" @@ -31,157 +28,16 @@ AnalysisResolver::~AnalysisResolver() { } -void AnalysisResolver::setAnalysisResolver(Pass *P, AnalysisResolver *AR) { - assert(P->Resolver == 0 && "Pass already in a PassManager!"); - P->Resolver = AR; -} - -#ifdef USE_OLD_PASSMANAGER -//===--===// -// PassManager implementation - The PassManager class is a simple Pimpl class -// that wraps the PassManagerT template. -// -PassManager::PassManager() : PM(new ModulePassManager()) {} -PassManager::~PassManager() { delete PM; } -void PassManager::add(Pass *P) { - ModulePass *MP = dynamic_cast(P); - assert(MP && "Not a modulepass?"); - PM->add(MP); -} -bool PassManager::run(Module &M) { return PM->runOnModule(M); } - -//===--===// -// FunctionPassManager implementation - The FunctionPassManager class -// is a simple Pimpl class that wraps the PassManagerT template. It -// is like PassManager, but only deals in FunctionPasses. -// -FunctionPassManager::FunctionPassManager(ModuleProvider *P) : - PM(new FunctionPassManagerT()), MP(P) {} -FunctionPassManager::~FunctionPassManager() { delete PM; } -void FunctionPassManager::add(FunctionPass *P) { PM->add(P); } -void FunctionPassManager::add(ImmutablePass *IP) { PM->add(IP); } - -/// doInitialization - Run all of the initializers for the function passes. -/// -bool FunctionPassManager::doInitialization() { - return PM->doInitialization(*MP->getModule()); -} - -bool FunctionPassManager::run(Function &F) { - std::string errstr; - if (MP->materializeFunction(&F, &errstr)) { -cerr << "Error reading bytecode file: " << errstr << "\n"; -abort(); - } - return PM->runOnFunction(F); -} - -/// doFinalization - Run all of the initializers for the function passes. -/// -bool FunctionPassManager::doFinalization() { - return PM->doFinalization(*MP->getModule()); -} - - -//===--===// -// TimingInfo Class - This class is used to calculate information about the -// amount of time each pass takes to execute. This only happens with -// -time-passes is enabled on the command line. -// -bool llvm::TimePassesIsEnabled = false; -static cl::opt -EnableTiming("time-passes", cl::location(TimePassesIsEnabled), -cl::desc("Time each pass, printing elapsed time for each on exit")); - -// createTheTimeInfo - This method either initializes the TheTimeInfo pointer to -// a non null value (if the -time-passes option is enabled) or it leaves it -// null. It may be called multiple times. -void TimingInfo::createTheTimeInfo() { - if (!TimePassesIsEnabled || TheTimeInfo) return; - - // Constructed the first time this is called, iff -time-passes is enabled. - // This guarantees that the object will be constructed before static globals, - // thus it will be destroyed before them. - static ManagedStatic TTI; - TheTimeInfo = &*TTI; -} - -void PMDebug::PrintArgumentInformation(const Pass *P) { - // Print out passes in pass manager... - if (const AnalysisResolver *PM = dynamic_cast(P)) { -for (unsigned i = 0, e = PM->getNumContainedPasses(); i != e; ++i) - PrintArgumentInformation(PM->getContainedPass(i)); - - } else { // Normal pass. Print argument information... -// Print out arguments for registered passes that are _optimizations_ -if (const PassInfo *PI = P->getPassInfo()) - if (!PI->isAnalysisGroup()) -cerr << " -" << PI->getPassArgument(); - } -} - -void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, - Pass *P, Module *M) { - if (PassDebugging >= Executions) { -cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '" - << P->getPassName(); -if (M) cerr << "' on Module '" << M->getModuleIdentifier() << "'\n"; -cerr << "'...\n"; - } -} - -void PMDebug::PrintPassInformation(unsigned Depth, const char *Action, -
[llvm-commits] CVS: llvm/include/llvm/Pass.h PassAnalysisSupport.h PassManager.h
Changes in directory llvm/include/llvm: Pass.h updated: 1.68 -> 1.69 PassAnalysisSupport.h updated: 1.26 -> 1.27 PassManager.h updated: 1.37 -> 1.38 --- Log message: Remove old pass manager. --- Diffs of the changes: (+4 -139) Pass.h| 39 PassAnalysisSupport.h | 36 ++ PassManager.h | 68 -- 3 files changed, 4 insertions(+), 139 deletions(-) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.68 llvm/include/llvm/Pass.h:1.69 --- llvm/include/llvm/Pass.h:1.68 Wed Jan 3 19:27:03 2007 +++ llvm/include/llvm/Pass.hFri Jan 5 14:16:23 2007 @@ -36,9 +36,6 @@ #include #include -//Use new Pass Manager. Disable old Pass Manager. -//#define USE_OLD_PASSMANAGER 1 - namespace llvm { class Value; @@ -52,7 +49,6 @@ class BasicBlockPassManager; class FunctionPassManagerT; class ModulePassManager; -struct AnalysisResolver; class AnalysisResolver_New; // AnalysisID - Use the PassInfo to identify a pass... @@ -64,8 +60,6 @@ /// constrained passes described below. /// class Pass { - friend struct AnalysisResolver; - AnalysisResolver *Resolver; // AnalysisResolver this pass is owned by... AnalysisResolver_New *Resolver_New; // Used to resolve analysis const PassInfo *PassInfoCache; @@ -77,7 +71,7 @@ void operator=(const Pass&); // DO NOT IMPLEMENT Pass(const Pass &); // DO NOT IMPLEMENT public: - Pass() : Resolver(0), Resolver_New(0), PassInfoCache(0) {} + Pass() : Resolver_New(0), PassInfoCache(0) {} virtual ~Pass() {} // Destructor is virtual so we can be subclassed /// getPassName - Return a nice clean name for a pass. This usually @@ -204,12 +198,8 @@ virtual bool runPass(Module &M) { return runOnModule(M); } virtual bool runPass(BasicBlock&) { return false; } -#ifdef USE_OLD_PASSMANAGER - virtual void addToPassManager(ModulePassManager *PM, AnalysisUsage &AU); -#else // Force out-of-line virtual method. virtual ~ModulePass(); -#endif }; @@ -232,15 +222,8 @@ /// virtual bool runOnModule(Module &M) { return false; } -#ifdef USE_OLD_PASSMANAGER -private: - template friend class PassManagerT; - friend class ModulePassManager; - virtual void addToPassManager(ModulePassManager *PM, AnalysisUsage &AU); -#else // Force out-of-line virtual method. virtual ~ImmutablePass(); -#endif }; //===--===// @@ -280,15 +263,6 @@ /// bool run(Function &F); -#ifdef USE_OLD_PASSMANAGER -protected: - template friend class PassManagerT; - friend class ModulePassManager; - friend class FunctionPassManagerT; - friend class BasicBlockPassManager; - virtual void addToPassManager(ModulePassManager *PM, AnalysisUsage &AU); - virtual void addToPassManager(FunctionPassManagerT *PM, AnalysisUsage &AU); -#endif }; @@ -342,17 +316,6 @@ virtual bool runPass(Module &M) { return false; } virtual bool runPass(BasicBlock &BB); -#ifdef USE_OLD_PASSMANAGER -private: - template friend class PassManagerT; - friend class FunctionPassManagerT; - friend class BasicBlockPassManager; - virtual void addToPassManager(ModulePassManager *PM, AnalysisUsage &AU) { -FunctionPass::addToPassManager(PM, AU); - } - virtual void addToPassManager(FunctionPassManagerT *PM, AnalysisUsage &AU); - virtual void addToPassManager(BasicBlockPassManager *PM,AnalysisUsage &AU); -#endif }; /// If the user specifies the -time-passes argument on an LLVM tool command line Index: llvm/include/llvm/PassAnalysisSupport.h diff -u llvm/include/llvm/PassAnalysisSupport.h:1.26 llvm/include/llvm/PassAnalysisSupport.h:1.27 --- llvm/include/llvm/PassAnalysisSupport.h:1.26Wed Dec 13 15:55:30 2006 +++ llvm/include/llvm/PassAnalysisSupport.h Fri Jan 5 14:16:23 2007 @@ -175,8 +175,6 @@ void startPass(Pass *P) {} void endPass(Pass *P) {} -protected: - void setAnalysisResolver(Pass *P, AnalysisResolver *AR); }; /// getAnalysisToUpdate() - This function is used by subclasses @@ -189,19 +187,12 @@ /// template AnalysisType *Pass::getAnalysisToUpdate() const { -#ifdef USE_OLD_PASSMANAGER - assert(Resolver && "Pass not resident in a PassManager object!"); -#else assert(Resolver_New && "Pass not resident in a PassManager object!"); -#endif + const PassInfo *PI = getClassPassInfo(); if (PI == 0) return 0; -#ifdef USE_OLD_PASSMANAGER - return dynamic_cast(Resolver->getAnalysisToUpdate(PI)); -#else return dynamic_cast (Resolver_New->getAnalysisToUpdate(PI, true)); -#endif } /// getAnalysis() - This function is used by subclasses to get @@ -210,34 +201,14 @@ /// template AnalysisType &Pass::getAnalysis() const { -#ifdef USE_OLD_PASSMANAGER - assert(Resolver && "Pass has not been inserted into a PassManager object!"); -#else - assert(Resolver_New&&"Pass has not been inserted into a PassMana
[llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/and_sext.ll
Changes in directory llvm/test/Regression/CodeGen/PowerPC: and_sext.ll updated: 1.4 -> 1.5 --- Log message: This test case needs parameter attributes, manually upgrade and don't run llvm-upgrade. --- Diffs of the changes: (+21 -21) and_sext.ll | 42 +- 1 files changed, 21 insertions(+), 21 deletions(-) Index: llvm/test/Regression/CodeGen/PowerPC/and_sext.ll diff -u llvm/test/Regression/CodeGen/PowerPC/and_sext.ll:1.4 llvm/test/Regression/CodeGen/PowerPC/and_sext.ll:1.5 --- llvm/test/Regression/CodeGen/PowerPC/and_sext.ll:1.4Fri Dec 1 22:23:08 2006 +++ llvm/test/Regression/CodeGen/PowerPC/and_sext.llFri Jan 5 12:38:33 2007 @@ -1,29 +1,29 @@ ; These tests should not contain a sign extend. -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep extsh && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep extsb +; RUN: llvm-as < %s | llc -march=ppc32 && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsh && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsb -int %test1(uint %mode.0.i.0) { -%tmp.79 = cast uint %mode.0.i.0 to short -%tmp.80 = cast short %tmp.79 to int -%tmp.81 = and int %tmp.80, 24 -ret int %tmp.81 +define i32 %test1(i32 %mode.0.i.0) { +%tmp.79 = trunc i32 %mode.0.i.0 to i16 +%tmp.80 = sext i16 %tmp.79 to i32 +%tmp.81 = and i32 %tmp.80, 24 +ret i32 %tmp.81 } -short %test2(short %X, short %x) { -%tmp = cast short %X to int -%tmp1 = cast short %x to int -%tmp2 = add int %tmp, %tmp1 -%tmp4 = shr int %tmp2, ubyte 1 -%tmp4 = cast int %tmp4 to short -%tmp45 = cast short %tmp4 to int -%retval = cast int %tmp45 to short -ret short %retval +define i16 %test2(i16 sext %X, i16 sext %x) sext { +%tmp = sext i16 %X to i32 +%tmp1 = sext i16 %x to i32 +%tmp2 = add i32 %tmp, %tmp1 +%tmp4 = ashr i32 %tmp2, i8 1 +%tmp4 = trunc i32 %tmp4 to i16 +%tmp45 = sext i16 %tmp4 to i32 +%retval = trunc i32 %tmp45 to i16 +ret i16 %retval } -short %test3(uint %X) { -%tmp1 = shr uint %X, ubyte 16 -%tmp1 = cast uint %tmp1 to short -ret short %tmp1 +define i16 %test3(i32 zext %X) sext { +%tmp1 = lshr i32 %X, i8 16 +%tmp1 = trunc i32 %tmp1 to i16 +ret i16 %tmp1 } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] Fix K&R prototype handling
This has been backed out due to buginess. Evan On Jan 4, 2007, at 3:25 PM, Chris Lattner wrote: > This patch causes us to compile functions like: > > p1 (f2, l) > float f2; short l; { > printf("%d\n", l); > } > > into: > > define i32 %p1(double %f2, i32 %l) { > > instead of: > > define i32 %p1(float %f2, i16 %l) { > > due to K&R promotion rules. This fixes a miscompilation of > SingleSource/UnitTests/2007-01-04-KNR-Args.c on PowerPC at -O0. > > -Chris > > > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/small-arguments.ll
Changes in directory llvm/test/Regression/CodeGen/PowerPC: small-arguments.ll updated: 1.6 -> 1.7 --- Log message: Update for change in parameter attributes syntax. --- Diffs of the changes: (+38 -38) small-arguments.ll | 76 ++--- 1 files changed, 38 insertions(+), 38 deletions(-) Index: llvm/test/Regression/CodeGen/PowerPC/small-arguments.ll diff -u llvm/test/Regression/CodeGen/PowerPC/small-arguments.ll:1.6 llvm/test/Regression/CodeGen/PowerPC/small-arguments.ll:1.7 --- llvm/test/Regression/CodeGen/PowerPC/small-arguments.ll:1.6 Sun Dec 31 00:01:59 2006 +++ llvm/test/Regression/CodeGen/PowerPC/small-arguments.ll Fri Jan 5 12:34:20 2007 @@ -1,53 +1,53 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep 'extsh\|rlwinm' +; RUN: llvm-as < %s | llc -march=ppc32 && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep 'extsh\|rlwinm' -declare short @sext %foo() +declare i16 %foo() sext -int %test1(short @sext %X) { - %Y = cast short %X to int ;; dead - ret int %Y +define i32 %test1(i16 sext %X) { + %Y = sext i16 %X to i32 ;; dead + ret i32 %Y } -int %test2(ushort @zext %X) { - %Y = cast ushort %X to int - %Z = and int %Y, 65535 ;; dead - ret int %Z +define i32 %test2(i16 zext %X) { + %Y = sext i16 %X to i32 + %Z = and i32 %Y, 65535 ;; dead + ret i32 %Z } -void %test3() { - %tmp.0 = call short %foo();; no extsh! - %tmp.1 = setlt short %tmp.0, 1234 +define void %test3() { + %tmp.0 = call i16 %foo() sext;; no extsh! + %tmp.1 = icmp slt i16 %tmp.0, 1234 br bool %tmp.1, label %then, label %UnifiedReturnBlock then: - call int %test1(short 0) + call i32 %test1(i16 0 sext) ret void UnifiedReturnBlock: ret void } -uint %test4(ushort* %P) { -%tmp.1 = load ushort* %P -%tmp.2 = cast ushort %tmp.1 to uint -%tmp.3 = and uint %tmp.2, 255 -ret uint %tmp.3 -} - -uint %test5(short* %P) { -%tmp.1 = load short* %P -%tmp.2 = cast short %tmp.1 to ushort -%tmp.3 = cast ushort %tmp.2 to uint -%tmp.4 = and uint %tmp.3, 255 -ret uint %tmp.4 -} - -uint %test6(uint* %P) { -%tmp.1 = load uint* %P -%tmp.2 = and uint %tmp.1, 255 -ret uint %tmp.2 -} - -ushort @zext %test7(float %a) { -%tmp.1 = cast float %a to ushort -ret ushort %tmp.1 +define i32 %test4(i16* %P) { +%tmp.1 = load i16* %P +%tmp.2 = zext i16 %tmp.1 to i32 +%tmp.3 = and i32 %tmp.2, 255 +ret i32 %tmp.3 +} + +define i32 %test5(i16* %P) { +%tmp.1 = load i16* %P +%tmp.2 = bitcast i16 %tmp.1 to i16 +%tmp.3 = zext i16 %tmp.2 to i32 +%tmp.4 = and i32 %tmp.3, 255 +ret i32 %tmp.4 +} + +define i32 %test6(i32* %P) { +%tmp.1 = load i32* %P +%tmp.2 = and i32 %tmp.1, 255 +ret i32 %tmp.2 +} + +define i16 %test7(float %a) zext { +%tmp.1 = fptoui float %a to i16 +ret i16 %tmp.1 } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll
Changes in directory llvm/test/Regression/CodeGen/X86: trunc-to-bool.ll updated: 1.5 -> 1.6 --- Log message: Update for change in parameter attribute syntax. --- Diffs of the changes: (+1 -1) trunc-to-bool.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll diff -u llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll:1.5 llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll:1.6 --- llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll:1.5 Sun Dec 31 00:01:59 2006 +++ llvm/test/Regression/CodeGen/X86/trunc-to-bool.ll Fri Jan 5 12:35:52 2007 @@ -5,7 +5,7 @@ ; RUN: llvm-as < %s | llc -march=x86 | grep '\(and\)\|\(test.*\$1\)' | \ ; RUN: wc -l | grep 6 -define bool @zext %test1(i32 %X) { +define bool %test1(i32 %X) zext { %Y = trunc i32 %X to bool ret bool %Y } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/GlobalOpt/memcpy.ll
Changes in directory llvm/test/Regression/Transforms/GlobalOpt: memcpy.ll updated: 1.4 -> 1.5 --- Log message: Global variables are not renamed by llvm-upgrade any more. --- Diffs of the changes: (+1 -1) memcpy.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/Transforms/GlobalOpt/memcpy.ll diff -u llvm/test/Regression/Transforms/GlobalOpt/memcpy.ll:1.4 llvm/test/Regression/Transforms/GlobalOpt/memcpy.ll:1.5 --- llvm/test/Regression/Transforms/GlobalOpt/memcpy.ll:1.4 Wed Jan 3 17:47:29 2007 +++ llvm/test/Regression/Transforms/GlobalOpt/memcpy.ll Fri Jan 5 12:37:18 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | \ -; RUN: grep 'G1.s = internal constant' +; RUN: grep 'G1 = internal constant' %G1 = internal global [58 x sbyte] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll weakextern.ll
Changes in directory llvm/test/Regression/Linker: 2005-12-06-AppendingZeroLengthArrays.ll updated: 1.3 -> 1.4 weakextern.ll updated: 1.5 -> 1.6 --- Log message: Global variables are not renamed by llvm-upgrade any more. --- Diffs of the changes: (+4 -4) 2005-12-06-AppendingZeroLengthArrays.ll |2 +- weakextern.ll |6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll diff -u llvm/test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll:1.3 llvm/test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll:1.4 --- llvm/test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll:1.3 Wed Jan 3 17:47:29 2007 +++ llvm/test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll Fri Jan 5 12:36:46 2007 @@ -1,7 +1,7 @@ ; RUN: echo "%G = appending global [0 x int] zeroinitializer" | llvm-upgrade |\ ; RUN: llvm-as > %t.out2.bc ; RUN: llvm-upgrade < %s | llvm-as > %t.out1.bc -; RUN: llvm-link %t.out[12].bc | llvm-dis | grep '%G.s =' +; RUN: llvm-link %t.out[12].bc | llvm-dis | grep '%G =' ; When linked, the globals should be merged, and the result should still ; be named '%G'. Index: llvm/test/Regression/Linker/weakextern.ll diff -u llvm/test/Regression/Linker/weakextern.ll:1.5 llvm/test/Regression/Linker/weakextern.ll:1.6 --- llvm/test/Regression/Linker/weakextern.ll:1.5 Wed Jan 3 17:47:29 2007 +++ llvm/test/Regression/Linker/weakextern.ll Fri Jan 5 12:36:46 2007 @@ -1,9 +1,9 @@ ; RUN: llvm-upgrade < %s | llvm-as > %t.bc ; RUN: llvm-upgrade < `dirname %s`/testlink1.ll | llvm-as > %t2.bc ; RUN: llvm-link %t.bc %t.bc %t2.bc -o %t1.bc -f -; RUN: llvm-dis < %t1.bc | grep "kallsyms_names.u = extern_weak" && -; RUN: llvm-dis < %t1.bc | grep "MyVar.s = external global i32" && -; RUN: llvm-dis < %t1.bc | grep "Inte.s = global i32" +; RUN: llvm-dis < %t1.bc | grep "kallsyms_names = extern_weak" && +; RUN: llvm-dis < %t1.bc | grep "MyVar = external global i32" && +; RUN: llvm-dis < %t1.bc | grep "Inte = global i32" %kallsyms_names = extern_weak global [0 x ubyte] %MyVar = extern_weak global int ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/packed_struct.ll
Changes in directory llvm/test/Regression/CodeGen/X86: packed_struct.ll updated: 1.3 -> 1.4 --- Log message: Global variables are not renamed by llvm-upgrade any more. --- Diffs of the changes: (+3 -3) packed_struct.ll |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/test/Regression/CodeGen/X86/packed_struct.ll diff -u llvm/test/Regression/CodeGen/X86/packed_struct.ll:1.3 llvm/test/Regression/CodeGen/X86/packed_struct.ll:1.4 --- llvm/test/Regression/CodeGen/X86/packed_struct.ll:1.3 Wed Jan 3 17:47:29 2007 +++ llvm/test/Regression/CodeGen/X86/packed_struct.ll Fri Jan 5 12:35:20 2007 @@ -1,6 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "foos.s+5" && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "foos.s+1" && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "foos.s+9" && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "foos+5" && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "foos+1" && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "foos+9" && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "bara+19" && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep "bara+4" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/loop-hoist.ll
Changes in directory llvm/test/Regression/CodeGen/X86: loop-hoist.ll updated: 1.5 -> 1.6 --- Log message: Global variables are not renamed by llvm-upgrade any more. --- Diffs of the changes: (+2 -2) loop-hoist.ll |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/Regression/CodeGen/X86/loop-hoist.ll diff -u llvm/test/Regression/CodeGen/X86/loop-hoist.ll:1.5 llvm/test/Regression/CodeGen/X86/loop-hoist.ll:1.6 --- llvm/test/Regression/CodeGen/X86/loop-hoist.ll:1.5 Wed Jan 3 17:47:29 2007 +++ llvm/test/Regression/CodeGen/X86/loop-hoist.ll Fri Jan 5 12:34:48 2007 @@ -1,9 +1,9 @@ ; RUN: llvm-upgrade < %s | llvm-as | \ ; RUN: llc -relocation-model=dynamic-no-pic -mtriple=i686-apple-darwin8.7.2 |\ -; RUN: grep L_Arr.s.non_lazy_ptr && +; RUN: grep L_Arr.non_lazy_ptr && ; RUN: llvm-upgrade < %s | llvm-as | \ ; RUN: llc -relocation-model=dynamic-no-pic -mtriple=i686-apple-darwin8.7.2 |\ -; RUN: %prcontext L_Arr.s.non_lazy_ptr 1 | grep '4(%esp)' +; RUN: %prcontext L_Arr.non_lazy_ptr 1 | grep '4(%esp)' %Arr = external global [0 x int]; <[0 x int]*> [#uses=2] ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/rotl.ll
Changes in directory llvm/test/Regression/CodeGen/PowerPC: rotl.ll updated: 1.4 -> 1.5 --- Log message: Wrap long RUN: line. --- Diffs of the changes: (+4 -2) rotl.ll |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/test/Regression/CodeGen/PowerPC/rotl.ll diff -u llvm/test/Regression/CodeGen/PowerPC/rotl.ll:1.4 llvm/test/Regression/CodeGen/PowerPC/rotl.ll:1.5 --- llvm/test/Regression/CodeGen/PowerPC/rotl.ll:1.4Mon Jan 1 23:53:06 2007 +++ llvm/test/Regression/CodeGen/PowerPC/rotl.llFri Jan 5 12:33:43 2007 @@ -1,6 +1,8 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep or && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwnm | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwinm | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \ +; RUN:grep rlwnm | wc -l | grep 2 && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \ +; RUN:grep rlwinm | wc -l | grep 2 implementation ; Functions: ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/darwin-labels.ll
Changes in directory llvm/test/Regression/CodeGen/PowerPC: darwin-labels.ll updated: 1.3 -> 1.4 --- Log message: Globals are not renamed any more. --- Diffs of the changes: (+1 -1) darwin-labels.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/PowerPC/darwin-labels.ll diff -u llvm/test/Regression/CodeGen/PowerPC/darwin-labels.ll:1.3 llvm/test/Regression/CodeGen/PowerPC/darwin-labels.ll:1.4 --- llvm/test/Regression/CodeGen/PowerPC/darwin-labels.ll:1.3 Mon Jan 1 23:55:05 2007 +++ llvm/test/Regression/CodeGen/PowerPC/darwin-labels.ll Fri Jan 5 12:33:16 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc | grep 'foo bar.s":' +; RUN: llvm-upgrade < %s | llvm-as | llc | grep 'foo bar":' target endian = big target pointersize = 32 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/and-elim.ll
Changes in directory llvm/test/Regression/CodeGen/PowerPC: and-elim.ll updated: 1.4 -> 1.5 --- Log message: This test case needs zext and sext attributes so manually upgrade it and don't run llvm-upgrade. --- Diffs of the changes: (+13 -13) and-elim.ll | 26 +- 1 files changed, 13 insertions(+), 13 deletions(-) Index: llvm/test/Regression/CodeGen/PowerPC/and-elim.ll diff -u llvm/test/Regression/CodeGen/PowerPC/and-elim.ll:1.4 llvm/test/Regression/CodeGen/PowerPC/and-elim.ll:1.5 --- llvm/test/Regression/CodeGen/PowerPC/and-elim.ll:1.4Sun Dec 31 00:01:59 2006 +++ llvm/test/Regression/CodeGen/PowerPC/and-elim.llFri Jan 5 12:31:56 2007 @@ -1,19 +1,19 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwin +; RUN: llvm-as < %s | llc -march=ppc32 && +; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwin -void %test(ubyte* %P) { - %W = load ubyte* %P - %X = shl ubyte %W, ubyte 1 - %Y = add ubyte %X, 2 - %Z = and ubyte %Y, 254; dead and - store ubyte %Z, ubyte* %P +define void %test(i8* %P) { + %W = load i8* %P + %X = shl i8 %W, i8 1 + %Y = add i8 %X, 2 + %Z = and i8 %Y, 254; dead and + store i8 %Z, i8* %P ret void } -ushort @zext %test2(ushort @zext %crc) { -; No and's should be needed for the ushorts here. -%tmp.1 = shr ushort %crc, ubyte 1 -%tmp.7 = xor ushort %tmp.1, 40961 -ret ushort %tmp.7 +define i16 %test2(i16 zext %crc) zext { +; No and's should be needed for the i16s here. +%tmp.1 = lshr i16 %crc, i8 1 +%tmp.7 = xor i16 %tmp.1, 40961 +ret i16 %tmp.7 } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Assembler/2002-12-15-GlobalResolve.ll
Changes in directory llvm/test/Regression/Assembler: 2002-12-15-GlobalResolve.ll updated: 1.3 -> 1.4 --- Log message: Beef up this test case a little by introducing a global variable name conflict after upgrade resulting from collapsed type planes. The test now checks to make sure llvm-upgrade produces appropriate warning messages. --- Diffs of the changes: (+4 -2) 2002-12-15-GlobalResolve.ll |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/test/Regression/Assembler/2002-12-15-GlobalResolve.ll diff -u llvm/test/Regression/Assembler/2002-12-15-GlobalResolve.ll:1.3 llvm/test/Regression/Assembler/2002-12-15-GlobalResolve.ll:1.4 --- llvm/test/Regression/Assembler/2002-12-15-GlobalResolve.ll:1.3 Sat Dec 2 14:34:08 2006 +++ llvm/test/Regression/Assembler/2002-12-15-GlobalResolve.ll Fri Jan 5 11:35:05 2007 @@ -1,9 +1,11 @@ -; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f +; RUN: llvm-upgrade < %s 2>/dev/null | llvm-as -o /dev/null -f && +; RUN: llvm-upgrade < %s 2>&1 | grep "Cannot disambiguate global value '%X'" && +; RUN: llvm-upgrade < %s 2>&1 | grep "Renaming global value '%X' to '%X.un" +%X = external global uint * %X = external global %T* %X = external global int * %T = type int implementation - ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/Alpha/i32_sub_1.ll
Changes in directory llvm/test/Regression/CodeGen/Alpha: i32_sub_1.ll updated: 1.3 -> 1.4 --- Log message: Changes to parameter attribute syntax. --- Diffs of the changes: (+1 -1) i32_sub_1.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/Alpha/i32_sub_1.ll diff -u llvm/test/Regression/CodeGen/Alpha/i32_sub_1.ll:1.3 llvm/test/Regression/CodeGen/Alpha/i32_sub_1.ll:1.4 --- llvm/test/Regression/CodeGen/Alpha/i32_sub_1.ll:1.3 Tue Jan 2 22:20:23 2007 +++ llvm/test/Regression/CodeGen/Alpha/i32_sub_1.ll Fri Jan 5 11:41:10 2007 @@ -3,7 +3,7 @@ implementation ; Functions: -define i32 @sext %foo(i32 @sext %x) { +define i32 %foo(i32 sext %x) sext { entry: %tmp.1 = add i32 %x, -1 ; [#uses=1] ret i32 %tmp.1 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/section.ll
Changes in directory llvm/test/Regression/CodeGen/ARM: section.ll updated: 1.6 -> 1.7 --- Log message: Globals are not being renamed any more. --- Diffs of the changes: (+1 -1) section.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/ARM/section.ll diff -u llvm/test/Regression/CodeGen/ARM/section.ll:1.6 llvm/test/Regression/CodeGen/ARM/section.ll:1.7 --- llvm/test/Regression/CodeGen/ARM/section.ll:1.6 Wed Jan 3 17:47:29 2007 +++ llvm/test/Regression/CodeGen/ARM/section.ll Fri Jan 5 11:39:54 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "__DTOR_END__.s:" && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "__DTOR_END__:" && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \ ; RUN:grep '.section .dtors,"aw",.progbits' ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/Alpha/zapnot.ll
Changes in directory llvm/test/Regression/CodeGen/Alpha: zapnot.ll updated: 1.3 -> 1.4 --- Log message: Changes to parameter attribute syntax. --- Diffs of the changes: (+1 -1) zapnot.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/Alpha/zapnot.ll diff -u llvm/test/Regression/CodeGen/Alpha/zapnot.ll:1.3 llvm/test/Regression/CodeGen/Alpha/zapnot.ll:1.4 --- llvm/test/Regression/CodeGen/Alpha/zapnot.ll:1.3Sun Dec 31 00:01:59 2006 +++ llvm/test/Regression/CodeGen/Alpha/zapnot.llFri Jan 5 11:41:34 2007 @@ -3,7 +3,7 @@ implementation ; Functions: -define i16 @zext %foo(i64 %y) { +define i16 %foo(i64 %y) zext { entry: %tmp.1 = trunc i64 %y to i16 ; [#uses=1] ret i16 %tmp.1 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/Alpha/add.ll
Changes in directory llvm/test/Regression/CodeGen/Alpha: add.ll updated: 1.4 -> 1.5 --- Log message: Changes to parameter attributes syntax. --- Diffs of the changes: (+13 -13) add.ll | 26 +- 1 files changed, 13 insertions(+), 13 deletions(-) Index: llvm/test/Regression/CodeGen/Alpha/add.ll diff -u llvm/test/Regression/CodeGen/Alpha/add.ll:1.4 llvm/test/Regression/CodeGen/Alpha/add.ll:1.5 --- llvm/test/Regression/CodeGen/Alpha/add.ll:1.4 Tue Jan 2 22:20:23 2007 +++ llvm/test/Regression/CodeGen/Alpha/add.ll Fri Jan 5 11:40:40 2007 @@ -19,19 +19,19 @@ implementation ; Functions: -define i32 @sext %al(i32 @sext %x.s, i32 @sext %y.s) { +define i32 %al(i32 sext %x.s, i32 sext %y.s) sext { entry: %tmp.3.s = add i32 %y.s, %x.s ; [#uses=1] ret i32 %tmp.3.s } -define i32 @sext %ali(i32 @sext %x.s) { +define i32 %ali(i32 sext %x.s) sext { entry: %tmp.3.s = add i32 100, %x.s; [#uses=1] ret i32 %tmp.3.s } -define i64 @sext %aq(i64 @sext %x.s, i64 @sext %y.s) { +define i64 %aq(i64 sext %x.s, i64 sext %y.s) sext { entry: %tmp.3.s = add i64 %y.s, %x.s ; [#uses=1] ret i64 %tmp.3.s @@ -43,13 +43,13 @@ ret i64 %tmp.3.s } -define i32 @sext %sl(i32 @sext %x.s, i32 @sext %y.s) { +define i32 %sl(i32 sext %x.s, i32 sext %y.s) sext { entry: %tmp.3.s = sub i32 %y.s, %x.s ; [#uses=1] ret i32 %tmp.3.s } -define i32 @sext %sli(i32 @sext %x.s) { +define i32 %sli(i32 sext %x.s) sext { entry: %tmp.3.s = sub i32 %x.s, 100; [#uses=1] ret i32 %tmp.3.s @@ -67,14 +67,14 @@ ret i64 %tmp.3.s } -define i32 @sext %a4l(i32 @sext %x.s, i32 @sext %y.s) { +define i32 %a4l(i32 sext %x.s, i32 sext %y.s) sext { entry: %tmp.1.s = shl i32 %y.s, i8 2 ; [#uses=1] %tmp.3.s = add i32 %tmp.1.s, %x.s ; [#uses=1] ret i32 %tmp.3.s } -define i32 @sext %a8l(i32 @sext %x.s, i32 @sext %y.s) { +define i32 %a8l(i32 sext %x.s, i32 sext %y.s) sext { entry: %tmp.1.s = shl i32 %y.s, i8 3 ; [#uses=1] %tmp.3.s = add i32 %tmp.1.s, %x.s ; [#uses=1] @@ -95,14 +95,14 @@ ret i64 %tmp.3.s } -define i32 @sext %a4li(i32 @sext %y.s) { +define i32 %a4li(i32 sext %y.s) sext { entry: %tmp.1.s = shl i32 %y.s, i8 2 ; [#uses=1] %tmp.3.s = add i32 100, %tmp.1.s; [#uses=1] ret i32 %tmp.3.s } -define i32 @sext %a8li(i32 @sext %y.s) { +define i32 %a8li(i32 sext %y.s) sext { entry: %tmp.1.s = shl i32 %y.s, i8 3 ; [#uses=1] %tmp.3.s = add i32 100, %tmp.1.s; [#uses=1] @@ -123,14 +123,14 @@ ret i64 %tmp.3.s } -define i32 @sext %s4l(i32 @sext %x.s, i32 @sext %y.s) { +define i32 %s4l(i32 sext %x.s, i32 sext %y.s) sext { entry: %tmp.1.s = shl i32 %y.s, i8 2 ; [#uses=1] %tmp.3.s = sub i32 %tmp.1.s, %x.s ; [#uses=1] ret i32 %tmp.3.s } -define i32 @sext %s8l(i32 @sext %x.s, i32 @sext %y.s) { +define i32 %s8l(i32 sext %x.s, i32 sext %y.s) sext { entry: %tmp.1.s = shl i32 %y.s, i8 3 ; [#uses=1] %tmp.3.s = sub i32 %tmp.1.s, %x.s ; [#uses=1] @@ -151,14 +151,14 @@ ret i64 %tmp.3.s } -define i32 @sext %s4li(i32 @sext %y.s) { +define i32 %s4li(i32 sext %y.s) sext { entry: %tmp.1.s = shl i32 %y.s, i8 2 ; [#uses=1] %tmp.3.s = sub i32 %tmp.1.s, 100; [#uses=1] ret i32 %tmp.3.s } -define i32 @sext %s8li(i32 @sext %y.s) { +define i32 %s8li(i32 sext %y.s) sext { entry: %tmp.1.s = shl i32 %y.s, i8 3 ; [#uses=1] %tmp.3.s = sub i32 %tmp.1.s, 100; [#uses=1] ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/constants.ll
Changes in directory llvm/test/Regression/CodeGen/ARM: constants.ll updated: 1.7 -> 1.8 --- Log message: Globals are not being renamed any more. --- Diffs of the changes: (+1 -1) constants.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/ARM/constants.ll diff -u llvm/test/Regression/CodeGen/ARM/constants.ll:1.7 llvm/test/Regression/CodeGen/ARM/constants.ll:1.8 --- llvm/test/Regression/CodeGen/ARM/constants.ll:1.7 Mon Jan 1 23:55:05 2007 +++ llvm/test/Regression/CodeGen/ARM/constants.ll Fri Jan 5 11:39:32 2007 @@ -6,7 +6,7 @@ ; RUN: grep "mov r0, #-1073741761" %t.s | wc -l | grep 1 && ; RUN: grep "mov r0, #1008" %t.s | wc -l | grep 1 && ; RUN: grep "cmp r0, #65536" %t.s | wc -l | grep 1 && -; RUN: grep "\.comm.*a.s,4,4" %t.s | wc -l | grep 1 +; RUN: grep "\.comm.*a,4,4" %t.s | wc -l | grep 1 %a = internal global int 0 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/fcopysign.ll
Changes in directory llvm/test/Regression/CodeGen/ARM: fcopysign.ll updated: 1.1 -> 1.2 --- Log message: This test case has been translated to 2.0 assembly so don't run llvm-upgrade on it. --- Diffs of the changes: (+1 -1) fcopysign.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/ARM/fcopysign.ll diff -u llvm/test/Regression/CodeGen/ARM/fcopysign.ll:1.1 llvm/test/Regression/CodeGen/ARM/fcopysign.ll:1.2 --- llvm/test/Regression/CodeGen/ARM/fcopysign.ll:1.1 Thu Jan 4 08:24:32 2007 +++ llvm/test/Regression/CodeGen/ARM/fcopysign.ll Fri Jan 5 11:39:07 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm +; RUN: llvm-as < %s | llc -march=arm define csretcc void %__divsc3({ float, float }* %agg.result, float %a, float %b, float %c, float %d) { entry: ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Assembler/2004-11-28-InvalidTypeCrash.ll
Changes in directory llvm/test/Regression/Assembler: 2004-11-28-InvalidTypeCrash.ll updated: 1.3 -> 1.4 --- Log message: Fix this to check for the correct error message. --- Diffs of the changes: (+2 -1) 2004-11-28-InvalidTypeCrash.ll |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/test/Regression/Assembler/2004-11-28-InvalidTypeCrash.ll diff -u llvm/test/Regression/Assembler/2004-11-28-InvalidTypeCrash.ll:1.3 llvm/test/Regression/Assembler/2004-11-28-InvalidTypeCrash.ll:1.4 --- llvm/test/Regression/Assembler/2004-11-28-InvalidTypeCrash.ll:1.3 Mon Jan 1 23:55:05 2007 +++ llvm/test/Regression/Assembler/2004-11-28-InvalidTypeCrash.ll Fri Jan 5 11:37:59 2007 @@ -1,3 +1,4 @@ -; RUN: (llvm-upgrade < %s | llvm-as -o /dev/null -f) 2>&1 | grep 'Cannot resolve type' +; RUN: (llvm-upgrade < %s | llvm-as -o /dev/null -f) 2>&1 | \ +; RUN: grep 'Cannot create a null initialized value of this type!' ; Test for PR463. This program is erroneous, but should not crash llvm-as. %.FOO = internal global %struct.none zeroinitializer ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Assembler/2003-02-02-ConstGlobal.ll
Changes in directory llvm/test/Regression/Assembler: 2003-02-02-ConstGlobal.ll (r1.3) removed --- Log message: This tests for something that will become illegal soon. The test/Feature suite has a test for renaming of global variables. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Feature/paramattrs.ll
Changes in directory llvm/test/Feature: paramattrs.ll updated: 1.2 -> 1.3 --- Log message: Fix the test case for the change in parameter attribute syntax. The @ is no longer needed and the @(...) syntax has been dropped in favor of a simple space separated list of attribute names. --- Diffs of the changes: (+6 -6) paramattrs.ll | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/test/Feature/paramattrs.ll diff -u llvm/test/Feature/paramattrs.ll:1.2 llvm/test/Feature/paramattrs.ll:1.3 --- llvm/test/Feature/paramattrs.ll:1.2 Wed Jan 3 18:03:37 2007 +++ llvm/test/Feature/paramattrs.ll Fri Jan 5 11:26:04 2007 @@ -2,19 +2,19 @@ ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -%ZFunTy = type i32(i8 @zext) -%SFunTy = type i32(i8 @sext) +%ZFunTy = type i32(i8 zext) +%SFunTy = type i32(i8 sext) -declare i16 @(sext) "test"(i16 @sext %arg) -declare i8 @zext "test2" (i16 @zext %a2) +declare i16 "test"(i16 sext %arg) sext +declare i8 "test2" (i16 zext %a2) zext implementation define i32 %main(i32 %argc, i8 **%argv) { %val = trunc i32 %argc to i16 -%res = call i16 @sext (i16 @sext) *%test(i16 %val) +%res = call i16 (i16 sext) sext *%test(i16 %val) %two = add i16 %res, %res -%res = call i8 @zext %test2(i16 %two @zext) +%res = call i8 %test2(i16 %two zext) zext %retVal = sext i16 %two to i32 ret i32 %retVal } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Assembler/2002-05-02-ParseError.ll
Changes in directory llvm/test/Regression/Assembler: 2002-05-02-ParseError.ll updated: 1.7 -> 1.8 --- Log message: Make this test that we can drop the implementation keyword for llvm-as. llvm-upgrade is irrelevant for this test case. --- Diffs of the changes: (+3 -3) 2002-05-02-ParseError.ll |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/test/Regression/Assembler/2002-05-02-ParseError.ll diff -u llvm/test/Regression/Assembler/2002-05-02-ParseError.ll:1.7 llvm/test/Regression/Assembler/2002-05-02-ParseError.ll:1.8 --- llvm/test/Regression/Assembler/2002-05-02-ParseError.ll:1.7 Sat Dec 2 14:34:08 2006 +++ llvm/test/Regression/Assembler/2002-05-02-ParseError.ll Fri Jan 5 11:29:41 2007 @@ -1,10 +1,10 @@ -; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f +; RUN: llvm-as %s -o /dev/null -f ; This should parse correctly without an 'implementation', but our current YACC ; based parser doesn't have the required 2 token lookahead... -%T = type int * +%T = type i32 * -%T %test() { +define %T %test() { ret %T null } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Feature/globalredefinition2.ll globalredefinition3.ll globalredefinition.ll
Changes in directory llvm/test/Feature: globalredefinition2.ll added (r1.1) globalredefinition3.ll added (r1.1) globalredefinition.ll updated: 1.3 -> 1.4 --- Log message: For PR1077: http://llvm.org/PR1077 : Split this test case into three cases. globalredefinition.ll just tests that a global can be forward referenced. globalredefinition2.ll tests that llvm-upgrade will warn about renaming duplicate global variables. globalredefinition3.ll tests that llvm-as will generate an error on duplicate global variables. This last test is currently XFAIL because the restriction is not implemented yet. --- Diffs of the changes: (+15 -4) globalredefinition.ll |4 globalredefinition2.ll |6 ++ globalredefinition3.ll |9 + 3 files changed, 15 insertions(+), 4 deletions(-) Index: llvm/test/Feature/globalredefinition2.ll diff -c /dev/null llvm/test/Feature/globalredefinition2.ll:1.1 *** /dev/null Fri Jan 5 11:25:22 2007 --- llvm/test/Feature/globalredefinition2.llFri Jan 5 11:25:12 2007 *** *** 0 --- 1,6 + ; Test that redefinitions of globals produces an error in llvm-upgrade + ; RUN: llvm-upgrade < %s -o /dev/null -f 2>&1 | \ + ; RUN: grep "Global variable '%B' was renamed to '" + + %B = global int 7 + %B = global int 7 Index: llvm/test/Feature/globalredefinition3.ll diff -c /dev/null llvm/test/Feature/globalredefinition3.ll:1.1 *** /dev/null Fri Jan 5 11:25:28 2007 --- llvm/test/Feature/globalredefinition3.llFri Jan 5 11:25:12 2007 *** *** 0 --- 1,9 + ; When PR1067 is fixed, this should not be XFAIL any more. + ; RUN: llvm-as < %s -o /dev/null -f 2>&1 | \ + ; RUN: grep 'Cannot redefine' + ; XFAIL: * + + ; Test forward references and redefinitions of globals + + %B = global i32 7 + %B = global i32 7 Index: llvm/test/Feature/globalredefinition.ll diff -u llvm/test/Feature/globalredefinition.ll:1.3 llvm/test/Feature/globalredefinition.ll:1.4 --- llvm/test/Feature/globalredefinition.ll:1.3 Fri Dec 1 22:23:07 2006 +++ llvm/test/Feature/globalredefinition.ll Fri Jan 5 11:25:12 2007 @@ -4,12 +4,8 @@ ; Test forward references and redefinitions of globals -%Y = global void()* %X - %A = global int* %B %B = global int 7 -%B = global int 7 - declare void %X() ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-upgrade/llvm-upgrade.cpp
Changes in directory llvm/tools/llvm-upgrade: llvm-upgrade.cpp updated: 1.6 -> 1.7 --- Log message: Adjust to new header file name. --- Diffs of the changes: (+1 -1) llvm-upgrade.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llvm-upgrade/llvm-upgrade.cpp diff -u llvm/tools/llvm-upgrade/llvm-upgrade.cpp:1.6 llvm/tools/llvm-upgrade/llvm-upgrade.cpp:1.7 --- llvm/tools/llvm-upgrade/llvm-upgrade.cpp:1.6Sun Dec 31 00:02:26 2006 +++ llvm/tools/llvm-upgrade/llvm-upgrade.cppFri Jan 5 11:19:32 2007 @@ -19,7 +19,7 @@ // //===--===// -#include "ParserInternals.h" +#include "UpgradeInternals.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Streams.h" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Feature/constexpr.ll
Changes in directory llvm/test/Feature: constexpr.ll updated: 1.11 -> 1.12 --- Log message: For PR1077: http://llvm.org/PR1077 : Global variable definitions with the same name and same type are no longer valid so don't attempt to test for this "feature". --- Diffs of the changes: (+0 -12) constexpr.ll | 12 1 files changed, 12 deletions(-) Index: llvm/test/Feature/constexpr.ll diff -u llvm/test/Feature/constexpr.ll:1.11 llvm/test/Feature/constexpr.ll:1.12 --- llvm/test/Feature/constexpr.ll:1.11 Fri Dec 1 22:23:07 2006 +++ llvm/test/Feature/constexpr.ll Fri Jan 5 11:22:13 2007 @@ -77,18 +77,6 @@ ;; TODO: Test constant expressions for unary and binary operators ;;- - -;;--- -;; Test duplicate constant expressions -;;--- - -%t4 = global int** cast (uint** %t3 to int**) - -%char8a = global int* cast (sbyte* getelementptr([11x sbyte]* %somestr, long 0, long 8) to int*) - -;%S3fld3 = global float* getelementptr (%SAType** %S3, long 0, long 0, uint 1, uint 0, long 0) - - ;;--- implementation ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeInternals.h UpgradeLexer.l UpgradeParser.y ParserInternals.h
Changes in directory llvm/tools/llvm-upgrade: UpgradeInternals.h added (r1.1) UpgradeLexer.l updated: 1.12 -> 1.13 UpgradeParser.y updated: 1.32 -> 1.33 ParserInternals.h (r1.12) removed --- Log message: Major update of llvm-upgrade: 1. Completely revise the type system so that types are handled as const objects and not created multiple times, cloned, or otherwise copied. This gets around memory issues, saves memory, and also emulates LLVM's no-two-types-of-the-same-shape-created semantics. 2. Adjust the handling of global names. Basically, we cannot rename them for a variety of reasons: linking, forward references, etc. 3. Detect global names that have name conflicts as the result of collapsed type planes or redefinitions that llvm-as no longer accepts. These will produce warnings on stderr and one of the globals will be renamed. 4. Rename ParserInternals.h as UpgradeInternals.h so it doesn't conflict in the debugger with ParserInternals.h from lib/AsmParser. 5. Move the guts of the TypeInfo class into the grammar so we aren't implementing large functions in a header file. This also helps with debugging a bit. --- Diffs of the changes: (+683 -120) UpgradeInternals.h | 210 ++ UpgradeLexer.l |4 UpgradeParser.y| 589 ++--- 3 files changed, 683 insertions(+), 120 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeInternals.h diff -c /dev/null llvm/tools/llvm-upgrade/UpgradeInternals.h:1.1 *** /dev/null Fri Jan 5 11:19:08 2007 --- llvm/tools/llvm-upgrade/UpgradeInternals.h Fri Jan 5 11:18:58 2007 *** *** 0 --- 1,210 + //===-- UpgradeInternals.h - Internal parser definitionsr ---*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Reid Spencer and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===--===// + // + // This header file defines the variables that are shared between the lexer, + // the parser, and the main program. + // + //===--===// + + #ifndef UPGRADE_INTERNALS_H + #define UPGRADE_INTERNALS_H + + #include + #include + #include + #include + #include + #include + + // Global variables exported from the lexer... + + extern std::string CurFileName; + extern std::string Textin; + extern int Upgradelineno; + extern std::istream* LexInput; + + struct TypeInfo; + typedef std::vector TypeList; + + void UpgradeAssembly( + const std::string & infile, std::istream& in, std::ostream &out, bool debug, + bool addAttrs); + + // Globals exported by the parser... + extern char* Upgradetext; + extern int Upgradeleng; + extern unsigned SizeOfPointer; + + int yyerror(const char *ErrorMsg) ; + + /// This enum is used to keep track of the original (1.9) type used to form + /// a type. These are needed for type upgrades and to determine how to upgrade + /// signed instructions with signless operands. + enum Types { + BoolTy, SByteTy, UByteTy, ShortTy, UShortTy, IntTy, UIntTy, LongTy, ULongTy, + FloatTy, DoubleTy, PointerTy, PackedTy, ArrayTy, StructTy, PackedStructTy, + OpaqueTy, VoidTy, LabelTy, FunctionTy, UnresolvedTy, UpRefTy + }; + + /// This type is used to keep track of the signedness of values. Instead + /// of creating llvm::Value directly, the parser will create ValueInfo which + /// associates a Value* with a Signedness indication. + struct ValueInfo { + std::string* val; + const TypeInfo* type; + bool constant; + bool isConstant() const { return constant; } + inline void destroy(); + }; + + /// This type is used to keep track of the signedness of the obsolete + /// integer types. Instead of creating an llvm::Type directly, the Lexer will + /// create instances of TypeInfo which retains the signedness indication so + /// it can be used by the parser for upgrade decisions. + /// For example if "uint" is encountered then the "first" field will be set + /// to "int32" and the "second" field will be set to "isUnsigned". If the + /// type is not obsolete then "second" will be set to "isSignless". + struct TypeInfo { + + static const TypeInfo* get(const std::string &newType, Types oldType); + static const TypeInfo* get(const std::string& newType, Types oldType, + const TypeInfo* eTy, const TypeInfo* rTy); + + static const TypeInfo* get(const std::string& newType, Types oldType, +const TypeInfo *eTy, uint64_t elems); + + static const TypeInfo* get(const std::string& newType, Types oldType, +TypeList* TL); + + static const TypeInfo* get(const std::string& newType, const TypeInfo* resTy, +TypeList* TL); + + const TypeInfo* resolve() const; +
[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y
Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.298 -> 1.299 --- Log message: Change the syntax for parameter attributes: 1. The @ sign is no longer necessary. 2. We now support "function attributes" as parameter attribute 0. 3. Instead of locating the return type attributes after the type of a function result, they are now located after the function header's closing paranthesis and before any alignment or section options. 4. The way has been prepared for a new "noreturn" function attribute but there is no support for recognizing it in the lexer nor doing anything with it if it does get set. 5. The FunctionType::getParamAttrsText method now has support for returning multiple attributes. This required a change in its interface. I'm unhappy that this change leads to 6 new shift/reduce conflicts, but in each case bison's decision to choose the shift is correct so there shouldn't be any damage from these conflicts. --- Diffs of the changes: (+52 -45) llvmAsmParser.y | 97 ++-- 1 files changed, 52 insertions(+), 45 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.298 llvm/lib/AsmParser/llvmAsmParser.y:1.299 --- llvm/lib/AsmParser/llvmAsmParser.y:1.298Wed Jan 3 20:57:22 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Fri Jan 5 11:06:19 2007 @@ -951,7 +951,7 @@ %type IndexList // For GEP indices %type TypeListI %type ArgTypeList ArgTypeListI -%type ArgType ResultType +%type ArgType %type JumpTable %typeGlobalType // GLOBAL or CONSTANT? %typeOptVolatile // 'volatile' or not @@ -978,7 +978,7 @@ %token FPVAL // Float or Double constant // Built in types... -%type Types +%type Types ResultTypes %type IntType FPType PrimType // Classifications %token VOID BOOL INT8 INT16 INT32 INT64 %token FLOAT DOUBLE LABEL @@ -999,7 +999,8 @@ %token X86_STDCALLCC_TOK X86_FASTCALLCC_TOK %token DATALAYOUT %type OptCallingConv -%type OptParamAttrs ParamAttrList ParamAttr +%type OptParamAttrs ParamAttr +%type OptFuncAttrs FuncAttr // Basic Block Terminating Operators %token RET BR SWITCH INVOKE UNWIND UNREACHABLE @@ -1026,6 +1027,8 @@ %token PHI_TOK SELECT SHL LSHR ASHR VAARG %token EXTRACTELEMENT INSERTELEMENT SHUFFLEVECTOR +// Function Attributes +%token NORETURN %start Module %% @@ -1129,15 +1132,20 @@ | SEXT { $$ = FunctionType::SExtAttribute; } ; -ParamAttrList : ParamAttr{ $$ = $1; } - | ParamAttrList ',' ParamAttr { -$$ = FunctionType::ParameterAttributes($1 | $3); +OptParamAttrs : /* empty */ { $$ = FunctionType::NoAttributeSet; } + | OptParamAttrs ParamAttr { +$$ = FunctionType::ParameterAttributes($1 | $2); } ; -OptParamAttrs : /* empty */ { $$ = FunctionType::NoAttributeSet; } - | '@' ParamAttr { $$ = $2; } - | '@' '(' ParamAttrList ')' { $$ = $3; } +FuncAttr : NORETURN { $$ = FunctionType::NoReturnAttribute; } + | ParamAttr + ; + +OptFuncAttrs : /* empty */ { $$ = FunctionType::NoAttributeSet; } + | OptFuncAttrs FuncAttr { +$$ = FunctionType::ParameterAttributes($1 | $2); + } ; // OptAlign/OptCAlign - An optional alignment, and an optional alignment with @@ -1223,11 +1231,11 @@ UR_OUT("New Upreference!\n"); CHECK_FOR_ERROR } - | Types OptParamAttrs '(' ArgTypeListI ')' { + | Types '(' ArgTypeListI ')' OptFuncAttrs { std::vector Params; std::vector Attrs; -Attrs.push_back($2); -for (TypeWithAttrsList::iterator I=$4->begin(), E=$4->end(); I != E; ++I) { +Attrs.push_back($5); +for (TypeWithAttrsList::iterator I=$3->begin(), E=$3->end(); I != E; ++I) { Params.push_back(I->Ty->get()); if (I->Ty->get() != Type::VoidTy) Attrs.push_back(I->Attrs); @@ -1236,16 +1244,16 @@ if (isVarArg) Params.pop_back(); FunctionType *FT = FunctionType::get(*$1, Params, isVarArg, Attrs); -delete $4; // Delete the argument list +delete $3; // Delete the argument list delete $1; // Delete the return type handle $$ = new PATypeHolder(HandleUpRefs(FT)); CHECK_FOR_ERROR } - | VOID OptParamAttrs '(' ArgTypeListI ')' { + | VOID '(' ArgTypeListI ')' OptFuncAttrs { std::vector Params; std::vector Attrs; -Attrs.push_back($2); -for (TypeWithAttrsList::iterator I=$4->begin(), E=$4->end(); I != E; ++I) { +Attrs.push_back($5); +for (TypeWithAttrsList::iterator I=$3->begin(), E=$3->end(); I != E; ++I) { Params.push_back(I->Ty->get()); if (I->Ty->get() != Type::VoidTy) Attrs.push_back(I->Attrs); @@ -1254,7 +1262,7 @@ if (isVarArg) Params.pop_back(); Fun
[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Type.cpp
Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.233 -> 1.234 Type.cpp updated: 1.154 -> 1.155 --- Log message: Change the syntax for parameter attributes: 1. The @ sign is no longer necessary. 2. We now support "function attributes" as parameter attribute 0. 3. Instead of locating the return type attributes after the type of a function result, they are now located after the function header's closing paranthesis and before any alignment or section options. 4. The way has been prepared for a new "noreturn" function attribute but there is no support for recognizing it in the lexer nor doing anything with it if it does get set. 5. The FunctionType::getParamAttrsText method now has support for returning multiple attributes. This required a change in its interface. I'm unhappy that this change leads to 6 new shift/reduce conflicts, but in each case bison's decision to choose the shift is correct so there shouldn't be any damage from these conflicts. --- Diffs of the changes: (+27 -27) AsmWriter.cpp | 28 ++-- Type.cpp | 26 +- 2 files changed, 27 insertions(+), 27 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.233 llvm/lib/VMCore/AsmWriter.cpp:1.234 --- llvm/lib/VMCore/AsmWriter.cpp:1.233 Sun Dec 31 16:17:01 2006 +++ llvm/lib/VMCore/AsmWriter.cpp Fri Jan 5 11:06:19 2007 @@ -271,10 +271,6 @@ case Type::FunctionTyID: { const FunctionType *FTy = cast(Ty); calcTypeName(FTy->getReturnType(), TypeStack, TypeNames, Result); -if (FTy->getParamAttrs(0)) { - Result += " "; - Result += FunctionType::getParamAttrsText(FTy->getParamAttrs(0)); -} Result += " ("; unsigned Idx = 1; for (FunctionType::param_iterator I = FTy->param_begin(), @@ -293,6 +289,10 @@ Result += "..."; } Result += ")"; +if (FTy->getParamAttrs(0)) { + Result += " "; + Result += FunctionType::getParamAttrsText(FTy->getParamAttrs(0)); +} break; } case Type::StructTyID: { @@ -698,8 +698,6 @@ std::ostream &AssemblyWriter::printTypeAtLeastOneLevel(const Type *Ty) { if (const FunctionType *FTy = dyn_cast(Ty)) { printType(FTy->getReturnType()); -if (FTy->getParamAttrs(0)) - Out << ' ' << FunctionType::getParamAttrsText(FTy->getParamAttrs(0)); Out << " ("; unsigned Idx = 1; for (FunctionType::param_iterator I = FTy->param_begin(), @@ -717,6 +715,8 @@ Out << "..."; } Out << ')'; +if (FTy->getParamAttrs(0)) + Out << ' ' << FunctionType::getParamAttrsText(FTy->getParamAttrs(0)); } else if (const StructType *STy = dyn_cast(Ty)) { if (STy->isPacked()) Out << '<'; @@ -969,8 +969,6 @@ const FunctionType *FT = F->getFunctionType(); printType(F->getReturnType()) << ' '; - if (FT->getParamAttrs(0)) -Out << FunctionType::getParamAttrsText(FT->getParamAttrs(0)) << ' '; if (!F->getName().empty()) Out << getLLVMName(F->getName()); else @@ -995,7 +993,8 @@ Out << "..."; // Output varargs portion of signature! } Out << ')'; - + if (FT->getParamAttrs(0)) +Out << ' ' << FunctionType::getParamAttrsText(FT->getParamAttrs(0)); if (F->hasSection()) Out << " section \"" << F->getSection() << '"'; if (F->getAlignment()) @@ -1186,8 +1185,6 @@ (!isa(RetTy) || !isa(cast(RetTy)->getElementType( { Out << ' '; printType(RetTy); - if (FTy->getParamAttrs(0) != FunctionType::NoAttributeSet) -Out << " " << FTy->getParamAttrsText(FTy->getParamAttrs(0)); writeOperand(Operand, false); } else { writeOperand(Operand, true); @@ -1201,6 +1198,8 @@ Out << " " << FTy->getParamAttrsText(FTy->getParamAttrs(op)); } Out << " )"; +if (FTy->getParamAttrs(0) != FunctionType::NoAttributeSet) + Out << ' ' << FTy->getParamAttrsText(FTy->getParamAttrs(0)); } else if (const InvokeInst *II = dyn_cast(&I)) { const PointerType *PTy = cast(Operand->getType()); const FunctionType *FTy = cast(PTy->getElementType()); @@ -1225,8 +1224,6 @@ (!isa(RetTy) || !isa(cast(RetTy)->getElementType( { Out << ' '; printType(RetTy); - if (FTy->getParamAttrs(0) != FunctionType::NoAttributeSet) -Out << " " << FTy->getParamAttrsText(FTy->getParamAttrs(0)); writeOperand(Operand, false); } else { writeOperand(Operand, true); @@ -1241,7 +1238,10 @@ Out << " " << FTy->getParamAttrsText(FTy->getParamAttrs(op-2)); } -Out << " )\n\t\t\tto"; +Out << " )"; +if (FTy->getParamAttrs(0) != FunctionType::NoAttributeSet) + Out << " " << FTy->getParamAttrsText(FTy->getParamAttrs(0)); +Out << "\n\t\t\tto"; writeOperand(II->getNormalDest(), true); Out << " unwind"; writeOperand(II->getUnwindDest(), true); Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.154 ll
[llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h
Changes in directory llvm/include/llvm: DerivedTypes.h updated: 1.76 -> 1.77 --- Log message: Change the syntax for parameter attributes: 1. The @ sign is no longer necessary. 2. We now support "function attributes" as parameter attribute 0. 3. Instead of locating the return type attributes after the type of a function result, they are now located after the function header's closing paranthesis and before any alignment or section options. 4. The way has been prepared for a new "noreturn" function attribute but there is no support for recognizing it in the lexer nor doing anything with it if it does get set. 5. The FunctionType::getParamAttrsText method now has support for returning multiple attributes. This required a change in its interface. I'm unhappy that this change leads to 6 new shift/reduce conflicts, but in each case bison's decision to choose the shift is correct so there shouldn't be any damage from these conflicts. --- Diffs of the changes: (+5 -4) DerivedTypes.h |9 + 1 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.76 llvm/include/llvm/DerivedTypes.h:1.77 --- llvm/include/llvm/DerivedTypes.h:1.76 Thu Jan 4 11:50:42 2007 +++ llvm/include/llvm/DerivedTypes.hFri Jan 5 11:06:19 2007 @@ -81,9 +81,10 @@ /// set of possible attributes. /// @brief Function parameter attributes enumeration. enum ParameterAttributes { -NoAttributeSet = 0, ///< No attribute value has been set on the parameter -ZExtAttribute = 1, ///< The parameter should be zero extended before call -SExtAttribute = 2 ///< The parameter should be sign extended before call +NoAttributeSet= 0, ///< No attribute value has been set +ZExtAttribute = 1, ///< zero extended before/after call +SExtAttribute = 1 << 1, ///< sign extended before/after call +NoReturnAttribute = 1 << 2 ///< mark the function as not returning }; typedef std::vector ParamAttrsList; private: @@ -142,7 +143,7 @@ } /// @brief Convert a ParameterAttribute into its assembly text - static const char * getParamAttrsText(ParameterAttributes Attr); + static std::string getParamAttrsText(ParameterAttributes Attr); // Implement the AbstractTypeUser interface. virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll
Changes in directory llvm/test/Regression/CodeGen/X86: sse-fcopysign.ll updated: 1.1 -> 1.2 --- Log message: Give the assembler some input. --- Diffs of the changes: (+4 -3) sse-fcopysign.ll |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll diff -u llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll:1.1 llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll:1.2 --- llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll:1.1 Fri Jan 5 02:12:59 2007 +++ llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll Fri Jan 5 10:45:06 2007 @@ -1,6 +1,7 @@ -; RUN: llvm-as | llc -march=x86 -mattr=+sse2 && -; RUN: llvm-as | llc -march=x86 -mattr=+sse2 | grep pslldq | wc -l | grep 1 && -; RUN: llvm-as | llc -march=x86 -mattr=+sse2 | not getp test +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 && +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | \ +; RUN:grep pslldq | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not getp test define float %test1(float %a, float %b) { %tmp = tail call float %copysignf( float %b, float %a ) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp
Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.311 -> 1.312 --- Log message: Typo --- Diffs of the changes: (+1 -1) X86ISelLowering.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.311 llvm/lib/Target/X86/X86ISelLowering.cpp:1.312 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.311 Fri Jan 5 01:55:56 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Fri Jan 5 02:32:24 2007 @@ -4144,7 +4144,7 @@ Constant *CS = ConstantStruct::get(CV); SDOperand CPIdx = DAG.getConstantPool(CS, getPointerTy(), 4); std::vector Tys; - Tys.push_back(VT); + Tys.push_back(SrcVT); Tys.push_back(MVT::Other); SmallVector Ops; Ops.push_back(DAG.getEntryNode()); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll
Changes in directory llvm/test/Regression/CodeGen/X86: sse-fcopysign.ll added (r1.1) --- Log message: Add a test case for SSE fcopysign using SSE bitwise operations. --- Diffs of the changes: (+18 -0) sse-fcopysign.ll | 18 ++ 1 files changed, 18 insertions(+) Index: llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll:1.1 *** /dev/null Fri Jan 5 02:13:09 2007 --- llvm/test/Regression/CodeGen/X86/sse-fcopysign.ll Fri Jan 5 02:12:59 2007 *** *** 0 --- 1,18 + ; RUN: llvm-as | llc -march=x86 -mattr=+sse2 && + ; RUN: llvm-as | llc -march=x86 -mattr=+sse2 | grep pslldq | wc -l | grep 1 && + ; RUN: llvm-as | llc -march=x86 -mattr=+sse2 | not getp test + + define float %test1(float %a, float %b) { + %tmp = tail call float %copysignf( float %b, float %a ) + ret float %tmp + } + + define double %test2(double %a, float %b, float %c) { + %tmp1 = add float %b, %c + %tmp2 = fpext float %tmp1 to double + %tmp = tail call double %copysign( double %a, double %tmp2 ) + ret double %tmp + } + + declare float %copysignf(float, float) + declare double %copysign(double, double) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits