[llvm-commits] CVS: llvm/test/Assembler/2007-05-21-Escape.ll
Changes in directory llvm/test/Assembler: 2007-05-21-Escape.ll added (r1.1) --- Log message: new testcase for a recent regression --- Diffs of the changes: (+22 -0) 2007-05-21-Escape.ll | 22 ++ 1 files changed, 22 insertions(+) Index: llvm/test/Assembler/2007-05-21-Escape.ll diff -c /dev/null llvm/test/Assembler/2007-05-21-Escape.ll:1.1 *** /dev/null Tue May 22 02:00:48 2007 --- llvm/test/Assembler/2007-05-21-Escape.llTue May 22 02:00:38 2007 *** *** 0 --- 1,22 + ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis + target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" + target triple = "x86_64-apple-darwin8" + %struct.bar = type { i32 } + %struct.foo = type { i32 } + + define i32 @"Func64"(%struct.bar* %F) { + entry: + ret i32 1 + } + + define i32 @Func64(%struct.bar* %B) { + entry: + ret i32 0 + } + + define i32 @test() { + entry: + %tmp = tail call i32 @"Func64"( %struct.bar* null ); [#uses=0] + %tmp1 = tail call i32 @Func64( %struct.bar* null ) ; [#uses=0] + ret i32 undef + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.284 -> 1.285 --- Log message: temporarily revert reid's asmwriter patch, it is missing the asmparser piece that decodes the escape sequences, thus breaking all cases that use them. This fixes test/Assembler/2007-05-21-Escape.ll --- Diffs of the changes: (+19 -33) AsmWriter.cpp | 52 +++- 1 files changed, 19 insertions(+), 33 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.284 llvm/lib/VMCore/AsmWriter.cpp:1.285 --- llvm/lib/VMCore/AsmWriter.cpp:1.284 Sat May 19 09:44:42 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Tue May 22 02:00:50 2007 @@ -33,7 +33,6 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/Streams.h" #include -#include using namespace llvm; namespace llvm { @@ -179,39 +178,17 @@ /// NameNeedsQuotes - Return true if the specified llvm name should be wrapped /// with ""'s. -static std::string QuoteNameIfNeeded(const std::string &Name) { - std::string result; - bool needsQuotes = Name[0] >= '0' && Name[0] <= '9'; - // Scan the name to see if it needs quotes and to replace funky chars with - // their octal equivalent. +static bool NameNeedsQuotes(const std::string &Name) { + if (Name[0] >= '0' && Name[0] <= '9') return true; + // Scan to see if we have any characters that are not on the "white list" for (unsigned i = 0, e = Name.size(); i != e; ++i) { char C = Name[i]; assert(C != '"' && "Illegal character in LLVM value name!"); -if (isalnum(C) || C == '-' || C == '.' || C == '_') - result += C; -else if (isprint(C)) { - needsQuotes = true; - result += C; -} else { - needsQuotes = true; - result += "\\"; - char hex1 = (C >> 4) & 0x0F; - if (hex1 < 10) -result += hex1 + '0'; - else -result += hex1 - 10 + 'A'; - char hex2 = C & 0x0F; - if (hex2 < 10) -result += hex2 + '0'; - else -result += hex2 - 10 + 'A'; -} - } - if (needsQuotes) { -result.insert(0,"\""); -result += '"'; +if ((C < 'a' || C > 'z') && (C < 'A' || C > 'Z') && (C < '0' || C > '9') && +C != '-' && C != '.' && C != '_') + return true; } - return result; + return false; } enum PrefixType { @@ -225,11 +202,20 @@ /// surrounded with ""'s (if it has special chars in it). static std::string getLLVMName(const std::string &Name, PrefixType Prefix) { assert(!Name.empty() && "Cannot get empty name!"); + + // First character cannot start with a number... + if (NameNeedsQuotes(Name)) { +if (Prefix == GlobalPrefix) + return "@\"" + Name + "\""; +return "\"" + Name + "\""; + } + + // If we get here, then the identifier is legal to use as a "VarID". switch (Prefix) { default: assert(0 && "Bad prefix!"); - case GlobalPrefix: return '@' + QuoteNameIfNeeded(Name); - case LabelPrefix: return QuoteNameIfNeeded(Name); - case LocalPrefix: return '%' + QuoteNameIfNeeded(Name); + case GlobalPrefix: return '@' + Name; + case LabelPrefix: return Name; + case LocalPrefix: return '%' + Name; } } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
On Tue, 2007-05-22 at 02:01 -0500, Chris Lattner wrote: > > Changes in directory llvm/lib/VMCore: > > AsmWriter.cpp updated: 1.284 -> 1.285 > --- > Log message: > > temporarily revert reid's asmwriter patch, it is missing the asmparser piece > that decodes the escape sequences, thus breaking all cases that use them. I sent you the patch for this yesterday. Reid. > > This fixes test/Assembler/2007-05-21-Escape.ll > > > > --- > Diffs of the changes: (+19 -33) > > AsmWriter.cpp | 52 +++- > 1 files changed, 19 insertions(+), 33 deletions(-) > > > Index: llvm/lib/VMCore/AsmWriter.cpp > diff -u llvm/lib/VMCore/AsmWriter.cpp:1.284 > llvm/lib/VMCore/AsmWriter.cpp:1.285 > --- llvm/lib/VMCore/AsmWriter.cpp:1.284 Sat May 19 09:44:42 2007 > +++ llvm/lib/VMCore/AsmWriter.cpp Tue May 22 02:00:50 2007 > @@ -33,7 +33,6 @@ > #include "llvm/Support/MathExtras.h" > #include "llvm/Support/Streams.h" > #include > -#include > using namespace llvm; > > namespace llvm { > @@ -179,39 +178,17 @@ > > /// NameNeedsQuotes - Return true if the specified llvm name should be > wrapped > /// with ""'s. > -static std::string QuoteNameIfNeeded(const std::string &Name) { > - std::string result; > - bool needsQuotes = Name[0] >= '0' && Name[0] <= '9'; > - // Scan the name to see if it needs quotes and to replace funky chars with > - // their octal equivalent. > +static bool NameNeedsQuotes(const std::string &Name) { > + if (Name[0] >= '0' && Name[0] <= '9') return true; > + // Scan to see if we have any characters that are not on the "white list" >for (unsigned i = 0, e = Name.size(); i != e; ++i) { > char C = Name[i]; > assert(C != '"' && "Illegal character in LLVM value name!"); > -if (isalnum(C) || C == '-' || C == '.' || C == '_') > - result += C; > -else if (isprint(C)) { > - needsQuotes = true; > - result += C; > -} else { > - needsQuotes = true; > - result += "\\"; > - char hex1 = (C >> 4) & 0x0F; > - if (hex1 < 10) > -result += hex1 + '0'; > - else > -result += hex1 - 10 + 'A'; > - char hex2 = C & 0x0F; > - if (hex2 < 10) > -result += hex2 + '0'; > - else > -result += hex2 - 10 + 'A'; > -} > - } > - if (needsQuotes) { > -result.insert(0,"\""); > -result += '"'; > +if ((C < 'a' || C > 'z') && (C < 'A' || C > 'Z') && (C < '0' || C > '9') > && > +C != '-' && C != '.' && C != '_') > + return true; >} > - return result; > + return false; > } > > enum PrefixType { > @@ -225,11 +202,20 @@ > /// surrounded with ""'s (if it has special chars in it). > static std::string getLLVMName(const std::string &Name, PrefixType Prefix) { >assert(!Name.empty() && "Cannot get empty name!"); > + > + // First character cannot start with a number... > + if (NameNeedsQuotes(Name)) { > +if (Prefix == GlobalPrefix) > + return "@\"" + Name + "\""; > +return "\"" + Name + "\""; > + } > + > + // If we get here, then the identifier is legal to use as a "VarID". >switch (Prefix) { >default: assert(0 && "Bad prefix!"); > - case GlobalPrefix: return '@' + QuoteNameIfNeeded(Name); > - case LabelPrefix: return QuoteNameIfNeeded(Name); > - case LocalPrefix: return '%' + QuoteNameIfNeeded(Name); > + case GlobalPrefix: return '@' + Name; > + case LabelPrefix: return Name; > + case LocalPrefix: return '%' + Name; >} > } > > > > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp PPCTargetMachine.h
Changes in directory llvm/lib/Target/PowerPC: PPCTargetMachine.cpp updated: 1.117 -> 1.118 PPCTargetMachine.h updated: 1.29 -> 1.30 --- Log message: Make tail merging the default, except on powerPC. There was no prior art for a target-dependent default with a command-line override; this way should be generally usable. --- Diffs of the changes: (+5 -0) PPCTargetMachine.cpp |4 PPCTargetMachine.h |1 + 2 files changed, 5 insertions(+) Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.117 llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.118 --- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.117 Sat Feb 24 23:04:13 2007 +++ llvm/lib/Target/PowerPC/PPCTargetMachine.cppTue May 22 12:14:46 2007 @@ -96,6 +96,10 @@ setRelocationModel(Reloc::Static); } +/// Override this for PowerPC. Tail merging happily breaks up instruction issue +/// groups, which typically degrades performance. +const bool PPCTargetMachine::DoTailMergeDefault() const { return false; } + PPC32TargetMachine::PPC32TargetMachine(const Module &M, const std::string &FS) : PPCTargetMachine(M, FS, false) { } Index: llvm/lib/Target/PowerPC/PPCTargetMachine.h diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.29 llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.30 --- llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.29 Wed Feb 7 19:39:44 2007 +++ llvm/lib/Target/PowerPC/PPCTargetMachine.h Tue May 22 12:14:46 2007 @@ -73,6 +73,7 @@ MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, MachineCodeEmitter &MCE); + virtual const bool DoTailMergeDefault() const; }; /// PPC32TargetMachine - PowerPC 32-bit target machine. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Support/CommandLine.h
Changes in directory llvm/include/llvm/Support: CommandLine.h updated: 1.64 -> 1.65 --- Log message: Make tail merging the default, except on powerPC. There was no prior art for a target-dependent default with a command-line override; this way should be generally usable. --- Diffs of the changes: (+22 -0) CommandLine.h | 22 ++ 1 files changed, 22 insertions(+) Index: llvm/include/llvm/Support/CommandLine.h diff -u llvm/include/llvm/Support/CommandLine.h:1.64 llvm/include/llvm/Support/CommandLine.h:1.65 --- llvm/include/llvm/Support/CommandLine.h:1.64Wed Apr 11 19:36:29 2007 +++ llvm/include/llvm/Support/CommandLine.h Tue May 22 12:14:46 2007 @@ -544,6 +544,28 @@ EXTERN_TEMPLATE_INSTANTIATION(class basic_parser); +//-- +// parser +enum boolOrDefault { BOU_UNSET, BOU_TRUE, BOU_FALSE }; +template<> +class parser : public basic_parser { +public: + // parse - Return true on error. + bool parse(Option &O, const char *ArgName, const std::string &Arg, + boolOrDefault &Val); + + enum ValueExpected getValueExpectedFlagDefault() const { +return ValueOptional; + } + + // getValueName - Do not print = at all. + virtual const char *getValueName() const { return 0; } + + // An out-of-line virtual method to provide a 'home' for this class. + virtual void anchor(); +}; + +EXTERN_TEMPLATE_INSTANTIATION(class basic_parser); //-- // parser ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/BranchFolding.cpp LLVMTargetMachine.cpp
Changes in directory llvm/lib/CodeGen: BranchFolding.cpp updated: 1.54 -> 1.55 LLVMTargetMachine.cpp updated: 1.12 -> 1.13 --- Log message: Make tail merging the default, except on powerPC. There was no prior art for a target-dependent default with a command-line override; this way should be generally usable. --- Diffs of the changes: (+15 -6) BranchFolding.cpp | 17 + LLVMTargetMachine.cpp |4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) Index: llvm/lib/CodeGen/BranchFolding.cpp diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.54 llvm/lib/CodeGen/BranchFolding.cpp:1.55 --- llvm/lib/CodeGen/BranchFolding.cpp:1.54 Thu May 17 20:28:58 2007 +++ llvm/lib/CodeGen/BranchFolding.cpp Tue May 22 12:14:46 2007 @@ -35,12 +35,19 @@ STATISTIC(NumDeadBlocks, "Number of dead blocks removed"); STATISTIC(NumBranchOpts, "Number of branches optimized"); STATISTIC(NumTailMerge , "Number of block tails merged"); -static cl::opt EnableTailMerge("enable-tail-merge", cl::Hidden); - +static cl::opt FlagEnableTailMerge("enable-tail-merge", + cl::init(cl::BOU_UNSET), cl::Hidden); namespace { struct BranchFolder : public MachineFunctionPass { static char ID; -BranchFolder() : MachineFunctionPass((intptr_t)&ID) {} +BranchFolder(bool defaultEnableTailMerge) : +MachineFunctionPass((intptr_t)&ID) { + switch (FlagEnableTailMerge) { + case cl::BOU_UNSET: EnableTailMerge = defaultEnableTailMerge; break; + case cl::BOU_TRUE: EnableTailMerge = true; break; + case cl::BOU_FALSE: EnableTailMerge = false; break; + } +} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Control Flow Optimizer"; } @@ -49,6 +56,7 @@ bool MadeChange; private: // Tail Merging. +bool EnableTailMerge; bool TailMergeBlocks(MachineFunction &MF); bool TryMergeBlocks(MachineBasicBlock* SuccBB, MachineBasicBlock* PredBB); @@ -79,7 +87,8 @@ bool isCond, MachineFunction::iterator FallThru); -FunctionPass *llvm::createBranchFoldingPass() { return new BranchFolder(); } +FunctionPass *llvm::createBranchFoldingPass(bool DefaultEnableTailMerge) { + return new BranchFolder(DefaultEnableTailMerge); } /// RemoveDeadBlock - Remove the specified dead machine basic block from the /// function, updating the CFG. Index: llvm/lib/CodeGen/LLVMTargetMachine.cpp diff -u llvm/lib/CodeGen/LLVMTargetMachine.cpp:1.12 llvm/lib/CodeGen/LLVMTargetMachine.cpp:1.13 --- llvm/lib/CodeGen/LLVMTargetMachine.cpp:1.12 Fri Mar 30 23:18:03 2007 +++ llvm/lib/CodeGen/LLVMTargetMachine.cpp Tue May 22 12:14:46 2007 @@ -78,7 +78,7 @@ // Branch folding must be run after regalloc and prolog/epilog insertion. if (!Fast) -PM.add(createBranchFoldingPass()); +PM.add(createBranchFoldingPass(DoTailMergeDefault())); // Fold redundant debug labels. PM.add(createDebugLabelFoldingPass()); @@ -181,7 +181,7 @@ // Branch folding must be run after regalloc and prolog/epilog insertion. if (!Fast) -PM.add(createBranchFoldingPass()); +PM.add(createBranchFoldingPass(DoTailMergeDefault())); if (addPreEmitPass(PM, Fast) && PrintMachineCode) PM.add(createMachineFunctionPrinterPass(cerr)); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Support/CommandLine.cpp
Changes in directory llvm/lib/Support: CommandLine.cpp updated: 1.87 -> 1.88 --- Log message: Make tail merging the default, except on powerPC. There was no prior art for a target-dependent default with a command-line override; this way should be generally usable. --- Diffs of the changes: (+18 -0) CommandLine.cpp | 18 ++ 1 files changed, 18 insertions(+) Index: llvm/lib/Support/CommandLine.cpp diff -u llvm/lib/Support/CommandLine.cpp:1.87 llvm/lib/Support/CommandLine.cpp:1.88 --- llvm/lib/Support/CommandLine.cpp:1.87 Wed Apr 11 19:36:29 2007 +++ llvm/lib/Support/CommandLine.cppTue May 22 12:14:46 2007 @@ -36,6 +36,7 @@ // Template instantiations and anchors. // TEMPLATE_INSTANTIATION(class basic_parser); +TEMPLATE_INSTANTIATION(class basic_parser); TEMPLATE_INSTANTIATION(class basic_parser); TEMPLATE_INSTANTIATION(class basic_parser); TEMPLATE_INSTANTIATION(class basic_parser); @@ -50,6 +51,7 @@ void Option::anchor() {} void basic_parser_impl::anchor() {} void parser::anchor() {} +void parser::anchor() {} void parser::anchor() {} void parser::anchor() {} void parser::anchor() {} @@ -767,6 +769,22 @@ return false; } +// parser implementation +// +bool parser::parse(Option &O, const char *ArgName, + const std::string &Arg, boolOrDefault &Value) { + if (Arg == "" || Arg == "true" || Arg == "TRUE" || Arg == "True" || + Arg == "1") { +Value = BOU_TRUE; + } else if (Arg == "false" || Arg == "FALSE" || Arg == "False" || Arg == "0") { +Value = BOU_FALSE; + } else { +return O.error(": '" + Arg + + "' is invalid value for boolean argument! Try 0 or 1"); + } + return false; +} + // parser implementation // bool parser::parse(Option &O, const char *ArgName, ___ 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/TargetMachine.h
Changes in directory llvm/include/llvm/Target: TargetMachine.h updated: 1.76 -> 1.77 --- Log message: Make tail merging the default, except on powerPC. There was no prior art for a target-dependent default with a command-line override; this way should be generally usable. --- Diffs of the changes: (+8 -0) TargetMachine.h |8 1 files changed, 8 insertions(+) Index: llvm/include/llvm/Target/TargetMachine.h diff -u llvm/include/llvm/Target/TargetMachine.h:1.76 llvm/include/llvm/Target/TargetMachine.h:1.77 --- llvm/include/llvm/Target/TargetMachine.h:1.76 Wed Feb 7 19:34:45 2007 +++ llvm/include/llvm/Target/TargetMachine.hTue May 22 12:14:46 2007 @@ -185,6 +185,10 @@ AssemblyFile, ObjectFile, DynamicLibrary }; + /// DoTailMergeDefault - Whether it is generally a good idea to do this + /// on this target. User flag overrides. + virtual const bool DoTailMergeDefault() const { return true; } + /// addPassesToEmitFile - Add passes to the specified pass manager to get the /// specified file emitted. Typically this will involve several steps of code /// generation. If Fast is set to true, the code generator should emit code @@ -315,6 +319,10 @@ MachineCodeEmitter &MCE) { return true; } + + /// DoTailMergeDefault - Whether it is generally a good idea to do this + /// on this target. User flag overrides. + virtual const bool DoTailMergeDefault() const { return true; } }; } // 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/include/llvm/CodeGen/Passes.h
Changes in directory llvm/include/llvm/CodeGen: Passes.h updated: 1.25 -> 1.26 --- Log message: Make tail merging the default, except on powerPC. There was no prior art for a target-dependent default with a command-line override; this way should be generally usable. --- Diffs of the changes: (+1 -1) Passes.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/Passes.h diff -u llvm/include/llvm/CodeGen/Passes.h:1.25 llvm/include/llvm/CodeGen/Passes.h:1.26 --- llvm/include/llvm/CodeGen/Passes.h:1.25 Tue May 15 21:00:02 2007 +++ llvm/include/llvm/CodeGen/Passes.h Tue May 22 12:14:46 2007 @@ -79,7 +79,7 @@ /// optimizations to delete branches to branches, eliminate branches to /// successor blocks (creating fall throughs), and eliminating branches over /// branches. - FunctionPass *createBranchFoldingPass(); + FunctionPass *createBranchFoldingPass(bool DefaultEnableTailMerge); /// IfConverter Pass - This pass performs machine code if conversion. FunctionPass *createIfConverterPass(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/Generic/2007-02-16-BranchFold.ll
Changes in directory llvm/test/CodeGen/Generic: 2007-02-16-BranchFold.ll updated: 1.5 -> 1.6 --- Log message: Test assumes tail merging is off; this must now be explicit. --- Diffs of the changes: (+1 -1) 2007-02-16-BranchFold.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/Generic/2007-02-16-BranchFold.ll diff -u llvm/test/CodeGen/Generic/2007-02-16-BranchFold.ll:1.5 llvm/test/CodeGen/Generic/2007-02-16-BranchFold.ll:1.6 --- llvm/test/CodeGen/Generic/2007-02-16-BranchFold.ll:1.5 Sun Apr 15 15:47:23 2007 +++ llvm/test/CodeGen/Generic/2007-02-16-BranchFold.ll Tue May 22 12:18:05 2007 @@ -1,5 +1,5 @@ ; PR 1200 -; RUN: llvm-as < %s | llc | not grep jmp +; RUN: llvm-as < %s | llc -enable-tail-merge=0 | not grep jmp ; ModuleID = '' target datalayout = "e-p:32:32" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-05-22-tailmerge-3.ll
Changes in directory llvm/test/CodeGen/ARM: 2007-05-22-tailmerge-3.ll added (r1.1) --- Log message: new testcases for -enable-tail-merge default handling --- Diffs of the changes: (+68 -0) 2007-05-22-tailmerge-3.ll | 68 ++ 1 files changed, 68 insertions(+) Index: llvm/test/CodeGen/ARM/2007-05-22-tailmerge-3.ll diff -c /dev/null llvm/test/CodeGen/ARM/2007-05-22-tailmerge-3.ll:1.1 *** /dev/null Tue May 22 12:19:33 2007 --- llvm/test/CodeGen/ARM/2007-05-22-tailmerge-3.ll Tue May 22 12:19:23 2007 *** *** 0 --- 1,68 + ; RUN: llvm-as < %s | llc -march=arm | grep bl.*baz | wc -l | grep 1 + ; RUN: llvm-as < %s | llc -march=arm | grep bl.*quux | wc -l | grep 1 + ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge=0 | grep bl.*baz | wc -l | grep 2 + ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge=0 | grep bl.*quux | wc -l | grep 2 + ; Check that tail merging is the default on ARM, and that -enable-tail-merge=0 works. + + ; ModuleID = 'tail.c' + target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" + target triple = "i686-apple-darwin8" + + define i32 @f(i32 %i, i32 %q) { + entry: + %i_addr = alloca i32; [#uses=2] + %q_addr = alloca i32; [#uses=2] + %retval = alloca i32, align 4 ; [#uses=1] + "alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %i, i32* %i_addr + store i32 %q, i32* %q_addr + %tmp = load i32* %i_addr; [#uses=1] + %tmp1 = icmp ne i32 %tmp, 0 ; [#uses=1] + %tmp12 = zext i1 %tmp1 to i8; [#uses=1] + %toBool = icmp ne i8 %tmp12, 0 ; [#uses=1] + br i1 %toBool, label %cond_true, label %cond_false + + cond_true:; preds = %entry + %tmp3 = call i32 (...)* @bar( ) ; [#uses=0] + %tmp4 = call i32 (...)* @baz( i32 5, i32 6 ); [#uses=0] + %tmp7 = load i32* %q_addr ; [#uses=1] + %tmp8 = icmp ne i32 %tmp7, 0; [#uses=1] + %tmp89 = zext i1 %tmp8 to i8; [#uses=1] + %toBool10 = icmp ne i8 %tmp89, 0; [#uses=1] + br i1 %toBool10, label %cond_true11, label %cond_false15 + + cond_false: ; preds = %entry + %tmp5 = call i32 (...)* @foo( ) ; [#uses=0] + %tmp6 = call i32 (...)* @baz( i32 5, i32 6 ); [#uses=0] + %tmp27 = load i32* %q_addr ; [#uses=1] + %tmp28 = icmp ne i32 %tmp27, 0 ; [#uses=1] + %tmp289 = zext i1 %tmp28 to i8 ; [#uses=1] + %toBool210 = icmp ne i8 %tmp289, 0 ; [#uses=1] + br i1 %toBool210, label %cond_true11, label %cond_false15 + + cond_true11: ; preds = %cond_next + %tmp13 = call i32 (...)* @foo( ); [#uses=0] + %tmp14 = call i32 (...)* @quux( i32 3, i32 4 ) ; [#uses=0] + br label %cond_next18 + + cond_false15: ; preds = %cond_next + %tmp16 = call i32 (...)* @bar( ); [#uses=0] + %tmp17 = call i32 (...)* @quux( i32 3, i32 4 ) ; [#uses=0] + br label %cond_next18 + + cond_next18: ; preds = %cond_false15, %cond_true11 + %tmp19 = call i32 (...)* @bar( ); [#uses=0] + br label %return + + return: ; preds = %cond_next18 + %retval20 = load i32* %retval ; [#uses=1] + ret i32 %retval20 + } + + declare i32 @bar(...) + + declare i32 @baz(...) + + declare i32 @foo(...) + + declare i32 @quux(...) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/PowerPC/2007-05-22-tailmerge-3.ll
Changes in directory llvm/test/CodeGen/PowerPC: 2007-05-22-tailmerge-3.ll added (r1.1) --- Log message: new testcases for -enable-tail-merge default handling --- Diffs of the changes: (+68 -0) 2007-05-22-tailmerge-3.ll | 68 ++ 1 files changed, 68 insertions(+) Index: llvm/test/CodeGen/PowerPC/2007-05-22-tailmerge-3.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/2007-05-22-tailmerge-3.ll:1.1 *** /dev/null Tue May 22 12:19:33 2007 --- llvm/test/CodeGen/PowerPC/2007-05-22-tailmerge-3.ll Tue May 22 12:19:23 2007 *** *** 0 --- 1,68 + ; RUN: llvm-as < %s | llc -march=ppc32 | grep bl.*baz | wc -l | grep 2 + ; RUN: llvm-as < %s | llc -march=ppc32 | grep bl.*quux | wc -l | grep 2 + ; RUN: llvm-as < %s | llc -march=ppc32 -enable-tail-merge | grep bl.*baz | wc -l | grep 1 + ; RUN: llvm-as < %s | llc -march=ppc32 -enable-tail-merge=1 | grep bl.*quux | wc -l | grep 1 + ; Check that tail merging is not the default on ppc, and that -enable-tail-merge works. + + ; ModuleID = 'tail.c' + target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" + target triple = "i686-apple-darwin8" + + define i32 @f(i32 %i, i32 %q) { + entry: + %i_addr = alloca i32; [#uses=2] + %q_addr = alloca i32; [#uses=2] + %retval = alloca i32, align 4 ; [#uses=1] + "alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %i, i32* %i_addr + store i32 %q, i32* %q_addr + %tmp = load i32* %i_addr; [#uses=1] + %tmp1 = icmp ne i32 %tmp, 0 ; [#uses=1] + %tmp12 = zext i1 %tmp1 to i8; [#uses=1] + %toBool = icmp ne i8 %tmp12, 0 ; [#uses=1] + br i1 %toBool, label %cond_true, label %cond_false + + cond_true:; preds = %entry + %tmp3 = call i32 (...)* @bar( ) ; [#uses=0] + %tmp4 = call i32 (...)* @baz( i32 5, i32 6 ); [#uses=0] + %tmp7 = load i32* %q_addr ; [#uses=1] + %tmp8 = icmp ne i32 %tmp7, 0; [#uses=1] + %tmp89 = zext i1 %tmp8 to i8; [#uses=1] + %toBool10 = icmp ne i8 %tmp89, 0; [#uses=1] + br i1 %toBool10, label %cond_true11, label %cond_false15 + + cond_false: ; preds = %entry + %tmp5 = call i32 (...)* @foo( ) ; [#uses=0] + %tmp6 = call i32 (...)* @baz( i32 5, i32 6 ); [#uses=0] + %tmp27 = load i32* %q_addr ; [#uses=1] + %tmp28 = icmp ne i32 %tmp27, 0 ; [#uses=1] + %tmp289 = zext i1 %tmp28 to i8 ; [#uses=1] + %toBool210 = icmp ne i8 %tmp289, 0 ; [#uses=1] + br i1 %toBool210, label %cond_true11, label %cond_false15 + + cond_true11: ; preds = %cond_next + %tmp13 = call i32 (...)* @foo( ); [#uses=0] + %tmp14 = call i32 (...)* @quux( i32 3, i32 4 ) ; [#uses=0] + br label %cond_next18 + + cond_false15: ; preds = %cond_next + %tmp16 = call i32 (...)* @bar( ); [#uses=0] + %tmp17 = call i32 (...)* @quux( i32 3, i32 4 ) ; [#uses=0] + br label %cond_next18 + + cond_next18: ; preds = %cond_false15, %cond_true11 + %tmp19 = call i32 (...)* @bar( ); [#uses=0] + br label %return + + return: ; preds = %cond_next18 + %retval20 = load i32* %retval ; [#uses=1] + ret i32 %retval20 + } + + declare i32 @bar(...) + + declare i32 @baz(...) + + declare i32 @foo(...) + + declare i32 @quux(...) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
On May 22, 2007, at 7:50 AM, Reid Spencer wrote: > On Tue, 2007-05-22 at 02:01 -0500, Chris Lattner wrote: >> >> Changes in directory llvm/lib/VMCore: >> >> AsmWriter.cpp updated: 1.284 -> 1.285 >> --- >> Log message: >> >> temporarily revert reid's asmwriter patch, it is missing the >> asmparser piece >> that decodes the escape sequences, thus breaking all cases that >> use them. > > I sent you the patch for this yesterday. I'm taking a look now, but my primary concern was to get the tree unbroken. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp
Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.147 -> 1.148 --- Log message: Silence a warning. --- Diffs of the changes: (+1 -1) DwarfWriter.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.147 llvm/lib/CodeGen/DwarfWriter.cpp:1.148 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.147 Mon May 21 13:50:28 2007 +++ llvm/lib/CodeGen/DwarfWriter.cppTue May 22 13:13:40 2007 @@ -2996,7 +2996,7 @@ // Look at each landing pad site to compute size. We need the size of each // landing pad site info and the size of the landing pad's actions. -signed FirstAction; +signed FirstAction = 0; for (unsigned i = 0, N = LandingPads.size(); i != N; ++i) { const LandingPadInfo *LandingPad = LandingPads[i]; ___ 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 PPCTargetMachine.h
Changes in directory llvm/lib/Target/PowerPC: PPCTargetMachine.cpp updated: 1.118 -> 1.119 PPCTargetMachine.h updated: 1.30 -> 1.31 --- Log message: name change requested by review of previous patch --- Diffs of the changes: (+2 -2) PPCTargetMachine.cpp |2 +- PPCTargetMachine.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.118 llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.119 --- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.118 Tue May 22 12:14:46 2007 +++ llvm/lib/Target/PowerPC/PPCTargetMachine.cppTue May 22 13:31:04 2007 @@ -98,7 +98,7 @@ /// Override this for PowerPC. Tail merging happily breaks up instruction issue /// groups, which typically degrades performance. -const bool PPCTargetMachine::DoTailMergeDefault() const { return false; } +const bool PPCTargetMachine::getEnableTailMergeDefault() const { return false; } PPC32TargetMachine::PPC32TargetMachine(const Module &M, const std::string &FS) : PPCTargetMachine(M, FS, false) { Index: llvm/lib/Target/PowerPC/PPCTargetMachine.h diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.30 llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.31 --- llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.30 Tue May 22 12:14:46 2007 +++ llvm/lib/Target/PowerPC/PPCTargetMachine.h Tue May 22 13:31:04 2007 @@ -73,7 +73,7 @@ MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(FunctionPassManager &PM, bool Fast, MachineCodeEmitter &MCE); - virtual const bool DoTailMergeDefault() const; + virtual const bool getEnableTailMergeDefault() const; }; /// PPC32TargetMachine - PowerPC 32-bit target machine. ___ 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/TargetMachine.h
Changes in directory llvm/include/llvm/Target: TargetMachine.h updated: 1.77 -> 1.78 --- Log message: name change requested by review of previous patch --- Diffs of the changes: (+4 -4) TargetMachine.h |8 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/include/llvm/Target/TargetMachine.h diff -u llvm/include/llvm/Target/TargetMachine.h:1.77 llvm/include/llvm/Target/TargetMachine.h:1.78 --- llvm/include/llvm/Target/TargetMachine.h:1.77 Tue May 22 12:14:46 2007 +++ llvm/include/llvm/Target/TargetMachine.hTue May 22 13:31:04 2007 @@ -185,9 +185,9 @@ AssemblyFile, ObjectFile, DynamicLibrary }; - /// DoTailMergeDefault - Whether it is generally a good idea to do this + /// getEnableTailMergeDefault - the default setting for -enable-tail-merge /// on this target. User flag overrides. - virtual const bool DoTailMergeDefault() const { return true; } + virtual const bool getEnableTailMergeDefault() const { return true; } /// addPassesToEmitFile - Add passes to the specified pass manager to get the /// specified file emitted. Typically this will involve several steps of code @@ -320,9 +320,9 @@ return true; } - /// DoTailMergeDefault - Whether it is generally a good idea to do this + /// getEnableTailMergeDefault - the default setting for -enable-tail-merge /// on this target. User flag overrides. - virtual const bool DoTailMergeDefault() const { return true; } + virtual const bool getEnableTailMergeDefault() const { return true; } }; } // 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/CodeGen/LLVMTargetMachine.cpp
Changes in directory llvm/lib/CodeGen: LLVMTargetMachine.cpp updated: 1.13 -> 1.14 --- Log message: name change requested by review of previous patch --- Diffs of the changes: (+2 -2) LLVMTargetMachine.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/LLVMTargetMachine.cpp diff -u llvm/lib/CodeGen/LLVMTargetMachine.cpp:1.13 llvm/lib/CodeGen/LLVMTargetMachine.cpp:1.14 --- llvm/lib/CodeGen/LLVMTargetMachine.cpp:1.13 Tue May 22 12:14:46 2007 +++ llvm/lib/CodeGen/LLVMTargetMachine.cpp Tue May 22 13:31:04 2007 @@ -78,7 +78,7 @@ // Branch folding must be run after regalloc and prolog/epilog insertion. if (!Fast) -PM.add(createBranchFoldingPass(DoTailMergeDefault())); +PM.add(createBranchFoldingPass(getEnableTailMergeDefault())); // Fold redundant debug labels. PM.add(createDebugLabelFoldingPass()); @@ -181,7 +181,7 @@ // Branch folding must be run after regalloc and prolog/epilog insertion. if (!Fast) -PM.add(createBranchFoldingPass(DoTailMergeDefault())); +PM.add(createBranchFoldingPass(getEnableTailMergeDefault())); if (addPreEmitPass(PM, Fast) && PrintMachineCode) PM.add(createMachineFunctionPrinterPass(cerr)); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/CommandLine.html
Changes in directory llvm/docs: CommandLine.html updated: 1.43 -> 1.44 --- Log message: Document boolOrDefault and its parser. --- Diffs of the changes: (+9 -1) CommandLine.html | 10 +- 1 files changed, 9 insertions(+), 1 deletion(-) Index: llvm/docs/CommandLine.html diff -u llvm/docs/CommandLine.html:1.43 llvm/docs/CommandLine.html:1.44 --- llvm/docs/CommandLine.html:1.43 Thu Dec 7 14:04:41 2006 +++ llvm/docs/CommandLine.html Tue May 22 13:32:34 2007 @@ -75,6 +75,8 @@ parser The parserspecialization +The parser +specialization The parser specialization The parser @@ -1702,6 +1704,12 @@ strings are "true", "TRUE", "True", "1", "false", "FALSE", "False", and "0". +The parser + specialization is used for cases where the value is boolean, +but we also need to know whether the option was specified at all. boolOrDefault +is an enum with 3 values, BOU_UNSET, BOU_TRUE and BOU_FALSE. This parser accepts +the same strings as parser . + The parser specialization simply stores the parsed string into the string value specified. No conversion or modification of the data is performed. @@ -1923,7 +1931,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2006/12/07 20:04:41 $ + Last modified: $Date: 2007/05/22 18:32:34 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/AsmParser/ParserInternals.h Lexer.l llvmAsmParser.y
Changes in directory llvm/lib/AsmParser: ParserInternals.h updated: 1.55 -> 1.56 Lexer.l updated: 1.110 -> 1.111 llvmAsmParser.y updated: 1.357 -> 1.358 --- Log message: Implement full unescaping of escaped hex characters in all quoted identifiers and strings. --- Diffs of the changes: (+121 -136) Lexer.l | 77 - ParserInternals.h | 40 ++- llvmAsmParser.y | 140 +++--- 3 files changed, 121 insertions(+), 136 deletions(-) Index: llvm/lib/AsmParser/ParserInternals.h diff -u llvm/lib/AsmParser/ParserInternals.h:1.55 llvm/lib/AsmParser/ParserInternals.h:1.56 --- llvm/lib/AsmParser/ParserInternals.h:1.55 Mon Apr 9 01:13:07 2007 +++ llvm/lib/AsmParser/ParserInternals.hTue May 22 13:52:21 2007 @@ -40,28 +40,22 @@ extern int llvmAsmleng; namespace llvm { +class Module; // Globals exported by the parser... extern std::string CurFilename; /// FIXME: Not threading friendly -class Module; +// RunVMAsmParser - Parse a file and return Module Module *RunVMAsmParser(const std::string &Filename, FILE *F); // Parse a string directly Module *RunVMAsmParser(const char * AsmString, Module * M); - // UnEscapeLexed - Run through the specified buffer and change \xx codes to the -// appropriate character. If AllowNull is set to false, a \00 value will cause -// an error. -// -// If AllowNull is set to true, the return value of the function points to the -// last character of the string in memory. -// -char *UnEscapeLexed(char *Buffer, bool AllowNull = false); - +// appropriate character. +char *UnEscapeLexed(char *Buffer); -// ThrowException - Wrapper around the ParseException class that automatically +// GenerateError - Wrapper around the ParseException class that automatically // fills in file line number and column number and options info. // // This also helps me because I keep typing 'throw new ParseException' instead @@ -96,7 +90,7 @@ union { unsigned Num; // If it's a numeric reference like %1234 -char*Name;// If it's a named reference. Memory must be free'd. +std::string *Name;// If it's a named reference. Memory must be deleted. int64_t ConstPool64; // Constant pool reference. This is the value uint64_t UConstPool64;// Unsigned constant pool reference. double ConstPoolFP; // Floating point constant pool reference @@ -110,11 +104,11 @@ static ValID createGlobalID(unsigned Num) { ValID D; D.Type = GlobalID; D.Num = Num; return D; } - static ValID createLocalName(char *Name) { -ValID D; D.Type = LocalName; D.Name = Name; return D; + static ValID createLocalName(const std::string &Name) { +ValID D; D.Type = LocalName; D.Name = new std::string(Name); return D; } - static ValID createGlobalName(char *Name) { -ValID D; D.Type = GlobalName; D.Name = Name; return D; + static ValID createGlobalName(const std::string &Name) { +ValID D; D.Type = GlobalName; D.Name = new std::string(Name); return D; } static ValID create(int64_t Val) { @@ -156,7 +150,7 @@ inline void destroy() const { if (Type == LocalName || Type == GlobalName) - free(Name);// Free this strdup'd memory. + delete Name;// Free this strdup'd memory. else if (Type == InlineAsmVal) delete IAD; } @@ -164,7 +158,7 @@ inline ValID copy() const { if (Type != LocalName && Type != GlobalName) return *this; ValID Result = *this; -Result.Name = strdup(Name); +Result.Name = new std::string(*Name); return Result; } @@ -172,8 +166,8 @@ switch (Type) { case LocalID : return '%' + utostr(Num); case GlobalID : return '@' + utostr(Num); -case LocalName : return Name; -case GlobalName: return Name; +case LocalName : return *Name; +case GlobalName: return *Name; case ConstFPVal: return ftostr(ConstPoolFP); case ConstNullVal : return "null"; case ConstUndefVal : return "undef"; @@ -197,7 +191,7 @@ case LocalID: case GlobalID: return Num < V.Num; case LocalName: -case GlobalName:return strcmp(Name, V.Name) < 0; +case GlobalName:return *Name < *V.Name; case ConstSIntVal: return ConstPool64 < V.ConstPool64; case ConstUIntVal: return UConstPool64 < V.UConstPool64; case ConstFPVal:return ConstPoolFP < V.ConstPoolFP; @@ -215,7 +209,7 @@ case LocalID: case GlobalID: return Num == V.Num; case LocalName: -case GlobalName: return strcmp(Name, V.Name) == 0; +case GlobalName: return *Name == *(V.Name); case ConstSIntVal: return ConstPool64 == V.ConstPool64; case ConstUIntVal: return UConstPool64 == V.UConstPool64; case ConstFPVal:return ConstPoolFP == V.ConstPoolFP; @@ -240,7 +234,7 @@ struct ArgListEntry { uint16_t Attrs; llvm::PATypeHolder *Ty; -
[llvm-commits] CVS: llvm/lib/AsmParser/Lexer.l
Changes in directory llvm/lib/AsmParser: Lexer.l updated: 1.111 -> 1.112 --- Log message: Don't allow the UnEscape code to read or write beyond the end of yytext. Make sure we convert \\ into \. --- Diffs of the changes: (+20 -11) Lexer.l | 31 --- 1 files changed, 20 insertions(+), 11 deletions(-) Index: llvm/lib/AsmParser/Lexer.l diff -u llvm/lib/AsmParser/Lexer.l:1.111 llvm/lib/AsmParser/Lexer.l:1.112 --- llvm/lib/AsmParser/Lexer.l:1.111Tue May 22 13:52:21 2007 +++ llvm/lib/AsmParser/Lexer.l Tue May 22 14:07:45 2007 @@ -102,15 +102,22 @@ // UnEscapeLexed - Run through the specified buffer and change \xx codes to the // appropriate character. -char *UnEscapeLexed(char *Buffer) { +char *UnEscapeLexed(char *Buffer, char* EndBuffer) { char *BOut = Buffer; for (char *BIn = Buffer; *BIn; ) { -if (BIn[0] == '\\' && isxdigit(BIn[1]) && isxdigit(BIn[2])) { - char Tmp = BIn[3]; BIn[3] = 0; // Terminate string - *BOut = (char)strtol(BIn+1, 0, 16); // Convert to number - BIn[3] = Tmp; // Restore character - BIn += 3; // Skip over handled chars - ++BOut; +if (BIn[0] == '\\') { + if (BIn < EndBuffer-1 && BIn[1] == '\\') { +*BOut++ = '\\'; // Two \ becomes one +BIn += 2; + } else if (BIn < EndBuffer-2 && isxdigit(BIn[1]) && isxdigit(BIn[2])) { +char Tmp = BIn[3]; BIn[3] = 0; // Terminate string +*BOut = (char)strtol(BIn+1, 0, 16); // Convert to number +BIn[3] = Tmp; // Restore character +BIn += 3; // Skip over handled chars +++BOut; + } else { +*BOut++ = *BIn++; + } } else { *BOut++ = *BIn++; } @@ -326,28 +333,30 @@ } {QuoteLabel}{ yytext[yyleng-2] = 0; // nuke colon, end quote - const char* EndChar = UnEscapeLexed(yytext+1); + const char* EndChar = UnEscapeLexed(yytext+1, yytext+yyleng); llvmAsmlval.StrVal = new std::string(yytext+1, EndChar - yytext - 1); return LABELSTR; } {StringConstant} { yytext[yyleng-1] = 0; // nuke end quote - const char* EndChar = UnEscapeLexed(yytext+1); + const char* EndChar = UnEscapeLexed(yytext+1, yytext+yyleng); llvmAsmlval.StrVal = new std::string(yytext+1, EndChar - yytext - 1); return STRINGCONSTANT; } {AtStringConstant} { yytext[yyleng-1] = 0; // nuke end quote - const char* EndChar = UnEscapeLexed(yytext+2); + const char* EndChar = + UnEscapeLexed(yytext+2, yytext+yyleng); llvmAsmlval.StrVal = new std::string(yytext+2, EndChar - yytext - 2); return ATSTRINGCONSTANT; } {PctStringConstant} { yytext[yyleng-1] = 0; // nuke end quote - const char* EndChar = UnEscapeLexed(yytext+2); + const char* EndChar = + UnEscapeLexed(yytext+2, yytext+yyleng); llvmAsmlval.StrVal = new std::string(yytext+2, EndChar - yytext - 2); return PCTSTRINGCONSTANT; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/AsmParser/Lexer.cpp.cvs Lexer.l.cvs
Changes in directory llvm/lib/AsmParser: Lexer.cpp.cvs updated: 1.46 -> 1.47 Lexer.l.cvs updated: 1.38 -> 1.39 --- Log message: Regenerate. --- Diffs of the changes: (+186 -168) Lexer.cpp.cvs | 323 +- Lexer.l.cvs | 31 +++-- 2 files changed, 186 insertions(+), 168 deletions(-) Index: llvm/lib/AsmParser/Lexer.cpp.cvs diff -u llvm/lib/AsmParser/Lexer.cpp.cvs:1.46 llvm/lib/AsmParser/Lexer.cpp.cvs:1.47 --- llvm/lib/AsmParser/Lexer.cpp.cvs:1.46 Tue May 22 13:52:55 2007 +++ llvm/lib/AsmParser/Lexer.cpp.cvsTue May 22 14:08:16 2007 @@ -20,7 +20,7 @@ /* A lexical scanner generated by flex*/ /* Scanner skeleton version: - * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.46 2007/05/22 18:52:55 reid Exp $ + * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.47 2007/05/22 19:08:16 reid Exp $ */ #define FLEX_SCANNER @@ -983,15 +983,22 @@ // UnEscapeLexed - Run through the specified buffer and change \xx codes to the // appropriate character. -char *UnEscapeLexed(char *Buffer) { +char *UnEscapeLexed(char *Buffer, char* EndBuffer) { char *BOut = Buffer; for (char *BIn = Buffer; *BIn; ) { -if (BIn[0] == '\\' && isxdigit(BIn[1]) && isxdigit(BIn[2])) { - char Tmp = BIn[3]; BIn[3] = 0; // Terminate string - *BOut = (char)strtol(BIn+1, 0, 16); // Convert to number - BIn[3] = Tmp; // Restore character - BIn += 3; // Skip over handled chars - ++BOut; +if (BIn[0] == '\\') { + if (BIn < EndBuffer-1 && BIn[1] == '\\') { +*BOut++ = '\\'; // Two \ becomes one +BIn += 2; + } else if (BIn < EndBuffer-2 && isxdigit(BIn[1]) && isxdigit(BIn[2])) { +char Tmp = BIn[3]; BIn[3] = 0; // Terminate string +*BOut = (char)strtol(BIn+1, 0, 16); // Convert to number +BIn[3] = Tmp; // Restore character +BIn += 3; // Skip over handled chars +++BOut; + } else { +*BOut++ = *BIn++; + } } else { *BOut++ = *BIn++; } @@ -1020,7 +1027,7 @@ /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing * it to deal with 64 bit numbers. */ -#line 1024 "Lexer.cpp" +#line 1031 "Lexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1171,10 +1178,10 @@ register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; -#line 173 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 180 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" -#line 1178 "Lexer.cpp" +#line 1185 "Lexer.cpp" if ( yy_init ) { @@ -1267,272 +1274,272 @@ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 175 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 182 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 177 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 184 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return BEGINTOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 178 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 185 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return ENDTOK; } YY_BREAK case 4: YY_RULE_SETUP -#line 179 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 186 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return TRUETOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 180 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 187 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return FALSETOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 181 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 188 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DECLARE; } YY_BREAK case 7: YY_RULE_SETUP -#line 182 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 189 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return DEFINE; } YY_BREAK case 8: YY_RULE_SETUP -#line 183 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 190 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return GLOBAL; } YY_BREAK case 9: YY_RULE_SETUP -#line 184 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 191 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return CONSTANT; } YY_BREAK case 10: YY_RULE_SETUP -#line 185 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 192 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return INTERNAL; } YY_BREAK case 11: YY_RULE_SETUP -#line 186 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 193 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return LINKONCE; } YY_BREAK case 12: YY_RULE_SETUP -#line 187 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 194 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return WEAK; } YY_BREAK case 13: YY_RULE_SETUP -#line 188 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 195 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" { return A
[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.285 -> 1.286 --- Log message: Reinstate the patch for escaping non-printing characters and allow for \\ to escape \. All these cases are now handled by the AsmParser. --- Diffs of the changes: (+36 -19) AsmWriter.cpp | 55 --- 1 files changed, 36 insertions(+), 19 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.285 llvm/lib/VMCore/AsmWriter.cpp:1.286 --- llvm/lib/VMCore/AsmWriter.cpp:1.285 Tue May 22 02:00:50 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Tue May 22 14:27:35 2007 @@ -33,6 +33,7 @@ #include "llvm/Support/MathExtras.h" #include "llvm/Support/Streams.h" #include +#include using namespace llvm; namespace llvm { @@ -178,17 +179,42 @@ /// NameNeedsQuotes - Return true if the specified llvm name should be wrapped /// with ""'s. -static bool NameNeedsQuotes(const std::string &Name) { - if (Name[0] >= '0' && Name[0] <= '9') return true; - // Scan to see if we have any characters that are not on the "white list" +static std::string QuoteNameIfNeeded(const std::string &Name) { + std::string result; + bool needsQuotes = Name[0] >= '0' && Name[0] <= '9'; + // Scan the name to see if it needs quotes and to replace funky chars with + // their octal equivalent. for (unsigned i = 0, e = Name.size(); i != e; ++i) { char C = Name[i]; assert(C != '"' && "Illegal character in LLVM value name!"); -if ((C < 'a' || C > 'z') && (C < 'A' || C > 'Z') && (C < '0' || C > '9') && -C != '-' && C != '.' && C != '_') - return true; +if (isalnum(C) || C == '-' || C == '.' || C == '_') + result += C; +else if (C == '\\') { + needsQuotes = true; + result += ""; +} else if (isprint(C)) { + needsQuotes = true; + result += C; +} else { + needsQuotes = true; + result += "\\"; + char hex1 = (C >> 4) & 0x0F; + if (hex1 < 10) +result += hex1 + '0'; + else +result += hex1 - 10 + 'A'; + char hex2 = C & 0x0F; + if (hex2 < 10) +result += hex2 + '0'; + else +result += hex2 - 10 + 'A'; +} + } + if (needsQuotes) { +result.insert(0,"\""); +result += '"'; } - return false; + return result; } enum PrefixType { @@ -202,20 +228,11 @@ /// surrounded with ""'s (if it has special chars in it). static std::string getLLVMName(const std::string &Name, PrefixType Prefix) { assert(!Name.empty() && "Cannot get empty name!"); - - // First character cannot start with a number... - if (NameNeedsQuotes(Name)) { -if (Prefix == GlobalPrefix) - return "@\"" + Name + "\""; -return "\"" + Name + "\""; - } - - // If we get here, then the identifier is legal to use as a "VarID". switch (Prefix) { default: assert(0 && "Bad prefix!"); - case GlobalPrefix: return '@' + Name; - case LabelPrefix: return Name; - case LocalPrefix: return '%' + Name; + case GlobalPrefix: return '@' + QuoteNameIfNeeded(Name); + case LabelPrefix: return QuoteNameIfNeeded(Name); + case LocalPrefix: return '%' + QuoteNameIfNeeded(Name); } } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/IntrinsicEmitter.cpp
Changes in directory llvm/utils/TableGen: IntrinsicEmitter.cpp updated: 1.31 -> 1.32 --- Log message: The Intrinsic::getDeclaration function's Tys parameter only contains the types of the iAny types involved in the overloaded intrinsic. Thus, we can't use the argument number as the index but have to count them separately in order to index Tys correctly. This patch rectifies this situation. --- Diffs of the changes: (+12 -5) IntrinsicEmitter.cpp | 17 - 1 files changed, 12 insertions(+), 5 deletions(-) Index: llvm/utils/TableGen/IntrinsicEmitter.cpp diff -u llvm/utils/TableGen/IntrinsicEmitter.cpp:1.31 llvm/utils/TableGen/IntrinsicEmitter.cpp:1.32 --- llvm/utils/TableGen/IntrinsicEmitter.cpp:1.31 Mon Apr 16 01:54:34 2007 +++ llvm/utils/TableGen/IntrinsicEmitter.cppTue May 22 14:30:31 2007 @@ -134,11 +134,18 @@ return false; } -static void EmitTypeGenerate(std::ostream &OS, Record *ArgType, unsigned ArgNo){ +static void EmitTypeGenerate(std::ostream &OS, Record *ArgType, + unsigned &ArgNo) { if (ArgType->isSubClassOf("LLVMIntegerType")) { unsigned BitWidth = ArgType->getValueAsInt("Width"); +// NOTE: The ArgNo variable here is not the absolute argument number, it is +// the index of the "arbitrary" type in the Tys array passed to the +// Intrinsic::getDeclaration function. Consequently, we only want to +// increment it when we actually hit an arbitray integer type which is +// identified by BitWidth == 0. Getting this wrong leads to very subtle +// bugs! if (BitWidth == 0) - OS << "Tys[" << ArgNo << "]"; + OS << "Tys[" << ArgNo++ << "]"; else OS << "IntegerType::get(" << BitWidth << ")"; } else if (ArgType->isSubClassOf("LLVMVectorType")) { @@ -253,16 +260,16 @@ --N; } +unsigned ArgNo = 0; OS << "ResultTy = "; -EmitTypeGenerate(OS, ArgTypes[0], 0); +EmitTypeGenerate(OS, ArgTypes[0], ArgNo); OS << ";\n"; for (unsigned j = 1; j != N; ++j) { OS << "ArgTys.push_back("; - EmitTypeGenerate(OS, ArgTypes[j], j); + EmitTypeGenerate(OS, ArgTypes[j], ArgNo); OS << ");\n"; } - OS << "break;\n"; } OS << " }\n"; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc] Intrinsics.patch (please apply)
The attached patch contains a small modification to get the index of the iAny types correct for overloaded intrinsics. It has been tested and passes DejaGnu and MultiSource. Please apply. Index: gcc/llvm-convert.cpp === --- gcc/llvm-convert.cpp (revision 342) +++ gcc/llvm-convert.cpp (working copy) @@ -4201,12 +4201,15 @@ bool TreeToLLVM::EmitBuiltinUnaryIntOp(Value *InVal, Value *&Result, Intrinsic::ID Id) { - const Type *Ty = InVal->getType(); - - const Type* Tys[2]; - Tys[0] = 0; // Result type is i32, not variable, signal so. - Tys[1] = Ty; // Parameter type is iAny so actual type must be specified here - Result = new CallInst(Intrinsic::getDeclaration(TheModule, Id, Tys, 2), + // The intrinsic might be overloaded in which case the argument is of + // varying type. Make sure that we specify the actual type for "iAny" + // by passing it as the 3rd and 4th parameters. This isn't needed for + // most intrinsics, but is needed for ctpop, cttz, ctlz. + const Type* Tys[] = { +InVal->getType() + }; + Result = new CallInst(Intrinsic::getDeclaration(TheModule, Id, Tys, + sizeof(Tys)/sizeof(Tys[0])), InVal, "tmp", CurBB); return true; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.767 -> 1.768 --- Log message: fix a miscompilation when passing a float through varargs --- Diffs of the changes: (+1 -2) InstructionCombining.cpp |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.767 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.768 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.767 Sat May 19 01:51:32 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue May 22 20:17:04 2007 @@ -389,8 +389,7 @@ if (const IntegerType* ITy = dyn_cast(Ty)) { if (ITy->getBitWidth() < 32) return Type::Int32Ty; - } else if (Ty == Type::FloatTy) -return Type::DoubleTy; + } return Ty; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_20] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.762.2.2 -> 1.762.2.3 --- Log message: Merge from mainline --- Diffs of the changes: (+1 -2) InstructionCombining.cpp |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.762.2.2 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.762.2.3 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.762.2.2 Tue May 22 00:38:40 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue May 22 23:22:41 2007 @@ -389,8 +389,7 @@ if (const IntegerType* ITy = dyn_cast(Ty)) { if (ITy->getBitWidth() < 32) return Type::Int32Ty; - } else if (Ty == Type::FloatTy) -return Type::DoubleTy; + } return Ty; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/ReleaseNotes.html
Changes in directory llvm/docs: ReleaseNotes.html updated: 1.385 -> 1.386 --- Log message: final updates --- Diffs of the changes: (+46 -42) ReleaseNotes.html | 88 -- 1 files changed, 46 insertions(+), 42 deletions(-) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.385 llvm/docs/ReleaseNotes.html:1.386 --- llvm/docs/ReleaseNotes.html:1.385 Fri May 18 04:04:20 2007 +++ llvm/docs/ReleaseNotes.html Tue May 22 23:39:32 2007 @@ -32,10 +32,10 @@ This document contains the release notes for the LLVM compiler -infrastructure, release 2.0. Here we describe the status of LLVM, including any -known problems and major improvements from the previous release. All LLVM +infrastructure, release 2.0. Here we describe the status of LLVM, including +major improvements from the previous release and any known problems. All LLVM releases may be downloaded from the http://llvm.org/releases/";>LLVM -releases web site. +releases web site. For more information about LLVM, including information about the latest release, please check out the http://llvm.org/";>main LLVM @@ -153,7 +153,7 @@ configure llvm-gcc on linux are no longer needed, and special hacks to build large C++ libraries like Qt are not needed. -LLVM now has a new MSIL backend. llc -march=msil will now turn LLVM +LLVM now has a new MSIL backend. llc -march=msil will now turn LLVM into MSIL (".net") bytecode. This is still fairly early development with a number of limitations. @@ -202,30 +202,30 @@ The pass manager has been entirely rewritten, making it significantly smaller, simpler, and more extensible. -Support has been added to run FunctionPasses interlaced with -CallGraphSCCPasses, and we now support loop transformations explicitly with -LoopPass. - -The -scalarrepl pass can now promote unions containing FP values -into a register, it can also handle unions of vectors of the same -size. +Support has been added to run FunctionPasses interlaced with +CallGraphSCCPasses, we now support loop transformations +explicitly with LoopPass, and ModulePasses may now use the +result of FunctionPasses. LLVM 2.0 includes a new loop rotation pass, which converts "for loops" into "do/while loops", where the condition is at the bottom of the loop. -The Loop Strength Reduction pass has been improved, and support added -for sinking expressions across blocks to reduce register pressure. +The Loop Strength Reduction pass has been improved, and we now support +sinking expressions across blocks to reduce register pressure. -ModulePasses may now use the result of FunctionPasses. +The -scalarrepl pass can now promote unions containing FP values +into a register, it can also handle unions of vectors of the same +size. The [Post]DominatorSet classes have been removed from LLVM and clients -switched to use the far-more-efficient ETForest class instead. +switched to use the more-efficient ETForest class instead. The ImmediateDominator class has also been removed, and clients have been switched to use DominatorTree instead. The predicate simplifier pass has been improved, making it able to do -simple value range propagation and eliminate more conditionals. +simple value range propagation and eliminate more conditionals. However, +note that predsimplify is not enabled by default in llvm-gcc. @@ -242,7 +242,7 @@ -Support was added for software floating point, which allows LLVM to target +LLVM now supports software floating point, which allows LLVM to target chips that don't have hardware FPUs (e.g. ARM thumb mode). A new register scavenger has been implemented, which is useful for @@ -262,8 +262,8 @@ sparse switches that have dense subregions, and implemented support for the shift/and trick. -Added support for tracking physreg sub-registers and super-registers -in the code generator, as well as extensive register +LLVM now supports tracking physreg sub-registers and super-registers +in the code generator, and includes extensive register allocator changes to track them. There is initial support for virtreg sub-registers @@ -306,7 +306,7 @@ several ways: -Extended TargetData to support better target parameterization in +TargetData now supports better target parameterization in the .ll/.bc files, eliminating the 'pointersize/endianness' attributes in the files (http://llvm.org/PR761";>PR761). @@ -338,7 +338,7 @@ PIC support for linux/x86 has been added. The X86 backend now supports the GCC regparm attribute. LLVM now supports inline asm with multiple constraint letters per operand -(like "ri") which is common in X86 inline asms. +(like "mri") which is common in X86 inline asms. ARM-specific Code Generator Enhancements: @@ -349,14 +349,16 @@ There are major new featu
[llvm-commits] [release_20] CVS: llvm/docs/ReleaseNotes.html
Changes in directory llvm/docs: ReleaseNotes.html updated: 1.368.2.2 -> 1.368.2.3 --- Log message: final updates to release notes --- Diffs of the changes: (+46 -42) ReleaseNotes.html | 88 -- 1 files changed, 46 insertions(+), 42 deletions(-) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.368.2.2 llvm/docs/ReleaseNotes.html:1.368.2.3 --- llvm/docs/ReleaseNotes.html:1.368.2.2 Tue May 22 01:23:12 2007 +++ llvm/docs/ReleaseNotes.html Tue May 22 23:41:25 2007 @@ -32,10 +32,10 @@ This document contains the release notes for the LLVM compiler -infrastructure, release 2.0. Here we describe the status of LLVM, including any -known problems and major improvements from the previous release. All LLVM +infrastructure, release 2.0. Here we describe the status of LLVM, including +major improvements from the previous release and any known problems. All LLVM releases may be downloaded from the http://llvm.org/releases/";>LLVM -releases web site. +releases web site. For more information about LLVM, including information about the latest release, please check out the http://llvm.org/";>main LLVM @@ -153,7 +153,7 @@ configure llvm-gcc on linux are no longer needed, and special hacks to build large C++ libraries like Qt are not needed. -LLVM now has a new MSIL backend. llc -march=msil will now turn LLVM +LLVM now has a new MSIL backend. llc -march=msil will now turn LLVM into MSIL (".net") bytecode. This is still fairly early development with a number of limitations. @@ -202,30 +202,30 @@ The pass manager has been entirely rewritten, making it significantly smaller, simpler, and more extensible. -Support has been added to run FunctionPasses interlaced with -CallGraphSCCPasses, and we now support loop transformations explicitly with -LoopPass. - -The -scalarrepl pass can now promote unions containing FP values -into a register, it can also handle unions of vectors of the same -size. +Support has been added to run FunctionPasses interlaced with +CallGraphSCCPasses, we now support loop transformations +explicitly with LoopPass, and ModulePasses may now use the +result of FunctionPasses. LLVM 2.0 includes a new loop rotation pass, which converts "for loops" into "do/while loops", where the condition is at the bottom of the loop. -The Loop Strength Reduction pass has been improved, and support added -for sinking expressions across blocks to reduce register pressure. +The Loop Strength Reduction pass has been improved, and we now support +sinking expressions across blocks to reduce register pressure. -ModulePasses may now use the result of FunctionPasses. +The -scalarrepl pass can now promote unions containing FP values +into a register, it can also handle unions of vectors of the same +size. The [Post]DominatorSet classes have been removed from LLVM and clients -switched to use the far-more-efficient ETForest class instead. +switched to use the more-efficient ETForest class instead. The ImmediateDominator class has also been removed, and clients have been switched to use DominatorTree instead. The predicate simplifier pass has been improved, making it able to do -simple value range propagation and eliminate more conditionals. +simple value range propagation and eliminate more conditionals. However, +note that predsimplify is not enabled by default in llvm-gcc. @@ -242,7 +242,7 @@ -Support was added for software floating point, which allows LLVM to target +LLVM now supports software floating point, which allows LLVM to target chips that don't have hardware FPUs (e.g. ARM thumb mode). A new register scavenger has been implemented, which is useful for @@ -262,8 +262,8 @@ sparse switches that have dense subregions, and implemented support for the shift/and trick. -Added support for tracking physreg sub-registers and super-registers -in the code generator, as well as extensive register +LLVM now supports tracking physreg sub-registers and super-registers +in the code generator, and includes extensive register allocator changes to track them. There is initial support for virtreg sub-registers @@ -306,7 +306,7 @@ several ways: -Extended TargetData to support better target parameterization in +TargetData now supports better target parameterization in the .ll/.bc files, eliminating the 'pointersize/endianness' attributes in the files (http://llvm.org/PR761";>PR761). @@ -338,7 +338,7 @@ PIC support for linux/x86 has been added. The X86 backend now supports the GCC regparm attribute. LLVM now supports inline asm with multiple constraint letters per operand -(like "ri") which is common in X86 inline asms. +(like "mri") which is common in X86 inline asms. ARM-specific Code Generator Enhancements: @@ -34
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.156 -> 1.157 --- Log message: If user wants to run instcombine twice, do not block it. --- Diffs of the changes: (+0 -5) PassManager.cpp |5 - 1 files changed, 5 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.156 llvm/lib/VMCore/PassManager.cpp:1.157 --- llvm/lib/VMCore/PassManager.cpp:1.156 Wed May 2 20:11:54 2007 +++ llvm/lib/VMCore/PassManager.cpp Wed May 23 00:08:52 2007 @@ -419,11 +419,6 @@ // TODO : Allocate function manager for this pass, other wise required set // may be inserted into previous function manager - // If this Analysis is already requested by one of the previous pass - // and it is still available then do not insert new pass in the queue again. - if (findAnalysisPass(P->getPassInfo())) - return; - // Give pass a chance to prepare the stage. P->preparePassManager(activeStack); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
> Reinstate the patch for escaping non-printing characters and allow for > \\ to escape \. All these cases are now handled by the AsmParser. Great, thanks again Reid! -Chris > > --- > Diffs of the changes: (+36 -19) > > AsmWriter.cpp | 55 +++ > +--- > 1 files changed, 36 insertions(+), 19 deletions(-) > > > Index: llvm/lib/VMCore/AsmWriter.cpp > diff -u llvm/lib/VMCore/AsmWriter.cpp:1.285 llvm/lib/VMCore/ > AsmWriter.cpp:1.286 > --- llvm/lib/VMCore/AsmWriter.cpp:1.285 Tue May 22 02:00:50 2007 > +++ llvm/lib/VMCore/AsmWriter.cpp Tue May 22 14:27:35 2007 > @@ -33,6 +33,7 @@ > #include "llvm/Support/MathExtras.h" > #include "llvm/Support/Streams.h" > #include > +#include > using namespace llvm; > > namespace llvm { > @@ -178,17 +179,42 @@ > > /// NameNeedsQuotes - Return true if the specified llvm name > should be wrapped > /// with ""'s. > -static bool NameNeedsQuotes(const std::string &Name) { > - if (Name[0] >= '0' && Name[0] <= '9') return true; > - // Scan to see if we have any characters that are not on the > "white list" > +static std::string QuoteNameIfNeeded(const std::string &Name) { > + std::string result; > + bool needsQuotes = Name[0] >= '0' && Name[0] <= '9'; > + // Scan the name to see if it needs quotes and to replace funky > chars with > + // their octal equivalent. >for (unsigned i = 0, e = Name.size(); i != e; ++i) { > char C = Name[i]; > assert(C != '"' && "Illegal character in LLVM value name!"); > -if ((C < 'a' || C > 'z') && (C < 'A' || C > 'Z') && (C < '0' > || C > '9') && > -C != '-' && C != '.' && C != '_') > - return true; > +if (isalnum(C) || C == '-' || C == '.' || C == '_') > + result += C; > +else if (C == '\\') { > + needsQuotes = true; > + result += ""; > +} else if (isprint(C)) { > + needsQuotes = true; > + result += C; > +} else { > + needsQuotes = true; > + result += "\\"; > + char hex1 = (C >> 4) & 0x0F; > + if (hex1 < 10) > +result += hex1 + '0'; > + else > +result += hex1 - 10 + 'A'; > + char hex2 = C & 0x0F; > + if (hex2 < 10) > +result += hex2 + '0'; > + else > +result += hex2 - 10 + 'A'; > +} > + } > + if (needsQuotes) { > +result.insert(0,"\""); > +result += '"'; >} > - return false; > + return result; > } > > enum PrefixType { > @@ -202,20 +228,11 @@ > /// surrounded with ""'s (if it has special chars in it). > static std::string getLLVMName(const std::string &Name, PrefixType > Prefix) { >assert(!Name.empty() && "Cannot get empty name!"); > - > - // First character cannot start with a number... > - if (NameNeedsQuotes(Name)) { > -if (Prefix == GlobalPrefix) > - return "@\"" + Name + "\""; > -return "\"" + Name + "\""; > - } > - > - // If we get here, then the identifier is legal to use as a > "VarID". >switch (Prefix) { >default: assert(0 && "Bad prefix!"); > - case GlobalPrefix: return '@' + Name; > - case LabelPrefix: return Name; > - case LocalPrefix: return '%' + Name; > + case GlobalPrefix: return '@' + QuoteNameIfNeeded(Name); > + case LabelPrefix: return QuoteNameIfNeeded(Name); > + case LocalPrefix: return '%' + QuoteNameIfNeeded(Name); >} > } > > > > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [127541] commit reid's intrinsics patch
Revision: 127541 Author: clattner Date: 2007-05-22 22:10:53 -0700 (Tue, 22 May 2007) Log Message: --- commit reid's intrinsics patch Modified Paths: -- apple-local/branches/llvm/gcc/llvm-convert.cpp Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp === --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-05-22 16:31:00 UTC (rev 127540) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-05-23 05:10:53 UTC (rev 127541) @@ -4201,12 +4201,15 @@ bool TreeToLLVM::EmitBuiltinUnaryIntOp(Value *InVal, Value *&Result, Intrinsic::ID Id) { - const Type *Ty = InVal->getType(); - - const Type* Tys[2]; - Tys[0] = 0; // Result type is i32, not variable, signal so. - Tys[1] = Ty; // Parameter type is iAny so actual type must be specified here - Result = new CallInst(Intrinsic::getDeclaration(TheModule, Id, Tys, 2), + // The intrinsic might be overloaded in which case the argument is of + // varying type. Make sure that we specify the actual type for "iAny" + // by passing it as the 3rd and 4th parameters. This isn't needed for + // most intrinsics, but is needed for ctpop, cttz, ctlz. + const Type* Tys[] = { +InVal->getType() + }; + Result = new CallInst(Intrinsic::getDeclaration(TheModule, Id, Tys, + sizeof(Tys)/sizeof(Tys[0])), InVal, "tmp", CurBB); return true; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc] Intrinsics.patch (please apply)
On May 22, 2007, at 12:33 PM, Reid Spencer wrote: > The attached patch contains a small modification to get the index > of the > iAny types correct for overloaded intrinsics. It has been tested and > passes DejaGnu and MultiSource. Please apply. Can you please explain what bad case this (and the previous patch) fixes? Is this a .ll/.bc syntax change? -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc] Intrinsics.patch (please apply)
On Tue, 22 May 2007 22:12:17 -0700 Chris Lattner <[EMAIL PROTECTED]> wrote: > >On May 22, 2007, at 12:33 PM, Reid Spencer wrote: > >> The attached patch contains a small modification to get the index >> of the >> iAny types correct for overloaded intrinsics. It has been tested and >> passes DejaGnu and MultiSource. Please apply. > >Can you please explain what bad case this (and the previous patch) >fixes? Is this a .ll/.bc syntax change? No, its not a .ll/.bc syntax change, but it is a slight API correction. The issue has to do with the Intrinsic::getDeclaration method and the interpretation of the (often defaulted) 3rd and 4th parameters that specify the actual types to "fill" in for the iAny parameters (or result). The third argument is an array of Type* and the fourth is the number of elements. Previously you had to specify an entry in the array for every parameter and the result type, regardless of whether they were iAny or not. This is inconsistent with uses of Intrinsic::getDeclaration when there are no iAny parameters in which case it is permissable to pass 0 for both the 3rd and 4th arguments (and those happen to the be the default values). For example, cttz and friends take an iAny parameter but return i32. Consequently they require only one type in the "Tys" argument to getDeclaration (for the parameter). Previously tblgen was indexing into "Tys" using the parameter index (or 0 for the result type) but this leads to "holes" (zero valued Type*) in the array. The interface was changed to eliminate these holes so that the only things passed in Tys is the actual types for the iAny arguments. Consider this, from LangRef.html: declare i32 @llvm.ctpop.i8 (i8 ) The single suffix (.i8) that qualifies the argument type indicates that you should be able to call getDeclaration with: Type *Tys[] = { Type::Int8Ty }; Function *F = Intrinsics::getDeclaration(Mod, Intrinsics::ctpop, Tys, 1); However, such a call previously caused an assertion (or worse). The problem is that the code generated by tblgen was indexing into Tys with a subscript of 1 (to match the first argument) but the array was only 1 item long. Consequently, you'd read junk from the stack and assert (or worse). Previously one would have had to pass, to getDeclaration, something like: Type *Tys[] = { 0, Type::Int8Ty }; Function *F = Intrinsics::getDeclaration(Mod, Intrinsics::ctpop, Tys, 2); which is counter-intuitive since you don't have to use the 3rd and 4th parameters at all (defaulting them to 0) if there are no iAny arguments. The function changed in the llvm-gcc patch was doing exactly this (an array of 2 with a 0 first element) and I changed it to use the former example (single element array). This was noticed by AutoESL when they tried to call getDeclaration directly themselves and ended up getting assertions and verifier failures. This wasn't noticed before in LLVM because the only use of an overloaded intrinsic in LLVM is bswap and that one is a degenerate case. Both its argument and its result are iAny so you end up needing an array that has two elements anyway - one for the result, one for the argument. However, in cases like part_select, part_set, cttz, ctlz and ctpop, that is not the case. > >-Chris > >___ >llvm-commits mailing list >llvm-commits@cs.uiuc.edu >http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Argument.h
Changes in directory llvm/include/llvm: Argument.h updated: 1.16 -> 1.17 --- Log message: make these accessors private. --- Diffs of the changes: (+7 -6) Argument.h | 13 +++-- 1 files changed, 7 insertions(+), 6 deletions(-) Index: llvm/include/llvm/Argument.h diff -u llvm/include/llvm/Argument.h:1.16 llvm/include/llvm/Argument.h:1.17 --- llvm/include/llvm/Argument.h:1.16 Mon Apr 16 22:26:42 2007 +++ llvm/include/llvm/Argument.hWed May 23 00:46:04 2007 @@ -46,12 +46,6 @@ inline const Function *getParent() const { return Parent; } inline Function *getParent() { return Parent; } - // getNext/Prev - Return the next or previous argument in the list. -Argument *getNext() { return Next; } - const Argument *getNext() const { return Next; } -Argument *getPrev() { return Prev; } - const Argument *getPrev() const { return Prev; } - virtual void print(std::ostream &OS) const; void print(std::ostream *OS) const { if (OS) print(*OS); @@ -64,6 +58,13 @@ static inline bool classof(const Value *V) { return V->getValueID() == ArgumentVal; } + +private: + // getNext/Prev - Return the next or previous argument in the list. + Argument *getNext() { return Next; } + const Argument *getNext() const { return Next; } + Argument *getPrev() { return Prev; } + const Argument *getPrev() const { return Prev; } }; } // End llvm namespace ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_20] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.762.2.3 -> 1.762.2.4 --- Log message: Fixing patch mistake. --- Diffs of the changes: (+5 -5) InstructionCombining.cpp | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.762.2.3 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.762.2.4 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.762.2.3 Tue May 22 23:22:41 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed May 23 01:07:37 2007 @@ -7767,11 +7767,6 @@ const FunctionType *FT = Callee->getFunctionType(); const Type *OldRetTy = Caller->getType(); - // Check to see if we are changing the return type... - if (OldRetTy != FT->getReturnType()) { -if (Callee->isDeclaration() && !Caller->use_empty() && -// Conversion is ok if changing from pointer to int of same size. -!(isa(FT->getReturnType()) && const FunctionType *ActualFT = cast(cast(CE->getType())->getElementType()); @@ -7780,6 +7775,11 @@ if (FT->getParamAttrs() != ActualFT->getParamAttrs()) return false; + // Check to see if we are changing the return type... + if (OldRetTy != FT->getReturnType()) { +if (Callee->isDeclaration() && !Caller->use_empty() && +// Conversion is ok if changing from pointer to int of same size. +!(isa(FT->getReturnType()) && TD->getIntPtrType() == OldRetTy)) return false; // Cannot transform this return value. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Transforms/LICM/2007-05-22-VolatileSink.ll
Changes in directory llvm/test/Transforms/LICM: 2007-05-22-VolatileSink.ll added (r1.1) --- Log message: new testcase for PR1435: http://llvm.org/PR1435 --- Diffs of the changes: (+56 -0) 2007-05-22-VolatileSink.ll | 56 + 1 files changed, 56 insertions(+) Index: llvm/test/Transforms/LICM/2007-05-22-VolatileSink.ll diff -c /dev/null llvm/test/Transforms/LICM/2007-05-22-VolatileSink.ll:1.1 *** /dev/null Wed May 23 01:36:02 2007 --- llvm/test/Transforms/LICM/2007-05-22-VolatileSink.llWed May 23 01:35:52 2007 *** *** 0 --- 1,56 + ; RUN: llvm-as < %s | opt -licm | llvm-dis | grep {volatile store} + ; PR1435 + target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" + target triple = "i686-apple-darwin8" + + define void @Transpose(i32* %DataIn, i32* %DataOut) { + entry: + %buffer = alloca [64 x i32], align 16 ; <[64 x i32]*> [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + br label %bb6 + + bb: ; preds = %bb6 + %tmp2 = volatile load i32* %DataIn ; [#uses=1] + %tmp3 = getelementptr [64 x i32]* %buffer, i32 0, i32 %i.0 ; [#uses=1] + store i32 %tmp2, i32* %tmp3 + %tmp5 = add i32 %i.0, 1 ; [#uses=1] + br label %bb6 + + bb6: ; preds = %bb, %entry + %i.0 = phi i32 [ 0, %entry ], [ %tmp5, %bb ]; [#uses=3] + %tmp8 = icmp sle i32 %i.0, 63 ; [#uses=1] + %tmp89 = zext i1 %tmp8 to i8; [#uses=1] + %toBool = icmp ne i8 %tmp89, 0 ; [#uses=1] + br i1 %toBool, label %bb, label %bb30 + + bb12: ; preds = %bb22 + %tmp14 = mul i32 %j.1, 8; [#uses=1] + %tmp16 = add i32 %tmp14, %i.1 ; [#uses=1] + %tmp17 = getelementptr [64 x i32]* %buffer, i32 0, i32 %tmp16 ; [#uses=1] + %tmp18 = load i32* %tmp17 ; [#uses=1] + volatile store i32 %tmp18, i32* %DataOut + %tmp21 = add i32 %j.1, 1; [#uses=1] + br label %bb22 + + bb22: ; preds = %bb30, %bb12 + %j.1 = phi i32 [ %tmp21, %bb12 ], [ 0, %bb30 ] ; [#uses=4] + %tmp24 = icmp sle i32 %j.1, 7 ; [#uses=1] + %tmp2425 = zext i1 %tmp24 to i8 ; [#uses=1] + %toBool26 = icmp ne i8 %tmp2425, 0 ; [#uses=1] + br i1 %toBool26, label %bb12, label %bb27 + + bb27: ; preds = %bb22 + %tmp29 = add i32 %i.1, 1; [#uses=1] + br label %bb30 + + bb30: ; preds = %bb27, %bb6 + %j.0 = phi i32 [ %j.1, %bb27 ], [ undef, %bb6 ] ; [#uses=0] + %i.1 = phi i32 [ %tmp29, %bb27 ], [ 0, %bb6 ] ; [#uses=3] + %tmp32 = icmp sle i32 %i.1, 7 ; [#uses=1] + %tmp3233 = zext i1 %tmp32 to i8 ; [#uses=1] + %toBool34 = icmp ne i8 %tmp3233, 0 ; [#uses=1] + br i1 %toBool34, label %bb22, label %return + + return: ; preds = %bb30 + 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/Analysis/AliasSetTracker.cpp
Changes in directory llvm/lib/Analysis: AliasSetTracker.cpp updated: 1.50 -> 1.51 --- Log message: when merging two alias sets together, be sure to propagate the volatility of the inner set. This fixes PR1435: http://llvm.org/PR1435 and Transforms/LICM/2007-05-22-VolatileSink.ll --- Diffs of the changes: (+5 -3) AliasSetTracker.cpp |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.50 llvm/lib/Analysis/AliasSetTracker.cpp:1.51 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.50 Sun May 6 08:37:16 2007 +++ llvm/lib/Analysis/AliasSetTracker.cpp Wed May 23 01:36:35 2007 @@ -351,9 +351,11 @@ // Loop over all of the pointers in this alias set... AliasSet::iterator I = AS.begin(), E = AS.end(); bool X; - for (; I != E; ++I) -addPointer(I.getPointer(), I.getSize(), - (AliasSet::AccessType)AS.AccessTy, X); + for (; I != E; ++I) { +AliasSet &NewAS = addPointer(I.getPointer(), I.getSize(), + (AliasSet::AccessType)AS.AccessTy, X); +if (AS.isVolatile()) NewAS.setVolatile(); + } } } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits