[llvm-commits] CVS: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
Changes in directory llvm/lib/Transforms/IPO: SimplifyLibCalls.cpp updated: 1.65 -> 1.66 --- Log message: More libcall transformations: printf("%s\n", str) -> puts(str) printf("%c", c) -> putchar(c) Also fixed fprintf(file, "%c", c) -> fputc(c, file) --- Diffs of the changes: (+110 -8) SimplifyLibCalls.cpp | 118 +++ 1 files changed, 110 insertions(+), 8 deletions(-) Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.65 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.66 --- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.65 Thu Jun 15 23:52:30 2006 +++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cppFri Jun 16 03:36:35 2006 @@ -221,6 +221,23 @@ /// @brief Return the size_t type -- syntactic shortcut const Type* getIntPtrType() const { return TD->getIntPtrType(); } + /// @brief Return a Function* for the putchar libcall + Function* get_putchar() { +if (!putchar_func) + putchar_func = M->getOrInsertFunction("putchar", Type::IntTy, Type::IntTy, +NULL); +return putchar_func; + } + + /// @brief Return a Function* for the puts libcall + Function* get_puts() { +if (!puts_func) + puts_func = M->getOrInsertFunction("puts", Type::IntTy, + PointerType::get(Type::SByteTy), + NULL); +return puts_func; + } + /// @brief Return a Function* for the fputc libcall Function* get_fputc(const Type* FILEptr_type) { if (!fputc_func) @@ -318,6 +335,8 @@ void reset(Module& mod) { M = &mod; TD = &getAnalysis(); +putchar_func = 0; +puts_func = 0; fputc_func = 0; fputs_func = 0; fwrite_func = 0; @@ -335,6 +354,7 @@ private: /// Caches for function pointers. + Function *putchar_func, *puts_func; Function *fputc_func, *fputs_func, *fwrite_func; Function *memcpy_func, *memchr_func; Function* sqrt_func; @@ -1264,10 +1284,94 @@ } } PowOptimizer; +/// This LibCallOptimization will simplify calls to the "printf" library +/// function. It looks for cases where the result of printf is not used and the +/// operation can be reduced to something simpler. +/// @brief Simplify the printf library function. +struct PrintfOptimization : public LibCallOptimization { +public: + /// @brief Default Constructor + PrintfOptimization() : LibCallOptimization("printf", + "Number of 'printf' calls simplified") {} + + /// @brief Make sure that the "printf" function has the right prototype + virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC){ +// Just make sure this has at least 1 arguments +return (f->arg_size() >= 1); + } + + /// @brief Perform the printf optimization. + virtual bool OptimizeCall(CallInst* ci, SimplifyLibCalls& SLC) { +// If the call has more than 2 operands, we can't optimize it +if (ci->getNumOperands() > 3 || ci->getNumOperands() <= 2) + return false; + +// If the result of the printf call is used, none of these optimizations +// can be made. +if (!ci->use_empty()) + return false; + +// All the optimizations depend on the length of the first argument and the +// fact that it is a constant string array. Check that now +uint64_t len = 0; +ConstantArray* CA = 0; +if (!getConstantStringLength(ci->getOperand(1), len, &CA)) + return false; + +if (len != 2 && len != 3) + return false; + +// The first character has to be a % +if (ConstantInt* CI = dyn_cast(CA->getOperand(0))) + if (CI->getRawValue() != '%') +return false; + +// Get the second character and switch on its value +ConstantInt* CI = dyn_cast(CA->getOperand(1)); +switch (CI->getRawValue()) { + case 's': + { +if (len != 3 || +dyn_cast(CA->getOperand(2))->getRawValue() != '\n') + return false; + +// printf("%s\n",str) -> puts(str) +Function* puts_func = SLC.get_puts(); +if (!puts_func) + return false; +std::vector args; +args.push_back(ci->getOperand(2)); +new CallInst(puts_func,args,ci->getName(),ci); +ci->replaceAllUsesWith(ConstantSInt::get(Type::IntTy,len)); +break; + } + case 'c': + { +// printf("%c",c) -> putchar(c) +if (len != 2) + return false; + +Function* putchar_func = SLC.get_putchar(); +if (!putchar_func) + return false; +CastInst* cast = new CastInst(ci->getOperand(2), Type::IntTy, + CI->getName()+".int", ci); +new CallInst(putchar_func, cast, "", ci); +ci->replaceAllUsesWith(ConstantSInt::get(Type::IntTy, 1)); +break; + } + default: +return false; +} +ci->eraseFromParent(); +return true; + } +} PrintfOptimizer; +
[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineDebugInfo.h
Changes in directory llvm/include/llvm/CodeGen: MachineDebugInfo.h updated: 1.35 -> 1.36 --- Log message: 1. Revise vector debug support. 2. Update docs for vector debug support and new version control. 3. Simplify serialization of DebugDescInfo subclasses. --- Diffs of the changes: (+51 -34) MachineDebugInfo.h | 85 +++-- 1 files changed, 51 insertions(+), 34 deletions(-) Index: llvm/include/llvm/CodeGen/MachineDebugInfo.h diff -u llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.35 llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.36 --- llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.35 Thu Jun 15 15:51:43 2006 +++ llvm/include/llvm/CodeGen/MachineDebugInfo.hFri Jun 16 08:14:03 2006 @@ -57,7 +57,8 @@ // Debug info constants. enum { - LLVMDebugVersion = 4 // Current version of debug information. + LLVMDebugVersion = (4 << 16), // Current version of debug information. + LLVMDebugVersionMask = 0x // Mask for version number. }; //===--===// @@ -90,25 +91,20 @@ /// class DebugInfoDesc { private: - enum { -tag_mask = 0x, -version_shift = 16 - }; - - unsigned Tag; // Content indicator. Dwarf values are // used but that does not limit use to // Dwarf writers. protected: - DebugInfoDesc(unsigned T) : Tag(T | (LLVMDebugVersion << version_shift)) {} + DebugInfoDesc(unsigned T) : Tag(T | LLVMDebugVersion) {} public: virtual ~DebugInfoDesc() {} // Accessors - unsigned getTag() const { return Tag & tag_mask; } - unsigned getVersion() const { return Tag >> version_shift; } + unsigned getTag() const { return Tag & ~LLVMDebugVersionMask; } + unsigned getVersion() const { return Tag & LLVMDebugVersionMask; } + void setTag(unsigned T) { Tag = T | LLVMDebugVersion; } /// TagFromGlobal - Returns the tag number from a debug info descriptor /// GlobalVariable. Return DIIValid if operand is not an unsigned int. @@ -199,7 +195,7 @@ /// descriptors. class AnchoredDesc : public DebugInfoDesc { private: - AnchorDesc *Anchor; // Anchor for all descriptors of the + DebugInfoDesc *Anchor;// Anchor for all descriptors of the // same type. protected: @@ -208,8 +204,8 @@ public: // Accessors. - AnchorDesc *getAnchor() const { return Anchor; } - void setAnchor(AnchorDesc *A) { Anchor = A; } + AnchorDesc *getAnchor() const { return static_cast(Anchor); } + void setAnchor(AnchorDesc *A) { Anchor = static_cast(A); } //======// // Subclasses should supply the following virtual methods. @@ -282,7 +278,7 @@ private: DebugInfoDesc *Context; // Context debug descriptor. std::string Name; // Type name (may be empty.) - CompileUnitDesc *File;// Defined compile unit (may be NULL.) + DebugInfoDesc *File; // Defined compile unit (may be NULL.) unsigned Line;// Defined line# (may be zero.) uint64_t Size;// Type bit size (may be zero.) uint64_t Align; // Type bit alignment (may be zero.) @@ -294,14 +290,18 @@ // Accessors DebugInfoDesc *getContext()const { return Context; } const std::string &getName() const { return Name; } - CompileUnitDesc *getFile() const { return File; } + CompileUnitDesc *getFile() const { +return static_cast(File); + } unsigned getLine() const { return Line; } uint64_t getSize() const { return Size; } uint64_t getAlign()const { return Align; } uint64_t getOffset() const { return Offset; } void setContext(DebugInfoDesc *C){ Context = C; } void setName(const std::string &N) { Name = N; } - void setFile(CompileUnitDesc *U) { File = U; } + void setFile(CompileUnitDesc *U) { +File = static_cast(U); + } void setLine(unsigned L) { Line = L; } void setSize(uint64_t S) { Size = S; } void setAlign(uint64_t A){ Align = A; } @@ -365,14 +365,18 @@ /// derived types (eg., typedef, pointer, reference.) class DerivedTypeDesc : public TypeDesc { private: - TypeDesc *FromType; // Type derived from. + DebugInfoDesc *FromType; // Type derived from. public: DerivedTypeDesc(unsigned T); // Accessors - TypeDesc *getFromType()const { return FromType; } - void setFromType(T
[llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp MachineDebugInfo.cpp
Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.62 -> 1.63 MachineDebugInfo.cpp updated: 1.41 -> 1.42 --- Log message: 1. Revise vector debug support. 2. Update docs for vector debug support and new version control. 3. Simplify serialization of DebugDescInfo subclasses. --- Diffs of the changes: (+24 -35) DwarfWriter.cpp | 16 +--- MachineDebugInfo.cpp | 43 +++ 2 files changed, 24 insertions(+), 35 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.62 llvm/lib/CodeGen/DwarfWriter.cpp:1.63 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.62 Thu Jun 15 15:51:43 2006 +++ llvm/lib/CodeGen/DwarfWriter.cppFri Jun 16 08:14:03 2006 @@ -1276,11 +1276,18 @@ NewType(Context, FromTy, Unit)); } } else if (CompositeTypeDesc *CompTy = dyn_cast(TyDesc)) { +// Fetch tag +unsigned Tag = CompTy->getTag(); + // Create specific DIE. -Slot = Ty = new DIE(CompTy->getTag()); +Slot = Ty = Tag == DW_TAG_vector_type ? new DIE(DW_TAG_array_type) : +new DIE(Tag); + std::vector &Elements = CompTy->getElements(); -switch (CompTy->getTag()) { +switch (Tag) { +case DW_TAG_vector_type: Ty->AddUInt(DW_AT_GNU_vector, DW_FORM_flag, 1); + // Fall thru case DW_TAG_array_type: { // Add element type. if (TypeDesc *FromTy = CompTy->getFromType()) { @@ -1288,11 +1295,6 @@ NewType(Context, FromTy, Unit)); } - // check for vector type - if (CompTy->isVector()) { -Ty->AddUInt(DW_AT_GNU_vector, DW_FORM_flag, 1); - } - // Don't emit size attribute. Size = 0; Index: llvm/lib/CodeGen/MachineDebugInfo.cpp diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.41 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.42 --- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.41 Thu Jun 15 15:51:43 2006 +++ llvm/lib/CodeGen/MachineDebugInfo.cpp Fri Jun 16 08:14:03 2006 @@ -459,7 +459,8 @@ /// GlobalVariable. Return DIIValid if operand is not an unsigned int. unsigned DebugInfoDesc::TagFromGlobal(GlobalVariable *GV) { ConstantUInt *C = getUIntOperand(GV, 0); - return C ? ((unsigned)C->getValue() & tag_mask) : (unsigned)DW_TAG_invalid; + return C ? ((unsigned)C->getValue() & ~LLVMDebugVersionMask) : + (unsigned)DW_TAG_invalid; } /// VersionFromGlobal - Returns the version number from a debug info @@ -467,7 +468,7 @@ /// int. unsigned DebugInfoDesc::VersionFromGlobal(GlobalVariable *GV) { ConstantUInt *C = getUIntOperand(GV, 0); - return C ? ((unsigned)C->getValue() >> version_shift) : + return C ? ((unsigned)C->getValue() & LLVMDebugVersionMask) : (unsigned)DW_TAG_invalid; } @@ -491,7 +492,8 @@ case DW_TAG_array_type: case DW_TAG_structure_type: case DW_TAG_union_type: - case DW_TAG_enumeration_type: return new CompositeTypeDesc(Tag); + case DW_TAG_enumeration_type: + case DW_TAG_vector_type: return new CompositeTypeDesc(Tag); case DW_TAG_subrange_type:return new SubrangeDesc(); case DW_TAG_enumerator: return new EnumeratorDesc(); case DW_TAG_return_variable: @@ -590,9 +592,7 @@ void AnchoredDesc::ApplyToFields(DIVisitor *Visitor) { DebugInfoDesc::ApplyToFields(Visitor); - DebugInfoDesc *Tmp = Anchor; - Visitor->Apply(Tmp); - Anchor = (AnchorDesc*)Tmp; + Visitor->Apply(Anchor); } //===--===// @@ -673,9 +673,7 @@ Visitor->Apply(Context); Visitor->Apply(Name); - DebugInfoDesc* Tmp = File; - Visitor->Apply(Tmp); - File = (CompileUnitDesc*)Tmp; + Visitor->Apply(File); Visitor->Apply(Line); Visitor->Apply(Size); Visitor->Apply(Align); @@ -782,9 +780,7 @@ void DerivedTypeDesc::ApplyToFields(DIVisitor *Visitor) { TypeDesc::ApplyToFields(Visitor); - DebugInfoDesc* Tmp = FromType; - Visitor->Apply(Tmp); - FromType = (TypeDesc*)Tmp; + Visitor->Apply(FromType); } /// getDescString - Return a string used to compose global names and labels. @@ -817,7 +813,6 @@ CompositeTypeDesc::CompositeTypeDesc(unsigned T) : DerivedTypeDesc(T) -, IsVector(false) , Elements() {} @@ -829,6 +824,7 @@ case DW_TAG_structure_type: case DW_TAG_union_type: case DW_TAG_enumeration_type: + case DW_TAG_vector_type: return true; default: break; } @@ -838,9 +834,8 @@ /// ApplyToFields - Target the visitor to the fields of the CompositeTypeDesc. /// void CompositeTypeDesc::ApplyToFields(DIVisitor *Visitor) { - DerivedTypeDesc::ApplyToFields(Visitor); - - Visitor->Apply(IsVector); + DerivedTypeDesc::ApplyToFields(Visitor); + Visitor->Apply(Elements); } @@ -990,13 +985,9 @@ Visitor->Apply(Context); Visitor->Apply(Name); - DebugInfoDesc* Tmp1 = File; - Visitor->Apply(Tmp1); - File = (CompileU
[llvm-commits] CVS: llvm/include/llvm/Support/Dwarf.h
Changes in directory llvm/include/llvm/Support: Dwarf.h updated: 1.7 -> 1.8 --- Log message: 1. Revise vector debug support. 2. Update docs for vector debug support and new version control. 3. Simplify serialization of DebugDescInfo subclasses. --- Diffs of the changes: (+2 -0) Dwarf.h |2 ++ 1 files changed, 2 insertions(+) Index: llvm/include/llvm/Support/Dwarf.h diff -u llvm/include/llvm/Support/Dwarf.h:1.7 llvm/include/llvm/Support/Dwarf.h:1.8 --- llvm/include/llvm/Support/Dwarf.h:1.7 Thu Jun 15 15:51:43 2006 +++ llvm/include/llvm/Support/Dwarf.h Fri Jun 16 08:14:03 2006 @@ -37,6 +37,8 @@ DW_TAG_arg_variable = 0x101, // Tag for argument variables. DW_TAG_return_variable = 0x102, // Tag for return variables. + DW_TAG_vector_type = 0x103, // Tag for vector types. + DW_TAG_user_base = 0x1000,// Recommended base for user tags. DW_CIE_VERSION = 1, // Common frame information version. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/SourceLevelDebugging.html
Changes in directory llvm/docs: SourceLevelDebugging.html updated: 1.19 -> 1.20 --- Log message: 1. Revise vector debug support. 2. Update docs for vector debug support and new version control. 3. Simplify serialization of DebugDescInfo subclasses. --- Diffs of the changes: (+56 -56) SourceLevelDebugging.html | 112 +++--- 1 files changed, 56 insertions(+), 56 deletions(-) Index: llvm/docs/SourceLevelDebugging.html diff -u llvm/docs/SourceLevelDebugging.html:1.19 llvm/docs/SourceLevelDebugging.html:1.20 --- llvm/docs/SourceLevelDebugging.html:1.19Thu Jun 15 15:51:43 2006 +++ llvm/docs/SourceLevelDebugging.html Fri Jun 16 08:14:02 2006 @@ -295,13 +295,15 @@ } -The first field of a descriptor is always an uint containing a tag -value identifying the content of the descriptor. The remaining fields are -specific to the descriptor. The values of tags are loosely bound to the tag -values of Dwarf information entries. However, that does not restrict the use of -the information supplied to Dwarf targets. +The first field of a descriptor is always an +uint containing a tag value identifying the content of the descriptor. +The remaining fields are specific to the descriptor. The values of tags are +loosely bound to the tag values of Dwarf information entries. However, that +does not restrict the use of the information supplied to Dwarf targets. To +facilitate versioning of debug information, the tag is augmented with the +current debug version (LLVMDebugVersion = 4 << 16 or 0x4.) -The details of the various descriptors follow. +The details of the various descriptors follow. @@ -314,7 +316,7 @@ %llvm.dbg.anchor.type = type { -uint, ;; Tag = 0 +uint, ;; Tag = 0 + LLVMDebugVersion uint;; Tag of descriptors grouped by the anchor } @@ -352,9 +354,8 @@ %llvm.dbg.compile_unit.type = type { -uint, ;; Tag = 17 (DW_TAG_compile_unit) +uint, ;; Tag = 17 + LLVMDebugVersion (DW_TAG_compile_unit) { }*, ;; Compile unit anchor = cast = (%llvm.dbg.anchor.type* %llvm.dbg.compile_units to { }*) -uint, ;; LLVM debug version number = 3 uint, ;; Dwarf language identifier (ex. DW_LANG_C89) sbyte*, ;; Source file name sbyte*, ;; Source file directory (includes trailing slash) @@ -362,11 +363,11 @@ } -These descriptors contain the version number for the debug info (currently -3), a source language ID for the file (we use the Dwarf 3.0 ID numbers, such as -DW_LANG_C89, DW_LANG_C_plus_plus, DW_LANG_Cobol74, -etc), three strings describing the filename, working directory of the compiler, -and an identifier string for the compiler that produced it. +These descriptors contain a source language ID for the file (we use the Dwarf +3.0 ID numbers, such as DW_LANG_C89, DW_LANG_C_plus_plus, +DW_LANG_Cobol74, etc), three strings describing the filename, working +directory of the compiler, and an identifier string for the compiler that +produced it. Compile unit descriptors provide the root context for objects declared in a specific source file. Global variables and top level functions would be defined @@ -384,7 +385,7 @@ %llvm.dbg.global_variable.type = type { -uint, ;; Tag = 52 (DW_TAG_variable) +uint, ;; Tag = 52 + LLVMDebugVersion (DW_TAG_variable) { }*, ;; Global variable anchor = cast (%llvm.dbg.anchor.type* %llvm.dbg.global_variables to { }*), { }*, ;; Reference to context descriptor sbyte*, ;; Name @@ -411,7 +412,7 @@ %llvm.dbg.subprogram.type = type { -uint, ;; Tag = 46 (DW_TAG_subprogram) +uint, ;; Tag = 46 + LLVMDebugVersion (DW_TAG_subprogram) { }*, ;; Subprogram anchor = cast (%llvm.dbg.anchor.type* %llvm.dbg.subprograms to { }*), { }*, ;; Reference to context descriptor sbyte*, ;; Name @@ -437,7 +438,7 @@ %llvm.dbg.block = type { -uint, ;; Tag = 13 (DW_TAG_lexical_block) +uint, ;; Tag = 13 + LLVMDebugVersion (DW_TAG_lexical_block) { }* ;; Reference to context descriptor } @@ -457,7 +458,7 @@ %llvm.dbg.basictype.type = type { -uint, ;; Tag = 36 (DW_TAG_base_type) +uint, ;; Tag = 36 + LLVMDebugVersion (DW_TAG_base_type) { }*, ;; Reference to context (typically a compile unit) sbyte*, ;; Name (may be "" for anonymous types) { }*, ;; Reference to compile unit where defined (may be NULL) @@ -575,7 +576,6 @@ uint, ;; Size in bits uint, ;; Alignment in bits uint, ;; Offset in bits -bool, ;; Is vector flag { }* ;; Reference to array of member descriptors } @@ -589,13 +589,15 @@ DW_TAG_enumeration_type = 4 DW_TAG_structure_type = 19 DW_TAG_union_type = 23 + DW_TAG_vector_type = 259 The vector flag indicates that an array type is a native packed vector. -The members of array types (tag = DW_TAG_array_type) are subrange descriptors, each representing the rang
[llvm-commits] CVS: llvm/docs/SourceLevelDebugging.html
Changes in directory llvm/docs: SourceLevelDebugging.html updated: 1.20 -> 1.21 --- Log message: add decimal form of LLVMDebugVersion --- Diffs of the changes: (+2 -2) SourceLevelDebugging.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/SourceLevelDebugging.html diff -u llvm/docs/SourceLevelDebugging.html:1.20 llvm/docs/SourceLevelDebugging.html:1.21 --- llvm/docs/SourceLevelDebugging.html:1.20Fri Jun 16 08:14:02 2006 +++ llvm/docs/SourceLevelDebugging.html Fri Jun 16 08:45:38 2006 @@ -301,7 +301,7 @@ loosely bound to the tag values of Dwarf information entries. However, that does not restrict the use of the information supplied to Dwarf targets. To facilitate versioning of debug information, the tag is augmented with the -current debug version (LLVMDebugVersion = 4 << 16 or 0x4.) +current debug version (LLVMDebugVersion = 4 << 16 or 0x4 or 262144.) The details of the various descriptors follow. @@ -1750,7 +1750,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2006/06/16 13:14:02 $ + Last modified: $Date: 2006/06/16 13:45:38 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Analysis/LinkAllAnalyses.h CallTargets.h
Changes in directory llvm/include/llvm/Analysis: LinkAllAnalyses.h updated: 1.5 -> 1.6 CallTargets.h (r1.1) removed --- Log message: move header --- Diffs of the changes: (+1 -1) LinkAllAnalyses.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Analysis/LinkAllAnalyses.h diff -u llvm/include/llvm/Analysis/LinkAllAnalyses.h:1.5 llvm/include/llvm/Analysis/LinkAllAnalyses.h:1.6 --- llvm/include/llvm/Analysis/LinkAllAnalyses.h:1.5Mon May 29 17:58:38 2006 +++ llvm/include/llvm/Analysis/LinkAllAnalyses.hFri Jun 16 09:33:00 2006 @@ -22,7 +22,7 @@ #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/DataStructure/DataStructure.h" -#include "llvm/Analysis/CallTargets.h" +#include "llvm/Analysis/DataStructure/CallTargets.h" #include "llvm/Function.h" #include ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/CallTargets.cpp
Changes in directory llvm/lib/Analysis/DataStructure: CallTargets.cpp updated: 1.1 -> 1.2 --- Log message: move header --- Diffs of the changes: (+1 -1) CallTargets.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Analysis/DataStructure/CallTargets.cpp diff -u llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.1 llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.2 --- llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.1 Mon May 29 18:39:48 2006 +++ llvm/lib/Analysis/DataStructure/CallTargets.cpp Fri Jun 16 09:33:53 2006 @@ -21,7 +21,7 @@ #include "llvm/Instructions.h" #include "llvm/Analysis/DataStructure/DataStructure.h" #include "llvm/Analysis/DataStructure/DSGraph.h" -#include "llvm/Analysis/CallTargets.h" +#include "llvm/Analysis/DataStructure/CallTargets.h" #include "llvm/ADT/Statistic.h" #include #include "llvm/Constants.h" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Analysis/DataStructure/CallTargets.h
Changes in directory llvm/include/llvm/Analysis/DataStructure: CallTargets.h added (r1.1) --- Log message: move header --- Diffs of the changes: (+54 -0) CallTargets.h | 54 ++ 1 files changed, 54 insertions(+) Index: llvm/include/llvm/Analysis/DataStructure/CallTargets.h diff -c /dev/null llvm/include/llvm/Analysis/DataStructure/CallTargets.h:1.1 *** /dev/null Fri Jun 16 09:33:10 2006 --- llvm/include/llvm/Analysis/DataStructure/CallTargets.h Fri Jun 16 09:33:00 2006 *** *** 0 --- 1,54 + //=- llvm/Analysis/CallTargets.h - Resolve Indirect Call Targets --*- C++ -*-=// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===--===// + // + // This pass uses DSA to map targets of all calls, and reports on if it + // thinks it knows all targets of a given call. + // + //===--===// + + #ifndef LLVM_ANALYSIS_CALLTARGETS_H + #define LLVM_ANALYSIS_CALLTARGETS_H + + #include "llvm/Pass.h" + #include "llvm/Support/CallSite.h" + + #include + #include + + namespace llvm { + + class CallTargetFinder : public ModulePass { + std::map > IndMap; + std::set CompleteSites; + std::list AllSites; + + void findIndTargets(Module &M); + public: + virtual bool runOnModule(Module &M); + + virtual void getAnalysisUsage(AnalysisUsage &AU) const; + + virtual void print(std::ostream &O, const Module *M) const; + + // Given a CallSite, get an iterator of callees + std::vector::iterator begin(CallSite cs); + std::vector::iterator end(CallSite cs); + + // Iterate over CallSites in program + std::list::iterator cs_begin(); + std::list::iterator cs_end(); + + // Do we think we have complete knowledge of this site? + // That is, do we think there are no missing callees + bool isComplete(CallSite cs) const; + }; + + } + + #endif ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp
Changes in directory llvm/lib/Analysis/DataStructure: CompleteBottomUp.cpp updated: 1.34 -> 1.35 --- Log message: Add a error message to cbu to match bu --- Diffs of the changes: (+7 -1) CompleteBottomUp.cpp |8 +++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp diff -u llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.34 llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.35 --- llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.34 Sun Jan 22 17:19:18 2006 +++ llvm/lib/Analysis/DataStructure/CompleteBottomUp.cppFri Jun 16 09:43:36 2006 @@ -56,8 +56,14 @@ } for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) -if (!I->isExternal() && !DSInfo.count(I)) +if (!I->isExternal() && !DSInfo.count(I)) { +#ifndef NDEBUG + if (MainFunc) +std::cerr << "*** CBU: Function unreachable from main: " + << I->getName() << "\n"; +#endif calculateSCCGraphs(getOrCreateGraph(*I), Stack, NextID, ValMap); +} GlobalsGraph->removeTriviallyDeadNodes(); ___ 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/ret_arg5.ll
Changes in directory llvm/test/Regression/CodeGen/ARM: ret_arg5.ll updated: 1.1 -> 1.2 --- Log message: This test isn't implemented yet --- Diffs of the changes: (+1 -0) ret_arg5.ll |1 + 1 files changed, 1 insertion(+) Index: llvm/test/Regression/CodeGen/ARM/ret_arg5.ll diff -u llvm/test/Regression/CodeGen/ARM/ret_arg5.ll:1.1 llvm/test/Regression/CodeGen/ARM/ret_arg5.ll:1.2 --- llvm/test/Regression/CodeGen/ARM/ret_arg5.ll:1.1Thu Jun 1 17:01:25 2006 +++ llvm/test/Regression/CodeGen/ARM/ret_arg5.llFri Jun 16 11:36:50 2006 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llc -march=arm +; XFAIL: * int %test(int %a1, int %a2, int %a3, int %a4, int %a5) { ret int %a5 } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CFrontend/2005-12-04-DeclarationLineNumbers.c 2006-01-13-Includes.c
Changes in directory llvm/test/Regression/CFrontend: 2005-12-04-DeclarationLineNumbers.c updated: 1.3 -> 1.4 2006-01-13-Includes.c updated: 1.3 -> 1.4 --- Log message: debug info is alive again --- Diffs of the changes: (+0 -4) 2005-12-04-DeclarationLineNumbers.c |2 -- 2006-01-13-Includes.c |2 -- 2 files changed, 4 deletions(-) Index: llvm/test/Regression/CFrontend/2005-12-04-DeclarationLineNumbers.c diff -u llvm/test/Regression/CFrontend/2005-12-04-DeclarationLineNumbers.c:1.3 llvm/test/Regression/CFrontend/2005-12-04-DeclarationLineNumbers.c:1.4 --- llvm/test/Regression/CFrontend/2005-12-04-DeclarationLineNumbers.c:1.3 Thu Apr 13 16:19:13 2006 +++ llvm/test/Regression/CFrontend/2005-12-04-DeclarationLineNumbers.c Fri Jun 16 11:50:24 2006 @@ -21,5 +21,3 @@ return s0734 + s1625; } -// FIXME: PR735 -// XFAIL: llvmgcc4 Index: llvm/test/Regression/CFrontend/2006-01-13-Includes.c diff -u llvm/test/Regression/CFrontend/2006-01-13-Includes.c:1.3 llvm/test/Regression/CFrontend/2006-01-13-Includes.c:1.4 --- llvm/test/Regression/CFrontend/2006-01-13-Includes.c:1.3Thu Apr 13 12:35:36 2006 +++ llvm/test/Regression/CFrontend/2006-01-13-Includes.cFri Jun 16 11:50:24 2006 @@ -1,6 +1,4 @@ // RUN: %llvmgcc %s -g -S -o - | gccas | llvm-dis | grep "test/Regression/CFrontend" -// XFAIL: llvmgcc4 -// PR676 #include ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CFrontend/2006-01-13-Includes.c
Changes in directory llvm/test/Regression/CFrontend: 2006-01-13-Includes.c updated: 1.4 -> 1.5 --- Log message: PR# not associated with XFAIL --- Diffs of the changes: (+1 -0) 2006-01-13-Includes.c |1 + 1 files changed, 1 insertion(+) Index: llvm/test/Regression/CFrontend/2006-01-13-Includes.c diff -u llvm/test/Regression/CFrontend/2006-01-13-Includes.c:1.4 llvm/test/Regression/CFrontend/2006-01-13-Includes.c:1.5 --- llvm/test/Regression/CFrontend/2006-01-13-Includes.c:1.4Fri Jun 16 11:50:24 2006 +++ llvm/test/Regression/CFrontend/2006-01-13-Includes.cFri Jun 16 11:57:43 2006 @@ -1,4 +1,5 @@ // RUN: %llvmgcc %s -g -S -o - | gccas | llvm-dis | grep "test/Regression/CFrontend" +// PR676 #include ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/GettingStarted.html
Changes in directory llvm/docs: GettingStarted.html updated: 1.132 -> 1.133 --- Log message: apple's compiler works too --- Diffs of the changes: (+4 -4) GettingStarted.html |8 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.132 llvm/docs/GettingStarted.html:1.133 --- llvm/docs/GettingStarted.html:1.132 Thu Apr 20 13:46:45 2006 +++ llvm/docs/GettingStarted.html Fri Jun 16 12:20:33 2006 @@ -486,9 +486,9 @@ LLVM is very demanding of the host C++ compiler, and as such tends to expose bugs in the compiler. In particular, several versions of GCC crash when trying -to compile LLVM. We routinely use GCC 3.3.3 and GCC 3.4.0 and have had success -with them (however, see below). Other versions of GCC will probably -work as well. GCC versions listed +to compile LLVM. We routinely use GCC 3.3.3, 3.4.0, and Apple 4.0.1 +successfully with them (however, see below). Other versions of GCC will +probably work as well. GCC versions listed here are known to not work. If you are using one of these versions, please try to upgrade your GCC to something more recent. If you run into a problem with a version of GCC not listed here, please mailto:[EMAIL PROTECTED]">let @@ -1536,7 +1536,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.x10sys.com/rspencer/";>Reid Spencer http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/04/20 18:46:45 $ + Last modified: $Date: 2006/06/16 17:20:33 $ ___ 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/PPC.td PPCISelLowering.cpp PPCSubtarget.cpp PPCSubtarget.h
Changes in directory llvm/lib/Target/PowerPC: PPC.td updated: 1.17 -> 1.18 PPCISelLowering.cpp updated: 1.188 -> 1.189 PPCSubtarget.cpp updated: 1.20 -> 1.21 PPCSubtarget.h updated: 1.14 -> 1.15 --- Log message: Rename some subtarget features. A CPU now can *have* 64-bit instructions, can in 32-bit mode we can choose to optionally *use* 64-bit registers. --- Diffs of the changes: (+12 -12) PPC.td |6 +++--- PPCISelLowering.cpp |6 +++--- PPCSubtarget.cpp|4 ++-- PPCSubtarget.h |8 4 files changed, 12 insertions(+), 12 deletions(-) Index: llvm/lib/Target/PowerPC/PPC.td diff -u llvm/lib/Target/PowerPC/PPC.td:1.17 llvm/lib/Target/PowerPC/PPC.td:1.18 --- llvm/lib/Target/PowerPC/PPC.td:1.17 Wed May 17 19:12:25 2006 +++ llvm/lib/Target/PowerPC/PPC.td Fri Jun 16 12:34:12 2006 @@ -19,10 +19,10 @@ // PowerPC Subtarget features. // -def Feature64Bit : SubtargetFeature<"64bit","Is64Bit", "true", +def Feature64Bit : SubtargetFeature<"64bit","Has64BitSupport", "true", "Enable 64-bit instructions">; -def Feature64BitRegs : SubtargetFeature<"64bitregs","Has64BitRegs", "true", -"Enable 64-bit registers [beta]">; +def Feature64BitRegs : SubtargetFeature<"64bitregs","Use64BitRegs", "true", + "Enable 64-bit registers usage for ppc32 [beta]">; def FeatureAltivec : SubtargetFeature<"altivec","HasAltivec", "true", "Enable Altivec instructions">; def FeatureGPUL : SubtargetFeature<"gpul","IsGigaProcessor", "true", Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.188 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.189 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.188 Thu Jun 15 03:17:07 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Fri Jun 16 12:34:12 2006 @@ -146,7 +146,7 @@ // We want to custom lower some of our intrinsics. setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom); - if (TM.getSubtarget().is64Bit()) { + if (TM.getSubtarget().has64BitSupport()) { // They also have instructions for converting between i64 and fp. setOperationAction(ISD::FP_TO_SINT, MVT::i64, Custom); setOperationAction(ISD::SINT_TO_FP, MVT::i64, Custom); @@ -163,7 +163,7 @@ setOperationAction(ISD::FP_TO_UINT, MVT::i32, Expand); } - if (TM.getSubtarget().has64BitRegs()) { + if (TM.getSubtarget().use64BitRegs()) { // 64 bit PowerPC implementations can support i64 types directly addRegisterClass(MVT::i64, PPC::G8RCRegisterClass); // BUILD_PAIR can't be handled natively, and should be expanded to shl/or @@ -2227,7 +2227,7 @@ switch (N->getOpcode()) { default: break; case ISD::SINT_TO_FP: -if (TM.getSubtarget().is64Bit()) { +if (TM.getSubtarget().has64BitSupport()) { if (N->getOperand(0).getOpcode() == ISD::FP_TO_SINT) { // Turn (sint_to_fp (fp_to_sint X)) -> fctidz/fcfid without load/stores. // We allow the src/dst to be either f32/f64, but the intermediate Index: llvm/lib/Target/PowerPC/PPCSubtarget.cpp diff -u llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.20 llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.21 --- llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.20 Thu Jun 15 20:37:27 2006 +++ llvm/lib/Target/PowerPC/PPCSubtarget.cppFri Jun 16 12:34:12 2006 @@ -73,8 +73,8 @@ : StackAlignment(16) , InstrItins() , IsGigaProcessor(false) - , Is64Bit(false) - , Has64BitRegs(false) + , Has64BitSupport(false) + , Use64BitRegs(false) , HasAltivec(false) , HasFSQRT(false) , HasSTFIWX(false) Index: llvm/lib/Target/PowerPC/PPCSubtarget.h diff -u llvm/lib/Target/PowerPC/PPCSubtarget.h:1.14 llvm/lib/Target/PowerPC/PPCSubtarget.h:1.15 --- llvm/lib/Target/PowerPC/PPCSubtarget.h:1.14 Thu Jun 15 20:37:27 2006 +++ llvm/lib/Target/PowerPC/PPCSubtarget.h Fri Jun 16 12:34:12 2006 @@ -33,8 +33,8 @@ /// Used by the ISel to turn in optimizations for POWER4-derived architectures bool IsGigaProcessor; - bool Is64Bit; - bool Has64BitRegs; + bool Has64BitSupport; + bool Use64BitRegs; bool HasAltivec; bool HasFSQRT; bool HasSTFIWX; @@ -66,12 +66,12 @@ bool hasFSQRT() const { return HasFSQRT; } bool hasSTFIWX() const { return HasSTFIWX; } - bool has64BitRegs() const { return Has64BitRegs; } + bool use64BitRegs() const { return Use64BitRegs; } bool hasAltivec() const { return HasAltivec; } bool isAIX() const { return IsAIX; } bool isDarwin() const { return IsDarwin; } - bool is64Bit() const { return Is64Bit; } + bool has64BitSupport() const { return Has64BitSupport; } bool isGigaProcessor() const { return IsGigaProcessor; } }; } // End llvm namespace ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCSubtarget.cpp PPCSubtarget.h
Changes in directory llvm/lib/Target/PowerPC: PPCSubtarget.cpp updated: 1.21 -> 1.22 PPCSubtarget.h updated: 1.15 -> 1.16 --- Log message: Document the subtarget features better, make sure that 64-bit mode, 64-bit support, and 64-bit register use are all consistent with each other. Add a new "IsPPC" feature, to distinguish ppc32 vs ppc64 targets, use this to configure TargetData differently. This not makes ppc64 blow up on lots of stuff :) --- Diffs of the changes: (+42 -6) PPCSubtarget.cpp | 21 + PPCSubtarget.h | 27 +-- 2 files changed, 42 insertions(+), 6 deletions(-) Index: llvm/lib/Target/PowerPC/PPCSubtarget.cpp diff -u llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.21 llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.22 --- llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.21 Fri Jun 16 12:34:12 2006 +++ llvm/lib/Target/PowerPC/PPCSubtarget.cppFri Jun 16 12:50:12 2006 @@ -16,6 +16,7 @@ #include "llvm/Module.h" #include "llvm/Support/CommandLine.h" #include "PPCGenSubtarget.inc" +#include using namespace llvm; PPCTargetEnum llvm::PPCTarget = TargetDefault; @@ -75,6 +76,7 @@ , IsGigaProcessor(false) , Has64BitSupport(false) , Use64BitRegs(false) + , IsPPC64(is64Bit) , HasAltivec(false) , HasFSQRT(false) , HasSTFIWX(false) @@ -90,6 +92,25 @@ // Parse features string. ParseSubtargetFeatures(FS, CPU); + // If we are generating code for ppc64, verify that options make sense. + if (is64Bit) { +if (!has64BitSupport()) { + std::cerr << "PPC: Generation of 64-bit code for a 32-bit processor " + "requested. Ignoring 32-bit processor feature.\n"; + Has64BitSupport = true; + // Silently force 64-bit register use on ppc64. + Use64BitRegs = true; +} + } + + // If the user requested use of 64-bit regs, but the cpu selected doesn't + // support it, warn and ignore. + if (use64BitRegs() && !has64BitSupport()) { +std::cerr << "PPC: 64-bit registers requested on CPU without support. " + "Disabling 64-bit register use.\n"; +Use64BitRegs = false; + } + // Set the boolean corresponding to the current target triple, or the default // if one cannot be determined, to true. const std::string& TT = M.getTargetTriple(); Index: llvm/lib/Target/PowerPC/PPCSubtarget.h diff -u llvm/lib/Target/PowerPC/PPCSubtarget.h:1.15 llvm/lib/Target/PowerPC/PPCSubtarget.h:1.16 --- llvm/lib/Target/PowerPC/PPCSubtarget.h:1.15 Fri Jun 16 12:34:12 2006 +++ llvm/lib/Target/PowerPC/PPCSubtarget.h Fri Jun 16 12:50:12 2006 @@ -35,6 +35,7 @@ bool IsGigaProcessor; bool Has64BitSupport; bool Use64BitRegs; + bool IsPPC64; bool HasAltivec; bool HasFSQRT; bool HasSTFIWX; @@ -58,21 +59,35 @@ /// getInstrItins - Return the instruction itineraies based on subtarget /// selection. const InstrItineraryData getInstrItineraryData() const { return InstrItins; } - + + /// getTargetDataString - Return the pointer size and type alignment + /// properties of this subtarget. const char *getTargetDataString() const { -// FIXME: Make is64Bit be for the processor, not the target. -return true ? "E-p:32:32-d:32-l:32" : "E-p:64:64-d:32-l:32"; +return isPPC64() ? "E-p:64:64-d:32-l:32" : "E-p:32:32-d:32-l:32"; } + /// isPPC64 - Return true if we are generating code for 64-bit pointer mode. + /// + bool isPPC64() const { return IsPPC64; } + + /// has64BitSupport - Return true if the selected CPU supports 64-bit + /// instructions, regardless of whether we are in 32-bit or 64-bit mode. + bool has64BitSupport() const { return Has64BitSupport; } + + /// use64BitRegs - Return true if in 64-bit mode or if we should use 64-bit + /// registers in 32-bit mode when possible. This can only true if + /// has64BitSupport() returns true. + bool use64BitRegs() const { return Use64BitRegs; } + + + // Specific obvious features. bool hasFSQRT() const { return HasFSQRT; } bool hasSTFIWX() const { return HasSTFIWX; } - bool use64BitRegs() const { return Use64BitRegs; } bool hasAltivec() const { return HasAltivec; } + bool isGigaProcessor() const { return IsGigaProcessor; } bool isAIX() const { return IsAIX; } bool isDarwin() const { return IsDarwin; } - bool has64BitSupport() const { return Has64BitSupport; } - bool isGigaProcessor() const { return IsGigaProcessor; } }; } // End llvm namespace ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp Interpreter.h
Changes in directory llvm/lib/ExecutionEngine/Interpreter: Interpreter.cpp updated: 1.30 -> 1.31 Interpreter.h updated: 1.74 -> 1.75 --- Log message: Simplify interpreter construction. --- Diffs of the changes: (+11 -21) Interpreter.cpp | 30 ++ Interpreter.h |2 +- 2 files changed, 11 insertions(+), 21 deletions(-) Index: llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.30 llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.31 --- llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.30 Tue May 2 20:29:56 2006 +++ llvm/lib/ExecutionEngine/Interpreter/Interpreter.cppFri Jun 16 13:08:38 2006 @@ -39,37 +39,27 @@ return 0; // error materializing the module. } - bool isLittleEndian = false; - switch (M->getEndianness()) { - case Module::LittleEndian: isLittleEndian = true; break; - case Module::BigEndian:isLittleEndian = false; break; - case Module::AnyPointerSize: + if (M->getEndianness() == Module::AnyEndianness) { int Test = 0; *(char*)&Test = 1;// Return true if the host is little endian -isLittleEndian = (Test == 1); -break; +bool isLittleEndian = (Test == 1); +M->setEndianness(isLittleEndian ? Module::LittleEndian : Module::BigEndian); } - bool isLongPointer = false; - switch (M->getPointerSize()) { - case Module::Pointer32: isLongPointer = false; break; - case Module::Pointer64: isLongPointer = true; break; - case Module::AnyPointerSize: -isLongPointer = (sizeof(void*) == 8); // Follow host -break; + if (M->getPointerSize() == Module::AnyPointerSize) { +// Follow host. +bool Ptr64 = sizeof(void*) == 8; +M->setPointerSize(Ptr64 ? Module::Pointer64 : Module::Pointer32); } - return new Interpreter(M, isLittleEndian, isLongPointer); + return new Interpreter(M); } //===--===// // Interpreter ctor - Initialize stuff // -Interpreter::Interpreter(Module *M, bool isLittleEndian, bool isLongPointer) - : ExecutionEngine(M), -TD("lli", isLittleEndian, isLongPointer ? 8 : 4, isLongPointer ? 8 : 4, - isLongPointer ? 8 : 4) { - +Interpreter::Interpreter(Module *M) : ExecutionEngine(M), TD("lli", M) { + memset(&ExitValue, 0, sizeof(ExitValue)); setTargetData(&TD); // Initialize the "backend" Index: llvm/lib/ExecutionEngine/Interpreter/Interpreter.h diff -u llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:1.74 llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:1.75 --- llvm/lib/ExecutionEngine/Interpreter/Interpreter.h:1.74 Wed Mar 22 23:22:51 2006 +++ llvm/lib/ExecutionEngine/Interpreter/Interpreter.h Fri Jun 16 13:08:38 2006 @@ -94,7 +94,7 @@ std::vector AtExitHandlers; public: - Interpreter(Module *M, bool isLittleEndian, bool isLongPointer); + Interpreter(Module *M); ~Interpreter(); /// runAtExitHandlers - Run any functions registered by the program's calls to ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
Changes in directory llvm/lib/ExecutionEngine/JIT: JITEmitter.cpp updated: 1.103 -> 1.104 --- Log message: Only count instructions as code size, not constant pools and other per-function stuff. --- Diffs of the changes: (+10 -6) JITEmitter.cpp | 16 ++-- 1 files changed, 10 insertions(+), 6 deletions(-) Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.103 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.104 --- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.103 Thu Jun 1 12:29:22 2006 +++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Fri Jun 16 13:09:26 2006 @@ -760,8 +760,14 @@ emitJumpTableInfo(F.getJumpTableInfo()); - MemMgr.endFunctionBody(F.getFunction(), BufferBegin, CurBufferPtr); - NumBytes += getCurrentPCOffset(); + // FnStart is the start of the text, not the start of the constant pool and + // other per-function data. + unsigned char *FnStart = +(unsigned char *)TheJIT->getPointerToGlobalIfAvailable(F.getFunction()); + unsigned char *FnEnd = CurBufferPtr; + + MemMgr.endFunctionBody(F.getFunction(), BufferBegin, FnEnd); + NumBytes += FnEnd-FnStart; if (!Relocations.empty()) { NumRelos += Relocations.size(); @@ -815,11 +821,9 @@ } } - DEBUG(void *FnStart = TheJIT->getPointerToGlobalIfAvailable(F.getFunction()); -char *FnEnd = (char*)getCurrentPCOffset(); -std::cerr << "JIT: Finished CodeGen of [" << FnStart + DEBUG(std::cerr << "JIT: Finished CodeGen of [" << (void*)FnStart << "] Function: " << F.getFunction()->getName() - << ": " << (FnEnd-(char*)FnStart) << " bytes of text, " + << ": " << (FnEnd-FnStart) << " bytes of text, " << Relocations.size() << " relocations\n"); Relocations.clear(); return false; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h
Changes in directory llvm/include/llvm/Target: TargetData.h updated: 1.38 -> 1.39 --- Log message: Remove ctor with each piece specifyable (which causes overload ambiguities), add a new init method. --- Diffs of the changes: (+11 -10) TargetData.h | 21 +++-- 1 files changed, 11 insertions(+), 10 deletions(-) Index: llvm/include/llvm/Target/TargetData.h diff -u llvm/include/llvm/Target/TargetData.h:1.38 llvm/include/llvm/Target/TargetData.h:1.39 --- llvm/include/llvm/Target/TargetData.h:1.38 Sat May 20 18:28:54 2006 +++ llvm/include/llvm/Target/TargetData.h Fri Jun 16 13:11:07 2006 @@ -45,20 +45,16 @@ unsigned char PointerAlignment; // Defaults to 8 bytes public: - TargetData(const std::string &TargetName = "", - bool LittleEndian = false, - unsigned char PtrSize = 8, - unsigned char PtrAl = 8, unsigned char DoubleAl = 8, - unsigned char FloatAl = 4, unsigned char LongAl = 8, - unsigned char IntAl = 4, unsigned char ShortAl = 2, - unsigned char ByteAl = 1, unsigned char BoolAl = 1); - /// Constructs a TargetData from a string of the following format: /// "E-p:64:64-d:64-f:32-l:64-i:32-s:16-b:8-B:8" /// The above string is considered the default, and any values not specified /// in the string will be assumed to be as above. - TargetData(const std::string &TargetName, - const std::string &TargetDescription); + TargetData(const std::string &TargetName = "", + const std::string &TargetDescription = "") { +assert(!TargetName.empty() && + "ERROR: Tool did not specify a target data to use!"); +init(TargetDescription); + } // Copy constructor TargetData (const TargetData &TD) : @@ -78,6 +74,11 @@ TargetData(const std::string &ToolName, const Module *M); ~TargetData(); // Not virtual, do not subclass this class + /// init - Specify configuration if not available at ctor time. + /// + void init(const std::string &TargetDescription); + + /// Target endianness... bool isLittleEndian() const { return LittleEndian; } bool isBigEndian() const { return!LittleEndian; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/TargetData.cpp
Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.68 -> 1.69 --- Log message: Remove ctor with each piece specifyable (which causes overload ambiguities), add a new init method. --- Diffs of the changes: (+1 -32) TargetData.cpp | 33 + 1 files changed, 1 insertion(+), 32 deletions(-) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.68 llvm/lib/Target/TargetData.cpp:1.69 --- llvm/lib/Target/TargetData.cpp:1.68 Sat May 20 18:28:54 2006 +++ llvm/lib/Target/TargetData.cpp Fri Jun 16 13:11:26 2006 @@ -95,38 +95,7 @@ // TargetData Class Implementation //===--===// -TargetData::TargetData(const std::string &TargetName, - bool isLittleEndian, unsigned char PtrSize, - unsigned char PtrAl, unsigned char DoubleAl, - unsigned char FloatAl, unsigned char LongAl, - unsigned char IntAl, unsigned char ShortAl, - unsigned char ByteAl, unsigned char BoolAl) { - - // If this assert triggers, a pass "required" TargetData information, but the - // top level tool did not provide one for it. We do not want to default - // construct, or else we might end up using a bad endianness or pointer size! - // - assert(!TargetName.empty() && - "ERROR: Tool did not specify a target data to use!"); - - LittleEndian = isLittleEndian; - PointerSize = PtrSize; - PointerAlignment = PtrAl; - DoubleAlignment = DoubleAl; - FloatAlignment = FloatAl; - LongAlignment= LongAl; - IntAlignment = IntAl; - ShortAlignment = ShortAl; - ByteAlignment= ByteAl; - BoolAlignment= BoolAl; -} - -TargetData::TargetData(const std::string &TargetName, - const std::string &TargetDescription) { - assert(!TargetName.empty() && - "ERROR: Tool did not specify a target data to use!"); - - +void TargetData::init(const std::string &TargetDescription) { std::string temp = TargetDescription; LittleEndian = false; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h
Changes in directory llvm/include/llvm/Target: TargetData.h updated: 1.39 -> 1.40 --- Log message: Simplify the targetdata ctor by not passing in a "targetname" which is always ignored. --- Diffs of the changes: (+14 -8) TargetData.h | 22 ++ 1 files changed, 14 insertions(+), 8 deletions(-) Index: llvm/include/llvm/Target/TargetData.h diff -u llvm/include/llvm/Target/TargetData.h:1.39 llvm/include/llvm/Target/TargetData.h:1.40 --- llvm/include/llvm/Target/TargetData.h:1.39 Fri Jun 16 13:11:07 2006 +++ llvm/include/llvm/Target/TargetData.h Fri Jun 16 13:21:53 2006 @@ -45,19 +45,26 @@ unsigned char PointerAlignment; // Defaults to 8 bytes public: + /// Default ctor - This has to exist, because this is a pass, but it should + /// never be used. + TargetData() { +assert(0 && "ERROR: Bad TargetData ctor used. " + "Tool did not specify a TargetData to use?"); +abort(); + } + /// Constructs a TargetData from a string of the following format: /// "E-p:64:64-d:64-f:32-l:64-i:32-s:16-b:8-B:8" /// The above string is considered the default, and any values not specified /// in the string will be assumed to be as above. - TargetData(const std::string &TargetName = "", - const std::string &TargetDescription = "") { -assert(!TargetName.empty() && - "ERROR: Tool did not specify a target data to use!"); + TargetData(const std::string &TargetDescription) { init(TargetDescription); } - - // Copy constructor - TargetData (const TargetData &TD) : + + /// Initialize target data from properties stored in the module. + TargetData(const Module *M); + + TargetData(const TargetData &TD) : ImmutablePass(), LittleEndian(TD.isLittleEndian()), BoolAlignment(TD.getBoolAlignment()), @@ -71,7 +78,6 @@ PointerAlignment(TD.getPointerAlignment()) { } - TargetData(const std::string &ToolName, const Module *M); ~TargetData(); // Not virtual, do not subclass this class /// init - Specify configuration if not available at ctor time. ___ 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/CTargetMachine.h
Changes in directory llvm/lib/Target/CBackend: CTargetMachine.h updated: 1.13 -> 1.14 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. Remove explicit casts to std::string now that there is no overload resolution issues in the TargetData ctors. --- Diffs of the changes: (+1 -2) CTargetMachine.h |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Target/CBackend/CTargetMachine.h diff -u llvm/lib/Target/CBackend/CTargetMachine.h:1.13 llvm/lib/Target/CBackend/CTargetMachine.h:1.14 --- llvm/lib/Target/CBackend/CTargetMachine.h:1.13 Fri May 12 01:33:48 2006 +++ llvm/lib/Target/CBackend/CTargetMachine.h Fri Jun 16 13:22:52 2006 @@ -23,8 +23,7 @@ const TargetData DataLayout; // Calculates type size & alignment CTargetMachine(const Module &M, const std::string &FS) -: TargetMachine("CBackend", M), - DataLayout("CBackend", &M) {} +: TargetMachine("CBackend", M), DataLayout(&M) {} // This is the only thing that actually does anything here. virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaTargetMachine.cpp
Changes in directory llvm/lib/Target/Alpha: AlphaTargetMachine.cpp updated: 1.25 -> 1.26 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. Remove explicit casts to std::string now that there is no overload resolution issues in the TargetData ctors. --- Diffs of the changes: (+1 -2) AlphaTargetMachine.cpp |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Target/Alpha/AlphaTargetMachine.cpp diff -u llvm/lib/Target/Alpha/AlphaTargetMachine.cpp:1.25 llvm/lib/Target/Alpha/AlphaTargetMachine.cpp:1.26 --- llvm/lib/Target/Alpha/AlphaTargetMachine.cpp:1.25 Fri May 19 19:24:56 2006 +++ llvm/lib/Target/Alpha/AlphaTargetMachine.cppFri Jun 16 13:22:52 2006 @@ -54,8 +54,7 @@ } AlphaTargetMachine::AlphaTargetMachine(const Module &M, const std::string &FS) - : TargetMachine("alpha"), -DataLayout(std::string("alpha"), std::string("e")), + : TargetMachine("alpha"), DataLayout("e"), FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0), JITInfo(*this), Subtarget(M, FS) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/Sparc/SparcTargetMachine.cpp
Changes in directory llvm/lib/Target/Sparc: SparcTargetMachine.cpp updated: 1.47 -> 1.48 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. Remove explicit casts to std::string now that there is no overload resolution issues in the TargetData ctors. --- Diffs of the changes: (+1 -2) SparcTargetMachine.cpp |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Target/Sparc/SparcTargetMachine.cpp diff -u llvm/lib/Target/Sparc/SparcTargetMachine.cpp:1.47 llvm/lib/Target/Sparc/SparcTargetMachine.cpp:1.48 --- llvm/lib/Target/Sparc/SparcTargetMachine.cpp:1.47 Fri May 19 19:49:30 2006 +++ llvm/lib/Target/Sparc/SparcTargetMachine.cppFri Jun 16 13:22:52 2006 @@ -31,8 +31,7 @@ /// SparcTargetMachine ctor - Create an ILP32 architecture model /// SparcTargetMachine::SparcTargetMachine(const Module &M, const std::string &FS) - : TargetMachine("Sparc"), -DataLayout(std::string("Sparc"), std::string("E-p:32:32")), + : TargetMachine("Sparc"), DataLayout("E-p:32:32"), Subtarget(M, FS), InstrInfo(Subtarget), FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) { } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/TargetData.cpp
Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.69 -> 1.70 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. Remove explicit casts to std::string now that there is no overload resolution issues in the TargetData ctors. --- Diffs of the changes: (+1 -1) TargetData.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.69 llvm/lib/Target/TargetData.cpp:1.70 --- llvm/lib/Target/TargetData.cpp:1.69 Fri Jun 16 13:11:26 2006 +++ llvm/lib/Target/TargetData.cpp Fri Jun 16 13:22:52 2006 @@ -152,7 +152,7 @@ } } -TargetData::TargetData(const std::string &ToolName, const Module *M) { +TargetData::TargetData(const Module *M) { LittleEndian = M->getEndianness() != Module::BigEndian; PointerSize = M->getPointerSize() != Module::Pointer64 ? 4 : 8; PointerAlignment = PointerSize; ___ 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/PPCTargetMachine.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCTargetMachine.cpp updated: 1.92 -> 1.93 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. Remove explicit casts to std::string now that there is no overload resolution issues in the TargetData ctors. --- Diffs of the changes: (+1 -2) PPCTargetMachine.cpp |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.92 llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.93 --- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.92 Thu Jun 15 20:37:27 2006 +++ llvm/lib/Target/PowerPC/PPCTargetMachine.cppFri Jun 16 13:22:52 2006 @@ -87,8 +87,7 @@ PPCTargetMachine::PPCTargetMachine(const Module &M, const std::string &FS, bool is64Bit) : TargetMachine("PowerPC"), Subtarget(M, FS, is64Bit), -DataLayout(std::string("PowerPC"), - std::string(Subtarget.getTargetDataString())), +DataLayout(Subtarget.getTargetDataString()), FrameInfo(*this, false), JITInfo(*this), TLInfo(*this), InstrItins(Subtarget.getInstrItineraryData()) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/analyze/analyze.cpp
Changes in directory llvm/tools/analyze: analyze.cpp updated: 1.67 -> 1.68 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. --- Diffs of the changes: (+1 -1) analyze.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/analyze/analyze.cpp diff -u llvm/tools/analyze/analyze.cpp:1.67 llvm/tools/analyze/analyze.cpp:1.68 --- llvm/tools/analyze/analyze.cpp:1.67 Wed Jun 7 18:03:13 2006 +++ llvm/tools/analyze/analyze.cpp Fri Jun 16 13:23:48 2006 @@ -148,7 +148,7 @@ PassManager Passes; // Add an appropriate TargetData instance for this module... -Passes.add(new TargetData("analyze", CurMod)); +Passes.add(new TargetData(CurMod)); // Make sure the input LLVM is well formed. if (!NoVerify) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp
Changes in directory llvm/tools/gccld: GenerateCode.cpp updated: 1.57 -> 1.58 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. --- Diffs of the changes: (+1 -1) GenerateCode.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/gccld/GenerateCode.cpp diff -u llvm/tools/gccld/GenerateCode.cpp:1.57 llvm/tools/gccld/GenerateCode.cpp:1.58 --- llvm/tools/gccld/GenerateCode.cpp:1.57 Sun May 14 14:17:28 2006 +++ llvm/tools/gccld/GenerateCode.cpp Fri Jun 16 13:23:48 2006 @@ -207,7 +207,7 @@ if (Verify) Passes.add(createVerifierPass()); // Add an appropriate TargetData instance for this module... - addPass(Passes, new TargetData("gccld", M)); + addPass(Passes, new TargetData(M)); // Often if the programmer does not specify proper prototypes for the // functions they are calling, they end up calling a vararg version of the ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-extract/llvm-extract.cpp
Changes in directory llvm/tools/llvm-extract: llvm-extract.cpp updated: 1.29 -> 1.30 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. --- Diffs of the changes: (+1 -1) llvm-extract.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llvm-extract/llvm-extract.cpp diff -u llvm/tools/llvm-extract/llvm-extract.cpp:1.29 llvm/tools/llvm-extract/llvm-extract.cpp:1.30 --- llvm/tools/llvm-extract/llvm-extract.cpp:1.29 Sun Apr 24 12:35:15 2005 +++ llvm/tools/llvm-extract/llvm-extract.cppFri Jun 16 13:23:48 2006 @@ -66,7 +66,7 @@ // In addition to deleting all other functions, we also want to spiff it // up a little bit. Do this now. PassManager Passes; -Passes.add(new TargetData("extract", M.get())); // Use correct TargetData +Passes.add(new TargetData(M.get())); // Use correct TargetData // Either isolate the function or delete it from the Module Passes.add(createFunctionExtractionPass(F, DeleteFn)); Passes.add(createGlobalDCEPass()); // Delete unreachable globals ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/gccas/gccas.cpp
Changes in directory llvm/tools/gccas: gccas.cpp updated: 1.115 -> 1.116 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. --- Diffs of the changes: (+1 -1) gccas.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/gccas/gccas.cpp diff -u llvm/tools/gccas/gccas.cpp:1.115 llvm/tools/gccas/gccas.cpp:1.116 --- llvm/tools/gccas/gccas.cpp:1.115Wed Feb 22 01:33:49 2006 +++ llvm/tools/gccas/gccas.cpp Fri Jun 16 13:23:48 2006 @@ -192,7 +192,7 @@ PassManager Passes; // Add an appropriate TargetData instance for this module... -Passes.add(new TargetData("gccas", M.get())); +Passes.add(new TargetData(M.get())); // Add all of the transformation passes to the pass manager to do the cleanup // and optimization of the GCC output. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetMachine.cpp
Changes in directory llvm/lib/Target/ARM: ARMTargetMachine.cpp updated: 1.2 -> 1.3 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. Remove explicit casts to std::string now that there is no overload resolution issues in the TargetData ctors. --- Diffs of the changes: (+1 -3) ARMTargetMachine.cpp |4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.2 llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.3 --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.2Fri May 19 19:24:56 2006 +++ llvm/lib/Target/ARM/ARMTargetMachine.cppFri Jun 16 13:22:52 2006 @@ -32,9 +32,7 @@ /// TargetMachine ctor - Create an ILP32 architecture model /// ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS) - : TargetMachine("ARM"), -DataLayout(std::string("ARM"), std::string("E-p:32:32")), -InstrInfo(), + : TargetMachine("ARM"), DataLayout("E-p:32:32"), FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) { } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp
Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.212 -> 1.213 --- Log message: Improve a comment. --- Diffs of the changes: (+1 -1) DAGISelEmitter.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.212 llvm/utils/TableGen/DAGISelEmitter.cpp:1.213 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.212Wed Jun 14 19:16:37 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Fri Jun 16 13:25:06 2006 @@ -145,7 +145,7 @@ assert(NumResults <= 1 && "We only work with nodes with zero or one result so far!"); - // Check that the number of operands is sane. + // Check that the number of operands is sane. Negative operands -> varargs. if (NodeInfo.getNumOperands() >= 0) { if (N->getNumChildren() != (unsigned)NodeInfo.getNumOperands()) TP.error(N->getOperator()->getName() + " node requires exactly " + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp
Changes in directory llvm/lib/ExecutionEngine/Interpreter: Interpreter.cpp updated: 1.31 -> 1.32 --- Log message: Simplify TargetData ctor call --- Diffs of the changes: (+1 -1) Interpreter.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.31 llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.32 --- llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp:1.31 Fri Jun 16 13:08:38 2006 +++ llvm/lib/ExecutionEngine/Interpreter/Interpreter.cppFri Jun 16 13:24:38 2006 @@ -58,7 +58,7 @@ //===--===// // Interpreter ctor - Initialize stuff // -Interpreter::Interpreter(Module *M) : ExecutionEngine(M), TD("lli", M) { +Interpreter::Interpreter(Module *M) : ExecutionEngine(M), TD(M) { memset(&ExitValue, 0, sizeof(ExitValue)); setTargetData(&TD); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp
Changes in directory llvm/projects/Stacker/lib/compiler: StackerCompiler.cpp updated: 1.16 -> 1.17 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. --- Diffs of the changes: (+1 -1) StackerCompiler.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp diff -u llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp:1.16 llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp:1.17 --- llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp:1.16 Fri May 12 12:29:40 2006 +++ llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp Fri Jun 16 13:23:49 2006 @@ -264,7 +264,7 @@ // Set up a pass manager PassManager Passes; // Add in the passes we want to execute -Passes.add(new TargetData("stkrc",TheModule)); +Passes.add(new TargetData(TheModule)); // Verify we start with valid Passes.add(createVerifierPass()); ___ 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/X86TargetMachine.cpp
Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.116 -> 1.117 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. Remove explicit casts to std::string now that there is no overload resolution issues in the TargetData ctors. --- Diffs of the changes: (+1 -1) X86TargetMachine.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.116 llvm/lib/Target/X86/X86TargetMachine.cpp:1.117 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.116 Tue May 30 16:45:53 2006 +++ llvm/lib/Target/X86/X86TargetMachine.cppFri Jun 16 13:22:52 2006 @@ -70,7 +70,7 @@ X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS) : TargetMachine("X86"), Subtarget(M, FS), -DataLayout(std::string("X86"), std::string("e-p:32:32-d:32-l:32")), +DataLayout("e-p:32:32-d:32-l:32"), FrameInfo(TargetFrameInfo::StackGrowsDown, Subtarget.getStackAlignment(), -4), InstrInfo(*this), JITInfo(*this), TLInfo(*this) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/llvm-ld/Optimize.cpp
Changes in directory llvm/tools/llvm-ld: Optimize.cpp updated: 1.8 -> 1.9 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. --- Diffs of the changes: (+1 -1) Optimize.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llvm-ld/Optimize.cpp diff -u llvm/tools/llvm-ld/Optimize.cpp:1.8 llvm/tools/llvm-ld/Optimize.cpp:1.9 --- llvm/tools/llvm-ld/Optimize.cpp:1.8 Wed Jun 7 18:07:51 2006 +++ llvm/tools/llvm-ld/Optimize.cpp Fri Jun 16 13:23:48 2006 @@ -102,7 +102,7 @@ Passes.add(createVerifierPass()); // Add an appropriate TargetData instance for this module... - addPass(Passes, new TargetData("gccld", M)); + addPass(Passes, new TargetData(M)); // Often if the programmer does not specify proper prototypes for the // functions they are calling, they end up calling a vararg version of the ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/IA64/IA64TargetMachine.cpp
Changes in directory llvm/lib/Target/IA64: IA64TargetMachine.cpp updated: 1.16 -> 1.17 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. Remove explicit casts to std::string now that there is no overload resolution issues in the TargetData ctors. --- Diffs of the changes: (+1 -1) IA64TargetMachine.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/IA64/IA64TargetMachine.cpp diff -u llvm/lib/Target/IA64/IA64TargetMachine.cpp:1.16 llvm/lib/Target/IA64/IA64TargetMachine.cpp:1.17 --- llvm/lib/Target/IA64/IA64TargetMachine.cpp:1.16 Fri May 19 19:24:56 2006 +++ llvm/lib/Target/IA64/IA64TargetMachine.cpp Fri Jun 16 13:22:52 2006 @@ -76,7 +76,7 @@ /// IA64TargetMachine ctor - Create an LP64 architecture model /// IA64TargetMachine::IA64TargetMachine(const Module &M, const std::string &FS) - : TargetMachine("IA64"), DataLayout(std::string("IA64"), std::string("e")), + : TargetMachine("IA64"), DataLayout("e"), FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0), TLInfo(*this) { // FIXME? check this stuff } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/bugpoint/ExtractFunction.cpp OptimizerDriver.cpp
Changes in directory llvm/tools/bugpoint: ExtractFunction.cpp updated: 1.47 -> 1.48 OptimizerDriver.cpp updated: 1.39 -> 1.40 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. --- Diffs of the changes: (+2 -2) ExtractFunction.cpp |2 +- OptimizerDriver.cpp |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/tools/bugpoint/ExtractFunction.cpp diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.47 llvm/tools/bugpoint/ExtractFunction.cpp:1.48 --- llvm/tools/bugpoint/ExtractFunction.cpp:1.47Fri May 12 12:28:36 2006 +++ llvm/tools/bugpoint/ExtractFunction.cpp Fri Jun 16 13:23:48 2006 @@ -80,7 +80,7 @@ // Spiff up the output a little bit. PassManager Passes; // Make sure that the appropriate target data is always used... - Passes.add(new TargetData("bugpoint", Result)); + Passes.add(new TargetData(Result)); /// FIXME: If this used runPasses() like the methods below, we could get rid /// of the -disable-* options! Index: llvm/tools/bugpoint/OptimizerDriver.cpp diff -u llvm/tools/bugpoint/OptimizerDriver.cpp:1.39 llvm/tools/bugpoint/OptimizerDriver.cpp:1.40 --- llvm/tools/bugpoint/OptimizerDriver.cpp:1.39Mon Jun 12 22:10:48 2006 +++ llvm/tools/bugpoint/OptimizerDriver.cpp Fri Jun 16 13:23:48 2006 @@ -104,7 +104,7 @@ PassManager PM; // Make sure that the appropriate target data is always used... - PM.add(new TargetData("bugpoint", Program)); + PM.add(new TargetData(Program)); for (unsigned i = 0, e = Passes.size(); i != e; ++i) { if (Passes[i]->getNormalCtor()) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/tools/opt/opt.cpp
Changes in directory llvm/tools/opt: opt.cpp updated: 1.109 -> 1.110 --- Log message: Don't pass target name into TargetData anymore, it is never used or needed. --- Diffs of the changes: (+1 -1) opt.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.109 llvm/tools/opt/opt.cpp:1.110 --- llvm/tools/opt/opt.cpp:1.109Wed Jun 7 18:03:13 2006 +++ llvm/tools/opt/opt.cpp Fri Jun 16 13:23:49 2006 @@ -134,7 +134,7 @@ PassManager Passes; // Add an appropriate TargetData instance for this module... -Passes.add(new TargetData("opt", M.get())); +Passes.add(new TargetData(M.get())); // Create a new optimization pass for each one specified on the command line for (unsigned i = 0; i < OptimizationList.size(); ++i) { ___ 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/SimplifyLibCalls.cpp
Changes in directory llvm/lib/Transforms/IPO: SimplifyLibCalls.cpp updated: 1.66 -> 1.67 --- Log message: Add missing casts. This fixed some regressions. --- Diffs of the changes: (+2 -2) SimplifyLibCalls.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.66 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.67 --- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.66 Fri Jun 16 03:36:35 2006 +++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cppFri Jun 16 13:37:15 2006 @@ -1340,7 +1340,7 @@ if (!puts_func) return false; std::vector args; -args.push_back(ci->getOperand(2)); +args.push_back(CastToCStr(ci->getOperand(2), *ci)); new CallInst(puts_func,args,ci->getName(),ci); ci->replaceAllUsesWith(ConstantSInt::get(Type::IntTy,len)); break; @@ -1474,7 +1474,7 @@ if (!fputs_func) return false; std::vector args; - args.push_back(ci->getOperand(3)); + args.push_back(CastToCStr(ci->getOperand(3), *ci)); args.push_back(ci->getOperand(1)); new CallInst(fputs_func,args,ci->getName(),ci); ci->replaceAllUsesWith(ConstantSInt::get(Type::IntTy,len)); ___ 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/PPC.h PPCRegisterInfo.td PPCSubtarget.cpp PPCTargetMachine.cpp
Changes in directory llvm/lib/Target/PowerPC: PPC.h updated: 1.28 -> 1.29 PPCRegisterInfo.td updated: 1.36 -> 1.37 PPCSubtarget.cpp updated: 1.22 -> 1.23 PPCTargetMachine.cpp updated: 1.93 -> 1.94 --- Log message: Remove the -darwin and -aix llc options, inferring darwinism and aixism from the target triple & subtarget info. woo. --- Diffs of the changes: (+7 -35) PPC.h|7 --- PPCRegisterInfo.td |4 ++-- PPCSubtarget.cpp | 18 +++--- PPCTargetMachine.cpp | 13 ++--- 4 files changed, 7 insertions(+), 35 deletions(-) Index: llvm/lib/Target/PowerPC/PPC.h diff -u llvm/lib/Target/PowerPC/PPC.h:1.28 llvm/lib/Target/PowerPC/PPC.h:1.29 --- llvm/lib/Target/PowerPC/PPC.h:1.28 Mon Mar 13 17:20:37 2006 +++ llvm/lib/Target/PowerPC/PPC.h Fri Jun 16 13:50:48 2006 @@ -21,17 +21,10 @@ class FunctionPass; class PPCTargetMachine; - -enum PPCTargetEnum { - TargetDefault, TargetAIX, TargetDarwin -}; - FunctionPass *createPPCBranchSelectionPass(); FunctionPass *createPPCISelDag(PPCTargetMachine &TM); FunctionPass *createDarwinAsmPrinter(std::ostream &OS, PPCTargetMachine &TM); FunctionPass *createAIXAsmPrinter(std::ostream &OS, PPCTargetMachine &TM); - -extern PPCTargetEnum PPCTarget; } // end namespace llvm; // GCC #defines PPC on Linux but we use it as our namespace name Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.td diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.36 llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.37 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.36 Thu May 4 11:56:45 2006 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.td Fri Jun 16 13:50:48 2006 @@ -215,7 +215,7 @@ let MethodBodies = [{ GPRCClass::iterator GPRCClass::allocation_order_begin(MachineFunction &MF) const { - return begin() + ((TargetAIX == PPCTarget) ? 1 : 0); + return begin(); } GPRCClass::iterator GPRCClass::allocation_order_end(MachineFunction &MF) const { @@ -238,7 +238,7 @@ let MethodBodies = [{ G8RCClass::iterator G8RCClass::allocation_order_begin(MachineFunction &MF) const { - return begin() + ((TargetAIX == PPCTarget) ? 1 : 0); + return begin(); } G8RCClass::iterator G8RCClass::allocation_order_end(MachineFunction &MF) const { Index: llvm/lib/Target/PowerPC/PPCSubtarget.cpp diff -u llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.22 llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.23 --- llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.22 Fri Jun 16 12:50:12 2006 +++ llvm/lib/Target/PowerPC/PPCSubtarget.cppFri Jun 16 13:50:48 2006 @@ -14,24 +14,10 @@ #include "PPCSubtarget.h" #include "PPC.h" #include "llvm/Module.h" -#include "llvm/Support/CommandLine.h" #include "PPCGenSubtarget.inc" #include - using namespace llvm; -PPCTargetEnum llvm::PPCTarget = TargetDefault; -namespace llvm { - cl::opt - PPCTargetArg(cl::desc("Force generation of code for a specific PPC target:"), - cl::values( - clEnumValN(TargetAIX, "aix", " Enable AIX codegen"), - clEnumValN(TargetDarwin,"darwin", - " Enable Darwin codegen"), - clEnumValEnd), - cl::location(PPCTarget), cl::init(TargetDefault)); -} - #if defined(__APPLE__) #include #include @@ -115,7 +101,9 @@ // if one cannot be determined, to true. const std::string& TT = M.getTargetTriple(); if (TT.length() > 5) { -IsDarwin = TT.find("darwin") != std::string::npos; +IsDarwin = TT.find("-darwin") != std::string::npos; +if (!IsDarwin) + IsAIX = TT.find("-aix") != std::string::npos; } else if (TT.empty()) { #if defined(_POWER) IsAIX = true; Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.93 llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.94 --- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.93 Fri Jun 16 13:22:52 2006 +++ llvm/lib/Target/PowerPC/PPCTargetMachine.cppFri Jun 16 13:50:48 2006 @@ -91,10 +91,6 @@ FrameInfo(*this, false), JITInfo(*this), TLInfo(*this), InstrItins(Subtarget.getInstrItineraryData()) { - if (TargetDefault == PPCTarget) { -if (Subtarget.isAIX()) PPCTarget = TargetAIX; -if (Subtarget.isDarwin()) PPCTarget = TargetDarwin; - } if (getRelocationModel() == Reloc::Default) if (Subtarget.isDarwin()) setRelocationModel(Reloc::DynamicNoPIC); @@ -153,15 +149,10 @@ // Decide which asm printer to use. If the user has not specified one on // the command line, choose whichever one matches the default (current host). - switch (PPCTarget) { - case TargetAIX: + if (Subtarget.isAIX()) PM.add(createAIXAsmPrinter(Out, *this)); -break; - case TargetDefault: - case TargetDarwin: + else PM.add(createDarwinAsmPrinter(Out, *this)); -break; - } PM.add(createMachineCodeDeleter()); return false; _
[llvm-commits] CVS: llvm/docs/GettingStarted.html
Changes in directory llvm/docs: GettingStarted.html updated: 1.133 -> 1.134 --- Log message: Document known xcode 2.3 issue --- Diffs of the changes: (+4 -1) GettingStarted.html |5 - 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.133 llvm/docs/GettingStarted.html:1.134 --- llvm/docs/GettingStarted.html:1.133 Fri Jun 16 12:20:33 2006 +++ llvm/docs/GettingStarted.html Fri Jun 16 14:53:39 2006 @@ -515,6 +515,9 @@ to a newer version of GCC. IA-64 GCC 4.0.0: The IA-64 version of GCC 4.0.0 is known to miscompile LLVM. +Apple Xcode 2.3: GCC crashes when compiling LLVM at -O3 (which is the + default with ENABLE_OPTIMIZED=1. To work around this, build with + "ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION=-O2". @@ -1536,7 +1539,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.x10sys.com/rspencer/";>Reid Spencer http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/06/16 17:20:33 $ + Last modified: $Date: 2006/06/16 19:53:39 $ ___ 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/PPCSubtarget.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCSubtarget.cpp updated: 1.23 -> 1.24 --- Log message: Force 64-bit register availability in 64-bit mode. For real. --- Diffs of the changes: (+2 -2) PPCSubtarget.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCSubtarget.cpp diff -u llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.23 llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.24 --- llvm/lib/Target/PowerPC/PPCSubtarget.cpp:1.23 Fri Jun 16 13:50:48 2006 +++ llvm/lib/Target/PowerPC/PPCSubtarget.cppFri Jun 16 15:05:06 2006 @@ -84,9 +84,9 @@ std::cerr << "PPC: Generation of 64-bit code for a 32-bit processor " "requested. Ignoring 32-bit processor feature.\n"; Has64BitSupport = true; - // Silently force 64-bit register use on ppc64. - Use64BitRegs = true; } +// Silently force 64-bit register use on ppc64. +Use64BitRegs = true; } // If the user requested use of 64-bit regs, but the cpu selected doesn't ___ 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/PPCInstr64Bit.td PPCInstrInfo.td
Changes in directory llvm/lib/Target/PowerPC: PPCInstr64Bit.td added (r1.1) PPCInstrInfo.td updated: 1.222 -> 1.223 --- Log message: Split 64-bit instructions out into a separate .td file --- Diffs of the changes: (+185 -130) PPCInstr64Bit.td | 183 +++ PPCInstrInfo.td | 132 --- 2 files changed, 185 insertions(+), 130 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -c /dev/null llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.1 *** /dev/null Fri Jun 16 15:22:11 2006 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.tdFri Jun 16 15:22:01 2006 *** *** 0 --- 1,183 + //===- PPCInstr64Bit.td - The PowerPC 64-bit Support ---*- tablegen -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Chris Lattner and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===--===// + // + // This file describes the PowerPC 64-bit instructions. These patterns are used + // both when in ppc64 mode and when in "use 64-bit extensions in 32-bit" mode. + // + //===--===// + + + //===--===// + // Fixed point instructions. + // + + let PPC970_Unit = 1 in { // FXU Operations. + + def OR8 : XForm_6<31, 444, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), +"or $rA, $rS, $rB", IntGeneral, +[(set G8RC:$rA, (or G8RC:$rS, G8RC:$rB))]>; + def OR4To8 : XForm_6<31, 444, (ops G8RC:$rA, GPRC:$rS, GPRC:$rB), +"or $rA, $rS, $rB", IntGeneral, +[]>; + def OR8To4 : XForm_6<31, 444, (ops GPRC:$rA, G8RC:$rS, G8RC:$rB), +"or $rA, $rS, $rB", IntGeneral, +[]>; + + def ADD8 : XOForm_1<31, 266, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), + "add $rT, $rA, $rB", IntGeneral, + [(set G8RC:$rT, (add G8RC:$rA, G8RC:$rB))]>; + def MULHD : XOForm_1<31, 73, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), + "mulhd $rT, $rA, $rB", IntMulHW, + [(set G8RC:$rT, (mulhs G8RC:$rA, G8RC:$rB))]>; + def MULHDU : XOForm_1<31, 9, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), + "mulhdu $rT, $rA, $rB", IntMulHWU, + [(set G8RC:$rT, (mulhu G8RC:$rA, G8RC:$rB))]>; + + def CMPDI : DForm_5_ext<11, (ops CRRC:$crD, GPRC:$rA, s16imm:$imm), + "cmpdi $crD, $rA, $imm", IntCompare>, isPPC64; + + def CMPLDI : DForm_6_ext<10, (ops CRRC:$dst, GPRC:$src1, u16imm:$src2), + "cmpldi $dst, $src1, $src2", IntCompare>, isPPC64; + def CMPD : XForm_16_ext<31, 0, (ops CRRC:$crD, GPRC:$rA, GPRC:$rB), + "cmpd $crD, $rA, $rB", IntCompare>, isPPC64; + def CMPLD : XForm_16_ext<31, 32, (ops CRRC:$crD, GPRC:$rA, GPRC:$rB), + "cmpld $crD, $rA, $rB", IntCompare>, isPPC64; + + def SLD : XForm_6<31, 27, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), +"sld $rA, $rS, $rB", IntRotateD, +[(set G8RC:$rA, (shl G8RC:$rS, G8RC:$rB))]>, isPPC64; + def SRD : XForm_6<31, 539, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), +"srd $rA, $rS, $rB", IntRotateD, +[(set G8RC:$rA, (srl G8RC:$rS, G8RC:$rB))]>, isPPC64; + def SRAD : XForm_6<31, 794, (ops G8RC:$rA, G8RC:$rS, G8RC:$rB), +"srad $rA, $rS, $rB", IntRotateD, +[(set G8RC:$rA, (sra G8RC:$rS, G8RC:$rB))]>, isPPC64; + def EXTSW : XForm_11<31, 986, (ops G8RC:$rA, G8RC:$rS), + "extsw $rA, $rS", IntGeneral, + [(set G8RC:$rA, (sext_inreg G8RC:$rS, i32))]>, isPPC64; + /// EXTSW_32 - Just like EXTSW, but works on '32-bit' registers. + def EXTSW_32 : XForm_11<31, 986, (ops GPRC:$rA, GPRC:$rS), + "extsw $rA, $rS", IntGeneral, + [(set GPRC:$rA, (PPCextsw_32 GPRC:$rS))]>, isPPC64; + + def SRADI : XSForm_1<31, 413, (ops GPRC:$rA, GPRC:$rS, u6imm:$SH), + "sradi $rA, $rS, $SH", IntRotateD>, isPPC64; + def DIVD : XOForm_1<31, 489, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), + "divd $rT, $rA, $rB", IntDivD, + [(set G8RC:$rT, (sdiv G8RC:$rA, G8RC:$rB))]>, isPPC64, + PPC970_DGroup_First, PPC970_DGroup_Cracked; + def DIVDU : XOForm_1<31, 457, 0, (ops G8RC:$rT, G8RC:$rA, G8RC:$rB), + "divdu $rT, $rA, $rB", IntDivD, + [(set G8RC:$rT, (udiv G8RC:$rA, G8RC:$rB))]>, isPPC64, + PPC970_DGroup_First, PPC970_DGroup_Cracked; + def MULLD : XOForm_1<31, 233, 0, (ops G8RC:$rT, G8RC
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp PPCInstr64Bit.td PPCInstrInfo.td
Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.189 -> 1.190 PPCInstr64Bit.td updated: 1.1 -> 1.2 PPCInstrInfo.td updated: 1.223 -> 1.224 --- Log message: fix some assumptions that pointers can only be 32-bits. With this, we can now compile: static unsigned long X; void test1() { X = 0; } into: _test1: lis r2, ha16(_X) li r3, 0 stw r3, lo16(_X)(r2) blr Totally amazing :) --- Diffs of the changes: (+59 -62) PPCISelLowering.cpp | 67 +++- PPCInstr64Bit.td| 33 ++--- PPCInstrInfo.td | 21 +++- 3 files changed, 59 insertions(+), 62 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.189 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.190 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.189 Fri Jun 16 12:34:12 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Fri Jun 16 16:01:35 2006 @@ -128,7 +128,10 @@ setOperationAction(ISD::GlobalAddress, MVT::i32, Custom); setOperationAction(ISD::ConstantPool, MVT::i32, Custom); setOperationAction(ISD::JumpTable, MVT::i32, Custom); - + setOperationAction(ISD::GlobalAddress, MVT::i64, Custom); + setOperationAction(ISD::ConstantPool, MVT::i64, Custom); + setOperationAction(ISD::JumpTable, MVT::i64, Custom); + // RET must be custom lowered, to meet ABI requirements setOperationAction(ISD::RET , MVT::Other, Custom); @@ -583,94 +586,94 @@ //===--===// static SDOperand LowerConstantPool(SDOperand Op, SelectionDAG &DAG) { + MVT::ValueType PtrVT = Op.getValueType(); ConstantPoolSDNode *CP = cast(Op); Constant *C = CP->get(); - SDOperand CPI = DAG.getTargetConstantPool(C, MVT::i32, CP->getAlignment()); - SDOperand Zero = DAG.getConstant(0, MVT::i32); + SDOperand CPI = DAG.getTargetConstantPool(C, PtrVT, CP->getAlignment()); + SDOperand Zero = DAG.getConstant(0, PtrVT); const TargetMachine &TM = DAG.getTarget(); + SDOperand Hi = DAG.getNode(PPCISD::Hi, PtrVT, CPI, Zero); + SDOperand Lo = DAG.getNode(PPCISD::Lo, PtrVT, CPI, Zero); + // If this is a non-darwin platform, we don't support non-static relo models // yet. if (TM.getRelocationModel() == Reloc::Static || !TM.getSubtarget().isDarwin()) { // Generate non-pic code that has direct accesses to the constant pool. // The address of the global is just (hi(&g)+lo(&g)). -SDOperand Hi = DAG.getNode(PPCISD::Hi, MVT::i32, CPI, Zero); -SDOperand Lo = DAG.getNode(PPCISD::Lo, MVT::i32, CPI, Zero); -return DAG.getNode(ISD::ADD, MVT::i32, Hi, Lo); +return DAG.getNode(ISD::ADD, PtrVT, Hi, Lo); } - SDOperand Hi = DAG.getNode(PPCISD::Hi, MVT::i32, CPI, Zero); if (TM.getRelocationModel() == Reloc::PIC) { // With PIC, the first instruction is actually "GR+hi(&G)". -Hi = DAG.getNode(ISD::ADD, MVT::i32, - DAG.getNode(PPCISD::GlobalBaseReg, MVT::i32), Hi); +Hi = DAG.getNode(ISD::ADD, PtrVT, + DAG.getNode(PPCISD::GlobalBaseReg, PtrVT), Hi); } - SDOperand Lo = DAG.getNode(PPCISD::Lo, MVT::i32, CPI, Zero); - Lo = DAG.getNode(ISD::ADD, MVT::i32, Hi, Lo); + Lo = DAG.getNode(ISD::ADD, PtrVT, Hi, Lo); return Lo; } static SDOperand LowerJumpTable(SDOperand Op, SelectionDAG &DAG) { + MVT::ValueType PtrVT = Op.getValueType(); JumpTableSDNode *JT = cast(Op); - SDOperand JTI = DAG.getTargetJumpTable(JT->getIndex(), MVT::i32); - SDOperand Zero = DAG.getConstant(0, MVT::i32); + SDOperand JTI = DAG.getTargetJumpTable(JT->getIndex(), PtrVT); + SDOperand Zero = DAG.getConstant(0, PtrVT); const TargetMachine &TM = DAG.getTarget(); - + + SDOperand Hi = DAG.getNode(PPCISD::Hi, PtrVT, JTI, Zero); + SDOperand Lo = DAG.getNode(PPCISD::Lo, PtrVT, JTI, Zero); + // If this is a non-darwin platform, we don't support non-static relo models // yet. if (TM.getRelocationModel() == Reloc::Static || !TM.getSubtarget().isDarwin()) { // Generate non-pic code that has direct accesses to the constant pool. // The address of the global is just (hi(&g)+lo(&g)). -SDOperand Hi = DAG.getNode(PPCISD::Hi, MVT::i32, JTI, Zero); -SDOperand Lo = DAG.getNode(PPCISD::Lo, MVT::i32, JTI, Zero); -return DAG.getNode(ISD::ADD, MVT::i32, Hi, Lo); +return DAG.getNode(ISD::ADD, PtrVT, Hi, Lo); } - SDOperand Hi = DAG.getNode(PPCISD::Hi, MVT::i32, JTI, Zero); if (TM.getRelocationModel() == Reloc::PIC) { // With PIC, the first instruction is actually "GR+hi(&G)". -Hi = DAG.getNode(ISD::ADD, MVT::i32, +Hi = DAG.getNode(ISD::ADD, PtrVT, DAG.getNode(PPCISD::GlobalBaseReg, MVT::i32), Hi); } - SDOperand Lo = DAG.getNode(PPCISD::Lo, MVT::i32, JTI, Zero); - Lo = DAG.getNode(ISD::ADD, MVT::i32, Hi, Lo)
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrInfo.td
Changes in directory llvm/lib/Target/PowerPC: PPCInstrInfo.td updated: 1.224 -> 1.225 --- Log message: In 64-bit mode, addr mode operands use G8RC instead of GPRC. --- Diffs of the changes: (+3 -3) PPCInstrInfo.td |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.224 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.225 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.224 Fri Jun 16 16:01:35 2006 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Fri Jun 16 16:29:03 2006 @@ -205,17 +205,17 @@ def memri : Operand { let PrintMethod = "printMemRegImm"; let NumMIOperands = 2; - let MIOperandInfo = (ops i32imm, GPRC); + let MIOperandInfo = (ops i32imm, ptr_rc); } def memrr : Operand { let PrintMethod = "printMemRegReg"; let NumMIOperands = 2; - let MIOperandInfo = (ops GPRC, GPRC); + let MIOperandInfo = (ops ptr_rc, ptr_rc); } def memrix : Operand { // memri where the imm is shifted 2 bits. let PrintMethod = "printMemRegImmShifted"; let NumMIOperands = 2; - let MIOperandInfo = (ops i32imm, GPRC); + let MIOperandInfo = (ops i32imm, ptr_rc); } // Define PowerPC specific addressing mode. ___ 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/PPCInstr64Bit.td
Changes in directory llvm/lib/Target/PowerPC: PPCInstr64Bit.td updated: 1.2 -> 1.3 --- Log message: Upgrade some load/store instructions to use the proper addressing mode stuff. --- Diffs of the changes: (+10 -10) PPCInstr64Bit.td | 20 ++-- 1 files changed, 10 insertions(+), 10 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.2 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.3 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.2Fri Jun 16 16:01:35 2006 +++ llvm/lib/Target/PowerPC/PPCInstr64Bit.tdFri Jun 16 16:29:41 2006 @@ -105,11 +105,11 @@ let isLoad = 1, PPC970_Unit = 2 in { -def LWA : DSForm_1<58, 2, (ops GPRC:$rT, s16immX4:$DS, GPRC:$rA), -"lwa $rT, $DS($rA)", LdStLWA, +def LWA : DSForm_1<58, 2, (ops G8RC:$rT, memrix:$src), +"lwa $rT, $src", LdStLWA, []>, isPPC64, PPC970_DGroup_Cracked; -def LD : DSForm_2<58, 0, (ops GPRC:$rT, s16immX4:$DS, GPRC:$rA), -"ld $rT, $DS($rA)", LdStLD, +def LD : DSForm_2<58, 0, (ops G8RC:$rT, memrix:$src), +"ld $rT, $src", LdStLD, []>, isPPC64; def LWAX : XForm_1<31, 341, (ops G8RC:$rD, memrr:$src), @@ -121,15 +121,15 @@ [(set G8RC:$rD, (load xaddr:$src))]>, isPPC64; } let isStore = 1, noResults = 1, PPC970_Unit = 2 in { -def STD : DSForm_2<62, 0, (ops GPRC:$rT, s16immX4:$DS, GPRC:$rA), -"std $rT, $DS($rA)", LdStSTD, +def STD : DSForm_2<62, 0, (ops G8RC:$rT, memrix:$src), +"std $rT, $src", LdStSTD, []>, isPPC64; -def STDX : XForm_8<31, 149, (ops GPRC:$rS, GPRC:$rA, GPRC:$rB), - "stdx $rS, $rA, $rB", LdStSTD, +def STDX : XForm_8<31, 149, (ops GPRC:$rS, memrr:$dst), + "stdx $rS, $dst", LdStSTD, []>, isPPC64, PPC970_DGroup_Cracked; -def STDUX : XForm_8<31, 181, (ops GPRC:$rS, GPRC:$rA, GPRC:$rB), - "stdux $rS, $rA, $rB", LdStSTD, +def STDUX : XForm_8<31, 181, (ops GPRC:$rS, memrr:$dst), + "stdux $rS, $dst", LdStSTD, []>, isPPC64; // STD_32/STDX_32 - Just like STD/STDX, but uses a '32-bit' input register. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/Makefile.rules
Changes in directory llvm: Makefile.rules updated: 1.379 -> 1.380 --- Log message: Do not hardcode random paths into the makefile. Make the user specify the SDK to use when building "universal" on Mac OS/X, if they want to use a specific one. --- Diffs of the changes: (+11 -5) Makefile.rules | 16 +++- 1 files changed, 11 insertions(+), 5 deletions(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.379 llvm/Makefile.rules:1.380 --- llvm/Makefile.rules:1.379 Thu Jun 15 12:31:22 2006 +++ llvm/Makefile.rules Fri Jun 16 16:47:59 2006 @@ -370,13 +370,19 @@ # If we are building a universal binary on Mac OS/X, pass extra options. This # is useful to people that want to link the LLVM libraries into their universal -# apps. +# apps. The UNIVERSAL_SDK_PATH variable can optionally be specified as a path +# to the SDK to use. For Mac OS/X 10.4 Intel machines, the traditional one is: +# UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/ ifdef UNIVERSAL - CompileCommonOpts += \ - -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk/ + CompileCommonOpts += -arch i386 -arch ppc Relink.Flags := -XCClinker -arch -XCClinker i386 -XCClinker -arch \ - -XCClinker ppc -XCClinker \ - -isysroot -XCClinker /Developer/SDKs/MacOSX10.4u.sdk/ + -XCClinker ppc + ifdef UNIVERSAL_SDK_PATH +CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH) +Relink.Flags += -XCClinker -isysroot -XCClinker $(UNIVERSAL_SDK_PATH) + endif + + # Building universal cannot compute dependencies automatically. DISABLE_AUTO_DEPENDENCIES=1 endif ___ 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/X86Subtarget.cpp
Changes in directory llvm/lib/Target/X86: X86Subtarget.cpp updated: 1.27 -> 1.28 --- Log message: Later models likely to have Yonah like attributes. --- Diffs of the changes: (+2 -1) X86Subtarget.cpp |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86Subtarget.cpp diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.27 llvm/lib/Target/X86/X86Subtarget.cpp:1.28 --- llvm/lib/Target/X86/X86Subtarget.cpp:1.27 Thu May 25 16:59:08 2006 +++ llvm/lib/Target/X86/X86Subtarget.cppFri Jun 16 16:58:49 2006 @@ -90,7 +90,8 @@ case 9: case 13: return "pentium-m"; case 14: return "yonah"; -default: return "i686"; +default: + return (Model > 14) ? "yonah" : "i686"; } case 15: { switch (Model) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/GettingStarted.html
Changes in directory llvm/docs: GettingStarted.html updated: 1.134 -> 1.135 --- Log message: Include information about svn repository for llvm-gcc4. --- Diffs of the changes: (+5 -1) GettingStarted.html |6 +- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.134 llvm/docs/GettingStarted.html:1.135 --- llvm/docs/GettingStarted.html:1.134 Fri Jun 16 14:53:39 2006 +++ llvm/docs/GettingStarted.html Fri Jun 16 18:20:21 2006 @@ -640,6 +640,10 @@ Binary release of the llvm-gcc4 front end for MacOS X/X86. +It is also possible to download the sources of the llvm-gcc4 front end from +a read-only subversion mirror at svn://anonsvn.opensource.apple.com/svn/llvm. + + @@ -1539,7 +1543,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.x10sys.com/rspencer/";>Reid Spencer http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/06/16 19:53:39 $ + Last modified: $Date: 2006/06/16 23:20:21 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/CFEBuildInstrs.html
Changes in directory llvm/docs: CFEBuildInstrs.html updated: 1.56 -> 1.57 --- Log message: Include information of svn repository for llvm-gcc4. --- Diffs of the changes: (+17 -1) CFEBuildInstrs.html | 18 +- 1 files changed, 17 insertions(+), 1 deletion(-) Index: llvm/docs/CFEBuildInstrs.html diff -u llvm/docs/CFEBuildInstrs.html:1.56 llvm/docs/CFEBuildInstrs.html:1.57 --- llvm/docs/CFEBuildInstrs.html:1.56 Mon Mar 13 23:39:39 2006 +++ llvm/docs/CFEBuildInstrs.html Fri Jun 16 18:34:49 2006 @@ -101,6 +101,22 @@ + +Retrieve the appropriate llvm-gcc4-x.y.source.tar.gz archive from the llvm +web site. +It is also possible to download the sources of the llvm-gcc4 front end from +a read-only mirror using subversion. To check out the code the first time use; + + +svn co svn://anonsvn.opensource.apple.com/svn/llvm dst-directory + +After that, the code can be be updated in the destination directory using; + + +svn update + +The mirror is brought up to date every evening. + Configure and build the LLVM libraries and tools. There are two ways to do this: either with objdir == srcdir or objdir != srcdir. It is recommended @@ -357,7 +373,7 @@ Brian Gaeke http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2006/03/14 05:39:39 $ + Last modified: $Date: 2006/06/16 23:34:49 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/IntrinsicInst.cpp
Changes in directory llvm/lib/VMCore: IntrinsicInst.cpp updated: 1.6 -> 1.7 --- Log message: Forgot operands were hard coded for compile unit. --- Diffs of the changes: (+2 -2) IntrinsicInst.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/VMCore/IntrinsicInst.cpp diff -u llvm/lib/VMCore/IntrinsicInst.cpp:1.6 llvm/lib/VMCore/IntrinsicInst.cpp:1.7 --- llvm/lib/VMCore/IntrinsicInst.cpp:1.6 Wed Jun 7 17:00:26 2006 +++ llvm/lib/VMCore/IntrinsicInst.cpp Fri Jun 16 18:36:12 2006 @@ -61,13 +61,13 @@ std::string DbgStopPointInst::getFileName() const { GlobalVariable *GV = cast(getContext()); ConstantStruct *CS = cast(GV->getInitializer()); - return CS->getOperand(4)->getStringValue(); + return CS->getOperand(3)->getStringValue(); } std::string DbgStopPointInst::getDirectory() const { GlobalVariable *GV = cast(getContext()); ConstantStruct *CS = cast(GV->getInitializer()); - return CS->getOperand(5)->getStringValue(); + return CS->getOperand(4)->getStringValue(); } //===--===// ___ 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/PPCInstrInfo.cpp PPCInstrInfo.h PPCTargetMachine.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCInstrInfo.cpp updated: 1.20 -> 1.21 PPCInstrInfo.h updated: 1.15 -> 1.16 PPCTargetMachine.cpp updated: 1.94 -> 1.95 --- Log message: Implement the getPointerRegClass method, which is required for the ptr_rc magic to work. --- Diffs of the changes: (+20 -6) PPCInstrInfo.cpp | 16 +--- PPCInstrInfo.h |8 ++-- PPCTargetMachine.cpp |2 +- 3 files changed, 20 insertions(+), 6 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.20 llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.21 --- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1.20 Thu May 4 12:52:23 2006 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.cppFri Jun 16 19:01:04 2006 @@ -13,13 +13,23 @@ #include "PPCInstrInfo.h" #include "PPCGenInstrInfo.inc" -#include "PPC.h" +#include "PPCTargetMachine.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include using namespace llvm; -PPCInstrInfo::PPCInstrInfo() - : TargetInstrInfo(PPCInsts, sizeof(PPCInsts)/sizeof(PPCInsts[0])) {} +PPCInstrInfo::PPCInstrInfo(PPCTargetMachine &tm) + : TargetInstrInfo(PPCInsts, sizeof(PPCInsts)/sizeof(PPCInsts[0])), TM(tm) {} + +/// getPointerRegClass - Return the register class to use to hold pointers. +/// This is used for addressing modes. +const TargetRegisterClass *PPCInstrInfo::getPointerRegClass() const { + if (TM.getSubtargetImpl()->isPPC64()) +return &PPC::G8RCRegClass; + else +return &PPC::GPRCRegClass; +} + bool PPCInstrInfo::isMoveInstr(const MachineInstr& MI, unsigned& sourceReg, Index: llvm/lib/Target/PowerPC/PPCInstrInfo.h diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.h:1.15 llvm/lib/Target/PowerPC/PPCInstrInfo.h:1.16 --- llvm/lib/Target/PowerPC/PPCInstrInfo.h:1.15 Wed May 24 12:04:04 2006 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.h Fri Jun 16 19:01:04 2006 @@ -62,9 +62,10 @@ class PPCInstrInfo : public TargetInstrInfo { + PPCTargetMachine &TM; const PPCRegisterInfo RI; public: - PPCInstrInfo(); + PPCInstrInfo(PPCTargetMachine &TM); /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As /// such, whenever a client has an instance of instruction info, it should @@ -72,7 +73,10 @@ /// virtual const MRegisterInfo &getRegisterInfo() const { return RI; } - // + /// getPointerRegClass - Return the register class to use to hold pointers. + /// This is used for addressing modes. + virtual const TargetRegisterClass *getPointerRegClass() const; + // Return true if the instruction is a register to register move and // leave the source and dest operands in the passed parameters. // Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.94 llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.95 --- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.94 Fri Jun 16 13:50:48 2006 +++ llvm/lib/Target/PowerPC/PPCTargetMachine.cppFri Jun 16 19:01:04 2006 @@ -87,7 +87,7 @@ PPCTargetMachine::PPCTargetMachine(const Module &M, const std::string &FS, bool is64Bit) : TargetMachine("PowerPC"), Subtarget(M, FS, is64Bit), -DataLayout(Subtarget.getTargetDataString()), +DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this), FrameInfo(*this, false), JITInfo(*this), TLInfo(*this), InstrItins(Subtarget.getInstrItineraryData()) { ___ 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/README.txt
Changes in directory llvm/lib/Target/X86: README.txt updated: 1.117 -> 1.118 --- Log message: A new entry. --- Diffs of the changes: (+2 -0) README.txt |2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Target/X86/README.txt diff -u llvm/lib/Target/X86/README.txt:1.117 llvm/lib/Target/X86/README.txt:1.118 --- llvm/lib/Target/X86/README.txt:1.117Thu Jun 15 16:33:31 2006 +++ llvm/lib/Target/X86/README.txt Fri Jun 16 19:45:49 2006 @@ -702,3 +702,5 @@ Smells like a register coallescing/reassociation issue. //===-===// + +Use cpuid to auto-detect CPU features such as SSE, SSE2, and SSE3. ___ 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/IndVarsSimplify/2006-06-16-Indvar-LCSSA-Crash.ll
Changes in directory llvm/test/Regression/Transforms/IndVarsSimplify: 2006-06-16-Indvar-LCSSA-Crash.ll added (r1.1) --- Log message: new testcase that crashes indvars --- Diffs of the changes: (+21 -0) 2006-06-16-Indvar-LCSSA-Crash.ll | 21 + 1 files changed, 21 insertions(+) Index: llvm/test/Regression/Transforms/IndVarsSimplify/2006-06-16-Indvar-LCSSA-Crash.ll diff -c /dev/null llvm/test/Regression/Transforms/IndVarsSimplify/2006-06-16-Indvar-LCSSA-Crash.ll:1.1 *** /dev/null Fri Jun 16 20:01:40 2006 --- llvm/test/Regression/Transforms/IndVarsSimplify/2006-06-16-Indvar-LCSSA-Crash.ll Fri Jun 16 20:01:30 2006 *** *** 0 --- 1,21 + ; RUN: llvm-as < %s | opt -indvars -disable-output + + void %get_block() { + endif.0: ; preds = %entry + br label %no_exit.30 + + no_exit.30: ; preds = %no_exit.30, %endif.0 + %x.12.0 = phi int [ %inc.28, %no_exit.30 ], [ -2, %endif.0 ] ; [#uses=1] + %tmp.583 = load ushort* null; [#uses=1] + %tmp.584 = cast ushort %tmp.583 to int ; [#uses=1] + %tmp.588 = load int* null ; [#uses=1] + %tmp.589 = mul int %tmp.584, %tmp.588 ; [#uses=1] + %tmp.591 = add int %tmp.589, 0 ; [#uses=1] + %inc.28 = add int %x.12.0, 1; [#uses=2] + %tmp.565 = setgt int %inc.28, 3 ; [#uses=1] + br bool %tmp.565, label %loopexit.30, label %no_exit.30 + + loopexit.30: ; preds = %no_exit.30 + %tmp.591.lcssa = phi int [ %tmp.591, %no_exit.30 ] ; [#uses=0] + ret void + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.82 -> 1.83 --- Log message: Fix IndVarsSimplify/2006-06-16-Indvar-LCSSA-Crash.ll, a case where a "LCSSA" phi node causes indvars to break dominance properties. This fixes causes indvars to avoid inserting aggressive code in this case, instead indvars should be fixed to be more aggressive in the face of lcssa phi's. --- Diffs of the changes: (+19 -4) IndVarSimplify.cpp | 23 +++ 1 files changed, 19 insertions(+), 4 deletions(-) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.82 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.83 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.82 Fri Nov 18 12:30:47 2005 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Fri Jun 16 20:02:31 2006 @@ -321,11 +321,26 @@ HasConstantItCount) { // Find out if this predictably varying value is actually used // outside of the loop. "extra" as opposed to "intra". -std::vector ExtraLoopUsers; +std::vector ExtraLoopUsers; for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); - UI != E; ++UI) - if (!L->contains(cast(*UI)->getParent())) -ExtraLoopUsers.push_back(*UI); + UI != E; ++UI) { + Instruction *User = cast(*UI); + if (!L->contains(User->getParent())) { +// If this is a PHI node in the exit block and we're inserting, +// into the exit block, it must have a single entry. In this +// case, we can't insert the code after the PHI and have the PHI +// still use it. Instead, don't insert the the PHI. +if (PHINode *PN = dyn_cast(User)) { + // FIXME: This is a case where LCSSA pessimizes code, this + // should be fixed better. + if (PN->getNumOperands() == 2 && + PN->getParent() == BlockToInsertInto) +continue; +} +ExtraLoopUsers.push_back(User); + } +} + if (!ExtraLoopUsers.empty()) { // Okay, this instruction has a user outside of the current loop // and varies predictably in this loop. Evaluate the value it ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrInfo.h
Changes in directory llvm/include/llvm/Target: TargetInstrInfo.h updated: 1.89 -> 1.90 --- Log message: Clean up --- Diffs of the changes: (+1 -2) TargetInstrInfo.h |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/include/llvm/Target/TargetInstrInfo.h diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.89 llvm/include/llvm/Target/TargetInstrInfo.h:1.90 --- llvm/include/llvm/Target/TargetInstrInfo.h:1.89 Thu Jun 15 03:10:27 2006 +++ llvm/include/llvm/Target/TargetInstrInfo.h Fri Jun 16 20:42:20 2006 @@ -149,8 +149,7 @@ const TargetRegisterClass *getInstrOperandRegClass(const TargetInstrDescriptor *II, unsigned Op) const { if (Op >= II->numOperands) { - if (!(II->Flags & M_VARIABLE_OPS)) -assert(false && "Invalid operand # of instruction"); + assert((II->Flags & M_VARIABLE_OPS)&& "Invalid operand # of instruction"); return NULL; } const TargetOperandInfo &toi = II->OpInfo[Op]; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits